From db9119d86fa9e2efd2c3dfab8ac2c49c2ee4da70 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 4 Aug 2018 14:35:57 +0300 Subject: Added DB, Observables, PMR Hardware Break Sensors & Break Sensors. --- .../Tango.BL/Entities/HardwareBlower.cs | 168 ++++++++++++ .../Tango.BL/Entities/HardwareBlowerType.cs | 123 +++++++++ .../Tango.BL/Entities/HardwareBreakSensor.cs | 168 ++++++++++++ .../Tango.BL/Entities/HardwareBreakSensorType.cs | 123 +++++++++ .../Tango.BL/Entities/HardwareVersion.cs | 44 +++ .../Tango.BL/Enumerations/HardwareBlowerTypes.cs | 22 ++ .../Enumerations/HardwareBreakSensorTypes.cs | 22 ++ .../Tango.BL/Enumerations/TechMonitors.cs | 12 +- .../Visual_Studio/Tango.BL/ObservablesContext.cs | 32 +++ .../Tango.BL/ObservablesEntitiesAdapter.cs | 8 + .../ObservablesEntitiesAdapterExtension.cs | 152 +++++++++++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 8 +- .../Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs | 28 ++ .../Tango.DAL.Remote/DB/HARDWARE_BLOWER_TYPES.cs | 33 +++ .../Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs | 28 ++ .../DB/HARDWARE_BREAK_SENSOR_TYPES.cs | 33 +++ .../Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs | 6 + .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 4 + .../Tango.DAL.Remote/DB/RemoteADO.Designer.cs | 2 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 302 +++++++++++++++++++++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 150 +++++----- .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 14 +- .../Tango.PMR/Diagnostics/DiagnosticsMonitors.cs | 6 +- .../Tango.PMR/Hardware/HardwareBlower.cs | 189 +++++++++++++ .../Tango.PMR/Hardware/HardwareBlowerType.cs | 47 ++++ .../Tango.PMR/Hardware/HardwareBreakSensor.cs | 218 +++++++++++++++ .../Tango.PMR/Hardware/HardwareBreakSensorType.cs | 48 ++++ Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 6 +- .../Utilities/Tango.PMRGenerator.CLI/Program.cs | 78 ++++++ .../Utilities/Tango.Protobuf.CLI/Program.cs | 18 ++ 30 files changed, 2008 insertions(+), 84 deletions(-) create mode 100644 Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs create mode 100644 Software/Visual_Studio/Tango.BL/Enumerations/HardwareBlowerTypes.cs create mode 100644 Software/Visual_Studio/Tango.BL/Enumerations/HardwareBreakSensorTypes.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWER_TYPES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSOR_TYPES.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlowerType.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensor.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensorType.cs (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs new file mode 100644 index 000000000..afef2c3d7 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs @@ -0,0 +1,168 @@ +//------------------------------------------------------------------------------ +// +// 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; + +namespace Tango.BL.Entities +{ + [Table("HARDWARE_BLOWERS")] + public partial class HardwareBlower : ObservableEntity + { + + protected String _hardwareblowertypeguid; + + /// + /// Gets or sets the hardwareblower hardware blower type guid. + /// + + [Column("HARDWARE_BLOWER_TYPE_GUID")] + [ForeignKey("HardwareBlowerType")] + + public String HardwareBlowerTypeGuid + { + get + { + return _hardwareblowertypeguid; + } + + set + { + _hardwareblowertypeguid = value; RaisePropertyChanged(nameof(HardwareBlowerTypeGuid)); + } + + } + + protected String _hardwareversionguid; + + /// + /// Gets or sets the hardwareblower hardware version guid. + /// + + [Column("HARDWARE_VERSION_GUID")] + [ForeignKey("HardwareVersion")] + + public String HardwareVersionGuid + { + get + { + return _hardwareversionguid; + } + + set + { + _hardwareversionguid = value; RaisePropertyChanged(nameof(HardwareVersionGuid)); + } + + } + + protected Boolean _enabled; + + /// + /// Gets or sets the hardwareblower enabled. + /// + + [Column("ENABLED")] + + public Boolean Enabled + { + get + { + return _enabled; + } + + set + { + _enabled = value; RaisePropertyChanged(nameof(Enabled)); + } + + } + + protected Double _voltage; + + /// + /// Gets or sets the hardwareblower voltage. + /// + + [Column("VOLTAGE")] + + public Double Voltage + { + get + { + return _voltage; + } + + set + { + _voltage = value; RaisePropertyChanged(nameof(Voltage)); + } + + } + + protected HardwareBlowerType _hardwareblowertype; + + /// + /// Gets or sets the hardwareblower hardware blower types. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual HardwareBlowerType HardwareBlowerType + { + get + { + return _hardwareblowertype; + } + + set + { + _hardwareblowertype = value; RaisePropertyChanged(nameof(HardwareBlowerType)); + } + + } + + protected HardwareVersion _hardwareversion; + + /// + /// Gets or sets the hardwareblower hardware versions. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual HardwareVersion HardwareVersion + { + get + { + return _hardwareversion; + } + + set + { + _hardwareversion = value; RaisePropertyChanged(nameof(HardwareVersion)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareBlower() : base() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs new file mode 100644 index 000000000..5bfdf6515 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// 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; + +namespace Tango.BL.Entities +{ + [Table("HARDWARE_BLOWER_TYPES")] + public partial class HardwareBlowerType : ObservableEntity + { + + protected Int32 _code; + + /// + /// Gets or sets the hardwareblowertype code. + /// + + [Column("CODE")] + + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + protected String _name; + + /// + /// Gets or sets the hardwareblowertype name. + /// + + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + protected String _description; + + /// + /// Gets or sets the hardwareblowertype description. + /// + + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + _description = value; RaisePropertyChanged(nameof(Description)); + } + + } + + protected ObservableCollection _hardwareblowers; + + /// + /// Gets or sets the hardwareblowertype hardware blowers. + /// + + public virtual ObservableCollection HardwareBlowers + { + get + { + return _hardwareblowers; + } + + set + { + _hardwareblowers = value; RaisePropertyChanged(nameof(HardwareBlowers)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareBlowerType() : base() + { + + HardwareBlowers = new ObservableCollection(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs new file mode 100644 index 000000000..f2bdf4f89 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs @@ -0,0 +1,168 @@ +//------------------------------------------------------------------------------ +// +// 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; + +namespace Tango.BL.Entities +{ + [Table("HARDWARE_BREAK_SENSORS")] + public partial class HardwareBreakSensor : ObservableEntity + { + + protected String _hardwarebreaksensortypeguid; + + /// + /// Gets or sets the hardwarebreaksensor hardware break sensor type guid. + /// + + [Column("HARDWARE_BREAK_SENSOR_TYPE_GUID")] + [ForeignKey("HardwareBreakSensorType")] + + public String HardwareBreakSensorTypeGuid + { + get + { + return _hardwarebreaksensortypeguid; + } + + set + { + _hardwarebreaksensortypeguid = value; RaisePropertyChanged(nameof(HardwareBreakSensorTypeGuid)); + } + + } + + protected String _hardwareversionguid; + + /// + /// Gets or sets the hardwarebreaksensor hardware version guid. + /// + + [Column("HARDWARE_VERSION_GUID")] + [ForeignKey("HardwareVersion")] + + public String HardwareVersionGuid + { + get + { + return _hardwareversionguid; + } + + set + { + _hardwareversionguid = value; RaisePropertyChanged(nameof(HardwareVersionGuid)); + } + + } + + protected Boolean _enabled; + + /// + /// Gets or sets the hardwarebreaksensor enabled. + /// + + [Column("ENABLED")] + + public Boolean Enabled + { + get + { + return _enabled; + } + + set + { + _enabled = value; RaisePropertyChanged(nameof(Enabled)); + } + + } + + protected Int32 _debouncetimemilli; + + /// + /// Gets or sets the hardwarebreaksensor de bounce time milli. + /// + + [Column("DE_BOUNCE_TIME_MILLI")] + + public Int32 DeBounceTimeMilli + { + get + { + return _debouncetimemilli; + } + + set + { + _debouncetimemilli = value; RaisePropertyChanged(nameof(DeBounceTimeMilli)); + } + + } + + protected HardwareBreakSensorType _hardwarebreaksensortype; + + /// + /// Gets or sets the hardwarebreaksensor hardware break sensor types. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual HardwareBreakSensorType HardwareBreakSensorType + { + get + { + return _hardwarebreaksensortype; + } + + set + { + _hardwarebreaksensortype = value; RaisePropertyChanged(nameof(HardwareBreakSensorType)); + } + + } + + protected HardwareVersion _hardwareversion; + + /// + /// Gets or sets the hardwarebreaksensor hardware versions. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual HardwareVersion HardwareVersion + { + get + { + return _hardwareversion; + } + + set + { + _hardwareversion = value; RaisePropertyChanged(nameof(HardwareVersion)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareBreakSensor() : base() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs new file mode 100644 index 000000000..c1d306e5b --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// 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; + +namespace Tango.BL.Entities +{ + [Table("HARDWARE_BREAK_SENSOR_TYPES")] + public partial class HardwareBreakSensorType : ObservableEntity + { + + protected Int32 _code; + + /// + /// Gets or sets the hardwarebreaksensortype code. + /// + + [Column("CODE")] + + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + protected String _name; + + /// + /// Gets or sets the hardwarebreaksensortype name. + /// + + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + protected String _description; + + /// + /// Gets or sets the hardwarebreaksensortype description. + /// + + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + _description = value; RaisePropertyChanged(nameof(Description)); + } + + } + + protected ObservableCollection _hardwarebreaksensors; + + /// + /// Gets or sets the hardwarebreaksensortype hardware break sensors. + /// + + public virtual ObservableCollection HardwareBreakSensors + { + get + { + return _hardwarebreaksensors; + } + + set + { + _hardwarebreaksensors = value; RaisePropertyChanged(nameof(HardwareBreakSensors)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareBreakSensorType() : base() + { + + HardwareBreakSensors = new ObservableCollection(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs index 4d06de0e1..9641896d9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs @@ -88,6 +88,46 @@ namespace Tango.BL.Entities } + protected ObservableCollection _hardwareblowers; + + /// + /// Gets or sets the hardwareversion hardware blowers. + /// + + public virtual ObservableCollection HardwareBlowers + { + get + { + return _hardwareblowers; + } + + set + { + _hardwareblowers = value; RaisePropertyChanged(nameof(HardwareBlowers)); + } + + } + + protected ObservableCollection _hardwarebreaksensors; + + /// + /// Gets or sets the hardwareversion hardware break sensors. + /// + + public virtual ObservableCollection HardwareBreakSensors + { + get + { + return _hardwarebreaksensors; + } + + set + { + _hardwarebreaksensors = value; RaisePropertyChanged(nameof(HardwareBreakSensors)); + } + + } + protected ObservableCollection _hardwaredancers; /// @@ -196,6 +236,10 @@ namespace Tango.BL.Entities Configurations = new ObservableCollection(); + HardwareBlowers = new ObservableCollection(); + + HardwareBreakSensors = new ObservableCollection(); + HardwareDancers = new ObservableCollection(); HardwareMotors = new ObservableCollection(); diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/HardwareBlowerTypes.cs b/Software/Visual_Studio/Tango.BL/Enumerations/HardwareBlowerTypes.cs new file mode 100644 index 000000000..0f8b447fd --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/HardwareBlowerTypes.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// 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.Linq; +using System.ComponentModel; + +namespace Tango.BL.Enumerations +{ + public enum HardwareBlowerTypes + { + } +} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/HardwareBreakSensorTypes.cs b/Software/Visual_Studio/Tango.BL/Enumerations/HardwareBreakSensorTypes.cs new file mode 100644 index 000000000..a43869bf5 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/HardwareBreakSensorTypes.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// 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.Linq; +using System.ComponentModel; + +namespace Tango.BL.Enumerations +{ + public enum HardwareBreakSensorTypes + { + } +} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs b/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs index c73105b9f..79e578f43 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs @@ -26,21 +26,21 @@ namespace Tango.BL.Enumerations ChillerTemperature = 27, /// - /// (Dancer 1) + /// (Left Dancer) /// - [Description("Dancer 1")] + [Description("Left Dancer")] Dancer1Angle = 0, /// - /// (Dancer 2) + /// (Middle Dancer) /// - [Description("Dancer 2")] + [Description("Middle Dancer")] Dancer2Angle = 1, /// - /// (Dancer 3) + /// (Right Dancer) /// - [Description("Dancer 3")] + [Description("Right Dancer")] Dancer3Angle = 2, /// diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs index 48e0e0151..5c20899e9 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs @@ -222,6 +222,38 @@ namespace Tango.BL get; set; } + /// + /// Gets or sets the HardwareBlowerTypes. + /// + public DbSet HardwareBlowerTypes + { + get; set; + } + + /// + /// Gets or sets the HardwareBlowers. + /// + public DbSet HardwareBlowers + { + get; set; + } + + /// + /// Gets or sets the HardwareBreakSensorTypes. + /// + public DbSet HardwareBreakSensorTypes + { + get; set; + } + + /// + /// Gets or sets the HardwareBreakSensors. + /// + public DbSet HardwareBreakSensors + { + get; set; + } + /// /// Gets or sets the HardwareDancerTypes. /// diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs index b8736f856..bc939259d 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs @@ -304,6 +304,14 @@ namespace Tango.BL HardwareSpeedSensors = Context.HardwareSpeedSensors.ToObservableCollection(); + HardwareBlowerTypes = Context.HardwareBlowerTypes.ToObservableCollection(); + + HardwareBlowers = Context.HardwareBlowers.ToObservableCollection(); + + HardwareBreakSensorTypes = Context.HardwareBreakSensorTypes.ToObservableCollection(); + + HardwareBreakSensors = Context.HardwareBreakSensors.ToObservableCollection(); + HtmlPages = Context.HtmlPages.ToObservableCollection(); Customers = Context.Customers.ToObservableCollection(); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs index ceaa4c77c..df7b44539 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs @@ -917,6 +917,150 @@ namespace Tango.BL } + private ObservableCollection _hardwareblowertypes; + /// + /// Gets or sets the HardwareBlowerTypes. + /// + public ObservableCollection HardwareBlowerTypes + { + get + { + return _hardwareblowertypes; + } + + set + { + _hardwareblowertypes = value; RaisePropertyChanged(nameof(HardwareBlowerTypes)); + } + + } + + private ICollectionView _hardwareblowertypesViewSource; + /// + /// Gets or sets the HardwareBlowerTypes View Source. + /// + public ICollectionView HardwareBlowerTypesViewSource + { + get + { + return _hardwareblowertypesViewSource; + } + + set + { + _hardwareblowertypesViewSource = value; RaisePropertyChanged(nameof(HardwareBlowerTypesViewSource)); + } + + } + + private ObservableCollection _hardwareblowers; + /// + /// Gets or sets the HardwareBlowers. + /// + public ObservableCollection HardwareBlowers + { + get + { + return _hardwareblowers; + } + + set + { + _hardwareblowers = value; RaisePropertyChanged(nameof(HardwareBlowers)); + } + + } + + private ICollectionView _hardwareblowersViewSource; + /// + /// Gets or sets the HardwareBlowers View Source. + /// + public ICollectionView HardwareBlowersViewSource + { + get + { + return _hardwareblowersViewSource; + } + + set + { + _hardwareblowersViewSource = value; RaisePropertyChanged(nameof(HardwareBlowersViewSource)); + } + + } + + private ObservableCollection _hardwarebreaksensortypes; + /// + /// Gets or sets the HardwareBreakSensorTypes. + /// + public ObservableCollection HardwareBreakSensorTypes + { + get + { + return _hardwarebreaksensortypes; + } + + set + { + _hardwarebreaksensortypes = value; RaisePropertyChanged(nameof(HardwareBreakSensorTypes)); + } + + } + + private ICollectionView _hardwarebreaksensortypesViewSource; + /// + /// Gets or sets the HardwareBreakSensorTypes View Source. + /// + public ICollectionView HardwareBreakSensorTypesViewSource + { + get + { + return _hardwarebreaksensortypesViewSource; + } + + set + { + _hardwarebreaksensortypesViewSource = value; RaisePropertyChanged(nameof(HardwareBreakSensorTypesViewSource)); + } + + } + + private ObservableCollection _hardwarebreaksensors; + /// + /// Gets or sets the HardwareBreakSensors. + /// + public ObservableCollection HardwareBreakSensors + { + get + { + return _hardwarebreaksensors; + } + + set + { + _hardwarebreaksensors = value; RaisePropertyChanged(nameof(HardwareBreakSensors)); + } + + } + + private ICollectionView _hardwarebreaksensorsViewSource; + /// + /// Gets or sets the HardwareBreakSensors View Source. + /// + public ICollectionView HardwareBreakSensorsViewSource + { + get + { + return _hardwarebreaksensorsViewSource; + } + + set + { + _hardwarebreaksensorsViewSource = value; RaisePropertyChanged(nameof(HardwareBreakSensorsViewSource)); + } + + } + private ObservableCollection _hardwaredancertypes; /// /// Gets or sets the HardwareDancerTypes. @@ -2665,6 +2809,14 @@ namespace Tango.BL FiberSynthsViewSource = CreateCollectionView(FiberSynths); + HardwareBlowerTypesViewSource = CreateCollectionView(HardwareBlowerTypes); + + HardwareBlowersViewSource = CreateCollectionView(HardwareBlowers); + + HardwareBreakSensorTypesViewSource = CreateCollectionView(HardwareBreakSensorTypes); + + HardwareBreakSensorsViewSource = CreateCollectionView(HardwareBreakSensors); + HardwareDancerTypesViewSource = CreateCollectionView(HardwareDancerTypes); HardwareDancersViewSource = CreateCollectionView(HardwareDancers); diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 58767ea88..dccfd8bcd 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -102,6 +102,10 @@ + + + + @@ -119,6 +123,8 @@ + + @@ -316,7 +322,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs new file mode 100644 index 000000000..8507177fd --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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 HARDWARE_BLOWERS + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string HARDWARE_BLOWER_TYPE_GUID { get; set; } + public string HARDWARE_VERSION_GUID { get; set; } + public bool ENABLED { get; set; } + public double VOLTAGE { get; set; } + + public virtual HARDWARE_BLOWER_TYPES HARDWARE_BLOWER_TYPES { get; set; } + public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWER_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWER_TYPES.cs new file mode 100644 index 000000000..8fe5bae81 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWER_TYPES.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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 HARDWARE_BLOWER_TYPES + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HARDWARE_BLOWER_TYPES() + { + this.HARDWARE_BLOWERS = new HashSet(); + } + + 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; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HARDWARE_BLOWERS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs new file mode 100644 index 000000000..d907bbc69 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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 HARDWARE_BREAK_SENSORS + { + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string HARDWARE_BREAK_SENSOR_TYPE_GUID { get; set; } + public string HARDWARE_VERSION_GUID { get; set; } + public bool ENABLED { get; set; } + public int DE_BOUNCE_TIME_MILLI { get; set; } + + public virtual HARDWARE_BREAK_SENSOR_TYPES HARDWARE_BREAK_SENSOR_TYPES { get; set; } + public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSOR_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSOR_TYPES.cs new file mode 100644 index 000000000..addcc2bf9 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSOR_TYPES.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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 HARDWARE_BREAK_SENSOR_TYPES + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HARDWARE_BREAK_SENSOR_TYPES() + { + this.HARDWARE_BREAK_SENSORS = new HashSet(); + } + + 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; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HARDWARE_BREAK_SENSORS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs index 8948e6e17..190ed45e6 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_VERSIONS.cs @@ -18,6 +18,8 @@ namespace Tango.DAL.Remote.DB public HARDWARE_VERSIONS() { this.CONFIGURATIONS = new HashSet(); + this.HARDWARE_BLOWERS = new HashSet(); + this.HARDWARE_BREAK_SENSORS = new HashSet(); this.HARDWARE_DANCERS = new HashSet(); this.HARDWARE_MOTORS = new HashSet(); this.HARDWARE_PID_CONTROLS = new HashSet(); @@ -34,6 +36,10 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection CONFIGURATIONS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HARDWARE_BLOWERS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HARDWARE_BREAK_SENSORS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection HARDWARE_DANCERS { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection HARDWARE_MOTORS { get; set; } 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 3bfc66745..7a6efadb4 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -50,6 +50,10 @@ namespace Tango.DAL.Remote.DB public virtual DbSet EVENT_TYPES_GROUPS { get; set; } public virtual DbSet FIBER_SHAPES { get; set; } public virtual DbSet FIBER_SYNTHS { get; set; } + public virtual DbSet HARDWARE_BLOWER_TYPES { get; set; } + public virtual DbSet HARDWARE_BLOWERS { get; set; } + public virtual DbSet HARDWARE_BREAK_SENSOR_TYPES { get; set; } + public virtual DbSet HARDWARE_BREAK_SENSORS { get; set; } public virtual DbSet HARDWARE_DANCER_TYPES { get; set; } public virtual DbSet HARDWARE_DANCERS { get; set; } public virtual DbSet HARDWARE_MOTOR_TYPES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs index 17bc2683d..d26e67908 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs @@ -1,4 +1,4 @@ -// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. +// T4 code generation is enabled for model 'C:\DATA\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model // is open in the designer. diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index b71c4e211..1dbcca618 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -327,6 +327,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1294,6 +1340,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2055,6 +2157,10 @@ + + + + @@ -2191,6 +2297,22 @@ + + + + + + + + + + + + + + + + @@ -2450,6 +2572,10 @@ + + + + @@ -2645,6 +2771,22 @@ + + + + + + + + + + + + + + + + @@ -3194,6 +3336,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3354,6 +3548,8 @@ + + @@ -4455,6 +4651,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5358,6 +5610,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 0a7f820e5..e85538862 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,77 +5,81 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -113,6 +117,10 @@ + + + + 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 84b9332c5..d57025a7c 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -138,6 +138,18 @@ RemoteADO.tt + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + + + RemoteADO.tt + RemoteADO.tt @@ -347,7 +359,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs index e14e338b8..a9ce72407 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs @@ -139,7 +139,7 @@ namespace Tango.PMR.Diagnostics { = pb::FieldCodec.ForDouble(10); private readonly pbc::RepeatedField dancer1Angle_ = new pbc::RepeatedField(); /// - ///Dancer 1 (Min = 0, Max = 16384, PPF = 100) + ///Left Dancer (Min = 0, Max = 16384, PPF = 100) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Dancer1Angle { @@ -152,7 +152,7 @@ namespace Tango.PMR.Diagnostics { = pb::FieldCodec.ForDouble(18); private readonly pbc::RepeatedField dancer2Angle_ = new pbc::RepeatedField(); /// - ///Dancer 2 (Min = 0, Max = 16384, PPF = 100) + ///Middle Dancer (Min = 0, Max = 16384, PPF = 100) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Dancer2Angle { @@ -165,7 +165,7 @@ namespace Tango.PMR.Diagnostics { = pb::FieldCodec.ForDouble(26); private readonly pbc::RepeatedField dancer3Angle_ = new pbc::RepeatedField(); /// - ///Dancer 3 (Min = 0, Max = 16384, PPF = 100) + ///Right Dancer (Min = 0, Max = 16384, PPF = 100) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Dancer3Angle { diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs new file mode 100644 index 000000000..785e57ce4 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs @@ -0,0 +1,189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareBlower.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.Hardware { + + /// Holder for reflection information generated from HardwareBlower.proto + public static partial class HardwareBlowerReflection { + + #region Descriptor + /// File descriptor for HardwareBlower.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareBlowerReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChRIYXJkd2FyZUJsb3dlci5wcm90bxISVGFuZ28uUE1SLkhhcmR3YXJlGhhI", + "YXJkd2FyZUJsb3dlclR5cGUucHJvdG8iYgoOSGFyZHdhcmVCbG93ZXISQgoS", + "SGFyZHdhcmVCbG93ZXJUeXBlGAEgASgOMiYuVGFuZ28uUE1SLkhhcmR3YXJl", + "LkhhcmR3YXJlQmxvd2VyVHlwZRIMCgRDb2RlGAIgASgFQh4KHGNvbS50d2lu", + "ZS50YW5nby5wbXIuaGFyZHdhcmViBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwareBlowerTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Hardware.HardwareBlower), global::Tango.PMR.Hardware.HardwareBlower.Parser, new[]{ "HardwareBlowerType", "Code" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HardwareBlower : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HardwareBlower()); + [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.Hardware.HardwareBlowerReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareBlower() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareBlower(HardwareBlower other) : this() { + hardwareBlowerType_ = other.hardwareBlowerType_; + code_ = other.code_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareBlower Clone() { + return new HardwareBlower(this); + } + + /// Field number for the "HardwareBlowerType" field. + public const int HardwareBlowerTypeFieldNumber = 1; + private global::Tango.PMR.Hardware.HardwareBlowerType hardwareBlowerType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Hardware.HardwareBlowerType HardwareBlowerType { + get { return hardwareBlowerType_; } + set { + hardwareBlowerType_ = value; + } + } + + /// Field number for the "Code" field. + public const int CodeFieldNumber = 2; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HardwareBlower); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HardwareBlower other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HardwareBlowerType != other.HardwareBlowerType) return false; + if (Code != other.Code) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HardwareBlowerType != 0) hash ^= HardwareBlowerType.GetHashCode(); + if (Code != 0) hash ^= Code.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 (HardwareBlowerType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HardwareBlowerType); + } + if (Code != 0) { + output.WriteRawTag(16); + output.WriteInt32(Code); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HardwareBlowerType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HardwareBlowerType); + } + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HardwareBlower other) { + if (other == null) { + return; + } + if (other.HardwareBlowerType != 0) { + HardwareBlowerType = other.HardwareBlowerType; + } + if (other.Code != 0) { + Code = other.Code; + } + } + + [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: { + hardwareBlowerType_ = (global::Tango.PMR.Hardware.HardwareBlowerType) input.ReadEnum(); + break; + } + case 16: { + Code = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlowerType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlowerType.cs new file mode 100644 index 000000000..24e1e612e --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlowerType.cs @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareBlowerType.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.Hardware { + + /// Holder for reflection information generated from HardwareBlowerType.proto + public static partial class HardwareBlowerTypeReflection { + + #region Descriptor + /// File descriptor for HardwareBlowerType.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareBlowerTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChhIYXJkd2FyZUJsb3dlclR5cGUucHJvdG8SElRhbmdvLlBNUi5IYXJkd2Fy", + "ZSooChJIYXJkd2FyZUJsb3dlclR5cGUSEgoOU3RhbmRhcmRCbG93ZXIQAEIe", + "Chxjb20udHdpbmUudGFuZ28ucG1yLmhhcmR3YXJlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Hardware.HardwareBlowerType), }, null)); + } + #endregion + + } + #region Enums + public enum HardwareBlowerType { + /// + ///Standard Blower + /// + [pbr::OriginalName("StandardBlower")] StandardBlower = 0, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensor.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensor.cs new file mode 100644 index 000000000..09958498a --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensor.cs @@ -0,0 +1,218 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareBreakSensor.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.Hardware { + + /// Holder for reflection information generated from HardwareBreakSensor.proto + public static partial class HardwareBreakSensorReflection { + + #region Descriptor + /// File descriptor for HardwareBreakSensor.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareBreakSensorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChlIYXJkd2FyZUJyZWFrU2Vuc29yLnByb3RvEhJUYW5nby5QTVIuSGFyZHdh", + "cmUaHUhhcmR3YXJlQnJlYWtTZW5zb3JUeXBlLnByb3RvIo8BChNIYXJkd2Fy", + "ZUJyZWFrU2Vuc29yEkwKF0hhcmR3YXJlQnJlYWtTZW5zb3JUeXBlGAEgASgO", + "MisuVGFuZ28uUE1SLkhhcmR3YXJlLkhhcmR3YXJlQnJlYWtTZW5zb3JUeXBl", + "Eg8KB0VuYWJsZWQYAiABKAgSGQoRRGVCb3VuY2VUaW1lTWlsbGkYAyABKAVC", + "HgocY29tLnR3aW5lLnRhbmdvLnBtci5oYXJkd2FyZWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwareBreakSensorTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Hardware.HardwareBreakSensor), global::Tango.PMR.Hardware.HardwareBreakSensor.Parser, new[]{ "HardwareBreakSensorType", "Enabled", "DeBounceTimeMilli" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HardwareBreakSensor : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HardwareBreakSensor()); + [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.Hardware.HardwareBreakSensorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareBreakSensor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareBreakSensor(HardwareBreakSensor other) : this() { + hardwareBreakSensorType_ = other.hardwareBreakSensorType_; + enabled_ = other.enabled_; + deBounceTimeMilli_ = other.deBounceTimeMilli_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareBreakSensor Clone() { + return new HardwareBreakSensor(this); + } + + /// Field number for the "HardwareBreakSensorType" field. + public const int HardwareBreakSensorTypeFieldNumber = 1; + private global::Tango.PMR.Hardware.HardwareBreakSensorType hardwareBreakSensorType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Hardware.HardwareBreakSensorType HardwareBreakSensorType { + get { return hardwareBreakSensorType_; } + set { + hardwareBreakSensorType_ = value; + } + } + + /// Field number for the "Enabled" field. + public const int EnabledFieldNumber = 2; + private bool enabled_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Enabled { + get { return enabled_; } + set { + enabled_ = value; + } + } + + /// Field number for the "DeBounceTimeMilli" field. + public const int DeBounceTimeMilliFieldNumber = 3; + private int deBounceTimeMilli_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int DeBounceTimeMilli { + get { return deBounceTimeMilli_; } + set { + deBounceTimeMilli_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HardwareBreakSensor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HardwareBreakSensor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HardwareBreakSensorType != other.HardwareBreakSensorType) return false; + if (Enabled != other.Enabled) return false; + if (DeBounceTimeMilli != other.DeBounceTimeMilli) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HardwareBreakSensorType != 0) hash ^= HardwareBreakSensorType.GetHashCode(); + if (Enabled != false) hash ^= Enabled.GetHashCode(); + if (DeBounceTimeMilli != 0) hash ^= DeBounceTimeMilli.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 (HardwareBreakSensorType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HardwareBreakSensorType); + } + if (Enabled != false) { + output.WriteRawTag(16); + output.WriteBool(Enabled); + } + if (DeBounceTimeMilli != 0) { + output.WriteRawTag(24); + output.WriteInt32(DeBounceTimeMilli); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HardwareBreakSensorType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HardwareBreakSensorType); + } + if (Enabled != false) { + size += 1 + 1; + } + if (DeBounceTimeMilli != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DeBounceTimeMilli); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HardwareBreakSensor other) { + if (other == null) { + return; + } + if (other.HardwareBreakSensorType != 0) { + HardwareBreakSensorType = other.HardwareBreakSensorType; + } + if (other.Enabled != false) { + Enabled = other.Enabled; + } + if (other.DeBounceTimeMilli != 0) { + DeBounceTimeMilli = other.DeBounceTimeMilli; + } + } + + [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: { + hardwareBreakSensorType_ = (global::Tango.PMR.Hardware.HardwareBreakSensorType) input.ReadEnum(); + break; + } + case 16: { + Enabled = input.ReadBool(); + break; + } + case 24: { + DeBounceTimeMilli = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensorType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensorType.cs new file mode 100644 index 000000000..b831b5e19 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBreakSensorType.cs @@ -0,0 +1,48 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareBreakSensorType.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.Hardware { + + /// Holder for reflection information generated from HardwareBreakSensorType.proto + public static partial class HardwareBreakSensorTypeReflection { + + #region Descriptor + /// File descriptor for HardwareBreakSensorType.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareBreakSensorTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch1IYXJkd2FyZUJyZWFrU2Vuc29yVHlwZS5wcm90bxISVGFuZ28uUE1SLkhh", + "cmR3YXJlKjIKF0hhcmR3YXJlQnJlYWtTZW5zb3JUeXBlEhcKE1N0YW5kYXJk", + "QnJlYWtTZW5zb3IQAEIeChxjb20udHdpbmUudGFuZ28ucG1yLmhhcmR3YXJl", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Hardware.HardwareBreakSensorType), }, null)); + } + #endregion + + } + #region Enums + public enum HardwareBreakSensorType { + /// + ///Standard Break Sensor + /// + [pbr::OriginalName("StandardBreakSensor")] StandardBreakSensor = 0, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index ddc715932..09ae2b64c 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -121,6 +121,10 @@ + + + + @@ -200,7 +204,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 274a381a6..c96b94dad 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs @@ -41,6 +41,8 @@ namespace Tango.PMRGenerator.CLI GenerateHardwareDispensers(db, pmrFolder); GenerateHardwareWinders(db, pmrFolder); GenerateHardwareSpeedSensors(db, pmrFolder); + GenerateHardwareBlowers(db, pmrFolder); + GenerateHardwareBreakSensors(db, pmrFolder); GenerateLiquidTypes(db, pmrFolder); GenerateWindingMethods(db, pmrFolder); GenerateSpoolTypes(db, pmrFolder); @@ -291,6 +293,82 @@ namespace Tango.PMRGenerator.CLI File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); } + private static void GenerateHardwareBlowers(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Hardware Blower Types..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "HardwareBlowerType"; + enumFile.Package = "Tango.PMR.Hardware"; + + foreach (var field in db.HardwareBlowerTypes.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Value = field.Code, + Description = field.Description, + }); + } + + Console.WriteLine("Generating Hardware Blowers..."); + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "HardwareBlower"; + messageFile.Package = "Tango.PMR.Hardware"; + messageFile.Imports.Add("HardwareBlowerType.proto"); + + messageFile.Properties.Add(new ProtoProperty("HardwareBlowerType", "HardwareBlowerType")); + + foreach (var prop in typeof(HardwareBlowerType).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) + { + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType), GetDbDescription(prop))); + } + + String enumString = enumFile.GenerateCode(); + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", enumFile.Name + ".proto"), enumString); + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); + } + + private static void GenerateHardwareBreakSensors(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Hardware Break Sensor Types..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "HardwareBreakSensorType"; + enumFile.Package = "Tango.PMR.Hardware"; + + foreach (var field in db.HardwareBreakSensorTypes.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Value = field.Code, + Description = field.Description, + }); + } + + Console.WriteLine("Generating Hardware Break Sensor..."); + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "HardwareBreakSensor"; + messageFile.Package = "Tango.PMR.Hardware"; + messageFile.Imports.Add("HardwareBreakSensorType.proto"); + + messageFile.Properties.Add(new ProtoProperty("HardwareBreakSensorType", "HardwareBreakSensorType")); + + foreach (var prop in typeof(HardwareBreakSensor).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) + { + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType), GetDbDescription(prop))); + } + + String enumString = enumFile.GenerateCode(); + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", enumFile.Name + ".proto"), enumString); + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); + } + private static void GenerateLiquidTypes(ObservablesContext db, String pmrFolder) { Console.WriteLine("Generating Dispenser Liquid Types..."); diff --git a/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs index 621a6d10f..d0c4ba1fe 100644 --- a/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs @@ -15,6 +15,20 @@ namespace Tango.Protobuf.CLI { Console.Title = "Tango Protobuf Compiler"; +#if DEBUG + + if (args.Length == 0) + { + args = new string[] + { + "-i ..\\..\\..\\PMR\\Messages", + "-o ..\\..\\Tango.PMR", + "-l CSharp", + }; + } + +#endif + if (args.Length == 0) { return ExitHelp(); @@ -24,6 +38,10 @@ namespace Tango.Protobuf.CLI if (CommandLine.Parser.Default.ParseArguments(args, options)) { + options.SourceFolder = options.SourceFolder.Trim(); + options.OutputFolder = options.OutputFolder.Trim(); + options.Language = options.Language.Trim(); + if (!Directory.Exists(options.SourceFolder)) { return ExitError("Could not locate source folder \"" + Path.GetFullPath(options.SourceFolder) + "\""); -- cgit v1.3.1