Пример #1
0
 private void updateTransceiverControllerConfig(TransceiverControllerConfig tcConfig, FormSettings formSettings)
 {
     tcConfig.transceiverType = formSettings.cwTransceiverType;
     tcConfig.serialDeviceId  = formSettings.serialDeviceId;
     for (int co = 0; co < TransceiverController.PIN_FUNCTIONS.Count; co++)
     {
         tcConfig.pinout[co]     = SerialDevice.SerialDevice.PINS.IndexOf(formSettings.transceiverPinSettings[co].pin);
         tcConfig.invertPins[co] = formSettings.transceiverPinSettings[co].invert;
     }
     tcConfig.tciHost   = formSettings.tciHost;
     tcConfig.tciPort   = formSettings.tciPort;
     tcConfig.tciTrnsNo = formSettings.tciTrnsNo;
 }
Пример #2
0
        public override void initialize()
        {
            if (formMain == null)
            {
                formMain = new FormMainConfig(this);
            }
            else
            {
                formMain.parent = this;
            }

            if (formLog == null)
            {
                formLog = new FormLogConfig(this);
            }
            else
            {
                formLog.parent = this;
            }

            if (httpService == null)
            {
                httpService = new HttpServiceConfig(this);
            }
            else
            {
                httpService.parent = this;
            }

            if (transceiverController == null)
            {
                transceiverController = new TransceiverControllerConfig(this);
            }
            else
            {
                transceiverController.parent = this;
            }

            if (cwMacros == null)
            {
                cwMacros = new List <string[]>();
            }
            for (int co = cwMacros.Count; co < CwMacrosDefaults.Count; co++)
            {
                cwMacros.Add(new string[] { CwMacrosDefaults[co].Item1, CwMacrosDefaults[co].Item2 });
            }

            if (serMainFormPanels != null)
            {
                _mainFormPanels = serMainFormPanels.ToDictionary(item => item.name, item => item.enabled);
            }
            else
            {
                _mainFormPanels = new Dictionary <string, bool>();
            }
            foreach (string panel in MainFormPanels)
            {
                if (!_mainFormPanels.ContainsKey(panel))
                {
                    _mainFormPanels[panel] = true;
                }
            }

            base.initialize();
        }
Пример #3
0
 public TransceiverController(TransceiverControllerConfig _config)
 {
     config = _config;
     Logger.Debug($"Stopwatch frequency: {Stopwatch.Frequency}");
 }