Пример #1
0
        void _riox_ObjectReceivedEvent(object o, RIOX.RIOXClient.ObjectReceivedEventArgs e)
        {
            RIOXData rd = (RIOXData)e.DataObject;

            Console.WriteLine("ObjectReceived " + rd.Count);

            // pass it through the CAT event parser since DDUtil passes them as command/data key/pair
            foreach (DictionaryEntry de in rd)
            {
                CATEventArgs c = new CATEventArgs((string)de.Key, (string)de.Value);
                Console.WriteLine("Key: {0} Val: {1}", de.Key, de.Value);
                CatcatEvent(this, c);
            }
        }
Пример #2
0
        private void ParseCommand(String command)
        {
            Match m = Regex.Match(command, "([A-Z]{2,4})(.*);", RegexOptions.Compiled);

            if (!m.Success)
            {
                return;
            }

            CATEventArgs cea = new CATEventArgs(m.Groups[1].ToString(), m.Groups[2].ToString());

            if (CATEvent != null)
            {
                CATEvent(this, cea);
            }
            return;
        }
Пример #3
0
        void CatcatEvent(object sender, CATEventArgs e)
        {
            switch (e.Command)
            {
            // vfoa, mode, xmit status
            case "ZZIF":
            case "IF":
                if (!_usingRIOX)    // may be an issue with ddutil and zzif; will investigate
                {
                    _data.vfoa = e.Data.Substring(0, 11);
                }
                // has the mode changed? if so, ask for new dsp string.
                if (!_data.rawmode.Equals(e.Data.Substring(27, 2)))
                {
                    WriteCommand("ZZMN" + e.Data.Substring(27, 2) + "");
                }
                _data.Mode = e.Data.Substring(27, 2);
                _data.mox  = (e.Data.Substring(26, 1).Equals("1")) ? true : false;
                break;

            case "ZZFA":
                _data.vfoa = e.Data;
                break;

            // vfob
            case "ZZFB":
                _data.vfob = e.Data;
                break;

            // band
            case "ZZBS":
                _data.Band = e.Data;
                break;

            // display mode
            case "ZZDM":
                _data.DisplayMode = e.Data;
                break;

            // agc
            case "ZZGT":
                _data.AGC = e.Data;
                break;

            // mode dsp filters
            case "ZZMN":
                ProcessDSPFilters(e.Data);
                break;

            case "ZZSM":
                _data.Smeter = e.Data.Substring(1);
                break;

            case "ZZTX":
                _data.mox = true;
                break;

            case "ZZFI":
                _data.DSPFilter = e.Data;
                break;

            case "ZZPA":
                _data.Preamp = e.Data;
                break;
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Пример #4
0
        void _riox_ObjectReceivedEvent(object o, RIOX.RIOXClient.ObjectReceivedEventArgs e)
        {
            RIOXData rd = (RIOXData)e.DataObject;
            Console.WriteLine("ObjectReceived " + rd.Count);

            // pass it through the CAT event parser since DDUtil passes them as command/data key/pair
            foreach(DictionaryEntry de in rd)
            {
                CATEventArgs c = new CATEventArgs((string)de.Key, (string)de.Value);
                Console.WriteLine("Key: {0} Val: {1}", de.Key, de.Value);
                CatcatEvent(this, c);
            }
        }
Пример #5
0
 void CatcatEvent(object sender, CATEventArgs e)
 {
     switch(e.Command)
     {
         // vfoa, mode, xmit status
         case "ZZIF": case "IF":
             if(!_usingRIOX) // may be an issue with ddutil and zzif; will investigate
                 _data.vfoa = e.Data.Substring(0, 11);
             // has the mode changed? if so, ask for new dsp string.
             if (!_data.rawmode.Equals(e.Data.Substring(27, 2)))
                 WriteCommand("ZZMN" + e.Data.Substring(27, 2) + "");
             _data.Mode = e.Data.Substring(27, 2);
             _data.mox = (e.Data.Substring(26, 1).Equals("1")) ? true : false;
             break;
         case "ZZFA":
             _data.vfoa = e.Data;
             break;
         // vfob
         case "ZZFB":
             _data.vfob = e.Data;
             break;
         // band
         case "ZZBS":
             _data.Band = e.Data;
             break;
         // display mode
         case "ZZDM":
             _data.DisplayMode = e.Data;
             break;
         // agc
         case "ZZGT":
             _data.AGC = e.Data;
             break;
         // mode dsp filters
         case "ZZMN":
             ProcessDSPFilters(e.Data);
             break;
         case "ZZSM":
             _data.Smeter = e.Data.Substring(1);
             break;
         case "ZZTX":
             _data.mox = true;
             break;
         case "ZZFI":
             _data.DSPFilter = e.Data;
             break;
         case "ZZPA":
             _data.Preamp = e.Data;
             break;
     }
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
Пример #6
0
        private void ParseCommand(String command)
        {
            Match m = Regex.Match(command, "([A-Z]{2,4})(.*);", RegexOptions.Compiled);
            if (!m.Success) return;

            CATEventArgs cea = new CATEventArgs(m.Groups[1].ToString(), m.Groups[2].ToString());
            if (CATEvent != null)
                CATEvent(this, cea);
            return;
        }