diff options
| author | Keith Packard <keithp@keithp.com> | 2014-06-10 10:11:03 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-06-10 10:11:03 -0700 | 
| commit | ae1174317fc476e39077f7dc257ec08709c6b301 (patch) | |
| tree | 2ec45054f13e08e24cfb93743b04a976cd68aac9 /telegps/TeleGPSConfig.java | |
| parent | 44ca50a2c9404c92cc887a23dfa25b335ebe6198 (diff) | |
altoslib/altosui/telegps: Change log size configuration
* Use new log-space value provided by firmware when available.
* Divide that up into 1-8 flights and offer those sizes as options to
  the user instead of a fixed set of sizes.
* Show how many flights each selection will store
* This also checks values provided by the user
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'telegps/TeleGPSConfig.java')
| -rw-r--r-- | telegps/TeleGPSConfig.java | 24 | 
1 files changed, 12 insertions, 12 deletions
diff --git a/telegps/TeleGPSConfig.java b/telegps/TeleGPSConfig.java index 22e6a3ac..3505b0bb 100644 --- a/telegps/TeleGPSConfig.java +++ b/telegps/TeleGPSConfig.java @@ -221,20 +221,20 @@ public class TeleGPSConfig implements ActionListener {  	void save_data() { -		/* bounds check stuff */ -		if (config_ui.flight_log_max() > data.log_limit()) { -			JOptionPane.showMessageDialog(owner, -						      String.format("Requested flight log, %dk, is larger than the available space, %dk.\n", -								    config_ui.flight_log_max(), -								    data.log_limit()), -						      "Maximum Flight Log Too Large", -						      JOptionPane.ERROR_MESSAGE); -			return; -		} +		try { +			/* bounds check stuff */ +			if (config_ui.flight_log_max() > data.log_space()/1024) { +				JOptionPane.showMessageDialog(owner, +							      String.format("Requested flight log, %dk, is larger than the available space, %dk.\n", +									    config_ui.flight_log_max(), +									    data.log_space()/1024), +							      "Maximum Flight Log Too Large", +							      JOptionPane.ERROR_MESSAGE); +				return; +			} -		/* Pull data out of the UI and stuff back into our local data record */ +			/* Pull data out of the UI and stuff back into our local data record */ -		try {  			data.get_values(config_ui);  			run_serial_thread(serial_mode_save);  		} catch (AltosConfigDataException ae) {  | 
