public SwipeRotaryInteraction(double initialControlAngle, Point centerPoint, Point location, double sensitivity) { _ = initialControlAngle; _centerPoint = centerPoint; _swipeThreshold = SWIPE_SENSITIVY_BASE * SwipeCalibration.Interpolate(sensitivity); _lastUpdateLocation = location; }
public RadialRotaryInteraction(double initialControlAngle, Point centerPoint, Point mouseDownLocation, double relativeSensitivity) { _initialControlAngle = initialControlAngle; _centerPoint = centerPoint; _radialThreshold = RadialCalibration.Interpolate(relativeSensitivity); DragPoint = mouseDownLocation; }
public override void ProcessNetworkData(string id, string value) { double scaledValue; if (double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out scaledValue)) { if (_calibratedScale != null) { _value.SetValue(new BindingValue(_calibratedScale.Interpolate(scaledValue)), false); } else { _value.SetValue(new BindingValue((scaledValue * _scale) + _baseValue), false); } } }
public OilPressure() : base("Oil Pressure", new Size(360, 360)) { _needleCalibration = new CalibrationPointCollectionDouble(0d, 0d, 100d, 320d); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/OilPressure/oil_faceplate.xaml", new Rect(30d, 30d, 300d, 300d))); _needle = new GaugeNeedle("{Helios}/Gauges/F-16/OilPressure/oil_needle.xaml", new Point(180d, 180d), new Size(60d, 144d), new Point(30d, 114d), 110d); _needle.Rotation = _needleCalibration.Interpolate(0); Components.Add(_needle); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/Common/f16_engine_bezel.png", new Rect(0d, 0d, 360d, 360d))); _oilPressure = new HeliosValue(this, new BindingValue(0d), "", "oil pressure", "Current oil pressure in the engine.", "Percent (0-100)", BindingValueUnits.Numeric); _oilPressure.Execute += new HeliosActionHandler(OilPressure_Execute); Actions.Add(_oilPressure); }
public Nozzle() : base("Nozzle", new Size(360, 360)) { _needleCalibration = new CalibrationPointCollectionDouble(0d, 0d, 100d, 280d); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/Nozzle/nozzle_faceplate.xaml", new Rect(30d, 30d, 300d, 300d))); _needle = new GaugeNeedle("{Helios}/Gauges/F-16/Nozzle/nozzle_needle.xaml", new Point(180d, 180d), new Size(60d, 144d), new Point(30d, 114d), 40d); _needle.Rotation = _needleCalibration.Interpolate(0); Components.Add(_needle); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/Common/f16_engine_bezel.png", new Rect(0d, 0d, 360d, 360d))); _nozzlePosition = new HeliosValue(this, new BindingValue(0d), "", "nozzle position", "Current afterburner nozzel position.", "Percent open (0-100)", BindingValueUnits.Numeric); _nozzlePosition.SetValue(new BindingValue(29.92), true); _nozzlePosition.Execute += new HeliosActionHandler(NozzlePosition_Execute); Actions.Add(_nozzlePosition); }
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; }
public FTIT() : base("FTIT", new Size(360, 360)) { _needleCalibration = new CalibrationPointCollectionDouble(200d, 18d, 1200d, 342d); _needleCalibration.Add(new CalibrationPointDouble(700d, 108d)); _needleCalibration.Add(new CalibrationPointDouble(1000d, 306d)); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/FTIT/ftit_faceplate.xaml", new Rect(30d, 30d, 300d, 300d))); _needle = new GaugeNeedle("{Helios}/Gauges/F-16/FTIT/ftit_needle.xaml", new Point(180d, 180d), new Size(60d, 144d), new Point(30d, 114d), 90d); _needle.Rotation = _needleCalibration.Interpolate(0); Components.Add(_needle); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/Common/f16_engine_bezel.png", new Rect(0d, 0d, 360d, 360d))); _ftit = new HeliosValue(this, new BindingValue(0d), "", "ftit", "Current fan turbine inlet temperature of the engine.", "", BindingValueUnits.Celsius); _ftit.SetValue(new BindingValue(29.92), true); _ftit.Execute += new HeliosActionHandler(FTIT_Execute); Actions.Add(_ftit); }
public IAS() : base("IAS", new Size(364, 376)) { _tapeCalibration = new CalibrationPointCollectionDouble(0d, 0d, 100d, 346d); _tape = new GaugeNeedle("{Helios}/Gauges/A-10/IAS/ias_tape.xaml", new Point(137, 93), new Size(436, 42), new Point(0, 0)); _tape.HorizontalOffset = -_tapeCalibration.Interpolate(0d); _tape.Clip = new RectangleGeometry(new Rect(137d, 93d, 90d, 42d)); Components.Add(_tape); Components.Add(new GaugeImage("{Helios}/Gauges/A-10/IAS/ias_faceplate.xaml", new Rect(32d, 38d, 300, 300))); _needleCalibration = new CalibrationPointCollectionDouble(0d, 0d, 550d, 340d); _needleCalibration.Add(new CalibrationPointDouble(100d, 34d)); _needle = new GaugeNeedle("{Helios}/Gauges/A-10/Common/needle_a.xaml", new Point(182d, 188d), new Size(22, 165), new Point(11, 130), 10d); Components.Add(_needle); Components.Add(new GaugeImage("{Helios}/Gauges/A-10/Common/gauge_bezel.png", new Rect(0d, 0d, 364d, 376d))); _indicatedAirSpeed = new HeliosValue(this, new BindingValue(0d), "", "indicated airspeed", "Current indicated airspeed of the aircraft.", "(0 - 550)", BindingValueUnits.Knots); _indicatedAirSpeed.Execute += new HeliosActionHandler(IndicatedAirSpeed_Execute); Actions.Add(_indicatedAirSpeed); }
void BankSteering_Execute(object action, HeliosActionEventArgs e) { _bankSteering.SetValue(e.Value, e.BypassCascadingTriggers); _bankSteeringNeedle.HorizontalOffset = _bankBarCalibration.Interpolate(e.Value.DoubleValue); }
void PitchSteering_Execute(object action, HeliosActionEventArgs e) { _pitchSteering.SetValue(e.Value, e.BypassCascadingTriggers); _pitchSteeringNeedle.VerticalOffset = -_pitchBarCalibration.Interpolate(e.Value.DoubleValue); }
void SlipBall_Execute(object action, HeliosActionEventArgs e) { _slipBall.SetValue(e.Value, e.BypassCascadingTriggers); _slipBallNeedle.HorizontalOffset = _slipBallCalibration.Interpolate(e.Value.DoubleValue); }
void GsIndicator_Execute(object action, HeliosActionEventArgs e) { _gsIndicator.SetValue(e.Value, e.BypassCascadingTriggers); _gsIndicatorNeedle.VerticalOffset = -_gsCalibration.Interpolate(e.Value.DoubleValue); }
public ADI() : base("ADI", new Size(350, 350)) { _pitchCalibration = new CalibrationPointCollectionDouble(-360d, -1066d, 360d, 1066d); _ball = new GaugeNeedle("{Helios}/Gauges/F-16/ADI/adi_ball.xaml", new Point(175d, 175d), new Size(225d, 1350d), new Point(112.5d, 677d)); _ball.Clip = new EllipseGeometry(new Point(175d, 175d), 113d, 113d); Components.Add(_ball); _ilsCalibration = new CalibrationPointCollectionDouble(-1d, -116d, 1d, 116d); _ilsHorizontalNeedle = new GaugeNeedle("{Helios}/Gauges/F-16/ADI/adi_ils_bar.xaml", new Point(175d, 175d), new Size(189d, 6d), new Point(95d, 4d), 90d); _ilsHorizontalNeedle.VerticalOffset = _ilsCalibration.Interpolate(1d); Components.Add(_ilsHorizontalNeedle); _ilsVerticalNeedle = new GaugeNeedle("{Helios}/Gauges/F-16/ADI/adi_ils_bar.xaml", new Point(175d, 175d), new Size(189d, 6d), new Point(95d, 4d)); _ilsVerticalNeedle.VerticalOffset = _ilsCalibration.Interpolate(1d); Components.Add(_ilsVerticalNeedle); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_inner_ring.xaml", new Rect(0d, 0d, 350d, 350d))); _auxFlagImage = new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_aux_flag.xaml", new Rect(0d, 0d, 350d, 350d)); _auxFlagImage.IsHidden = true; Components.Add(_auxFlagImage); _offFlagImage = new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_off_flag.xaml", new Rect(0d, 0d, 350d, 350d)); _offFlagImage.IsHidden = true; Components.Add(_offFlagImage); _gsFlagImage = new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_gs_flag.xaml", new Rect(0d, 0d, 350d, 350d)); _gsFlagImage.IsHidden = true; Components.Add(_gsFlagImage); _locFlagImage = new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_loc_flag.xaml", new Rect(0d, 0d, 350d, 350d)); _locFlagImage.IsHidden = true; Components.Add(_locFlagImage); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_outer_ring.xaml", new Rect(0d, 0d, 350d, 350d))); _ilsScaleNeedle = new GaugeNeedle("{Helios}/Gauges/F-16/ADI/adi_ils_scale_needle.xaml", new Point(30d, 174d), new Size(14d, 12d), new Point(1d, 6d)); Components.Add(_ilsScaleNeedle); _slipBallCalibration = new CalibrationPointCollectionDouble(-1d, -26d, 1d, 26d); _slipBallNeedle = new GaugeNeedle("{Helios}/Gauges/F-16/ADI/adi_slip_ball.xaml", new Point(175d, 313d), new Size(10d, 10d), new Point(5d, 5d)); Components.Add(_slipBallNeedle); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_guides.xaml", new Rect(0d, 0d, 350d, 350d))); Components.Add(new GaugeImage("{Helios}/Gauges/F-16/ADI/adi_bezel.png", new Rect(0d, 0d, 350d, 350d))); _slipBall = new HeliosValue(this, new BindingValue(0d), "", "side slip", "Side slip indicator offset.", "-1 to 1", BindingValueUnits.Numeric); _slipBall.Execute += new HeliosActionHandler(SlipBall_Execute); Actions.Add(_slipBall); _auxFlag = new HeliosValue(this, new BindingValue(false), "", "aux flag", "Indicates whether the aux flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _auxFlag.Execute += new HeliosActionHandler(AuxFlag_Execute); Actions.Add(_auxFlag); _offFlag = new HeliosValue(this, new BindingValue(false), "", "off flag", "Indicates whether the off flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _offFlag.Execute += new HeliosActionHandler(OffFlag_Execute); Actions.Add(_offFlag); _gsFlag = new HeliosValue(this, new BindingValue(false), "", "loc flag", "Indicates whether the loc flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _gsFlag.Execute += new HeliosActionHandler(GsFlag_Execute); Actions.Add(_gsFlag); _locFlag = new HeliosValue(this, new BindingValue(false), "", "gs flag", "Indicates whether the gs flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _locFlag.Execute += new HeliosActionHandler(LocFlag_Execute); Actions.Add(_locFlag); _pitch = new HeliosValue(this, new BindingValue(0d), "", "pitch", "Current ptich of the aircraft.", "(0 - 360)", BindingValueUnits.Degrees); _pitch.Execute += new HeliosActionHandler(Pitch_Execute); Actions.Add(_pitch); _roll = new HeliosValue(this, new BindingValue(0d), "", "roll", "Current roll of the aircraft.", "(0 - 360)", BindingValueUnits.Degrees); _roll.Execute += new HeliosActionHandler(Roll_Execute); Actions.Add(_roll); _ilsHorizontal = new HeliosValue(this, new BindingValue(1d), "", "ils horizontal deviation", "Current deviation from glide scope.", "-1 to 1", BindingValueUnits.Numeric); _ilsHorizontal.Execute += new HeliosActionHandler(ILSHorizontal_Execute); Actions.Add(_ilsHorizontal); _ilsVertical = new HeliosValue(this, new BindingValue(1d), "", "ils vertical deviation", "Current deviation from ILS side scope.", "-1 to 1", BindingValueUnits.Numeric); _ilsVertical.Execute += new HeliosActionHandler(ILSVertical_Execute); Actions.Add(_ilsVertical); }
void ClockHandSeconds_Execute(object action, HeliosActionEventArgs e) { _needle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue); }
void Deviation_Execute(object action, HeliosActionEventArgs e) { _courseDeviation.SetValue(e.Value, e.BypassCascadingTriggers); _deviationNeedle.HorizontalOffset = -_deviationCallibration.Interpolate(_courseDeviation.Value.DoubleValue); }
public ADI() : base("ADI", new Size(350, 350)) { Point center = new Point(174d, 163d); _pitchCalibration = new CalibrationPointCollectionDouble(-360d, -1066d, 360d, 1066d); _ball = new GaugeNeedle("{Helios}/Gauges/A-10/ADI/adi_ball.xaml", center, new Size(225d, 1350d), new Point(112.5d, 677d)); _ball.Clip = new EllipseGeometry(center, 113d, 113d); Components.Add(_ball); Components.Add(new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_inner_ring.xaml", new Rect(0d, 0d, 350d, 350d))); _slipBallCalibration = new CalibrationPointCollectionDouble(-1d, -26d, 1d, 26d); _slipBallNeedle = new GaugeNeedle("{Helios}/Gauges/A-10/ADI/adi_slip_ball.xaml", new Point(174d, 297d), new Size(10d, 10d), new Point(5d, 5d)); Components.Add(_slipBallNeedle); Components.Add(new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_guides.xaml", new Rect(0d, 0d, 350d, 350d))); _gsFlagImage = new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_gs_flag.xaml", new Rect(42d, 140d, 21d, 43d)); _gsFlagImage.IsHidden = true; Components.Add(_gsFlagImage); _offFlagImage = new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_off_flag.xaml", new Rect(58d, 210d, 55d, 56d)); _offFlagImage.IsHidden = true; Components.Add(_offFlagImage); _bankNeedle = new GaugeNeedle("{Helios}/Gauges/A-10/ADI/adi_bank_pointer.xaml", center, new Size(11d, 221d), new Point(5.5d, 110.5d)); Components.Add(_bankNeedle); _pitchBarCalibration = new CalibrationPointCollectionDouble(-1d, -150d, 1d, 150d); _pitchSteeringNeedle = new GaugeNeedle("{Helios}/Gauges/A-10/ADI/adi_pitch_steering_bar.xaml", new Point(0d, 163d), new Size(252d, 6d), new Point(0d, 3d)); _pitchSteeringNeedle.VerticalOffset = _pitchBarCalibration.Interpolate(-1d); Components.Add(_pitchSteeringNeedle); _bankBarCalibration = new CalibrationPointCollectionDouble(-1d, -128d, 1d, 134d); _bankSteeringNeedle = new GaugeNeedle("{Helios}/Gauges/A-10/ADI/adi_bank_steering_bar.xaml", new Point(175d, 0d), new Size(24d, 239d), new Point(23d, 0d)); _bankSteeringNeedle.HorizontalOffset = _bankBarCalibration.Interpolate(-1d); Components.Add(_bankSteeringNeedle); _courseFlagImage = new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_course_flag.xaml", new Rect(151d, 35d, 44d, 26d)); _courseFlagImage.IsHidden = true; Components.Add(_courseFlagImage); _gsCalibration = new CalibrationPointCollectionDouble(-1d, -66d, 1d, 66d); _gsIndicatorNeedle = new GaugeNeedle("{Helios}/Gauges/A-10/ADI/adi_gs_indicator.xaml", new Point(44d, 163d), new Size(14d, 12d), new Point(1d, 6d)); Components.Add(_gsIndicatorNeedle); Components.Add(new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_outer_ring.xaml", new Rect(0d, 0d, 350d, 350d))); Components.Add(new GaugeImage("{Helios}/Gauges/A-10/ADI/adi_bezel.png", new Rect(0d, 0d, 350d, 350d))); _slipBall = new HeliosValue(this, new BindingValue(0d), "", "Slip Ball Offset", "Side slip indicator offset from the center of the tube.", "(-1 to 1) -1 full left and 1 is full right.", BindingValueUnits.Numeric); _slipBall.Execute += new HeliosActionHandler(SlipBall_Execute); Actions.Add(_slipBall); _offFlag = new HeliosValue(this, new BindingValue(false), "", "Off Flag", "Indicates whether the off flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _offFlag.Execute += new HeliosActionHandler(OffFlag_Execute); Actions.Add(_offFlag); _gsFlag = new HeliosValue(this, new BindingValue(false), "", "Glide Slope Flag", "Indicates whether the glide scope flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _gsFlag.Execute += new HeliosActionHandler(GsFlag_Execute); Actions.Add(_gsFlag); _courseFlag = new HeliosValue(this, new BindingValue(false), "", "Course Flag", "Indicates whether the course flag is displayed.", "True if displayed.", BindingValueUnits.Boolean); _courseFlag.Execute += new HeliosActionHandler(CourseFlag_Execute); Actions.Add(_courseFlag); _pitch = new HeliosValue(this, new BindingValue(0d), "", "Pitch", "Current ptich of the aircraft.", "(0 - 360)", BindingValueUnits.Degrees); _pitch.Execute += new HeliosActionHandler(Pitch_Execute); Actions.Add(_pitch); _roll = new HeliosValue(this, new BindingValue(0d), "", "Bank", "Current bank of the aircraft.", "(0 - 360)", BindingValueUnits.Degrees); _roll.Execute += new HeliosActionHandler(Bank_Execute); Actions.Add(_roll); _bankSteering = new HeliosValue(this, new BindingValue(1d), "", "Bank steering bar offset", "Location of bank steering bar.", "(-1 to 1) -1 full left and 1 is full right.", BindingValueUnits.Numeric); _bankSteering.Execute += new HeliosActionHandler(BankSteering_Execute); Actions.Add(_bankSteering); _pitchSteering = new HeliosValue(this, new BindingValue(1d), "", "Pitch steering bar offset", "Location of pitch steering bar.", "(-1 to 1) 1 full up and -1 is full down.", BindingValueUnits.Numeric); _pitchSteering.Execute += new HeliosActionHandler(PitchSteering_Execute); Actions.Add(_pitchSteering); _gsIndicator = new HeliosValue(this, new BindingValue(0d), "", "Glide Scope Indicator Offset", "Location of glide scope indicator from middle of the scale.", "(-1 to 1) 1 full up and -1 is full down.", BindingValueUnits.Numeric); _gsIndicator.Execute += new HeliosActionHandler(GsIndicator_Execute); Actions.Add(_gsIndicator); }
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; }
private void LongDeviation_Execute(object action, HeliosActionEventArgs e) { _longDeviation.SetValue(e.Value, e.BypassCascadingTriggers); _longDeviationNeedle.VerticalOffset = _deviationScale.Interpolate(e.Value.DoubleValue); }
private void Altitude_Execute(object action, HeliosActionEventArgs e) { _altitude.SetValue(e.Value, e.BypassCascadingTriggers); _shortNeedle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue / 1000d); _longNeedle.Rotation = _needleCalibration.Interpolate((e.Value.DoubleValue % 1000d) / 100d); }
private void Pressure_Execute(object action, HeliosActionEventArgs e) { _qfePressure.SetValue(e.Value, e.BypassCascadingTriggers); _qfeCard.Rotation = -_qfeCalibration.Interpolate(e.Value.DoubleValue); }
void Pitch_Execute(object action, HeliosActionEventArgs e) { _pitch.SetValue(e.Value, e.BypassCascadingTriggers); _ball.VerticalOffset = _pitchCalibration.Interpolate(e.Value.DoubleValue); }
// Event callback for angle updates void AOA_Execute(object action, HeliosActionEventArgs e) { // Interpolate needle rotation based upon angle of attack input _needle.Rotation = -_needleCalibration.Interpolate(e.Value.DoubleValue); }
void cabinAltitude_Execute(object action, HeliosActionEventArgs e) { _needle.Rotation = _calibrationPoints.Interpolate(e.Value.DoubleValue); }
void Angle_Execute(object action, HeliosActionEventArgs e) { _needle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue); }
void Pitch_Execute(object action, HeliosActionEventArgs e) { _ball.VerticalOffset = _pitchCalibration.Interpolate(e.Value.DoubleValue); }
void AngleOfAttack_Execute(object action, HeliosActionEventArgs e) { _angleOfAttack.SetValue(e.Value, e.BypassCascadingTriggers); _aoaNeedle.VerticalOffset = _tapeCalibration.Interpolate(_angleOfAttack.Value.DoubleValue); }
void VerticalVelocity_Execute(object action, HeliosActionEventArgs e) { _needle.Rotation = _calibrationPoints.Interpolate(e.Value.DoubleValue); }
void ILSVertical_Execute(object action, HeliosActionEventArgs e) { _ilsVertical.SetValue(e.Value, e.BypassCascadingTriggers); _ilsVerticalNeedle.VerticalOffset = _ilsCalibration.Interpolate(e.Value.DoubleValue); }
private void CurrentO2Pressure_Execute(object action, HeliosActionEventArgs e) { _currentO2Pressure.SetValue(e.Value, e.BypassCascadingTriggers); _currentNeedle.Rotation = _needleCalibration.Interpolate(e.Value.DoubleValue); }
public static void OnZoomLevelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PreviewContent pc = (PreviewContent)d; pc.Preview.ZoomFactor = _zoomCalibration.Interpolate((double)e.NewValue); }