Esempio n. 1
0
        public GenericCATRadio(RadioConnectionSettings connectionSettings)
        {
            ConnectionSettings = connectionSettings;
            m_SerialPort = new SerialPort { PortName = connectionSettings.Port, BaudRate = connectionSettings.BaudRate, DtrEnable = connectionSettings.UseDTR, RtsEnable = connectionSettings.UseRTS };
            switch (connectionSettings.FlowControl)
            {
                case FlowControl.None:
                    m_SerialPort.Handshake = Handshake.None;
                    break;
                case FlowControl.DsrDtr:
                case FlowControl.RtsCts:
                    m_SerialPort.Handshake = Handshake.RequestToSend;
                    break;
                case FlowControl.XonXoff:
                    m_SerialPort.Handshake = Handshake.XOnXOff;
                    break;
            }
            m_SerialPort.Open();

            string logsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Cloudlog\\Logs");
            if (!Directory.Exists(logsFolder))
                Directory.CreateDirectory(logsFolder);
            string logPath = Path.Combine(logsFolder, "CloudlogCAT-" + DateTime.Now.ToString("yyyy-MM-dd-hhmmss") + ".txt");
            m_LogWriter = new StreamWriter(logPath);
            m_LogWriter.AutoFlush = true;

            m_PollThread = new Thread(PollMethod);
            m_PollThread.IsBackground = true;
            m_PollThread.Start();
        }
Esempio n. 2
0
        public GenericIcom(RadioConnectionSettings connectionSettings)
        {
            string[] ports = SerialPort.GetPortNames();

            m_Port = new SerialPort(connectionSettings.Port);
            m_Port.BaudRate = connectionSettings.BaudRate;
            m_Port.DtrEnable = connectionSettings.UseDTR;
            m_Port.RtsEnable = connectionSettings.UseRTS;
            m_Port.Open();

            m_MonitorThread = new Thread(ReadStream);
            m_MonitorThread.IsBackground = true;
            m_MonitorThread.Start();
        }
Esempio n. 3
0
        public GenericIcom(RadioConnectionSettings connectionSettings)
        {
            string[] ports = SerialPort.GetPortNames();

            m_Port           = new SerialPort(connectionSettings.Port);
            m_Port.BaudRate  = connectionSettings.BaudRate;
            m_Port.DtrEnable = connectionSettings.UseDTR;
            m_Port.RtsEnable = connectionSettings.UseRTS;
            m_Port.Open();

            m_MonitorThread = new Thread(ReadStream);
            m_MonitorThread.IsBackground = true;
            m_MonitorThread.Start();
        }
Esempio n. 4
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            RadioFactory            radioFactory = new RadioFactory();
            RadioConnectionSettings rcs          = new RadioConnectionSettings();
            RadioModel model;
            string     logbookUrl;

            using (ConnectionForm connForm = new ConnectionForm())
            {
                DialogResult dr = connForm.ShowDialog(this);
                if (dr == System.Windows.Forms.DialogResult.OK)
                {
                    model        = connForm.Model;
                    rcs.BaudRate = connForm.Speed;
                    rcs.Port     = connForm.SerialPort;
                    rcs.UseDTR   = connForm.UseDTR;
                    rcs.UseRTS   = connForm.UseRTS;
                    logbookUrl   = connForm.LogbookURL;
                }
                else
                {
                    Close();
                    return;
                }
            }

            try
            {
                m_Radio = radioFactory.GetRadio(model, rcs);

                m_RadioLabel.Text = m_Radio.ToString();

                m_API          = new CloudlogAPI(logbookUrl);
                m_UpdateThread = new Thread(UpdateFrequency);
                m_UpdateThread.IsBackground = true;
                m_UpdateThread.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 5
0
        public GenericCATRadio(RadioConnectionSettings connectionSettings)
        {
            ConnectionSettings = connectionSettings;
            m_SerialPort       = new SerialPort {
                PortName = connectionSettings.Port, BaudRate = connectionSettings.BaudRate, DtrEnable = connectionSettings.UseDTR, RtsEnable = connectionSettings.UseRTS
            };
            switch (connectionSettings.FlowControl)
            {
            case FlowControl.None:
                m_SerialPort.Handshake = Handshake.None;
                break;

            case FlowControl.DsrDtr:
            case FlowControl.RtsCts:
                m_SerialPort.Handshake = Handshake.RequestToSend;
                break;

            case FlowControl.XonXoff:
                m_SerialPort.Handshake = Handshake.XOnXOff;
                break;
            }
            m_SerialPort.Open();

            string logsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Cloudlog\\Logs");

            if (!Directory.Exists(logsFolder))
            {
                Directory.CreateDirectory(logsFolder);
            }
            string logPath = Path.Combine(logsFolder, "CloudlogCAT-" + DateTime.Now.ToString("yyyy-MM-dd-hhmmss") + ".txt");

            m_LogWriter           = new StreamWriter(logPath);
            m_LogWriter.AutoFlush = true;

            m_PollThread = new Thread(PollMethod);
            m_PollThread.IsBackground = true;
            m_PollThread.Start();
        }
Esempio n. 6
0
 public K3(RadioConnectionSettings rcs)
     : base(rcs)
 {
 }
Esempio n. 7
0
 public K3(RadioConnectionSettings rcs)
     : base(rcs)
 {
 }
Esempio n. 8
0
 public FT950(RadioConnectionSettings rcs)
     : base(rcs)
 {
 }