diff options
| author | Keith Packard <keithp@keithp.com> | 2014-05-28 22:53:06 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-05-28 22:53:06 -0700 | 
| commit | 13f84be8d1568a3fc2ed5eef5dcc2093c149285e (patch) | |
| tree | b7bdaad1167f457ab2ddc45b74619deadf114c03 | |
| parent | 8ba523cd793f2263bb1acd7a5a10f8964075bdc5 (diff) | |
telegps: Add flash device functionality
Move bits from altosui to altosuilib and use those.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | altosui/Makefile.am | 2 | ||||
| -rw-r--r-- | altosuilib/AltosFlashUI.java (renamed from altosui/AltosFlashUI.java) | 14 | ||||
| -rw-r--r-- | altosuilib/AltosRomconfigUI.java (renamed from altosui/AltosRomconfigUI.java) | 3 | ||||
| -rw-r--r-- | altosuilib/Makefile.am | 2 | ||||
| -rw-r--r-- | telegps/TeleGPS.java | 16 | 
5 files changed, 20 insertions, 17 deletions
diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 9eff1614..686b5967 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -21,7 +21,6 @@ altosui_JAVA = \  	AltosConfigTD.java \  	AltosConfigTDUI.java \  	AltosDescent.java \ -	AltosFlashUI.java \  	AltosFlightInfoTableModel.java \  	AltosFlightStatsTable.java \  	AltosFlightStatus.java \ @@ -37,7 +36,6 @@ altosui_JAVA = \  	AltosLanded.java \  	AltosPad.java \  	AltosUIPreferencesBackend.java \ -	AltosRomconfigUI.java \  	AltosUI.java \  	AltosGraph.java \  	AltosGraphDataPoint.java \ diff --git a/altosui/AltosFlashUI.java b/altosuilib/AltosFlashUI.java index d8c70a06..3f120617 100644 --- a/altosui/AltosFlashUI.java +++ b/altosuilib/AltosFlashUI.java @@ -15,7 +15,7 @@   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.   */ -package altosui; +package org.altusmetrum.altosuilib_2;  import java.awt.*;  import java.awt.event.*; @@ -24,7 +24,6 @@ import javax.swing.filechooser.FileNameExtensionFilter;  import java.io.*;  import java.util.concurrent.*;  import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*;  public class AltosFlashUI  	extends AltosUIDialog @@ -39,7 +38,7 @@ public class AltosFlashUI  	JProgressBar	pbar;  	JButton		cancel; -	JFrame		frame; +	AltosUIFrame	frame;  	// Hex file with rom image  	File		file; @@ -252,9 +251,9 @@ public class AltosFlashUI  	}  	boolean select_device() { -		int	product = Altos.product_any; +		int	product = AltosLib.product_any; -		device = AltosDeviceUIDialog.show(frame, Altos.product_any); +		device = AltosDeviceUIDialog.show(frame, AltosLib.product_any);  		if (device == null)  			return false; @@ -426,13 +425,12 @@ public class AltosFlashUI  		flash_task	f = new flash_task(this);  	} -	static void show(JFrame frame) { +	public static void show(AltosUIFrame frame) {  		AltosFlashUI	ui = new AltosFlashUI(frame); -  		ui.showDialog();  	} -	public AltosFlashUI(JFrame in_frame) { +	public AltosFlashUI(AltosUIFrame in_frame) {  		super(in_frame, "Program Altusmetrum Device", false);  		frame = in_frame; diff --git a/altosui/AltosRomconfigUI.java b/altosuilib/AltosRomconfigUI.java index d2fe54d9..8f002c4a 100644 --- a/altosui/AltosRomconfigUI.java +++ b/altosuilib/AltosRomconfigUI.java @@ -15,13 +15,12 @@   * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.   */ -package altosui; +package org.altusmetrum.altosuilib_2;  import java.awt.*;  import java.awt.event.*;  import javax.swing.*;  import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*;  public class AltosRomconfigUI  	extends AltosUIDialog diff --git a/altosuilib/Makefile.am b/altosuilib/Makefile.am index f554fd74..e697b17c 100644 --- a/altosuilib/Makefile.am +++ b/altosuilib/Makefile.am @@ -54,6 +54,8 @@ altosuilib_JAVA = \  	AltosDataChooser.java \  	AltosLights.java \  	AltosLed.java \ +	AltosFlashUI.java \ +	AltosRomconfigUI.java \  	AltosBTDevice.java \  	AltosBTDeviceIterator.java \  	AltosBTManage.java \ diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index de2b4aa3..7f34c763 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -89,21 +89,19 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo  	/* Device menu */  	final static String	download_command = "download"; -	final static String	configure_command = "configure";  	final static String	export_command = "export";  	final static String	graph_command = "graph"; +	final static String	configure_command = "configure"; +	final static String	flash_command = "flash";  	static final String[][] device_menu_entries = new String[][] {  		{ "Download Data",	download_command },  		{ "Configure Device",	configure_command },  		{ "Export Data",	export_command },  		{ "Graph Data",		graph_command }, +		{ "Flash Device",	flash_command },  	}; -//	private AltosInfoTable flightInfo; - -	boolean exit_on_close = false; -  	void stop_display() {  		if (thread != null && thread.isAlive()) {  			thread.interrupt(); @@ -240,6 +238,10 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo  	void graph() {  	} +	void flash() { +		AltosFlashUI.show(this); +	} +  	public void actionPerformed(ActionEvent ev) {  		/* File menu */ @@ -293,6 +295,10 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo  			graph();  			return;  		} +		if (flash_command.equals(ev.getActionCommand())) { +			flash(); +			return; +		}  	}  	void add_frequency_menu(int serial, final AltosFlightReader reader) {  | 
