示例#1
0
        public DM780Connector(MiniDeluxe parent)
        {
            _buffer = new StringBuilder();
            Console.WriteLine("Starting DM780 Connector");
            // We need to locate the DM780 window first.
            _dmwindow = FindWindow("DM780-Application", null);



            StringBuilder sb = WindowText(_dmwindow);

            if (sb.Length > 0)
            {
                _dm780Running = true;
                Console.WriteLine("DM780 Window: " + sb.ToString());
                // Now find the handle for the RICHEDIT control
            }

            //IntPtr child = FindWindowEx(_dmwindow, IntPtr.Zero, "RICHEDIT", null);
            StringBuilder sb2 = WindowText((IntPtr)0x00041788);

            if (sb2.Length > 0)
            {
                Console.WriteLine("Window: " + sb2.ToString());
            }
        }
示例#2
0
        private void callQRZ(string url)
        {
            MiniDeluxe.Debug("callQRZ running with: " + url);
            Stream qrzstrm;

            try
            {
                QRZData.Clear();
                qrzstrm = wc.OpenRead(url);
                QRZData.ReadXml(qrzstrm, XmlReadMode.InferSchema);
                qrzstrm.Close();
                if (!QRZData.Tables.Contains("QRZDatabase"))
                {
                    MiniDeluxe.Debug("Error: failed to receive QRZDatabase object");
                    return;
                }
                DataRow   dr   = QRZData.Tables["QRZDatabase"].Rows[0];
                DataTable sess = QRZData.Tables["Session"];
                DataRow   sr   = sess.Rows[0];
                _xmlError   = QRZField(sr, "Error");
                _xmlSession = QRZField(sr, "Key");
                _LGMTime    = QRZField(sr, "GMTime");
                _Lcount     = QRZField(sr, "Count");
                _LSubExp    = QRZField(sr, "SubExp");
                _LKey       = _xmlSession;
            }
            catch (Exception err)
            {
                MiniDeluxe.Debug("QRZ.com Error: " + err.Message);
            }
            _isOnline = (_xmlSession.Length > 0) ? true : false;
            MiniDeluxe.Debug("QRZ Session Key: " + _LKey);
        }
示例#3
0
        public NotifyIcon(MiniDeluxe parent)
        {
            _parent = parent;
            _notifyIcon = new System.Windows.Forms.NotifyIcon(_components);
            _contextMenuNotifyIcon = new ContextMenuStrip(_components);
            _configureToolStripMenuItem = new ToolStripMenuItem();
            _exitToolStripMenuItem = new ToolStripMenuItem();

            _notifyIcon.ContextMenuStrip = _contextMenuNotifyIcon;
            _notifyIcon.Icon = new System.Drawing.Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream("MiniDeluxe.Mic-20.ico"));
            _notifyIcon.Text = "MiniDeluxe";
            _notifyIcon.Visible = true;
            _notifyIcon.DoubleClick += NotifyIconDoubleClick;

            _contextMenuNotifyIcon.Items.AddRange(new ToolStripItem[] {
                _configureToolStripMenuItem,
                _exitToolStripMenuItem
            });

            _contextMenuNotifyIcon.Name = "_contextMenuNotifyIcon";
            _contextMenuNotifyIcon.Size = new System.Drawing.Size(130, 48);

            _configureToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
            _configureToolStripMenuItem.Name = "_configureToolStripMenuItem";
            _configureToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
            _configureToolStripMenuItem.Text = "Options";
            _configureToolStripMenuItem.Click += ConfigureToolStripMenuItemClick;

            _exitToolStripMenuItem.Name = "_exitToolStripMenuItem";
            _exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            _exitToolStripMenuItem.Text = "Exit";
            _exitToolStripMenuItem.Click += ExitToolStripMenuItemClick;
        }
示例#4
0
 public QRZcomConnector(MiniDeluxe parent)
 {
     _dburl    = Properties.Settings.Default.QRZdburl;
     _username = Properties.Settings.Default.QRZUsername;
     _password = Properties.Settings.Default.QRZPassword;
     doLogin();
 }
示例#5
0
 public HRDTCPServer(MiniDeluxe parent)
 {
     _parent          = parent;
     _connectionCount = 0;
     _listener        = new TcpListener(Properties.Settings.Default.LocalOnly ? IPAddress.Loopback : IPAddress.Any,
                                        Properties.Settings.Default.Port);
 }
示例#6
0
        public String GetWorkedBands(String callsign)
        {
            MiniDeluxe.Debug("GetWorkedBands running");
            String ret = "";

            if (dbConnected)
            {
                try
                {
                    // There is NO getqso function within the Log4OM WCF service so will need to query MySQL directly!
                    String query = "select `band` from `log` where `call`='" + callsign + "' group by `band` order by `band`";
                    MiniDeluxe.Debug("Query: " + query);
                    MySqlCommand    cmd = new MySqlCommand(query, _mysql);
                    MySqlDataReader dr  = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        ret = ret + dr["band"] + ",";
                    }
                    dr.Close();
                    ret = ret.TrimEnd(','); // Remove final comma
                    MiniDeluxe.Debug("Found bands:" + ret);
                }
                catch (Exception ex)
                {
                    MiniDeluxe.Debug("MySQL Error: " + ex.ToString());
                }
            }

            return(ret);
        }
示例#7
0
        public NotifyIcon(MiniDeluxe parent)
        {
            _parent                     = parent;
            _notifyIcon                 = new System.Windows.Forms.NotifyIcon(_components);
            _contextMenuNotifyIcon      = new ContextMenuStrip(_components);
            _configureToolStripMenuItem = new ToolStripMenuItem();
            _exitToolStripMenuItem      = new ToolStripMenuItem();

            _notifyIcon.ContextMenuStrip = _contextMenuNotifyIcon;
            _notifyIcon.Icon             = new System.Drawing.Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream("MiniDeluxe.Mic-20.ico"));
            _notifyIcon.Text             = "MiniDeluxe";
            _notifyIcon.Visible          = true;
            _notifyIcon.DoubleClick     += NotifyIconDoubleClick;

            _contextMenuNotifyIcon.Items.AddRange(new ToolStripItem[] {
                _configureToolStripMenuItem,
                _exitToolStripMenuItem
            });

            _contextMenuNotifyIcon.Name = "_contextMenuNotifyIcon";
            _contextMenuNotifyIcon.Size = new System.Drawing.Size(130, 48);

            _configureToolStripMenuItem.Font   = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
            _configureToolStripMenuItem.Name   = "_configureToolStripMenuItem";
            _configureToolStripMenuItem.Size   = new System.Drawing.Size(129, 22);
            _configureToolStripMenuItem.Text   = "Options";
            _configureToolStripMenuItem.Click += ConfigureToolStripMenuItemClick;

            _exitToolStripMenuItem.Name   = "_exitToolStripMenuItem";
            _exitToolStripMenuItem.Size   = new System.Drawing.Size(152, 22);
            _exitToolStripMenuItem.Text   = "Exit";
            _exitToolStripMenuItem.Click += ExitToolStripMenuItemClick;
        }
示例#8
0
        public void doLogin()
        {
            string url = _dburl + "?username="******";password="******"Login OK");
            }
        }
示例#9
0
        public N1MMConnector(MiniDeluxe parent)
        {
            _buffer = new StringBuilder();

            try
            {
                _parent   = parent;
                _client   = new UdpClient(Properties.Settings.Default.RadioPort);
                _endpoint = new IPEndPoint(Properties.Settings.Default.LocalOnly ? IPAddress.Loopback : IPAddress.Any, 0);
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to bind to UDP port: " + ex.ToString());
            }
            _readThread = new Thread(ReadThread);
            _readThread.Start();
        }
示例#10
0
        public bool GetCallsign(string cs)
        {
            MiniDeluxe.Debug("Lookup Callsign: " + cs);
            if (cs.Length < 3)
            {
                return(false);
            }
            string url = _dburl + "?s=" + _xmlSession + ";callsign=" + cs;

            callQRZ(url);
            if (!_isOnline)
            {
                doLogin();
                if (_isOnline)
                {
                    GetCallsign(cs);
                }
            }
            return(true);
        }
示例#11
0
        public Log4OMConnector(MiniDeluxe parent)
        {
            try
            {
                _log4om = new log4om.log4omService.WCFServiceClient();

                if (!_log4om.ConnectionTest())
                {
                    isConnected = false;
                    MiniDeluxe.Debug("Failed to Connect to Log4OM");
                }
                else
                {
                    isConnected = true;
                    MiniDeluxe.Debug("Successfully Connected to Log4OM");
                }
                // Connect to Database
                _mysql = new MySqlConnection("SERVER=" + Properties.Settings.Default.Log4OMDBServer + ";" +
                                             "DATABASE=" + Properties.Settings.Default.Log4OMDBName + ";" +
                                             "UID=" + Properties.Settings.Default.Log4OMDBUser + ";" +
                                             "PASSWORD="******";");
                try
                {
                    _mysql.Open();
                } catch (Exception ex)
                {
                    dbConnected = false;
                    throw new Exception("Failed to connect to Log4OM Database: " + ex.ToString());
                }

                _parent = parent;
            }
            catch (Exception ex)
            {
                throw new Exception("Something went wrong with Log4OM: " + ex.ToString());
            }
        }
示例#12
0
        public int GetWorkedThisBand(String callsign, String band)
        {
            MiniDeluxe.Debug("GetWorkedThisBand running");
            int ret = -1;

            if (dbConnected)
            {
                try
                {
                    // There is NO getqso function within the Log4OM WCF service so will need to query MySQL directly!
                    String query = "select count(*) from `log` where `call`='" + callsign + "' and `band`='" + band + "'";
                    MiniDeluxe.Debug("Query: " + query);
                    MySqlCommand cmd = new MySqlCommand(query, _mysql);
                    ret = int.Parse(cmd.ExecuteScalar() + "");
                    MiniDeluxe.Debug("Got Count of QSOs:" + ret.ToString());
                }
                catch (Exception ex)
                {
                    MiniDeluxe.Debug("MySQL Error: " + ex.ToString());
                }
            }

            return(ret);
        }
示例#13
0
 public MiniDeluxeForm(MiniDeluxe parent)
 {
     _parent = parent;
     InitializeComponent();
 }
示例#14
0
 public HRDTCPServer(MiniDeluxe parent)
 {
     _parent = parent;
     _connectionCount = 0;
     _listener = new TcpListener(Properties.Settings.Default.LocalOnly ? IPAddress.Loopback : IPAddress.Any,
                                     Properties.Settings.Default.Port);
 }
示例#15
0
 public MiniDeluxeForm(MiniDeluxe parent)
 {
     _parent = parent;
     InitializeComponent();
 }