Skip to content

Commit 7185360

Browse files
committed
2 parents 3b26a51 + 6d1a2e6 commit 7185360

File tree

3 files changed

+13
-49
lines changed

3 files changed

+13
-49
lines changed

Helios/Controls/CustomGaugeNeedle.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ public CustomGaugeNeedle(string imageFile, Point location, Size size, Point cent
4949
_baseRotation = baseRotation;
5050
}
5151

52-
#region Properties
53-
public bool ImageRefresh { get; set; }
52+
#region Properties
5453

55-
public string Image { get; set; }
54+
public string Image { get; set; }
5655

5756

5857
public double Tape_Width
@@ -216,20 +215,11 @@ protected override void OnRefresh(double xScale, double yScale)
216215
_yScale = yScale;
217216

218217
_rectangle = new Rect(0d, 0d, Math.Max(1d, _size.Width * xScale), Math.Max(1d, _size.Height * yScale));
219-
220-
if (ImageRefresh && ConfigManager.ImageManager is IImageManager3 refreshCapable)
221-
{
222-
_image = refreshCapable.LoadImage(Image, (int)_rectangle.Width, (int)_rectangle.Height, LoadImageOptions.ReloadIfChangedExternally);
223-
}
224-
else
225-
{
226-
_image = ConfigManager.ImageManager.LoadImage(Image, (int)_rectangle.Width, (int)_rectangle.Height);
227-
}
228-
229-
if (_image == null)
218+
_image = ConfigManager.ImageManager.LoadImage(Image, (int)_rectangle.Width, (int)_rectangle.Height);
219+
if (_image == null)
230220
{
231221
_image = ConfigManager.ImageManager.LoadImage("{Helios}/Images/General/missing_image.png", (int)_rectangle.Width, (int)_rectangle.Height);
232222
}
233-
}
223+
}
234224
}
235225
}

Helios/Controls/CustomTape.cs

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ namespace GadrocsWorkshop.Helios.Controls
2020
using System.Windows;
2121
using System.Windows.Media;
2222
using System.Xml;
23-
using System;
2423

2524
[HeliosControl("Helios.Base.CustomTape", "Custom Tape", "Custom Controls", typeof(Gauges.GaugeRenderer))]
2625

@@ -67,19 +66,20 @@ public class CustomTape : Gauges.BaseGauge
6766
private double _minInputRotation = 0d;
6867
private double _maxInputRotation = 1d;
6968

70-
private bool _imageRefresh;
71-
private HeliosValue _tapeImageRefresh;
7269

73-
public CustomTape()
70+
71+
72+
73+
74+
public CustomTape()
7475
: base("CustomTape", new Size(200d, 200d))
7576
{
7677
_Background = new Gauges.GaugeImage(_backgroundImage, new Rect(0, 0, _gaugeWidth, _gaugeHeight));
7778
Components.Add(_Background);
7879

7980
_Tape = new Gauges.CustomGaugeNeedle(_tapeImage, new Point(0, 0), new Size(200, 200), new Point(100, 100));
8081
_Tape.Clip = new RectangleGeometry(new Rect(1d, 1d,198d, 198d));
81-
Components.Add(_Tape);
82-
82+
Components.Add(_Tape);
8383

8484
_OffFlag = new Gauges.GaugeImage(_offFlagImage, new Rect(1d, 1d,55d, 55d));
8585
_OffFlag.IsHidden = false;
@@ -107,27 +107,10 @@ public CustomTape()
107107
_tapeRotation.Execute += new HeliosActionHandler(TapeRotation_Execute);
108108
Actions.Add(_tapeRotation);
109109
Values.Add(_tapeRotation);
110-
111-
_tapeImageRefresh = new HeliosValue(this, new BindingValue(false), "", "Tape Image Reload", "Indicates a reload of the Tape image", "True if reloaded.", BindingValueUnits.Boolean);
112-
_tapeImageRefresh.Execute += new HeliosActionHandler(TapeImageRefresh_Execute);
113-
Actions.Add(_tapeImageRefresh);
114-
Values.Add(_tapeImageRefresh);
115110
}
116111

117112

118-
#region Properties
119-
120-
public bool ImageRefresh
121-
{
122-
get { return _imageRefresh; }
123-
set
124-
{
125-
var oldValue = _imageRefresh;
126-
_imageRefresh = value;
127-
_Tape.ImageRefresh = _imageRefresh;
128-
OnPropertyChanged("ImageRefresh", oldValue, value, true);
129-
}
130-
}
113+
#region Properties
131114

132115
public string TapeImage
133116
{
@@ -743,13 +726,6 @@ public override void Reset()
743726

744727
#region Actions
745728

746-
void TapeImageRefresh_Execute(object action, HeliosActionEventArgs e)
747-
{
748-
_tapeImageRefresh.SetValue(e.Value, e.BypassCascadingTriggers);
749-
ImageRefresh = true;
750-
Refresh();
751-
}
752-
753729
void OffFlag_Execute(object action, HeliosActionEventArgs e)
754730
{
755731
_offFlag.SetValue(e.Value, e.BypassCascadingTriggers);
@@ -783,7 +759,6 @@ void TapeRotation_Execute(object action, HeliosActionEventArgs e)
783759

784760
public override void WriteXml(XmlWriter writer)
785761
{
786-
787762
base.WriteXml(writer);
788763

789764
writer.WriteElementString("TapeImage", TapeImage);
@@ -821,7 +796,6 @@ public override void WriteXml(XmlWriter writer)
821796

822797
public override void ReadXml(XmlReader reader)
823798
{
824-
825799
base.ReadXml(reader);
826800

827801
TapeImage = reader.ReadElementString("TapeImage");

publish.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
REM output location (you will need to change this for your local folder structure)
3-
set HELIOS_SHARE_FOLDER=d:\google\derammo.github\Helios
3+
set HELIOS_SHARE_FOLDER=C:\google\wheelchock.github\Helios
44

55
REM arguments and validation
66
set HELIOS_BUILT_VERSION=%1

0 commit comments

Comments
 (0)