Ejemplo n.º 1
0
 protected virtual void Release_Execute(object action, HeliosActionEventArgs e)
 {
     if (_lastSetPosition > -1 && !string.IsNullOrWhiteSpace(_sendStopAction[_lastSetPosition]))
     {
         SourceInterface.SendData(_sendStopAction[_lastSetPosition]);
     }
 }
Ejemplo n.º 2
0
        private void IncrementPosition_Execute(object action, HeliosActionEventArgs e)
        {
            long incrementValue = (long)e.Value.DoubleValue;

            _targetPosition.SetValue(new BindingValue(_targetPosition.Value.DoubleValue + (incrementValue > 0 ? incrementValue : 1)), e.BypassCascadingTriggers);
            Board.Device.SetStepperTargetPosition(Number, (long)_targetPosition.Value.DoubleValue);
        }
Ejemplo n.º 3
0
 void Angle_Execute(object action, HeliosActionEventArgs e)
 {
     BeginTriggerBypass(e.BypassCascadingTriggers);
     Angle = e.Value.DoubleValue;
     Card.setAngle(e.Value.DoubleValue);
     EndTriggerBypass(e.BypassCascadingTriggers);
 }
Ejemplo n.º 4
0
        void TapeHOffset_Execute(object action, HeliosActionEventArgs e)
        {
            _tapeHOffset.SetValue(e.Value, e.BypassCascadingTriggers);
            double hValue = (_tapeHOffset.Value.DoubleValue + ((_maxInputHorizontal - _minInputHorizontal) - _maxInputHorizontal)) / (_maxInputHorizontal - _minInputHorizontal);

            _Tape.HorizontalOffset = (_minHorizontal * (1 - hValue)) + (_horizontalTravel * hValue);              // lerp horizontal
        }
Ejemplo n.º 5
0
 void ResetAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (Profile != null)
     {
         Profile.Reset();
     }
 }
Ejemplo n.º 6
0
 void StopAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (Profile != null)
     {
         Profile.Stop();
     }
 }
Ejemplo n.º 7
0
        void CurrentHeading_Execute(object action, HeliosActionEventArgs e)
        {
            _currentHeading.SetValue(new BindingValue(ClampDegrees(e.Value.DoubleValue)), e.BypassCascadingTriggers);
            _compassNeedle.Rotation = -_currentHeading.Value.DoubleValue;

            if (!_relativeDesiredHeading)
            {
                _headingBug.Rotation = _desiredHeading.Value.DoubleValue + _compassNeedle.Rotation;
            }

            if (!_relativeBearing)
            {
                _bearingNeedle.Rotation  = _bearing1.Value.DoubleValue + _compassNeedle.Rotation;
                _bearingNeedle2.Rotation = _bearing2.Value.DoubleValue + _compassNeedle.Rotation;
            }

            if (!_relativeCourse)
            {
                _desiredCourseNeedle.Rotation = _desiredCourse.Value.DoubleValue + _compassNeedle.Rotation;
                _deviationNeedle.Rotation     = _desiredCourseNeedle.Rotation;
                _deviationCard.Rotation       = _desiredCourseNeedle.Rotation;
                _courseFlagNeedle.Rotation    = _deviationCard.Rotation;
                _toFlagNeedle.Rotation        = _deviationCard.Rotation;
                _fromFlagNeedle.Rotation      = _deviationCard.Rotation;
            }
            else
            {
                _courseDrum.Value = ClampDegrees(_desiredCourse.Value.DoubleValue + _currentHeading.Value.DoubleValue);
            }
        }
Ejemplo n.º 8
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);
 }
Ejemplo n.º 9
0
 void ReleaseAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (_callbacks.HasCallback(e.Value.StringValue))
     {
         _callbacks[e.Value.StringValue].Up();
     }
 }
Ejemplo n.º 10
0
 private void Heading_Execute(object action, HeliosActionEventArgs e)
 {
     _heading.SetValue(e.Value, e.BypassCascadingTriggers);
     _compassCard.Rotation = -e.Value.DoubleValue;
     _dtaNeedle.Rotation   = _compassCard.Rotation + _course.Value.DoubleValue;
     _headingBug.Rotation  = _compassCard.Rotation + _commandedHeading.Value.DoubleValue;
 }
Ejemplo n.º 11
0
 void SendAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (_callbacks.HasCallback(e.Value.StringValue))
     {
         _callbacks[e.Value.StringValue].Press();
     }
 }
Ejemplo n.º 12
0
        private void ChangeValueByPulses_Execute(object action, HeliosActionEventArgs e)
        {
            ClaimControlIfAvailable(e);
            if (Math.Abs(e.Value.DoubleValue) < 0.1)
            {
                // this represents no change
                return;
            }

            Logger.Debug("received change by pulses of {Pulses}", e.Value.DoubleValue);

            if (_boundRotaryControl != null && !_pulseMode)
            {
                // convert to angle
                _pulsesSinceBinding += e.Value.DoubleValue;
                _boundRotaryControl.ControlAngle += e.Value.DoubleValue * 360d / _pulsesPerRevolution;
                Logger.Debug("after {Pulses} pulses, set control to {Angle}", _pulsesSinceBinding, _boundRotaryControl.ControlAngle);
                return;
            }

            if (_boundPulsedControl != null)
            {
                // deliver raw pulses
                _boundPulsedControl.Pulse((int)e.Value.DoubleValue);
                return;
            }

            Logger.Debug("no supported interfaces on target control; cannot deliver pulses");
        }
Ejemplo n.º 13
0
 void DigitDisplay_Execute(object action, HeliosActionEventArgs e)
 {
     _onesDrum.Value      = e.Value.DoubleValue;
     _tensDrum.Value      = _onesDrum.Value / 10d;
     _hundredsDrum.Value  = _tensDrum.Value / 10d;
     _thousandsDrum.Value = _hundredsDrum.Value / 10d;
 }
Ejemplo n.º 14
0
 void ShowAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (Profile != null)
     {
         Profile.ShowControlCenter();
     }
 }
Ejemplo n.º 15
0
        private void DecrementPosition_Execute(object action, HeliosActionEventArgs e)
        {
            long incrementValue = (long)e.Value.DoubleValue;

            _targetPosition.SetValue(new BindingValue(_targetPosition.Value.DoubleValue - (incrementValue > 0 ? incrementValue : 1)), e.BypassCascadingTriggers);
            _stepperBoard.SetTargetPosition(_motorNum, (long)_targetPosition.Value.DoubleValue);
        }
Ejemplo n.º 16
0
        void TapeRotation_Execute(object action, HeliosActionEventArgs e)
        {
            _tapeRotation.SetValue(e.Value, e.BypassCascadingTriggers);
            double rValue = (_tapeRotation.Value.DoubleValue + ((_maxInputRotation - _minInputRotation) - _maxInputRotation)) / (_maxInputRotation - _minInputRotation); // convert to to 0-1

            _Tape.Rotation = (_minRotation * (1 - rValue)) + (_rotationTravel * rValue);                                                                                 // lerp rotation
        }
Ejemplo n.º 17
0
        void TapeOffset_Execute(object action, HeliosActionEventArgs e)
        {
            _tapeOffset.SetValue(e.Value, e.BypassCascadingTriggers);
            double vValue = (_tapeOffset.Value.DoubleValue + ((_maxInputVertical - _minInputVertical) - _maxInputVertical)) / (_maxInputVertical - _minInputVertical); // convert to to 0-1

            _Tape.VerticalOffset = (_minVertical * (1 - vValue)) + (_verticalTravel * vValue);                                                                         // lerp vertical
        }
Ejemplo n.º 18
0
        void Frequency_Execute(object action, HeliosActionEventArgs e)
        {
            _megaHzDrum.Value = Math.Floor(e.Value.DoubleValue);
            string s = e.Value.DoubleValue.ToString("#.000", System.Globalization.CultureInfo.InvariantCulture);

            _kiloHzDrum.Value = double.Parse(s.Substring(s.IndexOf(".") + 1)) / 10d;
        }
Ejemplo n.º 19
0
 void SendAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (_callbacks.HasCallback(e.Value.StringValue))
     {
         WindowFocused(_falconType);
         _callbacks[e.Value.StringValue].Press();
     }
 }
Ejemplo n.º 20
0
        void PushedValue_Execute(object action, HeliosActionEventArgs e)
        {
            BeginTriggerBypass(e.BypassCascadingTriggers);

            Pushed = e.Value.BoolValue;

            EndTriggerBypass(e.BypassCascadingTriggers);
        }
Ejemplo n.º 21
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);
     }
 }
Ejemplo n.º 22
0
 void DesiredCourse_Execute(object action, HeliosActionEventArgs e)
 {
     _desiredCourse.SetValue(new BindingValue(ClampDegrees(e.Value.DoubleValue)), e.BypassCascadingTriggers);
     _desiredCourseNeedle.Rotation = _desiredCourse.Value.DoubleValue + _compassNeedle.Rotation;
     _deviationNeedle.Rotation     = _desiredCourseNeedle.Rotation;
     _deviationCard.Rotation       = _desiredCourseNeedle.Rotation;
     _courseDrum.Value             = _desiredCourse.Value.DoubleValue;
     _courseFlagNeedle.Rotation    = _deviationCard.Rotation;
     _toFlagNeedle.Rotation        = _deviationCard.Rotation;
     _fromFlagNeedle.Rotation      = _deviationCard.Rotation;
 }
Ejemplo n.º 23
0
 void IncrementAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (e.Value.DoubleValue == 0d)
     {
         SourceInterface.SendData(_incrementData);
     }
     else
     {
         SourceInterface.SendData(_incrementPrefix + e.Value.StringValue);
     }
 }
Ejemplo n.º 24
0
        void DigitDisplay_Execute(object action, HeliosActionEventArgs e)
        {
            double _triggerVal = e.Value.DoubleValue;

            if (_triggerVal == 110)
            {
                _triggerVal = 77;                      // 10 in both drums should be SAFE so we adjust for this.
            }
            _rightDrum.Value = _triggerVal;
            _leftDrum.Value  = _rightDrum.Value / 10d;
        }
Ejemplo n.º 25
0
 void ReleaseAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (_release2)
     {
         SourceInterface.SendData(_release2ActionData);
     }
     else
     {
         SourceInterface.SendData(_release1ActionData);
     }
 }
Ejemplo n.º 26
0
 void FillColorAction_Execute(object action, HeliosActionEventArgs e)
 {
     try 
     {
         FillColor = (Color)_colorConverter.ConvertFromInvariantString(e.Value.StringValue);
     }
     catch
     {
         ConfigManager.LogManager.LogWarning("Rectangle error converting color value. (Name=\"" + Name + "\", Value=\"" + e.Value.StringValue + "\")");
     }            
 }
Ejemplo n.º 27
0
 void LaunchApplication_Execute(object action, HeliosActionEventArgs e)
 {
     try
     {
         Process.Start(e.Value.StringValue);
     }
     catch (Exception ex)
     {
         ConfigManager.LogManager.LogError("Error caught launching external application (path=\"" + e.Value.StringValue + "\")", ex);
     }
 }
Ejemplo n.º 28
0
 void IncrementAction_Execute(object action, HeliosActionEventArgs e)
 {
     if (e.Value.DoubleValue == 0d)
     {
         SourceInterface.SendData(_incrementData);
     }
     else
     {
         SourceInterface.SendData(_incrementPrefix + e.Value.StringValue);
     }
 }
Ejemplo n.º 29
0
        void Push_ExecuteAction(object action, HeliosActionEventArgs e)
        {
            BeginTriggerBypass(e.BypassCascadingTriggers);

            if (!BypassTriggers)
            {
                _pushedTrigger.FireTrigger(new BindingValue(true));
            }
            Pushed = true;
            EndTriggerBypass(e.BypassCascadingTriggers);
        }
Ejemplo n.º 30
0
 void FillColorAction_Execute(object action, HeliosActionEventArgs e)
 {
     try
     {
         FillColor = (Color)_colorConverter.ConvertFromInvariantString(e.Value.StringValue);
     }
     catch
     {
         ConfigManager.LogManager.LogWarning("Rectangle error converting color value. (Name=\"" + Name + "\", Value=\"" + e.Value.StringValue + "\")");
     }
 }
Ejemplo n.º 31
0
 void SetPositionAction_Execute(object action, HeliosActionEventArgs e)
 {
     BeginTriggerBypass(e.BypassCascadingTriggers);
     if (int.TryParse(e.Value.StringValue, out int index))
     {
         if (index >= 0 && index < Positions.Count)
         {
             CurrentPosition = index;
         }
     }
     EndTriggerBypass(e.BypassCascadingTriggers);
 }
Ejemplo n.º 32
0
 void DesiredHeading_Execute(object action, HeliosActionEventArgs e)
 {
     _desiredHeading.SetValue(new BindingValue(ClampDegrees(e.Value.DoubleValue)), e.BypassCascadingTriggers);
     if (_relativeDesiredHeading)
     {
         _headingBug.Rotation = _desiredHeading.Value.DoubleValue;
     }
     else
     {
         _headingBug.Rotation = _desiredHeading.Value.DoubleValue + _compassNeedle.Rotation;
     }
 }
Ejemplo n.º 33
0
        void Altitude_Execute(object action, HeliosActionEventArgs e)
        {
            _needle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue % 1000d);
            _tensDrum.Value = e.Value.DoubleValue / 10000d;

            // Setup then thousands drum to roll with the rest
            double thousands = (e.Value.DoubleValue / 100d) % 100d;
            if (thousands >= 99)
            {
                _tensDrum.StartRoll = thousands % 1d;
            }
            else
            {
                _tensDrum.StartRoll = -1d;
            }
            _drum.Value = e.Value.DoubleValue;
        }
Ejemplo n.º 34
0
 void DecrementAction_Execute(object action, HeliosActionEventArgs e)
 {
     double newValue = _value.Value.DoubleValue - _argValue;
     if (_loop)
     {
         while (newValue < _argMin)
         {
             newValue += (_argMax - _argMin);
         }
     }
     else
     {
         newValue = Math.Max(_argMin, newValue);
     }
     _value.SetValue(new BindingValue(newValue), e.BypassCascadingTriggers);
     SourceInterface.SendData(_actionData + _value.Value.DoubleValue.ToString(CultureInfo.InvariantCulture));
 }
Ejemplo n.º 35
0
 private void CurrentBatteryCapacity_Execute(object action, HeliosActionEventArgs e)
 {
     _currentBatteryCapacity.SetValue(e.Value, e.BypassCascadingTriggers);
     _currentNeedle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 36
0
 void VerticalVelocity_Execute(object action, HeliosActionEventArgs e)
 {
     _needle.Rotation = _calibrationPoints.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 37
0
 private void RightTemperature_Execute(object action, HeliosActionEventArgs e)
 {
     _rigthTemperature.SetValue(e.Value, e.BypassCascadingTriggers);
     _rightLargeNeedle.Rotation = _largeNeedleCalibration.Interpolate(e.Value.DoubleValue);
     _rightSmallNeedle.Rotation = _smallNeedleCalibration.Interpolate(e.Value.DoubleValue % 100d);
 }
Ejemplo n.º 38
0
 private void Heading_Execute(object action, HeliosActionEventArgs e)
 {
     _heading.SetValue(e.Value, e.BypassCascadingTriggers);
     _compassCard.Rotation = e.Value.DoubleValue;
 }
Ejemplo n.º 39
0
 void AftTankIndicator_Execute(object action, HeliosActionEventArgs e)
 {
     _aftTankIndicator.SetValue(e.Value, e.BypassCascadingTriggers);
     _aftTankLamp.IsHidden = !e.Value.BoolValue;
 }
Ejemplo n.º 40
0
 private void FwdQty_Execute(object action, HeliosActionEventArgs e)
 {
     _fwdFuelQty.SetValue(e.Value, e.BypassCascadingTriggers);
     _needleFwd.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 41
0
 private void TargetPosition_Execute(object action, HeliosActionEventArgs e)
 {
     _targetPosition.SetValue(e.Value, e.BypassCascadingTriggers);
     Board.Device.SetStepperTargetPosition(Number, (long)e.Value.DoubleValue);
 }
Ejemplo n.º 42
0
 private void GlideslopeDeviation_Execute(object action, HeliosActionEventArgs e)
 {
     _glideslopeDeviation.SetValue(e.Value, e.BypassCascadingTriggers);
     _glideslopeDeviationNeedle.VerticalOffset = _deviationScale.Interpolate(e.Value.DoubleValue) * -1;
 }
Ejemplo n.º 43
0
 private void Pressure_Execute(object action, HeliosActionEventArgs e)
 {
     _qfePressure.SetValue(e.Value, e.BypassCascadingTriggers);
     _qfeCard.Rotation = _qfeCalibration.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 44
0
 private void GFlag_Execute(object action, HeliosActionEventArgs e)
 {
     _gFlag.SetValue(e.Value, e.BypassCascadingTriggers);
     _gFlagImage.IsHidden = !e.Value.BoolValue;
 }
Ejemplo n.º 45
0
 private void Course_Execute(object action, HeliosActionEventArgs e)
 {
     _course.SetValue(e.Value, e.BypassCascadingTriggers);
     _courseNeedle.Rotation = e.Value.DoubleValue - 180;
     _innerBezelMarkers.Rotation = e.Value.DoubleValue - 180;
 }
Ejemplo n.º 46
0
 private void Bearing_Execute(object action, HeliosActionEventArgs e)
 {
     _bearing.SetValue(e.Value, e.BypassCascadingTriggers);
     _bearingNeedle.Rotation = e.Value.DoubleValue;
 }
Ejemplo n.º 47
0
 private void Zero_Execute(object action, HeliosActionEventArgs e)
 {
     Board.Device.ZeroStepperPosition(Number);
     _value.SetValue(new BindingValue(0), e.BypassCascadingTriggers);
 }
Ejemplo n.º 48
0
 void AirPressure_Execute(object action, HeliosActionEventArgs e)
 {
     _airPressureDrum.Value = e.Value.DoubleValue * 100d;
 }
Ejemplo n.º 49
0
 private void Value_Execute(object action, HeliosActionEventArgs e)
 {
     _value.SetValue(e.Value, e.BypassCascadingTriggers);
     _targetPosition.SetValue(new BindingValue(_calibration.Interpolate(e.Value.DoubleValue)), e.BypassCascadingTriggers);
     Board.Device.SetStepperTargetPosition(Number, (long)_targetPosition.Value.DoubleValue);
 }
Ejemplo n.º 50
0
 private void TargetPosition_Execute(object action, HeliosActionEventArgs e)
 {
     _targetPosition.SetValue(e.Value, e.BypassCascadingTriggers);
     _servoBoard.SetTargetPosition(_servoNum, (long)e.Value.DoubleValue);
 }
Ejemplo n.º 51
0
 private void DecrementPosition_Execute(object action, HeliosActionEventArgs e)
 {
     long incrementValue = (long)e.Value.DoubleValue;
     _targetPosition.SetValue(new BindingValue(_targetPosition.Value.DoubleValue - (incrementValue > 0 ? incrementValue : 1)), e.BypassCascadingTriggers);
     Board.Device.SetStepperTargetPosition(Number, (long)_targetPosition.Value.DoubleValue);
 }
Ejemplo n.º 52
0
 private void CourseDeviation_Execute(object action, HeliosActionEventArgs e)
 {
     _courseDeviation.SetValue(e.Value, e.BypassCascadingTriggers);
     _courseDeviationNeedle.HorizontalOffset = _deviationScale.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 53
0
 private void TriangleKM_Execute(object action, HeliosActionEventArgs e)
 {
     _kmTriangle.SetValue(e.Value, e.BypassCascadingTriggers);
     _kmTriangleNeedle.Rotation = _kmTriangleneedleCalibration.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 54
0
 private void AltitudeShort_Execute(object action, HeliosActionEventArgs e)
 {
     _altitudeShort.SetValue(e.Value, e.BypassCascadingTriggers);
     _shortNeedle.Rotation = _shortneedleCalibration.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 55
0
 void RPM_Execute(object action, HeliosActionEventArgs e)
 {
     _needle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue);
 }
Ejemplo n.º 56
0
 void Altitude_Execute(object action, HeliosActionEventArgs e)
 {
     _needle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue % 1000d);
     _tensDrum.Value = e.Value.DoubleValue / 10000d;
     _drum.Value = e.Value.DoubleValue;
 }