string_ref callsign;
AltosConfigUI config_ui;
boolean serial_started;
+ boolean made_visible;
boolean get_int(String line, String label, int_ref x) {
if (line.startsWith(label)) {
config_ui.set_pad_orientation(pad_orientation.get());
config_ui.set_callsign(callsign.get());
config_ui.set_clean();
- config_ui.make_visible();
+ if (!made_visible) {
+ made_visible = true;
+ config_ui.make_visible();
+ }
}
void process_line(String line) {
abort();
return;
}
- if (line.equals("done")) {
+ if (line.equals("all finished")) {
if (serial_line != null)
update_ui();
return;
SwingUtilities.invokeLater(r);
}
+ void reset_data() {
+ serial.set(0);
+ log_format.set(Altos.AO_LOG_FORMAT_UNKNOWN);
+ main_deploy.set(250);
+ apogee_delay.set(0);
+ radio_channel.set(0);
+ radio_setting.set(0);
+ radio_calibration.set(1186611);
+ radio_enable.set(-1);
+ flight_log_max.set(0);
+ ignite_mode.set(-1);
+ pad_orientation.set(-1);
+ storage_size.set(-1);
+ storage_erase_unit.set(-1);
+ stored_flight.set(-1);
+ callsign.set("N0CALL");
+ version.set("unknown");
+ product.set("unknown");
+ }
+
void get_data() {
try {
config.start_serial();
- stored_flight.set(-1);
+ reset_data();
+
config.serial_line.printf("c s\nf\nl\nv\n");
for (;;) {
try {
} catch (InterruptedException ie) {
}
}
- callback("done");
+ callback("all finished");
}
void save_data() {
}
} catch (FileNotFoundException ee) {
JOptionPane.showMessageDialog(owner,
- String.format("Cannot open device \"%s\"",
- device.toShortString()),
+ ee.getMessage(),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} catch (AltosSerialInUseException si) {