Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 protected virtual void Release_Execute(object action, HeliosActionEventArgs e)
 {
     if (_lastSetPosition > -1 && !string.IsNullOrWhiteSpace(_sendStopAction[_lastSetPosition]))
     {
         SourceInterface.SendData(_sendStopAction[_lastSetPosition]);
     }
 }
 public BasicFileInfo(Tuple <string, long> fileInfo, IFileSystemArchiveReader fsReader)
 {
     this.Name   = fileInfo.Item1;
     this.Size   = fileInfo.Item2;
     this.Offset = fsReader.GetFileFragmentList(this.Name).First <Tuple <long, long> >().Item1;
     this.Source = (SourceInterface)null;
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 void ReleaseAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (_release2)
     {
         SourceInterface.SendData(_release2ActionData);
     }
     else
     {
         SourceInterface.SendData(_release1ActionData);
     }
 }
Exemplo n.º 6
0
 void IncrementAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (e.Value.DoubleValue == 0d)
     {
         SourceInterface.SendData(_incrementData);
     }
     else
     {
         SourceInterface.SendData(_incrementPrefix + e.Value.StringValue);
     }
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
 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));
 }
Exemplo n.º 9
0
        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;
                }
            }
        }
Exemplo n.º 10
0
 void Value_Execute(object action, HeliosActionEventArgs e)
 {
     _value.SetValue(e.Value, e.BypassCascadingTriggers);
     SourceInterface.SendData(_actionData + _value.Value.DoubleValue.ToString(CultureInfo.InvariantCulture));
 }
Exemplo n.º 11
0
 void PushAction_Execute(object action, HeliosActionEventArgs e)
 {
     SourceInterface.SendData(_pushActionData);
 }
Exemplo n.º 12
0
 public override void Reset()
 {
     SourceInterface.BeginTriggerBypass(true);
     SwitchPosition = HatPosition.Center;
     SourceInterface.EndTriggerBypass(true);
 }
Exemplo n.º 13
0
 void IncrementAction_Execute(object action, HeliosActionEventArgs e)
 {
     SourceInterface.SendData(_incrementData);
 }
Exemplo n.º 14
0
 void Push2Action_Execute(object action, HeliosActionEventArgs e)
 {
     _release2 = true;
     SourceInterface.SendData(_pushed2ActionData);
 }