import altosui.AltosFlightStatusTableModel;
import altosui.AltosFlightInfoTableModel;
import altosui.AltosChannelMenu;
+import altosui.AltosFlashUI;
+import altosui.AltosLogfileChooser;
import libaltosJNI.*;
void ConfigureTeleMetrum() {
new AltosConfig(AltosUI.this);
}
+
+ void FlashImage() {
+ new AltosFlashUI(AltosUI.this);
+ }
+
/*
* Open an existing telemetry file and replay it in realtime
*/
* Replay a flight from telemetry data
*/
private void Replay() {
- JFileChooser logfile_chooser = new JFileChooser();
+ AltosLogfileChooser chooser = new AltosLogfileChooser(
+ AltosUI.this);
- logfile_chooser.setDialogTitle("Select Flight Record File");
- logfile_chooser.setFileFilter(new FileNameExtensionFilter("Flight data file", "eeprom", "telem"));
- logfile_chooser.setCurrentDirectory(AltosPreferences.logdir());
- int returnVal = logfile_chooser.showOpenDialog(AltosUI.this);
+ File file = chooser.runDialog();
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = logfile_chooser.getSelectedFile();
- if (file == null)
- System.out.println("No file selected?");
+ if (file != null) {
String filename = file.getName();
try {
FileInputStream replay = new FileInputStream(file);
});
menu.add(item);
+ item = new JMenuItem("Flash Image",KeyEvent.VK_F);
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ FlashImage();
+ }
+ });
+ menu.add(item);
+
item = new JMenuItem("Quit",KeyEvent.VK_Q);
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
ActionEvent.CTRL_MASK));