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-20 17:35:49 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-09-20 17:35:49 +0300
commit1e5d6d1b458aa963e6ddcd9b15d692a274acd561 (patch)
treee529e531c8b3a8b37bbc9c1a2edb4a8b50572323 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems
parent7a113fa2131b107c644c07fc0a2e7f4bc17b218f (diff)
downloadTango-1e5d6d1b458aa963e6ddcd9b15d692a274acd561.tar.gz
Tango-1e5d6d1b458aa963e6ddcd9b15d692a274acd561.zip
Implemented Heater widget on tech board!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs22
1 files changed, 21 insertions, 1 deletions
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 e1221e1f2..c1b876e9b 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
@@ -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.PMR.Diagnostics;
using Tango.SharedUI.Helpers;
@@ -18,6 +19,8 @@ namespace Tango.MachineStudio.Technician.TechItems
[TechItem(10)]
public class HeaterItem : TechItem
{
+ public event Action SetCommandClicked;
+
private TechHeater _techHeater;
/// <summary>
/// Gets or sets the db tech monitor.
@@ -28,6 +31,12 @@ namespace Tango.MachineStudio.Technician.TechItems
get { return _techHeater; }
set { _techHeater = value; RaisePropertyChangedAuto(); TechName = _techHeater != null ? _techHeater.Description : null; ItemGuid = value != null ? value.Guid : null; }
}
+
+ /// <summary>
+ /// Gets or sets the set command.
+ /// </summary>
+ public RelayCommand SetCommand { get; set; }
+
/// <summary>
/// Initializes a new instance of the <see cref="HeaterItem"/> class.
/// </summary>
@@ -37,6 +46,8 @@ namespace Tango.MachineStudio.Technician.TechItems
Color = Colors.White;
Description = "Heater Controller";
Image = ResourceHelper.GetImageFromResources("Images/heater-controller.png");
+ SetCommand = new RelayCommand(() => { SetCommandClicked?.Invoke(); }, (x) => HeaterState.CurrentValue != SetPoint);
+ HeaterState = new HeaterState();
}
/// <summary>
@@ -55,7 +66,16 @@ namespace Tango.MachineStudio.Technician.TechItems
public HeaterState HeaterState
{
get { return _heaterState; }
- set { _heaterState = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _heaterState = value;
+ RaisePropertyChangedAuto();
+
+ InvokeUI(() =>
+ {
+ SetCommand.RaiseCanExecuteChanged();
+ });
+ }
}
private double _setPoint;