aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-09-25 15:58:28 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-09-25 15:58:28 +0300
commitaeb14d2d27e479a88cb638c91be77454d250e19b (patch)
tree4afedb40bd3c020c3bf39a0b733419551b026109 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems
parent94b83ea6d7e62534219801dcf1d53ee6e187837d (diff)
downloadTango-aeb14d2d27e479a88cb638c91be77454d250e19b.tar.gz
Tango-aeb14d2d27e479a88cb638c91be77454d250e19b.zip
Implemented new single value controller widget.
Implemented new blower controller. Changed tech board styles to dark.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs40
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs1
3 files changed, 51 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs
index 6b532204e..f581988f7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs
@@ -7,6 +7,7 @@ using System.Windows.Media;
using System.Xml.Serialization;
using Tango.BL;
using Tango.BL.Entities;
+using Tango.Core.Commands;
using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
@@ -18,6 +19,8 @@ namespace Tango.MachineStudio.Technician.TechItems
[TechItem(16)]
public class BlowerItem : TechItem
{
+ public event EventHandler<bool> SetCommandClicked;
+
private static List<HardwareBlower> _BlowerConfigurations;
/// <summary>
/// Gets or sets the Blower configurations.
@@ -68,6 +71,36 @@ namespace Tango.MachineStudio.Technician.TechItems
set { _hardwareBlower = value; RaisePropertyChangedAuto(); }
}
+ private bool _isActive;
+ [XmlIgnore]
+ public bool IsActive
+ {
+ get { return _isActive; }
+ set { _isActive = value; RaisePropertyChangedAuto(); }
+ }
+
+ private bool _effectiveActive;
+ [XmlIgnore]
+ public bool EffectiveActive
+ {
+ get { return _effectiveActive; }
+ set
+ {
+ _effectiveActive = value;
+ RaisePropertyChangedAuto();
+ IsActive = _effectiveActive;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the set command.
+ /// </summary>
+ [XmlIgnore]
+ public RelayCommand SetCommand { get; set; }
+
+ [XmlIgnore]
+ public RelayCommand ToggleActiveCommand { get; set; }
+
/// <summary>
/// Initializes a new instance of the <see cref="BlowerItem"/> class.
/// </summary>
@@ -78,6 +111,13 @@ namespace Tango.MachineStudio.Technician.TechItems
Image = ResourceHelper.GetImageFromResources("Images/blower.png");
Color = Colors.White;
HardwareBlower = new HardwareBlower();
+
+ SetCommand = new RelayCommand(() => { SetCommandClicked?.Invoke(this, _isActive); });
+
+ ToggleActiveCommand = new RelayCommand(() =>
+ {
+ SetCommandClicked?.Invoke(this, _isActive);
+ });
}
/// <summary>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs
index 8a9cba883..2d8763f74 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using System.Windows.Media;
using System.Xml.Serialization;
using Tango.BL.Entities;
+using Tango.Core.Commands;
using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
@@ -17,10 +18,7 @@ namespace Tango.MachineStudio.Technician.TechItems
[TechItem(10)]
public class ControllerItem : TechItem
{
- /// <summary>
- /// Occurs when the controller value has changed.
- /// </summary>
- public event EventHandler<double> ValueChanged;
+ public event EventHandler SetCommandClicked;
private TechController _techController;
/// <summary>
@@ -56,7 +54,6 @@ namespace Tango.MachineStudio.Technician.TechItems
set
{
_value = value; RaisePropertyChangedAuto();
- ValueChanged?.Invoke(this, _value);
}
}
@@ -120,6 +117,12 @@ namespace Tango.MachineStudio.Technician.TechItems
public bool IsSetToDefault { get; set; }
/// <summary>
+ /// Gets or sets the set command.
+ /// </summary>
+ [XmlIgnore]
+ public RelayCommand SetCommand { get; set; }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="ControllerItem"/> class.
/// </summary>
public ControllerItem() : base()
@@ -130,6 +133,8 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.DodgerBlue;
LastUpdateTime = DateTime.Now;
UpdateInterval = 10;
+
+ SetCommand = new RelayCommand(() => { SetCommandClicked?.Invoke(this, new EventArgs()); });
}
/// <summary>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs
index c1b876e9b..e91c3f185 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs
@@ -35,6 +35,7 @@ namespace Tango.MachineStudio.Technician.TechItems
/// <summary>
/// Gets or sets the set command.
/// </summary>
+ [XmlIgnore]
public RelayCommand SetCommand { get; set; }
/// <summary>