Exemplo n.º 1
0
 public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     if (value == null)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     Common.RadioSignalingItem item = value as Common.RadioSignalingItem;
     if (item == null)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     if (string.IsNullOrWhiteSpace(item.UnitId) || item.SourceType == Common.SignalingSourceType.StreamingTag)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     return(System.Windows.Visibility.Visible);
 }
Exemplo n.º 2
0
        private void ProcessMDC1200(Decoders.MDC1200 decoder, RadioLog.Common.SignalCode sigCode, int frameCount, byte op, byte arg, ushort unitID, byte extra0, byte extra1, byte extra2, byte extra3, string opMsg)
        {
            Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "MDC: {0} on stream {1}", opMsg, _sourceName);

            _silenceHelper.ClearSilenceStats();

            if (_sigDelegate != null)
            {
                string desc = opMsg;
                if (!string.IsNullOrWhiteSpace(LastValidStreamTitle))
                {
                    desc += ", Stream Title=" + LastValidStreamTitle;
                }
                RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.Streaming, _sourceName, RadioLog.Common.SignalingNames.MDC, sigCode, string.Format("{0:X4}", unitID), desc, DateTime.Now, _recorder.CurrentFileName);
                _sigDelegate(sigItem);
            }
        }
Exemplo n.º 3
0
        private void ProcessRootDecoder(RadioLog.Common.SignalCode sigCode, string format, string unitId, string desc)
        {
            Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "{0}: {1} on stream {2}", format, sigCode, _sourceName);

            _silenceHelper.ClearSilenceStats();

            if (_sigDelegate != null)
            {
                if (!string.IsNullOrWhiteSpace(LastValidStreamTitle))
                {
                    desc += ", Stream Title=" + LastValidStreamTitle;
                }

                RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.Streaming, _sourceName, format, sigCode, unitId, desc, DateTime.Now, _recorder.CurrentFileName);
                _sigDelegate(sigItem);
            }
        }
Exemplo n.º 4
0
        private void ProcessSTAR(Decoders.STAR decoder, RadioLog.Common.SignalCode sigCode, uint unitID, uint tag, uint status, uint message)
        {
            Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "STAR: {0} on stream {1}", unitID, _sourceName);

            _silenceHelper.ClearSilenceStats();

            if (_sigDelegate != null)
            {
                string desc;
                if (!string.IsNullOrWhiteSpace(LastValidStreamTitle))
                {
                    desc = string.Format("Unit: {0}, Tag: {1}, Status: {2}, Message: {3}, Stream Title: {4}", unitID, tag, status, message, LastValidStreamTitle);
                }
                else
                {
                    desc = string.Format("Unit: {0}, Tag: {1}, Status: {2}, Message: {3}", unitID, tag, status, message);
                }
                RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.Streaming, _sourceName, RadioLog.Common.SignalingNames.STAR, sigCode, unitID.ToString(), desc, DateTime.Now, _recorder.CurrentFileName);
                _sigDelegate(sigItem);
            }
        }
Exemplo n.º 5
0
        protected void UpdateStreamTitle(string streamTitle, bool logEvent)
        {
            _streamTitle = streamTitle;
            string correctedStreamTitle = GetCorrectedStreamTitle(streamTitle);

            if (!string.IsNullOrWhiteSpace(correctedStreamTitle) && !string.Equals(correctedStreamTitle, _lastValidStreamTitle, StringComparison.InvariantCultureIgnoreCase))
            {
                _lastValidStreamTitle = correctedStreamTitle;
                if (processorWaveProvider != null)
                {
                    processorWaveProvider.LastValidStreamTitle = _lastValidStreamTitle;
                }
                if (_sigDelegate != null && logEvent)
                {
                    string curFileName = (processorWaveProvider == null) ? string.Empty : processorWaveProvider.CurrentFileName;
                    RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.StreamingTag, _streamName, string.Empty, Common.SignalCode.Generic, string.Empty, _lastValidStreamTitle, DateTime.Now, curFileName);
                    _sigDelegate(sigItem);
                }
            }
            //FirePropertyChangedAction(true);
        }
Exemplo n.º 6
0
 protected void UpdateStreamTitle(string streamTitle, bool logEvent)
 {
     _streamTitle = streamTitle;
     string correctedStreamTitle = GetCorrectedStreamTitle(streamTitle);
     if (!string.IsNullOrWhiteSpace(correctedStreamTitle) && !string.Equals(correctedStreamTitle, _lastValidStreamTitle, StringComparison.InvariantCultureIgnoreCase))
     {
         _lastValidStreamTitle = correctedStreamTitle;
         if (processorWaveProvider != null)
         {
             processorWaveProvider.LastValidStreamTitle = _lastValidStreamTitle;
         }
         if (_sigDelegate != null && logEvent)
         {
             string curFileName = (processorWaveProvider == null) ? string.Empty : processorWaveProvider.CurrentFileName;
             RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.StreamingTag, _streamName, string.Empty, Common.SignalCode.Generic, string.Empty, _lastValidStreamTitle, DateTime.Now, curFileName);
             _sigDelegate(sigItem);
         }
     }
    //FirePropertyChangedAction(true);
 }
Exemplo n.º 7
0
        private void ProcessSTAR(Decoders.STAR decoder, RadioLog.Common.SignalCode sigCode, uint unitID, uint tag, uint status, uint message)
        {
            Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "STAR: {0} on stream {1}", unitID, _sourceName);

            _silenceHelper.ClearSilenceStats();

            if (_sigDelegate != null)
            {
                string desc;
                if (!string.IsNullOrWhiteSpace(LastValidStreamTitle))
                {
                    desc = string.Format("Unit: {0}, Tag: {1}, Status: {2}, Message: {3}, Stream Title: {4}", unitID, tag, status, message, LastValidStreamTitle);
                }
                else
                {
                    desc = string.Format("Unit: {0}, Tag: {1}, Status: {2}, Message: {3}", unitID, tag, status, message);
                }
                RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.Streaming, _sourceName, RadioLog.Common.SignalingNames.STAR, sigCode, unitID.ToString(), desc, DateTime.Now, _recorder.CurrentFileName);
                _sigDelegate(sigItem);
            }
        }
Exemplo n.º 8
0
        private void ProcessMDC1200(Decoders.MDC1200 decoder, RadioLog.Common.SignalCode sigCode, int frameCount, byte op, byte arg, ushort unitID, byte extra0, byte extra1, byte extra2, byte extra3, string opMsg)
        {
            Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "MDC: {0} on stream {1}", opMsg, _sourceName);

            _silenceHelper.ClearSilenceStats();

            if (_sigDelegate != null)
            {
                string desc = opMsg;
                if (!string.IsNullOrWhiteSpace(LastValidStreamTitle))
                {
                    desc += ", Stream Title=" + LastValidStreamTitle;
                }
                RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.Streaming, _sourceName, RadioLog.Common.SignalingNames.MDC, sigCode, string.Format("{0:X4}", unitID), desc, DateTime.Now, _recorder.CurrentFileName);
                _sigDelegate(sigItem);
            }
        }
Exemplo n.º 9
0
        private void ProcessRootDecoder(RadioLog.Common.SignalCode sigCode, string format, string unitId, string desc)
        {
            Common.ConsoleHelper.ColorWriteLine(ConsoleColor.Magenta, "{0}: {1} on stream {2}", format, sigCode, _sourceName);

            _silenceHelper.ClearSilenceStats();

            if (_sigDelegate != null)
            {
                if (!string.IsNullOrWhiteSpace(LastValidStreamTitle))
                {
                    desc += ", Stream Title=" + LastValidStreamTitle;
                }

                RadioLog.Common.RadioSignalingItem sigItem = new Common.RadioSignalingItem(Common.SignalingSourceType.Streaming, _sourceName, format, sigCode, unitId, desc, DateTime.Now, _recorder.CurrentFileName);
                _sigDelegate(sigItem);
            }
        }