Esempio n. 1
0
        public HttpService(HttpServiceConfig _config, Tnxlog _rdaLog)
        {
            config         = _config;
            tnxlog         = _rdaLog;
            unsentFilePath = Path.Combine(tnxlog.dataPath, "unsent");
            List <QSO> unsentQSOs = QSOFactory.ReadList <List <QSO> >(unsentFilePath + ".qso");

            if (unsentQSOs != null && unsentQSOs.Count > 0)
            {
                Task.Run(async() =>
                {
                    await postQso(unsentQSOs.ToArray());
                });
            }
            List <QsoDeleteData> unsentDels = ProtoBufSerialization.Read <List <QsoDeleteData> >(unsentFilePath + ".del");

            if (unsentDels != null && unsentDels.Count > 0)
            {
                Task.Run(async() =>
                {
                    foreach (QsoDeleteData del in unsentDels)
                    {
                        if (!await _postDeleteQso(del))
                        {
                            addToQueue(del);
                        }
                    }
                });
            }
        }
Esempio n. 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();
        }
Esempio n. 3
0
 public StatusData(HttpServiceConfig _config) : base(_config)
 {
     qth = new StatusDataQth((TnxlogConfig)_config.parent);
 }
Esempio n. 4
0
 internal FreqData(HttpServiceConfig _config, string _freq) : base(_config)
 {
     freq = _freq;
 }
Esempio n. 5
0
 internal QsoDeleteRequest(HttpServiceConfig _config, QsoDeleteData qdd) : base(_config)
 {
     delete = qdd.delete;
 }
Esempio n. 6
0
 internal QsoDeleteRequest(HttpServiceConfig _config, QSO qso) : base(_config)
 {
     delete = qso.serverTs;
 }
Esempio n. 7
0
 internal QSOtoken(HttpServiceConfig _config, QSO[] _qso) : base(_config)
 {
     qso = _qso;
 }
Esempio n. 8
0
 public JSONToken(HttpServiceConfig _config)
 {
     config = _config;
 }