if (want_product == AltosLib.product_basestation)
return have_product == AltosLib.product_teledongle ||
- have_product == AltosLib.product_teleterra ||
have_product == AltosLib.product_telebt ||
have_product == AltosLib.product_megadongle;
have_product == AltosLib.product_easymega ||
have_product == AltosLib.product_telegps ||
have_product == AltosLib.product_easymini ||
- have_product == AltosLib.product_telemini;
+ have_product == AltosLib.product_telemini ||
+ have_product == AltosLib.product_easytimer;
if (have_product == AltosLib.product_altusmetrum) /* old devices match any request */
return true;
adjust_accel_cal();
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
+ case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
+ case AltosLib.AO_PAD_ORIENTATION_BIG_PARTS_UP:
return accel_cal_plus_cooked;
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN:
+ case AltosLib.AO_PAD_ORIENTATION_WORDS_UPSIDEDOWN:
+ case AltosLib.AO_PAD_ORIENTATION_BIG_PARTS_DOWN:
return invert_accel_value(accel_cal_minus_cooked);
default:
return AltosLib.MISSING;
adjust_accel_cal();
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
+ case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
+ case AltosLib.AO_PAD_ORIENTATION_BIG_PARTS_UP:
return accel_cal_minus_cooked;
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN:
+ case AltosLib.AO_PAD_ORIENTATION_WORDS_UPSIDEDOWN:
+ case AltosLib.AO_PAD_ORIENTATION_BIG_PARTS_DOWN:
return invert_accel_value(accel_cal_plus_cooked);
default:
return AltosLib.MISSING;
{
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
+ case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
+ case AltosLib.AO_PAD_ORIENTATION_BIG_PARTS_UP:
accel_cal_plus_cooked = accel_cal_plus;
accel_cal_minus_cooked = accel_cal_minus;
accel_cal_adjusted = true;
break;
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN:
+ case AltosLib.AO_PAD_ORIENTATION_WORDS_UPSIDEDOWN:
+ case AltosLib.AO_PAD_ORIENTATION_BIG_PARTS_DOWN:
accel_cal_plus_cooked = invert_accel_value(accel_cal_minus);
accel_cal_minus_cooked = invert_accel_value(accel_cal_plus);
accel_cal_adjusted = true;
public final static int product_altusmetrum = 0x000a;
public final static int product_telemetrum = 0x000b;
public final static int product_teledongle = 0x000c;
- public final static int product_teleterra = 0x000d;
+ public final static int product_easytimer = 0x000d;
public final static int product_telebt = 0x000e;
public final static int product_telelaunch = 0x000f;
public final static int product_telelco = 0x0010;
new Product("telemetrum", product_telemetrum),
new Product("teleballoon", product_telemetrum),
new Product("teledongle", product_teledongle),
- new Product("teleterra", product_teledongle),
+ new Product("easytimer", product_easytimer),
new Product("telebt", product_telebt),
new Product("telelaunch", product_telelaunch),
new Product("telelco", product_telelco),
public static final int AO_PAD_ORIENTATION_ANTENNA_UP = 0;
public static final int AO_PAD_ORIENTATION_ANTENNA_DOWN = 1;
+ public static final int AO_PAD_ORIENTATION_WORDS_UPRIGHT = 2;
+ public static final int AO_PAD_ORIENTATION_WORDS_UPSIDEDOWN = 3;
+ public static final int AO_PAD_ORIENTATION_BIG_PARTS_UP = 4;
+ public static final int AO_PAD_ORIENTATION_BIG_PARTS_DOWN = 5;
public static final int AO_LOG_FORMAT_UNKNOWN = 0;
public static final int AO_LOG_FORMAT_FULL = 1;
case product_altusmetrum: return "AltusMetrum";
case product_telemetrum: return "TeleMetrum";
case product_teledongle: return "TeleDongle";
- case product_teleterra: return "TeleTerra";
+ case product_easytimer: return "EasyTimer";
case product_telebt: return "TeleBT";
case product_telelaunch: return "TeleLaunch";
case product_telelco: return "TeleLco";
int accel = mma655x.accel;
if (cal_data.mma655x_inverted)
accel = 4095 - accel;
- if (cal_data.pad_orientation == 1)
+ if (cal_data.pad_orientation == AltosLib.AO_PAD_ORIENTATION_ANTENNA_DOWN)
accel = 4095 - accel;
listener.set_acceleration(cal_data.acceleration(accel));
}
double z,
int pad_orientation) {
AltosQuaternion orient = AltosQuaternion.vector(x, y, z).normalize();
- double sky = pad_orientation == 0 ? 1 : -1;
+ double sky = (pad_orientation & 1) == 0 ? 1 : -1;
AltosQuaternion up = new AltosQuaternion(0, 0, 0, sky);
rotation = up.vectors_to_rotation(orient);
}
"4250",
};
- static String[] pad_orientation_values = {
+ static String[] pad_orientation_values_radio = {
"Antenna Up",
"Antenna Down",
};
+ static String[] pad_orientation_values_no_radio = {
+ "Beeper Up",
+ "Beeper Down",
+ };
+
+ static String[] pad_orientation_values_six_axis = {
+ "Beeper Up",
+ "Beeper Down",
+ "Words Upright",
+ "Words Upsidedown",
+ "Big Parts Up",
+ "Big Parts Down",
+ };
+
+ String[] pad_orientation_values;
+
static String[] tracker_motion_values_m = {
"2",
"5",
return product != null && product.startsWith("TeleMetrum");
}
+ boolean is_telemega() {
+ String product = product_value.getText();
+ return product != null && product.startsWith("TeleMega");
+ }
+
+ boolean is_easymega() {
+ String product = product_value.getText();
+ return product != null && product.startsWith("EasyMega");
+ }
+
+ boolean is_easytimer() {
+ String product = product_value.getText();
+ return product != null && product.startsWith("EasyTimer");
+ }
+
+ boolean has_radio() {
+ return is_telemega() || is_telemetrum() || is_telemini();
+ }
+
void set_radio_enable_tool_tip() {
if (radio_enable_value.isVisible())
radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions");
pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward");
else if (is_telemini() || is_easymini())
pad_orientation_value.setToolTipText("TeleMini and EasyMini don't care how they are mounted");
+ else if (is_easytimer())
+ pad_orientation_value.setToolTipText("EasyTimer can be mounted in any of six orientations");
else
pad_orientation_value.setToolTipText("Can't select orientation");
}
c.anchor = GridBagConstraints.LINE_START;
c.insets = ir;
c.ipady = 5;
+ if (has_radio())
+ pad_orientation_values = pad_orientation_values_radio;
+ else if (is_easytimer())
+ pad_orientation_values = pad_orientation_values_six_axis;
+ else
+ pad_orientation_values = pad_orientation_values_no_radio;
+
pad_orientation_value = new JComboBox<String>(pad_orientation_values);
pad_orientation_value.setEditable(false);
pad_orientation_value.addItemListener(this);
"telemetrum-v1",
"telemini-v1",
"telenano",
- "teleshield",
- "teleterra"
+ "teleshield"
};
private static final String[] pair_programmed_devices = {
"TeleMetrum-v1",
"TeleMini-v1",
"TeleNano",
- "TeleShield",
- "TeleTerra"
+ "TeleShield"
};
private boolean is_pair_programmed() {
if (want_product == AltosUILib.product_basestation)
return have_product == AltosUILib.product_teledongle ||
- have_product == AltosUILib.product_teleterra ||
have_product == AltosUILib.product_telebt ||
have_product == AltosUILib.product_megadongle;
if (want_product == AltosUILib.product_altimeter)
return have_product == AltosUILib.product_telemetrum ||
have_product == AltosUILib.product_telemega ||
+ have_product == AltosUILib.product_easytimer ||
have_product == AltosUILib.product_easymega ||
have_product == AltosUILib.product_telegps ||
have_product == AltosUILib.product_easymini ||