private void AddRotarySwitch(string name, Point posn, Size size, string imagePrefix) { RotarySwitch rSwitch = AddRotarySwitch(name: name, posn: posn, size: size, knobImage: "{M2000C}/Images/TacanPanel/" + imagePrefix + ".png", defaultPosition: 0, clickType: RotaryClickType.Touch, interfaceDeviceName: _interfaceDeviceName, interfaceElementName: name, fromCenter: true); rSwitch.Positions.Clear(); switch (name) { case "X/Y Selector": rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "X", 0d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "Y", 45d)); break; case "Mode Selector": rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "OFF", 215d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "REC", 240d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 3, "T/R", 270d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 4, "A/A", 300d)); break; } foreach (RotarySwitchPosition position in rSwitch.Positions) { AddTrigger(rSwitch.Triggers["position " + position.Index + ".entered"], rSwitch.Name); } rSwitch.DefaultPosition = 1; }
private void AddKnob(string name, Point posn, Size size, string interfaceElementName) { RotarySwitch _knob = new RotarySwitch(); _knob.Name = "Fuel Panel_" + name; _knob.KnobImage = "{AV-8B}/Images/Fuel Selector Knob.png"; _knob.DrawLabels = false; _knob.DrawLines = false; _knob.Positions.Clear(); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 0, "Outboard", 265d)); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 1, "Inboard", 295d)); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 2, "Wing", 325d)); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 3, "Internal", 355d)); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 4, "Total", 25d)); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 5, "Feed", 55d)); _knob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_knob, 6, "BIT", 85d)); _knob.CurrentPosition = 4; _knob.DefaultPosition = 4; _knob.Top = posn.Y; _knob.Left = posn.X; _knob.Width = size.Width; _knob.Height = size.Height; AddRotarySwitchBindings(name, posn, size, _knob, _interfaceDeviceName, interfaceElementName); }
private void AddRotarySwitch(string name, Point posn, Size size, string imagePrefix) { RotarySwitch rSwitch = AddRotarySwitch(name: name, posn: posn, size: size, knobImage: "{M2000C}/Images/VorIlsPanel/" + imagePrefix + ".png", defaultPosition: 0, clickType: ClickType.Touch, interfaceDeviceName: _interfaceDeviceName, interfaceElementName: name, fromCenter: true); rSwitch.Positions.Clear(); switch (name) { case "Power Selector": rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "ON", -40d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "OFF", 40d)); break; case "Mode Selector": rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "HG", -40d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "BD", 40d)); break; } foreach (RotarySwitchPosition position in rSwitch.Positions) { AddTrigger(rSwitch.Triggers["position " + position.Index + ".entered"], rSwitch.Name); } rSwitch.DefaultPosition = 1; }
private void AddSwitch(string name, string knobImage, Point posn, Size size, bool fromCenter) { RotarySwitch rSwitch = AddRotarySwitch(name: name, posn: posn, size: size, knobImage: knobImage, defaultPosition: 0, clickType: ClickType.Touch, interfaceDeviceName: _interfaceDeviceName, interfaceElementName: name, fromCenter: fromCenter); rSwitch.IsContinuous = true; rSwitch.Positions.Clear(); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 0, "TR/VS", 220d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "D/RLT", 240d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "CP/PD", 270d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 3, "ALT", 300d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 4, "L/G", 325d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 5, "RD/TD", 0d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 6, "dL/dG", 40d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 7, "dALT", 70d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 8, "P/t", 95d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 9, "REC", 135d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 10, "DV/FV", 185d)); }
private RotarySwitch AddRotarySwitch(string name, Point posn, Size size, string knobNumber, int defaultPosition, RotarySwitchPositionCollection positions, string interfaceElementName) { RotarySwitch newSwitch = new RotarySwitch { Name = _interfaceDeviceName + "_" + name, KnobImage = _imageLocation + "A-10C_UHF_Radio_Selector_Knob_" + knobNumber + ".png", DrawLabels = false, DrawLines = false, Top = posn.Y, Left = posn.X, Width = size.Width, Height = size.Height, DefaultPosition = defaultPosition, IsContinuous = false }; newSwitch.Positions.Clear(); foreach (RotarySwitchPosition swPosn in positions) { newSwitch.Positions.Add(swPosn); } AddRotarySwitchBindings(name, posn, size, newSwitch, _interfaceDeviceName, interfaceElementName); return(newSwitch); }
public RotarySwitchPosition(RotarySwitch rotarySwitch, int index, string name, double rotation) { _index = index; _name = name; _rotation = rotation; _enterTrigger = new HeliosTrigger(rotarySwitch, "", "position " + _index, "entered", "Fires when switch enters the " + _name + " position"); _exitTrigger = new HeliosTrigger(rotarySwitch, "", "position " + _index, "exited", "Fires when switch exits the " + _name + " position"); }
public Radio() : base("Radio/ACNIP", new Size(727, 902)) { // 00000000*2100=99:2101=123.457: AddTextDisplay("Channel Number", 200, 20, new Size(81, 80), "Channel Number", 72, "99", TextHorizontalAlignment.Left); AddTextDisplay("Frequency Display", 281, 27, new Size(216, 51), "Frequency", 48, "888.888", TextHorizontalAlignment.Left); AddEncoder("Radio volume", new Point(95, 39), new Size(50, 50), "Volume Knob", "WQHD/Knob/Radio Squlech Knob.png"); AddEncoder("Channel Knob", new Point(547, 37), new Size(70, 70), "Chan/Freq Knob", "WQHD/Knob/Radio Channel Select.png"); AddButton("A Mode Button", 260, 186, new Size(68, 68), "Ancillary Mode Pointer A mode", "WQHD/Button/Radio A Up.png"); AddButton("P Mode Button", 358, 186, new Size(68, 68), "Ancillary Mode Switch P mode", "WQHD/Button/Radio P Up.png"); AddButton("Load Switch", 628, 105, new Size(68, 68), "LOAD/OFST Switch", "WQHD/Button/Radio Load Up.png"); RotarySwitch _opKnob = AddKnob("Operational Mode", new Point(119, 163), new Size(90, 90), "Operational Mode Switch"); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 0, "Zero", 315d)); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 1, "Off", 0d)); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 2, "Test", 45d)); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 3, "TR+G", 90d)); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 4, "TR", 135d)); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 5, "ADF", 180d)); _opKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_opKnob, 6, "Chng PRST", 225d)); RotarySwitch _freqKnob = AddKnob("Frequency Mode", new Point(491, 163), new Size(90, 90), "Frequency Mode Switch"); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 0, "AJ/M", 315d)); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 1, "AJ", 0d)); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 2, "MAR", 45d)); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 3, "PRST", 90d)); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 4, "MAN", 135d)); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 5, "342", 180d)); _freqKnob.Positions.Add(new Helios.Controls.RotarySwitchPosition(_freqKnob, 6, "121", 225d)); _interfaceDeviceName = "ACNIP"; // 00000000*2102=MODE:2103=PLN:2104=CODE:2105=00:2106=MODE:2107=CY:2108=CODE:2109=03: AddTextDisplay("1 Mode Label", 138, 381, new Size(68, 25), "ACNIP 1 Mode Label", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("1 Mode display", 138, 406, new Size(68, 25), "ACNIP 1 Mode", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("1 Code Label", 138, 431, new Size(68, 25), "ACNIP 1 Code Label", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("1 Code display", 138, 456, new Size(68, 25), "ACNIP 1 Code", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("2 Mode Label", 208, 381, new Size(68, 25), "ACNIP 2 Mode Label", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("2 Mode display", 208, 406, new Size(68, 25), "ACNIP 2 Mode", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("2 Code Label", 208, 431, new Size(68, 25), "ACNIP 2 Code Label", 24, "MMMM", TextHorizontalAlignment.Center); AddTextDisplay("2 Code display", 208, 456, new Size(68, 25), "ACNIP 2 Code", 24, "MMMM", TextHorizontalAlignment.Center); AddTwoWayToggle("Mode Switch", 323, 391, new Size(69, 107), "ACNIP Mode Switch", "WQHD/Switch/Orange "); AddTwoWayToggle("KY-1 Cipher Switch", 435, 372, new Size(64, 146), "KY-1 Cipher Type Selector Switch", "WQHD/Switch/Domed "); AddTwoWayToggle("KY-2 Cipher Switch", 546, 372, new Size(64, 146), "KY-2 Cipher Type Selector Switch", "WQHD/Switch/Domed "); AddTwoWayToggle("KY-1 Code/Mode Switch", 108, 570, new Size(69, 107), "KY-1 Code/Mode Switch", "WQHD/Switch/Orange "); AddTwoWayToggle("KY-2 Code/Mode Switch", 218, 570, new Size(69, 107), "KY-2 Code/Mode Switch", "WQHD/Switch/Orange "); AddTwoWayToggle("ACNIP Radio Selector Switch", 323, 553, new Size(64, 146), "ACNIP Radio Selector Switch", "WQHD/Switch/Domed "); AddTwoWayToggle("KY-58 Codes Clear Switch", 434, 553, new Size(64, 146), "KY-58 Codes Clear Switch", "WQHD/Switch/Domed "); AddThreeWayToggle("KY-58 Load Switch", 546, 553, new Size(64, 146), "KY-58 Remote Codes Load Switch", "WQHD/Switch/Domed "); AddTwoWayToggle("IFF Operational Mode Switch", 434, 733, new Size(64, 146), "IFF Operational Mode Switch", "WQHD/Switch/Domed "); AddThreeWayToggle("IFF Crypto Switch", 546, 733, new Size(64, 146), "IFF Crypto Mode Switch", "WQHD/Switch/Domed "); _interfaceDeviceName = "Intercomm"; AddThreeWayToggle("Mic Switch", 321, 750, new Size(69, 107), "Mic Operational Mode Switch", "WQHD/Switch/Orange "); AddPot("Ground Volume", new Point(154, 719), new Size(120, 120), "Ground Volume Knob", "WQHD/Knob/Outer.png"); AddPot("Aux Volume", new Point(174, 739), new Size(80, 80), "Aux Volume Knob", "WQHD/Knob/Inner.png", 270, 270); }
protected RotarySwitch AddRotarySwitch(string name, Point posn, Size size, string knobImage, int defaultPosition, RotarySwitchPositionCollection positions, string interfaceDeviceName, string interfaceElementName, bool fromCenter) { if (fromCenter) { posn = FromCenter(posn, size); } string componentName = GetComponentName(name); RotarySwitch knob = new RotarySwitch { Name = componentName, KnobImage = knobImage, DrawLabels = false, DrawLines = false, Top = posn.Y, Left = posn.X, Width = size.Width, Height = size.Height, DefaultPosition = defaultPosition }; knob.Positions.Clear(); knob.DefaultPosition = defaultPosition; foreach (RotarySwitchPosition swPosn in positions) { knob.Positions.Add(swPosn); } Children.Add(knob); foreach (IBindingTrigger trigger in knob.Triggers) { AddTrigger(trigger, componentName); } AddAction(knob.Actions["set.position"], componentName); AddDefaultOutputBinding( childName: componentName, deviceTriggerName: "position.changed", interfaceActionName: interfaceDeviceName + ".set." + interfaceElementName ); AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", deviceActionName: "set.position"); return(knob); }
protected RotarySwitch AddRotarySwitch(string name, Point posn, Size size, string knobImage, int defaultPosition, ClickType clickType, string interfaceDeviceName, string interfaceElementName, bool fromCenter, NonClickableZone[] nonClickableZones = null) { if (fromCenter) { posn = FromCenter(posn, size); } string componentName = GetComponentName(name); RotarySwitch _knob = new RotarySwitch { Name = componentName, KnobImage = knobImage, DrawLabels = false, DrawLines = false, Top = posn.Y, Left = posn.X, Width = size.Width, Height = size.Height, DefaultPosition = defaultPosition, ClickType = clickType, }; _knob.NonClickableZones = nonClickableZones; _knob.Positions.Clear(); Children.Add(_knob); foreach (IBindingTrigger trigger in _knob.Triggers) { AddTrigger(trigger, componentName); } foreach (IBindingAction action in _knob.Actions) { AddAction(action, componentName); } AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", deviceActionName: "set.position"); AddDefaultOutputBinding( childName: componentName, deviceTriggerName: "position.changed", interfaceActionName: interfaceDeviceName + ".set." + interfaceElementName); return(_knob); }
private void AddRotarySwitch(string name, NonClickableZone[] nonClickableZones) { RotarySwitch rSwitch = AddRotarySwitch(name: name, posn: new Point(169, 83), size: new Size(160, 160), knobImage: "{M2000C}/Images/LGPanel/emergency-landing-gear-lever.png", defaultPosition: 0, clickType: ClickType.Touch, interfaceDeviceName: _interfaceDeviceName, interfaceElementName: name, nonClickableZones: nonClickableZones, fromCenter: true); rSwitch.Positions.Clear(); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "OFF", 0d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "ON", 90d)); }
private void AddRotarySwitch(string name, Point posn, Size size, string imagePrefix) { RotarySwitch rSwitch = AddRotarySwitch(name: name, posn: posn, size: size, knobImage: "{M2000C}/Images/HSIPanel/" + imagePrefix + ".png", defaultPosition: 0, clickType: RotaryClickType.Touch, interfaceDeviceName: _interfaceDeviceName, interfaceElementName: name, fromCenter: true); rSwitch.Positions.Clear(); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "Cv/NAV", 0d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "NAV", 20d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 3, "TAC", 40d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 4, "VAD", 60d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 5, "rho", 80d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 6, "theta", 100d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 7, "TEL", 120d)); rSwitch.DefaultPosition = 2; }
public CMSP() : base("CMSP", new Size(666, 404)) { //AddPanel("Filters", new Point(0, 0), new Size(666, 404), _imageLocation + "A-10C_CMSP_Filter_Panel.png", _interfaceDeviceName, "Display Filters"); AddTextDisplay("Display Line 1 Text", 73, 35, new Size(430, 50), "Line 1 Display", "a1B2C3D4m5s6x7O8", " =[]]]]; =[]]]; =[]]; =][;"); // These substitutions are for blanks of different widths _bezel = AddPanel("Bezel", new Point(0, 0), new Size(666, 404), _imageLocation + PANEL_IMAGE, _interfaceDeviceName, "CMSP Bezel"); AddOSBButton("OSB 1", 86, 168, new Size(64, 64), "OSB 1"); AddOSBButton("OSB 2", 175, 168, new Size(64, 64), "OSB 2"); AddOSBButton("OSB 3", 275, 168, new Size(64, 64), "OSB 3"); AddOSBButton("OSB 4", 367, 168, new Size(64, 64), "OSB 4"); AddRTNButton("RTN", 546, 50, new Size(68, 67), "Return to Previous Rotary Menu"); AddRocker("Page Cycle", new Point(492, 38), new Size(51, 97), ThreeWayToggleSwitchPosition.Two, ThreeWayToggleSwitchType.MomOnMom, _interfaceDeviceName, "Page Cycle", false, _imageLocation + "A-10C_CMSP_NXT_Rocker_Up.png", _imageLocation + "A-10C_CMSP_NXT_Rocker_Middle.png", _imageLocation + "A-10C_CMSP_NXT_Rocker_Down.png", LinearClickType.Touch, false); AddThreeWayToggle("MWS Switch", new Point(93, 262), new Size(41, 139), "MWS"); AddThreeWayToggle("JMR Switch", new Point(186, 262), new Size(41, 139), "JMR"); AddThreeWayToggle("RWR Switch", new Point(278, 262), new Size(41, 139), "RWR"); AddThreeWayToggle("Disp Switch", new Point(374, 262), new Size(41, 139), "DISP"); AddTwoWayToggle("ECM Pod Jettison", 471, 139, new Size(53, 128), "ECM Pod Jettison"); AddPot("Brightness", new Point(550, 176), new Size(60, 60), "Brightness"); AddTextDisplay("Display MWS Text", 73, 87, new Size(101, 50), "Line 2 MWS Display", "amsx", _CMSPConversion); AddTextDisplay("Display JMR Text", 174, 87, new Size(101, 50), "Line 2 JMR Display", "amsx", _CMSPConversion); AddTextDisplay("Display RWR Text", 275, 87, new Size(101, 50), "Line 2 RWR Display", "amsx", _CMSPConversion); AddTextDisplay("Display Disp Text", 376, 87, new Size(101, 50), "Line 2 DISP Display", "amsx", _CMSPConversion); _positions.Add(new RotarySwitchPosition(this, 1, "OFF", 225d)); _positions.Add(new RotarySwitchPosition(this, 2, "STBY", 270d)); _positions.Add(new RotarySwitchPosition(this, 3, "MAN", 315d)); _positions.Add(new RotarySwitchPosition(this, 4, "SEMI", 0d)); _positions.Add(new RotarySwitchPosition(this, 5, "AUTO", 45d)); RotarySwitch knob = AddRotarySwitch("Mode Dial", new Point(478, 269), new Size(125, 125), _imageLocation + "A-10C_CMSP_Knob.png", 1, _positions, _interfaceDeviceName, "Mode Select Dial", false); knob.IsContinuous = false; }
protected void AddRotarySwitchBindings(string name, Point posn, Size size, RotarySwitch rotarySwitch, string interfaceDeviceName, string interfaceElementName) { string componentName = GetComponentName(name); Children.Add(rotarySwitch); foreach (IBindingTrigger trigger in rotarySwitch.Triggers) { AddTrigger(trigger, componentName); } AddAction(rotarySwitch.Actions["set.position"], componentName); AddDefaultOutputBinding( childName: componentName, deviceTriggerName: "position.changed", interfaceActionName: interfaceDeviceName + ".set." + interfaceElementName ); AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", deviceActionName: "set.position"); }
private void AddSwitch(string name, string knobImage, Point posn, Size size, bool fromCenter) { RotarySwitch rSwitch = AddRotarySwitch(name: name, posn: posn, size: size, knobImage: knobImage, defaultPosition: 0, clickType: ClickType.Touch, interfaceDeviceName: _interfaceDeviceName, interfaceElementName: name, fromCenter: fromCenter); rSwitch.IsContinuous = true; rSwitch.Positions.Clear(); switch (name) { case "Mode Selector": rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 0, "AR", 2d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "VEI", 27d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "CAL", 61d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 3, "TST", 93d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 4, "ALN", 120d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 5, "ALCM", 148d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 6, "NAV", 178d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 7, "SEC", 202d)); break; case "Operation Selector": rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 0, "N", 357d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 1, "STS", 322d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 2, "DCI", 290d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 3, "CRV", 254d)); rSwitch.Positions.Add(new RotarySwitchPosition(rSwitch, 4, "MAIN", 216d)); break; } }
public RotarySwitchAddPositionUndoEvent(RotarySwitch rotary, RotarySwitchPosition position) { _rotary = rotary; _position = position; }
public RotarySwitchDeletePositionUndoEvent(RotarySwitch rotary, RotarySwitchPosition position, int index) { _index = index; _rotary = rotary; _position = position; }