Ejemplo n.º 1
0
 public HSIMiles(BaseUDPInterface sourceInterface)
     : base(sourceInterface)
 {
     _distance = new HeliosValue(sourceInterface, BindingValue.Empty, "HSI", "Distance to beacon", "Range in nautical miles to the currently selected steerpoint or TACAN station.", "", BindingValueUnits.NauticalMiles);
     Values.Add(_distance);
     Triggers.Add(_distance);
 }
Ejemplo n.º 2
0
 public ILSFrequency(BaseUDPInterface sourceInterface)
     : base(sourceInterface)
 {
     _frequency = new HeliosValue(sourceInterface, BindingValue.Empty, "ILS", "Frequency", "Currently tuned ILS frequency.", "", BindingValueUnits.Numeric);
     Values.Add(_frequency);
     Triggers.Add(_frequency);
 }
Ejemplo n.º 3
0
 public static Switch CreateToggleSwitch(BaseUDPInterface sourceInterface, string deviceId, string action, string argId, 
                                             string position1Value, string position1Name, 
                                             string position2Value, string position2Name, 
                                             string device, string name, string exportFormat)
 {
     return new Switch(sourceInterface, deviceId, argId, new SwitchPosition[] { new SwitchPosition(position1Value, position1Name, action), new SwitchPosition(position2Value, position2Name, action) }, device, name, exportFormat);
 }
Ejemplo n.º 4
0
        public IndicatorPushButton(BaseUDPInterface sourceInterface, string deviceId, string buttonId, string argId, string device, string name, string pushValue, string releaseValue)
            : base(sourceInterface)
        {
            _id = argId;
            _format = "%0.1f";

            _pushValue = pushValue;
            _releaseValue = releaseValue;

            _pushActionData = "C" + deviceId + "," + buttonId + "," + pushValue;
            _releaseActionData = "C" + deviceId + "," + buttonId + "," + releaseValue;

            _value = new HeliosValue(sourceInterface, BindingValue.Empty, device, name, "Current state of this button.", "True if the button is currently pushed(either via pressure or toggle), otherwise false.", BindingValueUnits.Boolean);
            Values.Add(_value);
            Triggers.Add(_value);

            _indicatorValue = new HeliosValue(sourceInterface, BindingValue.Empty, device, name + " indicator", "Current state of the indicator lamp on this button.", "True if the indicator is on, otherwise false.", BindingValueUnits.Boolean);
            Values.Add(_indicatorValue);
            Triggers.Add(_indicatorValue);

            _pushedTrigger = new HeliosTrigger(sourceInterface, device, name, "pushed", "Fired when this button is pushed in the simulator.");
            Triggers.Add(_pushedTrigger);
            _releasedTrigger = new HeliosTrigger(sourceInterface, device, name, "released", "Fired when this button is released in the simulator.");
            Triggers.Add(_releasedTrigger);

            _pushAction = new HeliosAction(sourceInterface, device, name, "push", "Pushes this button in the simulator");
            _pushAction.Execute += new HeliosActionHandler(PushAction_Execute);
            Actions.Add(_pushAction);
            _releaseAction = new HeliosAction(sourceInterface, device, name, "release", "Releases the button in the simulator.");
            _releaseAction.Execute += new HeliosActionHandler(ReleaseAction_Execute);
            Actions.Add(_releaseAction);
        }
Ejemplo n.º 5
0
 public LatitudeEntry(BaseUDPInterface sourceInterface)
     : base(sourceInterface)
 {
     _variation = new HeliosValue(sourceInterface, BindingValue.Empty, "PShK-7 Latitude Entry", "Latitude Entry Display", "", "", BindingValueUnits.Degrees);
     Values.Add(_variation);
     Triggers.Add(_variation);
 }
Ejemplo n.º 6
0
 public VHFRadioEncoder(BaseUDPInterface sourceInterface, string deviceId, string buttonId, string button2Id, string argId, double argValue, double argMin, double argMax, string device, string name, bool loop, string exportFormat)
     : base(sourceInterface, deviceId, buttonId, button2Id, argId, argValue, argMin, argMax, device, name, loop, exportFormat)
 {
     _windowValue = new HeliosValue(sourceInterface, new BindingValue(0.0d), device, name + " window", "Current value displayed in this encoder.", argMin.ToString() + "-" + argMax.ToString(), BindingValueUnits.Text);
     Values.Add(_windowValue);
     Triggers.Add(_windowValue);
 }
Ejemplo n.º 7
0
 public TotalFuel(BaseUDPInterface sourceInterface)
     : base(sourceInterface)
 {
     _fuel = new HeliosValue(sourceInterface, BindingValue.Empty, "Fuel Gauge", "Total Fuel", "Fuel amount shown on the totalizer.", "", BindingValueUnits.Pounds);
     Values.Add(_fuel);
     Triggers.Add(_fuel);
 }
Ejemplo n.º 8
0
 public MagVariation(BaseUDPInterface sourceInterface)
     : base(sourceInterface)
 {
     _variation = new HeliosValue(sourceInterface, BindingValue.Empty, "ZMS-3 Magnetic Variation", "Variation Display", "", "", BindingValueUnits.Degrees);
     Values.Add(_variation);
     Triggers.Add(_variation);
 }
Ejemplo n.º 9
0
        public HatSwitch(BaseUDPInterface sourceInterface, string deviceId, string argId, 
                            string leftAction, string leftValue, 
                            string upAction, string upValue, 
                            string rightAction, string rightValue, 
                            string downAction, string downValue, 
                            string releaseAction, string releaseValue,
                            string device, string name, string exportFormat, bool everyFrame)
            : base(sourceInterface)
        {
            _id = argId;
            _format = exportFormat;
            _everyframe = everyFrame;

            _sendData.Add(HatPosition.Center, "C" + deviceId + "," + releaseAction + "," + releaseValue);
            _sendData.Add(HatPosition.Left, "C" + deviceId + "," + leftAction + "," + leftValue);
            _sendData.Add(HatPosition.Up, "C" + deviceId + "," + upAction + "," + upValue);
            _sendData.Add(HatPosition.Right, "C" + deviceId + "," + rightAction + "," + rightValue);
            _sendData.Add(HatPosition.Down, "C" + deviceId + "," + downAction + "," + downValue);

            _positionByValue.Add(releaseValue, HatPosition.Center);
            _positionByValue.Add(leftValue, HatPosition.Left);
            _positionByValue.Add(upValue, HatPosition.Up);
            _positionByValue.Add(rightValue, HatPosition.Right);
            _positionByValue.Add(downValue, HatPosition.Down);            

            _positionValue = new HeliosValue(sourceInterface, new BindingValue((double)_currentPosition), device, name, "Current position of the hat switch.", "Position 0 = center, 1 = up, 2 = down, 3 = left,  or 4 = right.", BindingValueUnits.Numeric);
            _positionValue.Execute += new HeliosActionHandler(SetPositionAction_Execute);
            Values.Add(_positionValue);
            Actions.Add(_positionValue);
            Triggers.Add(_positionValue);
        }
Ejemplo n.º 10
0
        public Axis(BaseUDPInterface sourceInterface, string deviceId, string buttonId, string argId, double argValue, double argMin, double argMax, string device, string name, bool loop, string exportFormat)
            : base(sourceInterface)
        {
            _id = argId;
            _format = exportFormat;
            _loop = loop;

            _argValue = argValue;
            _argMin = argMin;
            _argMax = argMax;

            _actionData = "C" + deviceId + "," + buttonId + ",";

            _value = new HeliosValue(sourceInterface, new BindingValue(0.0d), device, name, "Current value of this axis.", argMin.ToString() + "-" + argMax.ToString(), BindingValueUnits.Numeric);
            _value.Execute += new HeliosActionHandler(Value_Execute);
            Values.Add(_value);
            Actions.Add(_value);
            Triggers.Add(_value);

            _incrementAction = new HeliosAction(sourceInterface, device, name, "increment", "Increments this axis value.", "Amount to increment by (Default:"+ argValue + ")", BindingValueUnits.Numeric);
            _incrementAction.Execute += new HeliosActionHandler(IncrementAction_Execute);
            Actions.Add(_incrementAction);

            _decrementAction = new HeliosAction(sourceInterface, device, name, "decrement", "Decrement this axis value.", "Amount to decrement by (Default:" + -argValue + ")", BindingValueUnits.Numeric);
            _decrementAction.Execute += new HeliosActionHandler(DecrementAction_Execute);
            Actions.Add(_decrementAction);
        }
Ejemplo n.º 11
0
 public VHF2Rotary23(BaseUDPInterface sourceInterface, string id, string device, string name)
     : base(sourceInterface)
 {
     _elements = new ExportDataElement[] { new DCSDataElement(id, "%.2f", true) };
     _value = new HeliosValue(sourceInterface, BindingValue.Empty, device, name, "", "", BindingValueUnits.Numeric);
     Values.Add(_value);
     Triggers.Add(_value);
 }
Ejemplo n.º 12
0
 public NetworkValue(BaseUDPInterface sourceInterface, string id, string device, string name, string description, string valueDescription, BindingValueUnit unit, string exportFormat)
     : base(sourceInterface)
 {
     _id = id;
     _format = exportFormat;
     _value = new HeliosValue(sourceInterface, BindingValue.Empty, device, name, description, valueDescription, unit);
     Values.Add(_value);
     Triggers.Add(_value);
 }
Ejemplo n.º 13
0
        public HSIRange(BaseUDPInterface sourceInterface)
            : base(sourceInterface)
        {
            //            AddFunction(new ScaledNetworkValue(this, "117", 100d, "HSI", "Range to bearing", "Range in kilometers to current beacon.", "", BindingValueUnits.Kilometers), true);

            _range = new HeliosValue(sourceInterface, BindingValue.Empty, "HSI", "Range to bearing", "Range in kilometers to current beacon.", "", BindingValueUnits.Kilometers);
            Values.Add(_range);
            Triggers.Add(_range);
        }
Ejemplo n.º 14
0
        public Text(BaseUDPInterface sourceInterface, string id, string device, string name, string description)
            : base(sourceInterface)
        {
            _id = id;

            _value = new HeliosValue(sourceInterface, BindingValue.Empty, device, name, description, "", BindingValueUnits.Text);
            Values.Add(_value);
            Triggers.Add(_value);
        }
Ejemplo n.º 15
0
 public HatSwitch(BaseUDPInterface sourceInterface, string deviceId, string argId,
             string leftAction, string leftValue,
             string upAction, string upValue,
             string rightAction, string rightValue,
             string downAction, string downValue,
             string releaseAction, string releaseValue,
             string device, string name, string exportFormat)
     : this(sourceInterface, deviceId, argId, leftAction, leftValue, upAction, upValue, rightAction, rightValue, downAction, downValue, releaseAction, releaseValue, device, name, exportFormat, false)
 {
 }
Ejemplo n.º 16
0
        public FlagValue(BaseUDPInterface sourceInterface, string id, string device, string name, string description, string exportFormat)
            : base(sourceInterface)
        {
            _id = id;
            _format = exportFormat;

            _value = new HeliosValue(sourceInterface, BindingValue.Empty, device, name, description, "", BindingValueUnits.Boolean);
            Values.Add(_value);
            Triggers.Add(_value);
        }
Ejemplo n.º 17
0
        public Altimeter(BaseUDPInterface sourceInterface)
            : base(sourceInterface)
        {
            _altitude = new HeliosValue(sourceInterface, BindingValue.Empty, "Altimeter", "Altitude", "Barometric altitude above sea level of the aircraft.", "Value is adjusted per altimeter pressure setting.", BindingValueUnits.Feet);
            Values.Add(_altitude);
            Triggers.Add(_altitude);

            _pressure = new HeliosValue(sourceInterface, BindingValue.Empty, "Altimeter", "Pressure", "Manually set barometric altitude.", "", BindingValueUnits.InchesOfMercury);
            Values.Add(_pressure);
            Triggers.Add(_pressure);
        }
Ejemplo n.º 18
0
 public static GuardedSwitch CreateThreeWaySwitch(BaseUDPInterface sourceInterface, string deviceId, string action, string argId,
                                             string guardAction, string guardArgId, string guardUpValue, string guardDownValue,
                                             string position1Value, string position1Name,
                                             string position2Value, string position2Name,
                                             string position3Value, string position3Name,
                                             string device, string name, string exportFormat)
 {
     return new GuardedSwitch(sourceInterface, deviceId, argId, guardAction, guardArgId, guardUpValue, guardDownValue,
             new SwitchPosition[] { new SwitchPosition(position1Value, position1Name, action), new SwitchPosition(position2Value, position2Name, action), new SwitchPosition(position3Value, position3Name, action) },
             device, name, exportFormat);
 }
Ejemplo n.º 19
0
        public TACANChannel(BaseUDPInterface sourceInterface)
            : base(sourceInterface)
        {
            _channel = new HeliosValue(sourceInterface, BindingValue.Empty, "TACAN", "Channel", "Currently tuned TACAN channel.", "", BindingValueUnits.Numeric);
            Values.Add(_channel);
            Triggers.Add(_channel);

            _mode = new HeliosValue(sourceInterface, BindingValue.Empty, "TACAN", "Channel Mode", "Current TACAN channel mode.", "1=X, 2=Y", BindingValueUnits.Numeric);
            Values.Add(_mode);
            Triggers.Add(_mode);
        }
Ejemplo n.º 20
0
 public NetworkTriggerValue(BaseUDPInterface sourceInterface, string id, string name, string description,
                            string valueDescription)
     : base(sourceInterface)
 {
     _id    = id;
     _value = new HeliosValue(sourceInterface, BindingValue.Empty, "", name, description, valueDescription,
                              BindingValueUnits.Text);
     Values.Add(_value);
     Triggers.Add(_value);
     _receivedTrigger = new HeliosTrigger(sourceInterface, "", name, "received", description);
 }
Ejemplo n.º 21
0
        public static Switch CreateRotarySwitch(BaseUDPInterface sourceInterface, string deviceId, string action, string argId, string device, string name, string exportFormat, params string[] positionData)
        {
            Debug.Assert(positionData.Length > 2, "DCS rotary switch definition must have more than one position.");
            Debug.Assert(positionData.Length % 2 == 0, "DCS rotary switch definition data inclomplete.");

            List<SwitchPosition> positions = new List<SwitchPosition>();
            for (int i = 0; i < positionData.Length; i++)
            {
                positions.Add(new SwitchPosition(positionData[i++], positionData[i], action));
            }

            return new Switch(sourceInterface, deviceId, argId, positions.ToArray(), device, name, exportFormat);
        }
Ejemplo n.º 22
0
        public Rocker(BaseUDPInterface sourceInterface, string deviceId, string button1Id, string button2Id, string releaseButtonId, string releaseButton2Id, string argId, string device, string name, bool vertical, string push1Value, string push2Value, string releaseValue, string exportFormat)
            : base(sourceInterface)
        {
            _id = argId;
            _format = exportFormat;

            _position1Value = push1Value;
            _position2Value = push2Value;
            _releaseValue = releaseValue;

            _pushed1ActionData = "C" + deviceId + "," + button1Id + "," + push1Value;
            _pushed2ActionData = "C" + deviceId + "," + button2Id + "," + push2Value;
            _release1ActionData = "C" + deviceId + "," + releaseButtonId + "," + releaseValue;
            _release2ActionData = "C" + deviceId + "," + releaseButton2Id + "," + releaseValue;

            if (vertical)
            {
                _position1Name = "up";
                _position2Name = "down";
            }
            else
            {
                _position1Name = "left";
                _position2Name = "right";
            }

            _value = new HeliosValue(sourceInterface, new BindingValue(false), device, name, "Current state of this rocker.", "1=" + _position1Name + ", 2=released" + ", 3=" + _position2Name, BindingValueUnits.Numeric);
            Values.Add(_value);
            Triggers.Add(_value);

            _pushed1Trigger = new HeliosTrigger(sourceInterface, device, name, "pushed " + _position1Name, "Fired when this rocker is pushed " + _position1Name + " in the simulator.");
            Triggers.Add(_pushed1Trigger);
            _pushed2Trigger = new HeliosTrigger(sourceInterface, device, name, "pushed " + _position2Name, "Fired when this rocker is pushed " + _position2Name + " in the simulator.");
            Triggers.Add(_pushed2Trigger);

            _releasedTrigger = new HeliosTrigger(sourceInterface, device, name, "released", "Fired when this rocker is released in the simulator.");
            Triggers.Add(_releasedTrigger);

            _push1Action = new HeliosAction(sourceInterface, device, name, "push " + _position1Name, "Pushes this rocker " + _position1Name + " in the simulator");
            _push1Action.Execute += new HeliosActionHandler(Push1Action_Execute);
            Actions.Add(_push1Action);

            _push2Action = new HeliosAction(sourceInterface, device, name, "push " + _position2Name, "Pushes this rocker " + _position2Name + " in the simulator");
            _push2Action.Execute += new HeliosActionHandler(Push2Action_Execute);
            Actions.Add(_push2Action);

            _releaseAction = new HeliosAction(sourceInterface, device, name, "release", "Releases the rocker in the simulator.");
            _releaseAction.Execute += new HeliosActionHandler(ReleaseAction_Execute);
            Actions.Add(_releaseAction);
        }
Ejemplo n.º 23
0
        public Switch(BaseUDPInterface sourceInterface, string deviceId, string argId, SwitchPosition[] positions, string device, string name, string exportFormat, bool everyFrame)
            : base(sourceInterface)
        {
            _id = argId;
            _format = exportFormat;
            _everyframe = everyFrame;

            _positions = positions;
            _sendAction = new string[_positions.Length];
            _sendStopAction = new string[_positions.Length];
            _exitAction = new string[_positions.Length];

            _valueDescriptions = "";
            for (int i = 0; i < _positions.Length; i++)
            {
                SwitchPosition position = _positions[i];

                if (_valueDescriptions.Length > 0)
                {
                    _valueDescriptions += ",";
                }
                _valueDescriptions += (i + 1).ToString() + "=" + position.Name;
                if (position.Action != null)
                {
                    _sendAction[i] = "C" + deviceId + "," + position.Action + "," + position.ArgValue;
                }
                if (position.StopAction != null)
                {
                    _sendStopAction[i] = "C" + deviceId + "," + position.StopAction + "," + position.StopActionValue;
                }
                if (position.ExitValue != null)
                {
                    _exitAction[i] = "C" + deviceId + "," + position.Action + "," + position.ExitValue;
                }
            }

            _releaseAction = new HeliosAction(sourceInterface, device, name, "release", "Releases pressure on current position (allows momentary and electronically held switch to revert to another position if necessary).");
            _releaseAction.Execute += new HeliosActionHandler(Release_Execute);
            Actions.Add(_releaseAction);

            _value = new HeliosValue(sourceInterface, BindingValue.Empty, device, name, "Current position of this switch.", _valueDescriptions, BindingValueUnits.Numeric);
            _value.Execute += new HeliosActionHandler(Value_Execute);
            Actions.Add(_value);
            Triggers.Add(_value);
            Values.Add(_value);

            _currentPosition = -1;
        }
Ejemplo n.º 24
0
        public RotaryEncoder(BaseUDPInterface sourceInterface, string deviceId, string buttonId, string button2Id, string argId, double argValue, string device, string name)
            : base(sourceInterface)
        {
            _incrementPrefix = "C" + deviceId + "," + button2Id + ",";
            _decrementPrefix = "C" + deviceId + "," + buttonId + ",";
            _incrementData = _incrementPrefix + argValue.ToString(CultureInfo.InvariantCulture);
            _decrementData = _decrementPrefix + (-argValue).ToString(CultureInfo.InvariantCulture);

            _incrementAction = new HeliosAction(sourceInterface, device, name, "increment", "Increments this setting.", "Value to increment by. (Defaults to " + argValue + " if input evaluates to zero.)", BindingValueUnits.Numeric);
            _incrementAction.Execute += new HeliosActionHandler(IncrementAction_Execute);
            Actions.Add(_incrementAction);

            _decrementAction = new HeliosAction(sourceInterface, device, name, "decrement", "Decrement this setting.", "Value to increment by. (Defaults to " + -argValue + " if input evaluates to zero.)", BindingValueUnits.Numeric);
            _decrementAction.Execute += new HeliosActionHandler(DecrementAction_Execute);
            Actions.Add(_decrementAction);
        }
Ejemplo n.º 25
0
        public LockedEncoder(BaseUDPInterface sourceInterface, string deviceId, string buttonId, string button2Id, string argId, double argValue, string device, string name)
            : base(sourceInterface)
        {
            _incrementPrefix = "C" + deviceId + "," + buttonId + ",";
            _decrementPrefix = "C" + deviceId + "," + button2Id + ",";
            _incrementData = _incrementPrefix + argValue.ToString(CultureInfo.InvariantCulture);
            _decrementData = _decrementPrefix + (-argValue).ToString(CultureInfo.InvariantCulture);

            _incrementAction = new HeliosAction(sourceInterface, device, name, "increment", "Increments this setting.");
            _incrementAction.Execute += new HeliosActionHandler(IncrementAction_Execute);
            Actions.Add(_incrementAction);

            _decrementAction = new HeliosAction(sourceInterface, device, name, "decrement", "Decrement this setting.");
            _decrementAction.Execute += new HeliosActionHandler(DecrementAction_Execute);
            Actions.Add(_decrementAction);
        }
Ejemplo n.º 26
0
        public GuardedSwitch(BaseUDPInterface sourceInterface, string deviceId, string argId, string guardAction, string guardArgId, string guardUpValue, string guardDownValue, SwitchPosition[] positions, string device, string name, string exportFormat, bool everyFrame)
            : base(sourceInterface, deviceId, argId, positions, device, name, exportFormat, everyFrame)
        {
            _guardArgId = guardArgId;
            _guardUpValue = guardUpValue;
            _guardDownValue = guardDownValue;

            _actionData[0] = "C" + deviceId + "," + guardAction + "," + guardUpValue;
            _actionData[1] = "C" + deviceId + "," + guardAction + "," + guardDownValue;

            _guardValue = new HeliosValue(sourceInterface, BindingValue.Empty, device, name + " guard", "Current position of the guard for this switch.", "1 = Up, 2 = Down", BindingValueUnits.Numeric);
            _guardValue.Execute += new HeliosActionHandler(GuardValue_Execute);
            Actions.Add(_guardValue);
            Triggers.Add(_guardValue);
            Values.Add(_guardValue);

            _autoguardPositionAction = new HeliosAction(sourceInterface, device, name, "autoguard set", "Sets the position of this switch, and automatically switches the guard up if necessary.", ValueDescriptions, BindingValueUnits.Numeric);
            _autoguardPositionAction.Execute += new HeliosActionHandler(AutoguardPositionAction_Execute);
            Actions.Add(_autoguardPositionAction);
        }
Ejemplo n.º 27
0
 public FlagValue(BaseUDPInterface sourceInterface, string id, string device, string name, string description)
     : this(sourceInterface, id, device, name, description, "%0.1f")
 {
 }
Ejemplo n.º 28
0
 public ScaledNetworkValue(BaseUDPInterface sourceInterface, string id, double scale, string device, string name, string description, string valueDescription, BindingValueUnit unit, double baseValue, string exportFormat)
     : this(sourceInterface, id, device, name, description, valueDescription, unit, baseValue, exportFormat)
 {
     _calibratedScale = null;
     _scale = scale;
 }
Ejemplo n.º 29
0
 public ScaledNetworkValue(BaseUDPInterface sourceInterface, string id, double scale, string device, string name, string description, string valueDescription, BindingValueUnit unit)
     : this(sourceInterface, id, scale, device, name, description, valueDescription, unit, 0d, "%.4f")
 {
 }
Ejemplo n.º 30
0
 public ScaledNetworkValue(BaseUDPInterface sourceInterface, string id, CalibrationPointCollectionDouble scale, string device, string name, string description, string valueDescription, BindingValueUnit unit, string exportFormat)
     : this(sourceInterface, id, device, name, description, valueDescription, unit, 0d, exportFormat)
 {
     _calibratedScale = scale;
     _scale = 0d;
 }
Ejemplo n.º 31
0
 public RotaryEncoder(BaseUDPInterface sourceInterface, string deviceId, string buttonId, string argId, double argValue, string device, string name)
     : this(sourceInterface, deviceId, buttonId, buttonId, argId, argValue, device, name)
 {
 }