Example #1
0
        private void SetLED(MicrowaveLinkQuality lq, MicrowaveLinkQuality.Parameters parameter, LED led)
        {
            bool on = false;

            switch (parameter)
            {
            case MicrowaveLinkQuality.Parameters.TunerLocked:
                on = lq.TunerLocked;
                break;

            case MicrowaveLinkQuality.Parameters.DemodulatorLocked:
                on = lq.DemodulatorLocked;
                break;

            case MicrowaveLinkQuality.Parameters.TransportStreamLocked:
                on = lq.TransportStreamLocked;
                break;

            case MicrowaveLinkQuality.Parameters.FECLocked:
                on = lq.FECLocked;
                break;

            case MicrowaveLinkQuality.Parameters.DecoderLocked:
                on = lq.DecoderLocked;
                break;

            default:
                return;
            }

            led.LEDColor = on ? LEDGood : LEDFail;
            tt.SetToolTip(led, string.Format(ttFormat[parameter], (on ? string.Empty : " NOT")));
        }
Example #2
0
 /// <summary>
 /// Returns each set flag in the specified Link Quality Parameters
 /// </summary>
 /// <param name="linkParams">link parameters</param>
 /// <returns>an enumerable of all the set flags</returns>
 public static IEnumerable <MicrowaveLinkQuality.Parameters> EnumerateSetFlags(this MicrowaveLinkQuality.Parameters linkParams)
 {
     foreach (int value in Enum.GetValues(typeof(MicrowaveLinkQuality.Parameters)))
     {
         if ((value & (int)linkParams) == value)
         {
             yield return((MicrowaveLinkQuality.Parameters)value);
         }
     }
 }
Example #3
0
 /// <summary>
 /// Checks if a MicrowaveLinkQuality parameter is set on MicrowaveCapabilities.SupportedLinkQualityParameters property
 /// </summary>
 /// <param name="caps">capabilities to check</param>
 /// <param name="linkQualityParameter">link quality parameter to check for</param>
 /// <returns>true if set in MicrowaveCapabilities.SupportedLinkQualityParameters, false otherwise</returns>
 public static bool IsSet(this MicrowaveCapabilities caps, MicrowaveLinkQuality.Parameters linkQualityParameter)
 {
     return(MicrowaveLinkQuality.IsParameterValid(caps.SupportedLinkQualityParameters, linkQualityParameter));
 }
Example #4
0
 /// <summary>
 /// Checks if a parameter is set on a MicrowaveLinkQuality object
 /// </summary>
 /// <param name="linkQuality">LQ to check</param>
 /// <param name="parameter">parameter to check</param>
 /// <returns>true if the specified parameter is set, false otherwise</returns>
 public static bool IsSet(this MicrowaveLinkQuality linkQuality, MicrowaveLinkQuality.Parameters parameter)
 {
     return(MicrowaveLinkQuality.IsParameterValid(linkQuality.ValidParameterData, parameter));
 }