public void onOptionsButtonClicked(View view) { switch (view.getId()) { case R.id.wizard_hallx_left: barobot.main_queue.add("A0", true); barobot.main_queue.add( new AsyncMessage(true) { @Override public String getName() { return "Save hall x left value"; } @Override public Queue run(Mainboard dev, Queue queue) { checkValue(true); updateUi(); return null; } }); barobot.lightManager.carret_color(barobot.main_queue, 255, 0, 0); barobot.main_queue.addWait(100); barobot.lightManager.carret_color(barobot.main_queue, 0, 0, 0); break; case R.id.wizard_hallx_right: barobot.main_queue.add("A0", true); barobot.main_queue.add( new AsyncMessage(true) { @Override public String getName() { return "Save hall x right value"; } @Override public Queue run(Mainboard dev, Queue queue) { checkValue(false); updateUi(); return null; } }); barobot.lightManager.carret_color(barobot.main_queue, 255, 0, 0); barobot.main_queue.addWait(100); barobot.lightManager.carret_color(barobot.main_queue, 0, 0, 0); break; default: super.onOptionsButtonClicked(view); break; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_wizard_hall_x); wizard_hallx_value_left = (TextView) findViewById(R.id.wizard_hallx_value_left); wizard_hallx_value_right = (TextView) findViewById(R.id.wizard_hallx_value_right); wizard_hallx_results_max = (TextView) findViewById(R.id.wizard_hallx_results_max); wizard_hallx_hints_max = (TextView) findViewById(R.id.wizard_hallx_hints_max); wizard_hallx_results_start = (TextView) findViewById(R.id.wizard_hallx_results_start); wizard_hallx_hints_start = (TextView) findViewById(R.id.wizard_hallx_hints_start); wizard_hallx_dispenser = (TextView) findViewById(R.id.wizard_hallx_dispenser); wizard_hallx_results_max.setVisibility(View.GONE); wizard_hallx_results_start.setVisibility(View.GONE); // barobot.state.set("HALLX_MIN_VALUE", "-1" ); barobot.state.set("HALLX_MIN_STATE", "-1"); // barobot.state.set("HALLX_MAX_VALUE", "-1" ); barobot.state.set("HALLX_MAX_STATE", "-1"); }
@Override protected void onDestroy() { barobot.lightManager.turnOffLeds(barobot.main_queue); super.onDestroy(); }