summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4211c59)
The log code won't let you resize the maximum flight log while there
is still data on the flight computer; the code to figure that out in
the UI was busted, leaving users confused about why it wasn't working.
Signed-off-by: Keith Packard <keithp@keithp.com>
+ boolean use_flash_for_config() {
+ if (product.startsWith("TeleMega"))
+ return false;
+ if (product.startsWith("TeleMetrum-v2"))
+ return false;
+ return true;
+ }
+
+
- if (storage_size > 0 && storage_erase_unit > 0) {
- int log_limit = storage_size - storage_erase_unit;
+ if (storage_size > 0) {
+ int log_limit = storage_size;
+
+ if (storage_erase_unit > 0 && use_flash_for_config())
+ log_limit -= storage_erase_unit;
+
if (log_limit > 0)
return log_limit / 1024;
}
if (log_limit > 0)
return log_limit / 1024;
}
dest.set_radio_calibration(radio_calibration);
dest.set_radio_frequency(frequency());
boolean max_enabled = true;
dest.set_radio_calibration(radio_calibration);
dest.set_radio_frequency(frequency());
boolean max_enabled = true;
+
+ if (log_limit() == 0)
+ max_enabled = false;
+
switch (log_format) {
case AltosLib.AO_LOG_FORMAT_TINY:
max_enabled = false;
break;
default:
switch (log_format) {
case AltosLib.AO_LOG_FORMAT_TINY:
max_enabled = false;
break;
default:
- if (stored_flight >= 0)
max_enabled = false;
break;
}
max_enabled = false;
break;
}
dest.set_flight_log_max_enabled(max_enabled);
dest.set_radio_enable(radio_enable);
dest.set_flight_log_max_limit(log_limit());
dest.set_flight_log_max_enabled(max_enabled);
dest.set_radio_enable(radio_enable);
dest.set_flight_log_max_limit(log_limit());
+ boolean is_telemini_v1() {
+ String product = product_value.getText();
+ return product != null && product.startsWith("TeleMini-v1");
+ }
+
boolean is_telemini() {
String product = product_value.getText();
return product != null && product.startsWith("TeleMini");
}
boolean is_telemini() {
String product = product_value.getText();
return product != null && product.startsWith("TeleMini");
}
+ boolean is_easymini() {
+ String product = product_value.getText();
+ return product != null && product.startsWith("EasyMini");
+ }
+
boolean is_telemetrum() {
String product = product_value.getText();
return product != null && product.startsWith("TeleMetrum");
boolean is_telemetrum() {
String product = product_value.getText();
return product != null && product.startsWith("TeleMetrum");
if (flight_log_max_value.isEnabled())
flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
else {
if (flight_log_max_value.isEnabled())
flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
else {
- if (is_telemetrum())
- flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory");
- else if (is_telemini())
- flight_log_max_value.setToolTipText("TeleMini stores only one flight");
+ if (is_telemini_v1())
+ flight_log_max_value.setToolTipText("TeleMini-v1 stores only one flight");
- flight_log_max_value.setToolTipText("Cannot set max flight log value");
+ flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory");
else {
if (is_telemetrum())
pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward");
else {
if (is_telemetrum())
pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward");
- else if (is_telemini())
- pad_orientation_value.setToolTipText("TeleMini doesn't care how it is mounted");
+ else if (is_telemini() || is_easymini())
+ pad_orientation_value.setToolTipText("TeleMini and EasyMini don't care how they are mounted");
else
pad_orientation_value.setToolTipText("Can't select orientation");
}
else
pad_orientation_value.setToolTipText("Can't select orientation");
}
String get_main_deploy_label() {
return String.format("Main Deploy Altitude(%s):", AltosConvert.height.show_units());
}
String get_main_deploy_label() {
return String.format("Main Deploy Altitude(%s):", AltosConvert.height.show_units());
}
String[] main_deploy_values() {
if (AltosConvert.imperial_units)
return main_deploy_values_ft;
else
return main_deploy_values_m;
}
String[] main_deploy_values() {
if (AltosConvert.imperial_units)
return main_deploy_values_ft;
else
return main_deploy_values_m;
}
void set_main_deploy_values() {
String[] v = main_deploy_values();
while (main_deploy_value.getItemCount() > 0)
void set_main_deploy_values() {
String[] v = main_deploy_values();
while (main_deploy_value.getItemCount() > 0)
main_deploy_value.addItem(v[i]);
main_deploy_value.setMaximumRowCount(v.length);
}
main_deploy_value.addItem(v[i]);
main_deploy_value.setMaximumRowCount(v.length);
}
public void units_changed(boolean imperial_units) {
String v = main_deploy_value.getSelectedItem().toString();
main_deploy_label.setText(get_main_deploy_label());
public void units_changed(boolean imperial_units) {
String v = main_deploy_value.getSelectedItem().toString();
main_deploy_label.setText(get_main_deploy_label());
}
public void set_flight_log_max(int new_flight_log_max) {
}
public void set_flight_log_max(int new_flight_log_max) {
- flight_log_max_value.setEnabled(new_flight_log_max > 0);
flight_log_max_value.setSelectedItem(Integer.toString(new_flight_log_max));
set_flight_log_max_tool_tip();
}
flight_log_max_value.setSelectedItem(Integer.toString(new_flight_log_max));
set_flight_log_max_tool_tip();
}