* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_3;
+package org.altusmetrum.altosuilib_9;
import java.awt.*;
import java.awt.event.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altoslib_9.*;
public class AltosFlashUI
extends AltosUIDialog
// Flash controller
AltosProgrammer programmer;
- private static String[] pair_programmed = {
+ private static final String[] pair_programmed_files = {
"teleballoon",
- "telebt",
- "teledongle",
+ "telebt-v1",
+ "teledongle-v0",
"telefire",
"telemetrum-v0",
"telemetrum-v1",
"teleterra"
};
+ private static final String[] pair_programmed_devices = {
+ "TeleBalloon",
+ "TeleBT-v1",
+ "TeleDongle-v0",
+ "TeleFire",
+ "TeleMetrum-v0",
+ "TeleMetrum-v1",
+ "TeleMini",
+ "TeleNano",
+ "TeleShield",
+ "TeleTerra"
+ };
+
private boolean is_pair_programmed() {
if (file != null) {
String name = file.getName();
- for (int i = 0; i < pair_programmed.length; i++) {
- if (name.startsWith(pair_programmed[i]))
+ for (int i = 0; i < pair_programmed_files.length; i++) {
+ if (name.startsWith(pair_programmed_files[i]))
return true;
}
}
if (device != null) {
- if (!device.matchProduct(AltosLib.product_altusmetrum) &&
- (device.matchProduct(AltosLib.product_teledongle) ||
- device.matchProduct(AltosLib.product_telebt)))
- return true;
+ String name = device.toString();
+ for (int i = 0; i < pair_programmed_devices.length; i++) {
+ if (name.startsWith(pair_programmed_devices[i]))
+ return true;
+ }
}
return false;
}
new AltosHexfileFilter(AltosLib.product_teledongle, "teledongle", "TeleDongle Image"),
new AltosHexfileFilter(AltosLib.product_telemega, "telemega", "TeleMega Image"),
new AltosHexfileFilter(AltosLib.product_easymini, "easymini", "EasyMini Image"),
+ new AltosHexfileFilter(AltosLib.product_easymega, "easymega", "EasyMega Image"),
};
boolean select_source_file() {