diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-08-04 16:50:29 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-08-04 16:50:29 +0300 |
| commit | 4fb8ff57dcd3bce39ac54d4c52cef091df8c570b (patch) | |
| tree | c259fb8fc9991ae504ff1994333444e7fe88c95c /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems | |
| parent | df9efa378c7741e325b0de775cf7b33634b9f8b3 (diff) | |
| download | Tango-4fb8ff57dcd3bce39ac54d4c52cef091df8c570b.tar.gz Tango-4fb8ff57dcd3bce39ac54d4c52cef091df8c570b.zip | |
Implemented Blower, Break Sensor in Tech Board.
Added to uploaded hardware config. !!!!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems')
3 files changed, 206 insertions, 0 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 new file mode 100644 index 000000000..59a96f107 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Xml.Serialization; +using Tango.BL.Entities; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Technician.TechItems +{ + /// <summary> + /// Represents a Blower controller item. + /// </summary> + /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" /> + [TechItem(16)] + public class BlowerItem : TechItem + { + private static List<HardwareBlower> _BlowerConfigurations; + /// <summary> + /// Gets or sets the Blower configurations. + /// </summary> + public static List<HardwareBlower> BlowerConfigurations + { + get { return _BlowerConfigurations; } + set { _BlowerConfigurations = value; } + } + + static BlowerItem() + { + BlowerConfigurations = new List<HardwareBlower>(); + + foreach (var BlowerType in BL.ObservablesEntitiesAdapter.Instance.HardwareBlowerTypes) + { + BlowerConfigurations.Add(new HardwareBlower() { HardwareBlowerType = BlowerType }); + } + } + + private HardwareBlowerType _hardwareBlowerType; + /// <summary> + /// Gets or sets the type of the hardware Blower. + /// </summary> + [XmlIgnore] + public HardwareBlowerType HardwareBlowerType + { + get { return _hardwareBlowerType; } + set + { + _hardwareBlowerType = value; RaisePropertyChangedAuto(); TechName = _hardwareBlowerType != null ? _hardwareBlowerType.Description : null; ItemGuid = value != null ? value.Guid : null; + + if (_hardwareBlowerType != null) + { + HardwareBlower = BlowerConfigurations.SingleOrDefault(x => x.HardwareBlowerType == _hardwareBlowerType); + } + } + } + + private HardwareBlower _hardwareBlower; + /// <summary> + /// Gets or sets the hardware Blower. + /// </summary> + [XmlIgnore] + public HardwareBlower HardwareBlower + { + get { return _hardwareBlower; } + set { _hardwareBlower = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Initializes a new instance of the <see cref="BlowerItem"/> class. + /// </summary> + public BlowerItem() : base() + { + Name = "Blower"; + Description = "Blower Controller"; + Image = ResourceHelper.GetImageFromResources("Images/blower.png"); + Color = Colors.White; + HardwareBlower = new HardwareBlower(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="BlowerItem"/> class. + /// </summary> + /// <param name="BlowerType">Type of the Blower.</param> + public BlowerItem(HardwareBlowerType BlowerType) : this() + { + HardwareBlowerType = BlowerType; + } + + /// <summary> + /// Clones this instance. + /// </summary> + /// <returns></returns> + public override TechItem Clone() + { + BlowerItem cloned = base.Clone() as BlowerItem; + cloned.HardwareBlowerType = HardwareBlowerType; + return cloned; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs new file mode 100644 index 000000000..cf1ed682e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Xml.Serialization; +using Tango.BL.Entities; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Technician.TechItems +{ + /// <summary> + /// Represents a BreakSensor controller item. + /// </summary> + /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" /> + [TechItem(17)] + public class BreakSensorItem : TechItem + { + private static List<HardwareBreakSensor> _BreakSensorConfigurations; + /// <summary> + /// Gets or sets the BreakSensor configurations. + /// </summary> + public static List<HardwareBreakSensor> BreakSensorConfigurations + { + get { return _BreakSensorConfigurations; } + set { _BreakSensorConfigurations = value; } + } + + static BreakSensorItem() + { + BreakSensorConfigurations = new List<HardwareBreakSensor>(); + + foreach (var BreakSensorType in BL.ObservablesEntitiesAdapter.Instance.HardwareBreakSensorTypes) + { + BreakSensorConfigurations.Add(new HardwareBreakSensor() { HardwareBreakSensorType = BreakSensorType }); + } + } + + private HardwareBreakSensorType _hardwareBreakSensorType; + /// <summary> + /// Gets or sets the type of the hardware BreakSensor. + /// </summary> + [XmlIgnore] + public HardwareBreakSensorType HardwareBreakSensorType + { + get { return _hardwareBreakSensorType; } + set + { + _hardwareBreakSensorType = value; RaisePropertyChangedAuto(); TechName = _hardwareBreakSensorType != null ? _hardwareBreakSensorType.Description : null; ItemGuid = value != null ? value.Guid : null; + + if (_hardwareBreakSensorType != null) + { + HardwareBreakSensor = BreakSensorConfigurations.SingleOrDefault(x => x.HardwareBreakSensorType == _hardwareBreakSensorType); + } + } + } + + private HardwareBreakSensor _hardwareBreakSensor; + /// <summary> + /// Gets or sets the hardware BreakSensor. + /// </summary> + [XmlIgnore] + public HardwareBreakSensor HardwareBreakSensor + { + get { return _hardwareBreakSensor; } + set { _hardwareBreakSensor = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Initializes a new instance of the <see cref="BreakSensorItem"/> class. + /// </summary> + public BreakSensorItem() : base() + { + Name = "Break Sensor"; + Description = "Break Sensor Controller"; + Image = ResourceHelper.GetImageFromResources("Images/break.png"); + Color = Colors.White; + HardwareBreakSensor = new HardwareBreakSensor(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="BreakSensorItem"/> class. + /// </summary> + /// <param name="BreakSensorType">Type of the BreakSensor.</param> + public BreakSensorItem(HardwareBreakSensorType BreakSensorType) : this() + { + HardwareBreakSensorType = BreakSensorType; + } + + /// <summary> + /// Clones this instance. + /// </summary> + /// <returns></returns> + public override TechItem Clone() + { + BreakSensorItem cloned = base.Clone() as BreakSensorItem; + cloned.HardwareBreakSensorType = HardwareBreakSensorType; + return cloned; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs index a1aba597b..11188c69d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs @@ -34,6 +34,8 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlInclude(typeof(WinderItem))] [XmlInclude(typeof(DancerItem))] [XmlInclude(typeof(SpeedSensorItem))] + [XmlInclude(typeof(BlowerItem))] + [XmlInclude(typeof(BreakSensorItem))] [XmlInclude(typeof(ProcessParametersItem))] [XmlInclude(typeof(JobRunnerItem))] public abstract class TechItem : ExtendedObject |
