Exemple #1
0
 public bool GetAdaptiveSpeedFeedbackConfiguration(out AdaptiveSpeedFeedbackConfig?config, out float?freq, bool confirm)
 {
     config = null; freq = null;
     if (/*terminated?*/ _cancelEvent.WaitOne(0))
     {
         return(false);
     }
     CommandDefinition.CommandFormat command  = ConstructCommand(CommandEnum.AdaptiveSpeedFeedbackConfig, BooleanValue.False, ActionEnum.Get, 0);
     CommandDefinition.CommandFormat?response = SendCommand(command, confirm);
     if (response != null && response.Value.CommandAck.Command == CommandEnum.AdaptiveSpeedFeedbackConfig && response.Value.Action.Action == ActionEnum.Response)
     {
         config = (AdaptiveSpeedFeedbackConfig)OperatingMode.ToObject(typeof(AdaptiveSpeedFeedbackConfig), response.Value.Action.SubAction);
         freq   = BitConverter.ToSingle(response.Value.Payload, 0);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
 public bool GetStaticPulseFrequency(OperatingMode?selectedMode, out OperatingMode?mode, out int?freq, bool confirm)
 {
     mode = null; freq = null;
     if (/*terminated?*/ _cancelEvent.WaitOne(0))
     {
         return(false);
     }
     CommandDefinition.CommandFormat command  = ConstructCommand(CommandEnum.StaticPulseFreq, BooleanValue.False, ActionEnum.Get, (byte)selectedMode);
     CommandDefinition.CommandFormat?response = SendCommand(command, confirm);
     if (response != null && response.Value.CommandAck.Command == CommandEnum.StaticPulseFreq && response.Value.Action.Action == ActionEnum.Response)
     {
         mode = (OperatingMode)OperatingMode.ToObject(typeof(OperatingMode), response.Value.Action.SubAction);
         freq = BitConverter.ToInt32(response.Value.Payload, 0);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #3
0
 public bool GetAdaptiveModeTriggerRatio(OperatingMode?selectedMode, out OperatingMode?mode, out float?ratio, bool confirm)
 {
     mode = null; ratio = null;
     if (/*terminated?*/ _cancelEvent.WaitOne(0))
     {
         return(false);
     }
     CommandDefinition.CommandFormat command  = ConstructCommand(CommandEnum.AdaptiveModeToTrigRatio, BooleanValue.False, ActionEnum.Get, (byte)selectedMode);
     CommandDefinition.CommandFormat?response = SendCommand(command, confirm);
     if (response != null && response.Value.CommandAck.Command == CommandEnum.AdaptiveModeToTrigRatio && response.Value.Action.Action == ActionEnum.Response)
     {
         mode  = (OperatingMode)OperatingMode.ToObject(typeof(OperatingMode), response.Value.Action.SubAction);
         ratio = BitConverter.ToSingle(response.Value.Payload, 0);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #4
0
 public bool GetOperatingMode(out OperatingMode?mode, out short?minFreq, out short?maxFreq, bool confirm)
 {
     mode = null; minFreq = null; maxFreq = null;
     if (/*terminated?*/ _cancelEvent.WaitOne(0))
     {
         return(false);
     }
     CommandDefinition.CommandFormat command  = ConstructCommand(CommandEnum.OperatingMode, BooleanValue.False, ActionEnum.Get, 0);
     CommandDefinition.CommandFormat?response = SendCommand(command, confirm);
     if (response != null && response.Value.CommandAck.Command == CommandEnum.OperatingMode && response.Value.Action.Action == ActionEnum.Response)
     {
         mode    = (OperatingMode)OperatingMode.ToObject(typeof(OperatingMode), response.Value.Action.SubAction);
         minFreq = BitConverter.ToInt16(response.Value.Payload, 0);
         maxFreq = BitConverter.ToInt16(response.Value.Payload, 2);
         return(true);
     }
     else
     {
         return(false);
     }
 }