예제 #1
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            DG200Configuration cfg = this.generateConfig();

            SetDGConfigurationCommand set = new SetDGConfigurationCommand(cfg);

            set.setSerialConnection(this._sc);

            try
            {
                set.execute();
            }
            catch (kimandtodd.DG200CSharp.commands.exceptions.CommandException ex)
            {
                Console.WriteLine("An exception was thrown when trying to set the configuration: " + ex.Message);
            }

            SetDGConfigurationCommandResult setR = (SetDGConfigurationCommandResult)set.getLastResult();

            kimandtodd.GPX_Reader.MainWindow win = this.Owner as kimandtodd.GPX_Reader.MainWindow;

            win.lblStatus.Content  = "Connected on port " + this._sc.getPortName() + ".\n";
            win.lblStatus.Content += setR.getSuccess() ? "Configuration saved." : "Configuration not saved!";

            this.Close();
        }
예제 #2
0
        public void populate(DG200Configuration cfg)
        {
            this.chkWaas.IsChecked     = cfg.getEnableWaas();
            this.chkAltitude.IsChecked = (cfg.getTrackingType() == BaseDGTrackPoint.FORMAT_POSITION_DATE_SPEED_ALTITUDE);

            if (cfg.getUseTimeInterval())
            {
                this.rdoUseTime.IsChecked = true;
                this.rdoUseDist.IsChecked = false;
            }
            else
            {
                this.rdoUseTime.IsChecked = false;
                this.rdoUseDist.IsChecked = true;
            }

            this.txtSecondsIntvl.Text = (cfg.getTimeInterval() / 1000).ToString("D");
            this.txtMetersIntvl.Text  = cfg.getDistanceInterval().ToString();

            this.chkDistance.IsChecked = cfg.getUseDistanceThreshold();
            this.chkSpeed.IsChecked    = cfg.getUseSpeedThreshold();

            this.txtMinSpeed.Text    = cfg.getSpeedThresholdValue().ToString();
            this.txtMinDistance.Text = cfg.getDistanceThresholdValue().ToString();

            this._cfg = cfg;
        }
예제 #3
0
        private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                GetDGConfigurationCommandResult cr = this.getConfig();
                this._dgConfig           = cr.getConfiguration();
                this.mnuConfig.IsEnabled = true;
                this.mnuErase.IsEnabled  = true;

                this.refreshTrackHeaders();
            }
            catch (kimandtodd.DG200CSharp.commands.exceptions.CommandException ex)
            {
                this.lblStatus.Content = "Connection failed: " + ex.Message;
            }
        }
예제 #4
0
 protected override void processBuffer()
 {
     this._config = new DG200Configuration(this.getCurrentBuffer());
 }