예제 #1
0
void
DeviceEditWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  instance = this;

  RowFormWidget::Prepare(parent, rc);

  DataFieldEnum *port_df = new DataFieldEnum(OnDataField);
  port_df->SetDetachGUI(true);
  FillPorts(*port_df, config);
  Add(_("Port"), NULL, port_df);

  DataFieldEnum *baud_rate_df = new DataFieldEnum(NULL);
  FillBaudRates(*baud_rate_df);
  baud_rate_df->Set(config.baud_rate);
  Add(_("Baudrate"), NULL, baud_rate_df);

  DataFieldEnum *bulk_baud_rate_df = new DataFieldEnum(NULL);
  bulk_baud_rate_df->addEnumText(_T("Default"), 0u);
  FillBaudRates(*bulk_baud_rate_df);
  bulk_baud_rate_df->Set(config.bulk_baud_rate);
  Add(_("Bulk baud rate"),
      _("The baud rate used for bulk transfers, such as task declaration or flight download."),
      bulk_baud_rate_df);

  DataFieldEnum *tcp_port_df = new DataFieldEnum(NULL);
  FillTCPPorts(*tcp_port_df);
  tcp_port_df->Set(config.tcp_port);
  Add(_("TCP Port"), NULL, tcp_port_df);

  DataFieldEnum *driver_df = new DataFieldEnum(OnDataField);
  driver_df->SetDetachGUI(true);
  const TCHAR *driver_name;
  for (unsigned i = 0; (driver_name = GetDriverNameByIndex(i)) != NULL; i++)
    driver_df->addEnumText(driver_name, GetDriverDisplayNameByIndex(i));

  driver_df->Sort(1);
  driver_df->SetAsString(config.driver_name);

  Add(_("Driver"), NULL, driver_df);

  port_df->SetDetachGUI(false);
  driver_df->SetDetachGUI(false);

  UpdateVisibilities();
}
예제 #2
0
void
DeviceEditWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  instance = this;

  RowFormWidget::Prepare(parent, rc);

  DataFieldEnum *port_df = new DataFieldEnum(OnDataField);
  port_df->SetDetachGUI(true);
  FillPorts(*port_df, config);
  Add(_("Port"), NULL, port_df);

  DataFieldEnum *baud_rate_df = new DataFieldEnum(NULL);
  FillBaudRates(*baud_rate_df);
  baud_rate_df->Set(config.baud_rate);
  Add(_("Baudrate"), NULL, baud_rate_df);

  DataFieldEnum *bulk_baud_rate_df = new DataFieldEnum(NULL);
  bulk_baud_rate_df->addEnumText(_T("Default"), 0u);
  FillBaudRates(*bulk_baud_rate_df);
  bulk_baud_rate_df->Set(config.bulk_baud_rate);
  Add(_("Bulk baud rate"),
      _("The baud rate used for bulk transfers, such as task declaration or flight download."),
      bulk_baud_rate_df);

  DataFieldEnum *tcp_port_df = new DataFieldEnum(NULL);
  FillTCPPorts(*tcp_port_df);
  tcp_port_df->Set(config.tcp_port);
  Add(_("TCP Port"), NULL, tcp_port_df);

  DataFieldEnum *driver_df = new DataFieldEnum(OnDataField);
  driver_df->SetDetachGUI(true);
  const TCHAR *driver_name;
  for (unsigned i = 0; (driver_name = GetDriverNameByIndex(i)) != NULL; i++)
    driver_df->addEnumText(driver_name, GetDriverDisplayNameByIndex(i));

  driver_df->Sort(1);
  driver_df->SetAsString(config.driver_name);

  Add(_("Driver"), NULL, driver_df);

  AddBoolean(_("Sync. from device"),
             _("This option lets you configure if XCSoar should use settings "
               "like the MacCready value, bugs and ballast from the device."),
             config.sync_from_device);
  SetExpertRow(SyncFromDevice);

  AddBoolean(_("Sync. to device"),
             _("This option lets you configure if XCSoar should send settings "
               "like the MacCready value, bugs and ballast to the device."),
             config.sync_to_device);
  SetExpertRow(SyncToDevice);

  AddBoolean(_("Ignore checksum"),
             _("If your GPS device outputs invalid NMEA checksums, this will "
               "allow it's data to be used anyway."),
             config.ignore_checksum);
  SetExpertRow(IgnoreCheckSum);

  port_df->SetDetachGUI(false);
  driver_df->SetDetachGUI(false);

  UpdateVisibilities();
}