protected void GuardValue_Execute(object action, HeliosActionEventArgs e) { SourceInterface.BeginTriggerBypass(e.BypassCascadingTriggers); GuardPosition = (int)e.Value.DoubleValue; SourceInterface.SendData(_actionData[GuardPosition - 1]); SourceInterface.EndTriggerBypass(e.BypassCascadingTriggers); }
protected virtual void Release_Execute(object action, HeliosActionEventArgs e) { if (_lastSetPosition > -1 && !string.IsNullOrWhiteSpace(_sendStopAction[_lastSetPosition])) { SourceInterface.SendData(_sendStopAction[_lastSetPosition]); } }
void AutoguardPositionAction_Execute(object action, HeliosActionEventArgs e) { if (GuardPosition == 2) { SourceInterface.BeginTriggerBypass(e.BypassCascadingTriggers); GuardPosition = 1; SourceInterface.SendData(_actionData[GuardPosition - 1]); SourceInterface.EndTriggerBypass(e.BypassCascadingTriggers); } }
void ReleaseAction_Execute(object action, HeliosActionEventArgs e) { if (_release2) { SourceInterface.SendData(_release2ActionData); } else { SourceInterface.SendData(_release1ActionData); } }
void IncrementAction_Execute(object action, HeliosActionEventArgs e) { if (e.Value.DoubleValue == 0d) { SourceInterface.SendData(_incrementData); } else { SourceInterface.SendData(_incrementPrefix + e.Value.StringValue); } }
void SetPositionAction_Execute(object action, HeliosActionEventArgs e) { SourceInterface.BeginTriggerBypass(e.BypassCascadingTriggers); try { SwitchPosition = (HatPosition)Enum.Parse(typeof(HatPosition), e.Value.StringValue); SourceInterface.SendData(_sendData[SwitchPosition]); } catch { // No-op if the parse fails we won't set the position. } SourceInterface.EndTriggerBypass(e.BypassCascadingTriggers); }
void IncrementAction_Execute(object action, HeliosActionEventArgs e) { double newValue = _value.Value.DoubleValue + _argValue; if (_loop) { while (newValue > _argMax) { newValue = _argMin; } } else { newValue = Math.Min(_argMax, newValue); } _value.SetValue(new BindingValue(newValue), e.BypassCascadingTriggers); SourceInterface.SendData(_incrementData + _value.Value.DoubleValue.ToString(CultureInfo.InvariantCulture)); }
protected virtual void Value_Execute(object action, HeliosActionEventArgs e) { int index = (int)e.Value.DoubleValue - 1; if (index >= 0 && index < _positions.Length) { _value.SetValue(e.Value, e.BypassCascadingTriggers); if (_currentPosition > -1 && !string.IsNullOrWhiteSpace(_exitAction[_currentPosition])) { SourceInterface.SendData(_exitAction[_currentPosition]); } _currentPosition = index; if (!string.IsNullOrWhiteSpace(_sendAction[_currentPosition])) { SourceInterface.SendData(_sendAction[_currentPosition]); _lastSetPosition = _currentPosition; } } }
void Value_Execute(object action, HeliosActionEventArgs e) { _value.SetValue(e.Value, e.BypassCascadingTriggers); SourceInterface.SendData(_actionData + _value.Value.DoubleValue.ToString(CultureInfo.InvariantCulture)); }
void PushAction_Execute(object action, HeliosActionEventArgs e) { SourceInterface.SendData(_pushActionData); }
void IncrementAction_Execute(object action, HeliosActionEventArgs e) { SourceInterface.SendData(_incrementData); }
void Push2Action_Execute(object action, HeliosActionEventArgs e) { _release2 = true; SourceInterface.SendData(_pushed2ActionData); }