From fccf28feafb784d16603a8ce1cdeddc57be9471d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 17 Sep 2018 18:01:34 +0300 Subject: Started working on tech heaters. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 15400960 -> 15400960 bytes Software/Graphics/heater-controller.png | Bin 0 -> 1136 bytes .../PMR/Messages/Diagnostics/HeaterState.proto | 16 ++ Software/PMR/Messages/Diagnostics/HeaterType.proto | 31 +++ .../Diagnostics/SetHeaterStateRequest.proto | 13 + .../Diagnostics/SetHeaterStateResponse.proto | 9 + .../Diagnostics/StartDiagnosticsResponse.proto | 4 + .../Editors/HeaterElementEditor.xaml | 94 +++++++ .../Editors/HeaterElementEditor.xaml.cs | 102 +++++++ .../Images/heater-controller.png | Bin 0 -> 1136 bytes .../Tango.MachineStudio.Technician.csproj | 13 +- .../TechItems/HeaterItem.cs | 82 ++++++ .../TechItems/TechItem.cs | 1 + .../Visual_Studio/Tango.BL/Entities/TechHeater.cs | 101 +++++++ .../Tango.BL/Enumerations/EventTypes.cs | 6 + .../Tango.BL/Enumerations/TechHeaters.cs | 47 ++++ .../Visual_Studio/Tango.BL/ObservablesContext.cs | 8 + .../ObservablesEntitiesAdapterExtension.cs | 38 +++ .../Tango.BL/ObservablesStaticCollections.cs | 1 + .../ObservablesStaticCollectionsExtension.cs | 38 +++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 3 +- .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 36 +++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 133 ++++----- .../Tango.DAL.Remote/DB/TECH_HEATERS.cs | 24 ++ .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 5 +- .../Tango.PMR/Diagnostics/HeaterState.cs | 303 +++++++++++++++++++++ .../Tango.PMR/Diagnostics/HeaterType.cs | 51 ++++ .../Tango.PMR/Diagnostics/SetHeaterStateRequest.cs | 218 +++++++++++++++ .../Diagnostics/SetHeaterStateResponse.cs | 131 +++++++++ .../Diagnostics/StartDiagnosticsResponse.cs | 43 ++- Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 6 +- .../Utilities/Tango.PMRGenerator.CLI/Program.cs | 23 ++ 34 files changed, 1502 insertions(+), 79 deletions(-) create mode 100644 Software/Graphics/heater-controller.png create mode 100644 Software/PMR/Messages/Diagnostics/HeaterState.proto create mode 100644 Software/PMR/Messages/Diagnostics/HeaterType.proto create mode 100644 Software/PMR/Messages/Diagnostics/SetHeaterStateRequest.proto create mode 100644 Software/PMR/Messages/Diagnostics/SetHeaterStateResponse.proto create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/heater-controller.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterState.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterType.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateRequest.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateResponse.cs (limited to 'Software') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index f6cd64958..799dc0f37 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index bbc28ea0b..ab520a1f0 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/heater-controller.png b/Software/Graphics/heater-controller.png new file mode 100644 index 000000000..71d6698ec Binary files /dev/null and b/Software/Graphics/heater-controller.png differ diff --git a/Software/PMR/Messages/Diagnostics/HeaterState.proto b/Software/PMR/Messages/Diagnostics/HeaterState.proto new file mode 100644 index 000000000..2227dea7c --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/HeaterState.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +import "HeaterType.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message HeaterState +{ + HeaterType HeaterType = 1; + double SetPoint = 2; + double CurrentValue = 3; + bool IsActive = 4; + bool IsRampingUp = 5; + bool IsInSetPoint = 6; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/HeaterType.proto b/Software/PMR/Messages/Diagnostics/HeaterType.proto new file mode 100644 index 000000000..156152d6c --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/HeaterType.proto @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Tango PMR Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// +//------------------------------------------------------------------------------ + +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +enum HeaterType +{ + + HeaterZone1 = 0; + + HeaterZone2 = 1; + + HeaterZone3 = 2; + + HeaterZone4 = 3; + + HeaterZone5 = 4; + + HeaterZone6 = 5; + +} diff --git a/Software/PMR/Messages/Diagnostics/SetHeaterStateRequest.proto b/Software/PMR/Messages/Diagnostics/SetHeaterStateRequest.proto new file mode 100644 index 000000000..e1553d50a --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/SetHeaterStateRequest.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +import "HeaterType.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message SetHeaterStateRequest +{ + HeaterType HeaterType = 1; + double SetPoint = 2; + bool IsActive = 3; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/SetHeaterStateResponse.proto b/Software/PMR/Messages/Diagnostics/SetHeaterStateResponse.proto new file mode 100644 index 000000000..876abd9fc --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/SetHeaterStateResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message SetHeaterStateResponse +{ + +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/StartDiagnosticsResponse.proto b/Software/PMR/Messages/Diagnostics/StartDiagnosticsResponse.proto index 2f03d00fd..cb1ff43b7 100644 --- a/Software/PMR/Messages/Diagnostics/StartDiagnosticsResponse.proto +++ b/Software/PMR/Messages/Diagnostics/StartDiagnosticsResponse.proto @@ -3,6 +3,7 @@ syntax = "proto3"; import "DigitalInterfaceState.proto"; import "ValueComponentState.proto"; import "DiagnosticsMonitors.proto"; +import "HeaterState.proto"; package Tango.PMR.Diagnostics; option java_package = "com.twine.tango.pmr.diagnostics"; @@ -17,4 +18,7 @@ message StartDiagnosticsResponse //Value Components Effective Values repeated ValueComponentState ComponentsStates = 3; + + //Heaters States + repeated HeaterState HeatersStates = 4; } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml new file mode 100644 index 000000000..f72c5ad08 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml.cs new file mode 100644 index 000000000..b0b28454a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Editors; +using Tango.BL.Entities; +using Tango.MachineStudio.Technician.TechItems; +using Tango.Core; + +namespace Tango.MachineStudio.Technician.Editors +{ + [ContentProperty("InnerContent")] + public partial class HeaterElementEditor : ElementEditor + { + /// + /// Initializes a new instance of the class. + /// + public HeaterElementEditor() + : base() + { + InitializeComponent(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The framework element. + public HeaterElementEditor(HeaterItem heaterItem) + : this() + { + HeaterItem = heaterItem; + DataContext = HeaterItem; + } + + /// + /// Initializes a new instance of the class. + /// + /// The framework element. + /// The bounds. + public HeaterElementEditor(HeaterItem heaterItem, Rect bounds) + : this(heaterItem) + { + Left = bounds.Left; + Top = bounds.Top; + Width = bounds.Width; + Height = bounds.Height; + } + + private HeaterItem _heaterItem; + public HeaterItem HeaterItem + { + get { return _heaterItem; } + set { _heaterItem = value; RaisePropertyChanged(nameof(HeaterItem)); } + } + + + /// + /// Clones this instance. + /// + /// + public override IElementEditor Clone() + { + try + { + var clonedItem = HeaterItem.Clone() as HeaterItem; + HeaterElementEditor cloned = new HeaterElementEditor(clonedItem); + cloned.Top = Top; + cloned.Left = Left; + cloned.Width = Width; + cloned.Height = Height; + cloned.Angle = Angle; + return cloned; + } + catch (Exception ex) + { + throw new InvalidOperationException("Could not clone this editor. You may have to create a custom editor and implement a custom Clone method.", ex); + } + } + + /// + /// Gets the hosted element. + /// + [ParameterIgnore] + public override Object HostedElement + { + get { return HeaterItem; } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/heater-controller.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/heater-controller.png new file mode 100644 index 000000000..71d6698ec Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/heater-controller.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj index 73039bc4b..21fcf3e24 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj @@ -100,6 +100,9 @@ + + HeaterElementEditor.xaml + TextElementEditor.xaml @@ -233,6 +236,7 @@ + @@ -258,6 +262,10 @@ MachineTechView.xaml + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -634,10 +642,13 @@ + + + - + \ No newline at end of file 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 new file mode 100644 index 000000000..e1221e1f2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/HeaterItem.cs @@ -0,0 +1,82 @@ +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.PMR.Diagnostics; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Technician.TechItems +{ + /// + /// Represents a heater controller. + /// + /// + [TechItem(10)] + public class HeaterItem : TechItem + { + private TechHeater _techHeater; + /// + /// Gets or sets the db tech monitor. + /// + [XmlIgnore] + public TechHeater TechHeater + { + get { return _techHeater; } + set { _techHeater = value; RaisePropertyChangedAuto(); TechName = _techHeater != null ? _techHeater.Description : null; ItemGuid = value != null ? value.Guid : null; } + } + /// + /// Initializes a new instance of the class. + /// + public HeaterItem() : base() + { + Name = "Heater Controller"; + Color = Colors.White; + Description = "Heater Controller"; + Image = ResourceHelper.GetImageFromResources("Images/heater-controller.png"); + } + + /// + /// Initializes a new instance of the class. + /// + /// The db tech monitor. + public HeaterItem(TechHeater techHeater) : this() + { + TechHeater = techHeater; + } + + private HeaterState _heaterState; + /// + /// Gets or sets the state of the heater. + /// + public HeaterState HeaterState + { + get { return _heaterState; } + set { _heaterState = value; RaisePropertyChangedAuto(); } + } + + private double _setPoint; + /// + /// Gets or sets the set point. + /// + public double SetPoint + { + get { return _setPoint; } + set { _setPoint = value; RaisePropertyChangedAuto(); } + } + + /// + /// Clones this instance. + /// + /// + public override TechItem Clone() + { + HeaterItem cloned = base.Clone() as HeaterItem; + cloned.TechHeater = TechHeater; + 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 04b6c1fab..0d7568d68 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 @@ -39,6 +39,7 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlInclude(typeof(ProcessParametersItem))] [XmlInclude(typeof(JobRunnerItem))] [XmlInclude(typeof(TextItem))] + [XmlInclude(typeof(HeaterItem))] public abstract class TechItem : ExtendedObject { /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs b/Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs new file mode 100644 index 000000000..5ebf86451 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs @@ -0,0 +1,101 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; +using System.Linq; +using Tango.DAL.Remote.DB; +using Tango.Core; + +namespace Tango.BL.Entities +{ + [Table("TECH_HEATERS")] + public partial class TechHeater : ObservableEntity + { + + protected Int32 _code; + + /// + /// Gets or sets the techheater code. + /// + + [Column("CODE")] + + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + protected String _name; + + /// + /// Gets or sets the techheater name. + /// + + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + protected String _description; + + /// + /// Gets or sets the techheater description. + /// + + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + _description = value; RaisePropertyChanged(nameof(Description)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public TechHeater() : base() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/EventTypes.cs b/Software/Visual_Studio/Tango.BL/Enumerations/EventTypes.cs index 7d1b7cda3..b4fc2b82a 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/EventTypes.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/EventTypes.cs @@ -907,6 +907,12 @@ namespace Tango.BL.Enumerations [Description(" Motor Dispenser 7 Under Voltage")] MotorDispenser7UnderVoltage = 155, + /// + /// ( Motor Dispenser 8 Under Voltage) + /// + [Description(" Motor Dispenser 8 Under Voltage")] + MotorDispenser8UnderVoltage = 156, + /// /// (Occurs a request has been sent to the machine or external bridge service) /// diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/TechHeaters.cs b/Software/Visual_Studio/Tango.BL/Enumerations/TechHeaters.cs index 075422bb7..45e72beee 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/TechHeaters.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/TechHeaters.cs @@ -1,3 +1,13 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// +//------------------------------------------------------------------------------ + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -8,5 +18,42 @@ namespace Tango.BL.Enumerations { public enum TechHeaters { + + /// + /// (Heater Zone 1) + /// + [Description("Heater Zone 1")] + HeaterZone1 = 0, + + /// + /// (Heater Zone 2) + /// + [Description("Heater Zone 2")] + HeaterZone2 = 1, + + /// + /// (Heater Zone 3) + /// + [Description("Heater Zone 3")] + HeaterZone3 = 2, + + /// + /// (Heater Zone 4) + /// + [Description("Heater Zone 4")] + HeaterZone4 = 3, + + /// + /// (Heater Zone 5) + /// + [Description("Heater Zone 5")] + HeaterZone5 = 4, + + /// + /// (Heater Zone 6) + /// + [Description("Heater Zone 6")] + HeaterZone6 = 5, + } } diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs index b9c11fc8d..0c8557173 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs @@ -574,6 +574,14 @@ namespace Tango.BL get; set; } + /// + /// Gets or sets the TechHeaters. + /// + public DbSet TechHeaters + { + get; set; + } + /// /// Gets or sets the TechIos. /// diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs index 9d564192e..dbe06364a 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs @@ -2501,6 +2501,42 @@ namespace Tango.BL } + private ObservableCollection _techheaters; + /// + /// Gets or sets the TechHeaters. + /// + public ObservableCollection TechHeaters + { + get + { + return _techheaters; + } + + set + { + _techheaters = value; RaisePropertyChanged(nameof(TechHeaters)); + } + + } + + private ICollectionView _techheatersViewSource; + /// + /// Gets or sets the TechHeaters View Source. + /// + public ICollectionView TechHeatersViewSource + { + get + { + return _techheatersViewSource; + } + + set + { + _techheatersViewSource = value; RaisePropertyChanged(nameof(TechHeatersViewSource)); + } + + } + private ObservableCollection _techios; /// /// Gets or sets the TechIos. @@ -2861,6 +2897,8 @@ namespace Tango.BL TechDispensersViewSource = CreateCollectionView(TechDispensers); + TechHeatersViewSource = CreateCollectionView(TechHeaters); + TechIosViewSource = CreateCollectionView(TechIos); TechMonitorsViewSource = CreateCollectionView(TechMonitors); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs index 4820c784b..c6b120ea4 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs @@ -78,6 +78,7 @@ namespace Tango.BL TechIos = db.TechIos.ToObservableCollection(); TechMonitors = db.TechMonitors.ToObservableCollection(); TechValves = db.TechValves.ToObservableCollection(); + TechHeaters = db.TechHeaters.ToObservableCollection(); Machines = db.Machines.Include(x => x.Organization).ToObservableCollection(); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs index 38db29aab..911a6421e 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs @@ -2501,6 +2501,42 @@ namespace Tango.BL } + private ObservableCollection _techheaters; + /// + /// Gets or sets the TechHeaters. + /// + public ObservableCollection TechHeaters + { + get + { + return _techheaters; + } + + set + { + _techheaters = value; RaisePropertyChanged(nameof(TechHeaters)); + } + + } + + private ICollectionView _techheatersViewSource; + /// + /// Gets or sets the TechHeaters View Source. + /// + public ICollectionView TechHeatersViewSource + { + get + { + return _techheatersViewSource; + } + + set + { + _techheatersViewSource = value; RaisePropertyChanged(nameof(TechHeatersViewSource)); + } + + } + private ObservableCollection _techios; /// /// Gets or sets the TechIos. @@ -2861,6 +2897,8 @@ namespace Tango.BL TechDispensersViewSource = CreateCollectionView(TechDispensers); + TechHeatersViewSource = CreateCollectionView(TechHeaters); + TechIosViewSource = CreateCollectionView(TechIos); TechMonitorsViewSource = CreateCollectionView(TechMonitors); diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index a9894d79c..932a0279f 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -126,6 +126,7 @@ + @@ -334,7 +335,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs index 4e056c513..a20e01387 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -94,6 +94,7 @@ namespace Tango.DAL.Remote.DB public virtual DbSet TANGO_VERSIONS { get; set; } public virtual DbSet TECH_CONTROLLERS { get; set; } public virtual DbSet TECH_DISPENSERS { get; set; } + public virtual DbSet TECH_HEATERS { get; set; } public virtual DbSet TECH_IOS { get; set; } public virtual DbSet TECH_MONITORS { get; set; } public virtual DbSet TECH_VALVES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 7942f3f2b..1609463e7 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -983,6 +983,17 @@ + + + + + + + + + + + @@ -2209,6 +2220,7 @@ + @@ -2622,6 +2634,7 @@ + @@ -4094,6 +4107,17 @@ + + + + + + + + + + + @@ -6314,6 +6338,18 @@ + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 49224a7c9..27afb3f0f 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,80 +5,81 @@ - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs new file mode 100644 index 000000000..b37a0c5a1 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class TECH_HEATERS + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj index c242d3837..a6fdd02d0 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -288,6 +288,9 @@ RemoteADO.tt + + RemoteADO.tt + RemoteADO.tt @@ -356,7 +359,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterState.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterState.cs new file mode 100644 index 000000000..ac653f694 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterState.cs @@ -0,0 +1,303 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HeaterState.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Diagnostics { + + /// Holder for reflection information generated from HeaterState.proto + public static partial class HeaterStateReflection { + + #region Descriptor + /// File descriptor for HeaterState.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HeaterStateReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFIZWF0ZXJTdGF0ZS5wcm90bxIVVGFuZ28uUE1SLkRpYWdub3N0aWNzGhBI", + "ZWF0ZXJUeXBlLnByb3RvIqkBCgtIZWF0ZXJTdGF0ZRI1CgpIZWF0ZXJUeXBl", + "GAEgASgOMiEuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkhlYXRlclR5cGUSEAoI", + "U2V0UG9pbnQYAiABKAESFAoMQ3VycmVudFZhbHVlGAMgASgBEhAKCElzQWN0", + "aXZlGAQgASgIEhMKC0lzUmFtcGluZ1VwGAUgASgIEhQKDElzSW5TZXRQb2lu", + "dBgGIAEoCEIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZw", + "cm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.HeaterTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.HeaterState), global::Tango.PMR.Diagnostics.HeaterState.Parser, new[]{ "HeaterType", "SetPoint", "CurrentValue", "IsActive", "IsRampingUp", "IsInSetPoint" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HeaterState : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HeaterState()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.HeaterStateReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HeaterState() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HeaterState(HeaterState other) : this() { + heaterType_ = other.heaterType_; + setPoint_ = other.setPoint_; + currentValue_ = other.currentValue_; + isActive_ = other.isActive_; + isRampingUp_ = other.isRampingUp_; + isInSetPoint_ = other.isInSetPoint_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HeaterState Clone() { + return new HeaterState(this); + } + + /// Field number for the "HeaterType" field. + public const int HeaterTypeFieldNumber = 1; + private global::Tango.PMR.Diagnostics.HeaterType heaterType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Diagnostics.HeaterType HeaterType { + get { return heaterType_; } + set { + heaterType_ = value; + } + } + + /// Field number for the "SetPoint" field. + public const int SetPointFieldNumber = 2; + private double setPoint_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double SetPoint { + get { return setPoint_; } + set { + setPoint_ = value; + } + } + + /// Field number for the "CurrentValue" field. + public const int CurrentValueFieldNumber = 3; + private double currentValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double CurrentValue { + get { return currentValue_; } + set { + currentValue_ = value; + } + } + + /// Field number for the "IsActive" field. + public const int IsActiveFieldNumber = 4; + private bool isActive_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsActive { + get { return isActive_; } + set { + isActive_ = value; + } + } + + /// Field number for the "IsRampingUp" field. + public const int IsRampingUpFieldNumber = 5; + private bool isRampingUp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsRampingUp { + get { return isRampingUp_; } + set { + isRampingUp_ = value; + } + } + + /// Field number for the "IsInSetPoint" field. + public const int IsInSetPointFieldNumber = 6; + private bool isInSetPoint_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsInSetPoint { + get { return isInSetPoint_; } + set { + isInSetPoint_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HeaterState); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HeaterState other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HeaterType != other.HeaterType) return false; + if (SetPoint != other.SetPoint) return false; + if (CurrentValue != other.CurrentValue) return false; + if (IsActive != other.IsActive) return false; + if (IsRampingUp != other.IsRampingUp) return false; + if (IsInSetPoint != other.IsInSetPoint) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HeaterType != 0) hash ^= HeaterType.GetHashCode(); + if (SetPoint != 0D) hash ^= SetPoint.GetHashCode(); + if (CurrentValue != 0D) hash ^= CurrentValue.GetHashCode(); + if (IsActive != false) hash ^= IsActive.GetHashCode(); + if (IsRampingUp != false) hash ^= IsRampingUp.GetHashCode(); + if (IsInSetPoint != false) hash ^= IsInSetPoint.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (HeaterType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HeaterType); + } + if (SetPoint != 0D) { + output.WriteRawTag(17); + output.WriteDouble(SetPoint); + } + if (CurrentValue != 0D) { + output.WriteRawTag(25); + output.WriteDouble(CurrentValue); + } + if (IsActive != false) { + output.WriteRawTag(32); + output.WriteBool(IsActive); + } + if (IsRampingUp != false) { + output.WriteRawTag(40); + output.WriteBool(IsRampingUp); + } + if (IsInSetPoint != false) { + output.WriteRawTag(48); + output.WriteBool(IsInSetPoint); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HeaterType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HeaterType); + } + if (SetPoint != 0D) { + size += 1 + 8; + } + if (CurrentValue != 0D) { + size += 1 + 8; + } + if (IsActive != false) { + size += 1 + 1; + } + if (IsRampingUp != false) { + size += 1 + 1; + } + if (IsInSetPoint != false) { + size += 1 + 1; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HeaterState other) { + if (other == null) { + return; + } + if (other.HeaterType != 0) { + HeaterType = other.HeaterType; + } + if (other.SetPoint != 0D) { + SetPoint = other.SetPoint; + } + if (other.CurrentValue != 0D) { + CurrentValue = other.CurrentValue; + } + if (other.IsActive != false) { + IsActive = other.IsActive; + } + if (other.IsRampingUp != false) { + IsRampingUp = other.IsRampingUp; + } + if (other.IsInSetPoint != false) { + IsInSetPoint = other.IsInSetPoint; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + heaterType_ = (global::Tango.PMR.Diagnostics.HeaterType) input.ReadEnum(); + break; + } + case 17: { + SetPoint = input.ReadDouble(); + break; + } + case 25: { + CurrentValue = input.ReadDouble(); + break; + } + case 32: { + IsActive = input.ReadBool(); + break; + } + case 40: { + IsRampingUp = input.ReadBool(); + break; + } + case 48: { + IsInSetPoint = input.ReadBool(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterType.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterType.cs new file mode 100644 index 000000000..7ffdd7130 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/HeaterType.cs @@ -0,0 +1,51 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HeaterType.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Diagnostics { + + /// Holder for reflection information generated from HeaterType.proto + public static partial class HeaterTypeReflection { + + #region Descriptor + /// File descriptor for HeaterType.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HeaterTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChBIZWF0ZXJUeXBlLnByb3RvEhVUYW5nby5QTVIuRGlhZ25vc3RpY3MqcgoK", + "SGVhdGVyVHlwZRIPCgtIZWF0ZXJab25lMRAAEg8KC0hlYXRlclpvbmUyEAES", + "DwoLSGVhdGVyWm9uZTMQAhIPCgtIZWF0ZXJab25lNBADEg8KC0hlYXRlclpv", + "bmU1EAQSDwoLSGVhdGVyWm9uZTYQBUIhCh9jb20udHdpbmUudGFuZ28ucG1y", + "LmRpYWdub3N0aWNzYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Diagnostics.HeaterType), }, null)); + } + #endregion + + } + #region Enums + public enum HeaterType { + [pbr::OriginalName("HeaterZone1")] HeaterZone1 = 0, + [pbr::OriginalName("HeaterZone2")] HeaterZone2 = 1, + [pbr::OriginalName("HeaterZone3")] HeaterZone3 = 2, + [pbr::OriginalName("HeaterZone4")] HeaterZone4 = 3, + [pbr::OriginalName("HeaterZone5")] HeaterZone5 = 4, + [pbr::OriginalName("HeaterZone6")] HeaterZone6 = 5, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateRequest.cs new file mode 100644 index 000000000..ce64f14f9 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateRequest.cs @@ -0,0 +1,218 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SetHeaterStateRequest.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Diagnostics { + + /// Holder for reflection information generated from SetHeaterStateRequest.proto + public static partial class SetHeaterStateRequestReflection { + + #region Descriptor + /// File descriptor for SetHeaterStateRequest.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SetHeaterStateRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChtTZXRIZWF0ZXJTdGF0ZVJlcXVlc3QucHJvdG8SFVRhbmdvLlBNUi5EaWFn", + "bm9zdGljcxoQSGVhdGVyVHlwZS5wcm90byJyChVTZXRIZWF0ZXJTdGF0ZVJl", + "cXVlc3QSNQoKSGVhdGVyVHlwZRgBIAEoDjIhLlRhbmdvLlBNUi5EaWFnbm9z", + "dGljcy5IZWF0ZXJUeXBlEhAKCFNldFBvaW50GAIgASgBEhAKCElzQWN0aXZl", + "GAMgASgIQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlhZ25vc3RpY3NiBnBy", + "b3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.HeaterTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetHeaterStateRequest), global::Tango.PMR.Diagnostics.SetHeaterStateRequest.Parser, new[]{ "HeaterType", "SetPoint", "IsActive" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SetHeaterStateRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetHeaterStateRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.SetHeaterStateRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetHeaterStateRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetHeaterStateRequest(SetHeaterStateRequest other) : this() { + heaterType_ = other.heaterType_; + setPoint_ = other.setPoint_; + isActive_ = other.isActive_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetHeaterStateRequest Clone() { + return new SetHeaterStateRequest(this); + } + + /// Field number for the "HeaterType" field. + public const int HeaterTypeFieldNumber = 1; + private global::Tango.PMR.Diagnostics.HeaterType heaterType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Diagnostics.HeaterType HeaterType { + get { return heaterType_; } + set { + heaterType_ = value; + } + } + + /// Field number for the "SetPoint" field. + public const int SetPointFieldNumber = 2; + private double setPoint_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double SetPoint { + get { return setPoint_; } + set { + setPoint_ = value; + } + } + + /// Field number for the "IsActive" field. + public const int IsActiveFieldNumber = 3; + private bool isActive_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsActive { + get { return isActive_; } + set { + isActive_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SetHeaterStateRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SetHeaterStateRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HeaterType != other.HeaterType) return false; + if (SetPoint != other.SetPoint) return false; + if (IsActive != other.IsActive) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HeaterType != 0) hash ^= HeaterType.GetHashCode(); + if (SetPoint != 0D) hash ^= SetPoint.GetHashCode(); + if (IsActive != false) hash ^= IsActive.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (HeaterType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HeaterType); + } + if (SetPoint != 0D) { + output.WriteRawTag(17); + output.WriteDouble(SetPoint); + } + if (IsActive != false) { + output.WriteRawTag(24); + output.WriteBool(IsActive); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HeaterType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HeaterType); + } + if (SetPoint != 0D) { + size += 1 + 8; + } + if (IsActive != false) { + size += 1 + 1; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SetHeaterStateRequest other) { + if (other == null) { + return; + } + if (other.HeaterType != 0) { + HeaterType = other.HeaterType; + } + if (other.SetPoint != 0D) { + SetPoint = other.SetPoint; + } + if (other.IsActive != false) { + IsActive = other.IsActive; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + heaterType_ = (global::Tango.PMR.Diagnostics.HeaterType) input.ReadEnum(); + break; + } + case 17: { + SetPoint = input.ReadDouble(); + break; + } + case 24: { + IsActive = input.ReadBool(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateResponse.cs new file mode 100644 index 000000000..8131558ff --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetHeaterStateResponse.cs @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SetHeaterStateResponse.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Diagnostics { + + /// Holder for reflection information generated from SetHeaterStateResponse.proto + public static partial class SetHeaterStateResponseReflection { + + #region Descriptor + /// File descriptor for SetHeaterStateResponse.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SetHeaterStateResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChxTZXRIZWF0ZXJTdGF0ZVJlc3BvbnNlLnByb3RvEhVUYW5nby5QTVIuRGlh", + "Z25vc3RpY3MiGAoWU2V0SGVhdGVyU3RhdGVSZXNwb25zZUIhCh9jb20udHdp", + "bmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetHeaterStateResponse), global::Tango.PMR.Diagnostics.SetHeaterStateResponse.Parser, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SetHeaterStateResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetHeaterStateResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.SetHeaterStateResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetHeaterStateResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetHeaterStateResponse(SetHeaterStateResponse other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetHeaterStateResponse Clone() { + return new SetHeaterStateResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SetHeaterStateResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SetHeaterStateResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SetHeaterStateResponse other) { + if (other == null) { + return; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/StartDiagnosticsResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/StartDiagnosticsResponse.cs index ae9aa4e08..b50075eba 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/StartDiagnosticsResponse.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/StartDiagnosticsResponse.cs @@ -25,17 +25,19 @@ namespace Tango.PMR.Diagnostics { "Ch5TdGFydERpYWdub3N0aWNzUmVzcG9uc2UucHJvdG8SFVRhbmdvLlBNUi5E", "aWFnbm9zdGljcxobRGlnaXRhbEludGVyZmFjZVN0YXRlLnByb3RvGhlWYWx1", "ZUNvbXBvbmVudFN0YXRlLnByb3RvGhlEaWFnbm9zdGljc01vbml0b3JzLnBy", - "b3RvIuwBChhTdGFydERpYWdub3N0aWNzUmVzcG9uc2USPAoITW9uaXRvcnMY", - "ASABKAsyKi5UYW5nby5QTVIuRGlhZ25vc3RpY3MuRGlhZ25vc3RpY3NNb25p", - "dG9ycxJMChZEaWdpdGFsSW50ZXJmYWNlU3RhdGVzGAIgAygLMiwuVGFuZ28u", - "UE1SLkRpYWdub3N0aWNzLkRpZ2l0YWxJbnRlcmZhY2VTdGF0ZRJEChBDb21w", - "b25lbnRzU3RhdGVzGAMgAygLMiouVGFuZ28uUE1SLkRpYWdub3N0aWNzLlZh", - "bHVlQ29tcG9uZW50U3RhdGVCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFn", - "bm9zdGljc2IGcHJvdG8z")); + "b3RvGhFIZWF0ZXJTdGF0ZS5wcm90byKnAgoYU3RhcnREaWFnbm9zdGljc1Jl", + "c3BvbnNlEjwKCE1vbml0b3JzGAEgASgLMiouVGFuZ28uUE1SLkRpYWdub3N0", + "aWNzLkRpYWdub3N0aWNzTW9uaXRvcnMSTAoWRGlnaXRhbEludGVyZmFjZVN0", + "YXRlcxgCIAMoCzIsLlRhbmdvLlBNUi5EaWFnbm9zdGljcy5EaWdpdGFsSW50", + "ZXJmYWNlU3RhdGUSRAoQQ29tcG9uZW50c1N0YXRlcxgDIAMoCzIqLlRhbmdv", + "LlBNUi5EaWFnbm9zdGljcy5WYWx1ZUNvbXBvbmVudFN0YXRlEjkKDUhlYXRl", + "cnNTdGF0ZXMYBCADKAsyIi5UYW5nby5QTVIuRGlhZ25vc3RpY3MuSGVhdGVy", + "U3RhdGVCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFnbm9zdGljc2IGcHJv", + "dG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DigitalInterfaceStateReflection.Descriptor, global::Tango.PMR.Diagnostics.ValueComponentStateReflection.Descriptor, global::Tango.PMR.Diagnostics.DiagnosticsMonitorsReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DigitalInterfaceStateReflection.Descriptor, global::Tango.PMR.Diagnostics.ValueComponentStateReflection.Descriptor, global::Tango.PMR.Diagnostics.DiagnosticsMonitorsReflection.Descriptor, global::Tango.PMR.Diagnostics.HeaterStateReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.StartDiagnosticsResponse), global::Tango.PMR.Diagnostics.StartDiagnosticsResponse.Parser, new[]{ "Monitors", "DigitalInterfaceStates", "ComponentsStates" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.StartDiagnosticsResponse), global::Tango.PMR.Diagnostics.StartDiagnosticsResponse.Parser, new[]{ "Monitors", "DigitalInterfaceStates", "ComponentsStates", "HeatersStates" }, null, null, null) })); } #endregion @@ -69,6 +71,7 @@ namespace Tango.PMR.Diagnostics { Monitors = other.monitors_ != null ? other.Monitors.Clone() : null; digitalInterfaceStates_ = other.digitalInterfaceStates_.Clone(); componentsStates_ = other.componentsStates_.Clone(); + heatersStates_ = other.heatersStates_.Clone(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -116,6 +119,19 @@ namespace Tango.PMR.Diagnostics { get { return componentsStates_; } } + /// Field number for the "HeatersStates" field. + public const int HeatersStatesFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_heatersStates_codec + = pb::FieldCodec.ForMessage(34, global::Tango.PMR.Diagnostics.HeaterState.Parser); + private readonly pbc::RepeatedField heatersStates_ = new pbc::RepeatedField(); + /// + ///Heaters States + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField HeatersStates { + get { return heatersStates_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StartDiagnosticsResponse); @@ -132,6 +148,7 @@ namespace Tango.PMR.Diagnostics { if (!object.Equals(Monitors, other.Monitors)) return false; if(!digitalInterfaceStates_.Equals(other.digitalInterfaceStates_)) return false; if(!componentsStates_.Equals(other.componentsStates_)) return false; + if(!heatersStates_.Equals(other.heatersStates_)) return false; return true; } @@ -141,6 +158,7 @@ namespace Tango.PMR.Diagnostics { if (monitors_ != null) hash ^= Monitors.GetHashCode(); hash ^= digitalInterfaceStates_.GetHashCode(); hash ^= componentsStates_.GetHashCode(); + hash ^= heatersStates_.GetHashCode(); return hash; } @@ -157,6 +175,7 @@ namespace Tango.PMR.Diagnostics { } digitalInterfaceStates_.WriteTo(output, _repeated_digitalInterfaceStates_codec); componentsStates_.WriteTo(output, _repeated_componentsStates_codec); + heatersStates_.WriteTo(output, _repeated_heatersStates_codec); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -167,6 +186,7 @@ namespace Tango.PMR.Diagnostics { } size += digitalInterfaceStates_.CalculateSize(_repeated_digitalInterfaceStates_codec); size += componentsStates_.CalculateSize(_repeated_componentsStates_codec); + size += heatersStates_.CalculateSize(_repeated_heatersStates_codec); return size; } @@ -183,6 +203,7 @@ namespace Tango.PMR.Diagnostics { } digitalInterfaceStates_.Add(other.digitalInterfaceStates_); componentsStates_.Add(other.componentsStates_); + heatersStates_.Add(other.heatersStates_); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -208,6 +229,10 @@ namespace Tango.PMR.Diagnostics { componentsStates_.AddEntriesFrom(input, _repeated_componentsStates_codec); break; } + case 34: { + heatersStates_.AddEntriesFrom(input, _repeated_heatersStates_codec); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 508e8ad54..c2480d8c0 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -85,6 +85,8 @@ + + @@ -101,6 +103,8 @@ + + @@ -218,7 +222,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs index e7a1cead1..36f78391e 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs @@ -47,6 +47,7 @@ namespace Tango.PMRGenerator.CLI GenerateWindingMethods(db, pmrFolder); GenerateSpoolTypes(db, pmrFolder); GenerateProcessParameters(db, pmrFolder); + GenerateHeaterTypes(db, pmrFolder); GenerateColorLabColorSpaces(db, pmrFolder); GenerateColorLabLiquidTypes(db, pmrFolder); @@ -415,6 +416,28 @@ namespace Tango.PMRGenerator.CLI File.WriteAllText(Path.Combine(pmrFolder, "Printing", enumFile.Name + ".proto"), enumString); } + private static void GenerateHeaterTypes(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Heater Types..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "HeaterType"; + enumFile.Package = "Tango.PMR.Diagnostics"; + + foreach (var field in db.TechHeaters.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Value = field.Code, + }); + } + + String enumString = enumFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Diagnostics", enumFile.Name + ".proto"), enumString); + } + private static void GenerateSpoolTypes(ObservablesContext db, String pmrFolder) { Console.WriteLine("Generating Spool Types..."); -- cgit v1.3.1