示例#1
0
void
V7ConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  RequestAllSettings(device);

  brgps = WaitUnsignedValue(device, "BRGPS", 5);
  brpda = WaitUnsignedValue(device, "BRPDA", 5);

  static gcc_constexpr_data StaticEnumChoice baud_list[] = {
    { 0, _T("4800"), NULL },
    { 1, _T("9600"), NULL },
    { 2, _T("19200"), NULL },
    { 3, _T("38400"), NULL },
    { 4, _T("57600"), NULL },
    { 5, _T("115200"), NULL },
    { 6, _T("230400"), NULL },
    { 7, _T("256000"), NULL },
    { 8, _T("460800"), NULL },
    { 9, _T("500k"), NULL },
    { 10, _T("1M"), NULL },
    { 0 }
  };

  AddEnum(_("GPS baud rate"), NULL, baud_list, brgps);
  AddEnum(_("PDA baud rate"), NULL, baud_list, brpda);
}
示例#2
0
void
NanoConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  RequestAllSettings(device);

  static constexpr StaticEnumChoice baud_list[] = {
    { 2400, _T("2400"), NULL },
    { 4800, _T("4800"), NULL },
    { 9600, _T("9600"), NULL },
    { 19200, _T("19200"), NULL },
    { 38400, _T("38400"), NULL },
    { 57600, _T("57600"), NULL },
    { 115200, _T("115200"), NULL },
    { 0 }
  };

  AddEnum(_("Baud rate"), NULL, baud_list,
          WaitUnsignedValue(device, "BAUDRATE", 115200));

  AddBoolean(_("Auto off"), NULL,
             WaitBoolValue(device, "AUTOOFF", false));

  AddBoolean(_("Auto finish flight"), NULL,
             WaitBoolValue(device, "OFFFIN", true));

  AddBoolean(_("Always run"), NULL,
             WaitBoolValue(device, "ALWRUN", false));

  AddBoolean(_("Enable NMEA"), NULL,
             WaitBoolValue(device, "NMEA", true));

  AddInteger(_("Recording interval"), NULL,
             _T("%d s"), _T("%d"), 1, 60, 1,
             WaitUnsignedValue(device, "RECINT", 1));
}
void
LX16xxConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  RequestAllSettings(device);

  AddInteger(_("Avg. time"), NULL, _T("%d s"), _T("%d"), 1, 30, 1,
             WaitUnsignedValue(device, LX1600::Setting::VARIO_AVG_TIME, 25));

  static constexpr StaticEnumChoice range_list[] = {
    { 25, _T("2.5 m/s"), NULL },
    { 50, _T("5.0 m/s"), NULL },
    { 100, _T("10 m/s"), NULL },
    { 0 }
  };

  AddEnum(_("Vario Range"), NULL, range_list,
          (unsigned)(WaitFixedValue(device, LX1600::Setting::VARIO_RANGE,
                                    fixed(5.0)) * 10));
  AddFloat(_("Vario Filter"), NULL,
           _T("%.2f s"), _T("%.2f"), fixed(0.25), fixed(5), fixed(0.25), false,
           WaitFixedValue(device, LX1600::Setting::VARIO_FILTER, fixed(1)));

  static constexpr StaticEnumChoice te_level_list[] = {
    { 0, _T("Off"), NULL },
    { 50, _T("50 %"), NULL },
    { 60, _T("60 %"), NULL },
    { 70, _T("70 %"), NULL },
    { 80, _T("80 %"), NULL },
    { 90, _T("90 %"), NULL },
    { 100, _T("100 %"), NULL },
    { 110, _T("110 %"), NULL },
    { 120, _T("120 %"), NULL },
    { 130, _T("130 %"), NULL },
    { 140, _T("140 %"), NULL },
    { 150, _T("150 %"), NULL },
    { 0 }
  };

  AddEnum(_("TE Level"), NULL, te_level_list,
          (unsigned)WaitFixedValue(device, LX1600::Setting::TE_LEVEL, fixed(50)));

  AddFloat(_("TE Filter"), NULL,
           _T("%.2f s"), _T("%.2f"), fixed(0.0), fixed(2), fixed(1), false,
           WaitFixedValue(device, LX1600::Setting::TE_FILTER, fixed(1.5)));

  AddFloat(_("SMART Filter"), NULL,
           _T("%.2f m/s²"), _T("%.2f"), fixed(0.5), fixed(5), fixed(0.1), false,
           WaitFixedValue(device, LX1600::Setting::SMART_VARIO_FILTER, fixed(1)));
}
示例#4
0
static unsigned
WaitBoolValue(LXDevice &device, const char *name,
              bool default_value)
{
  return WaitUnsignedValue(device, name, default_value) != 0;
}