From a851545901aea6ac5e33d375236afdef6ecfa26f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 11 Mar 2018 10:59:52 +0200 Subject: Implemented VS solution release builds! --- Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj') diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index d622bd6a0..0c093659f 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -28,7 +28,7 @@ pdbonly true - bin\Release\ + ..\Build\Release\ TRACE prompt 4 -- cgit v1.3.1 From 37b740c1d128d694b9dcbc3669808435b5d88fec Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 13 Mar 2018 15:27:16 +0200 Subject: Implemented Gauge Control & Technician module controller item ! Auto generated diagnostics monitors & controllers PMR. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1048576 -> 1048576 bytes Software/Graphics/controller.png | Bin 0 -> 1667 bytes Software/PMR/Messages/ColorLab/ColorSpace.proto | 12 +- Software/PMR/Messages/ColorLab/LiquidType.proto | 12 +- Software/PMR/Messages/Common/MessageType.proto | 2 + .../Messages/Diagnostics/DiagnosticsMonitors.proto | 129 ++ .../Diagnostics/PushDiagnosticsResponse.proto | 32 +- .../Diagnostics/SetComponentValueRequest.proto | 12 + .../Diagnostics/SetComponentValueResponse.proto | 9 + .../PMR/Messages/Diagnostics/ValueComponent.proto | 25 + .../Messages/Diagnostics/ValueComponentState.proto | 12 + .../PMR/Messages/Hardware/HardwareDancer.proto | 12 +- .../PMR/Messages/Hardware/HardwareDancerType.proto | 15 +- .../PMR/Messages/Hardware/HardwareDispenser.proto | 12 +- .../Messages/Hardware/HardwareDispenserType.proto | 12 +- Software/PMR/Messages/Hardware/HardwareMotor.proto | 12 +- .../PMR/Messages/Hardware/HardwareMotorType.proto | 16 +- .../PMR/Messages/Hardware/HardwarePidControl.proto | 12 +- .../Messages/Hardware/HardwarePidControlType.proto | 26 +- .../PMR/Messages/Hardware/HardwareWinder.proto | 12 +- .../PMR/Messages/Hardware/HardwareWinderType.proto | 13 +- .../Messages/Printing/DispenserLiquidType.proto | 12 +- Software/PMR/Messages/Printing/JobSpool.proto | 12 +- Software/PMR/Messages/Printing/JobSpoolType.proto | 12 +- .../PMR/Messages/Printing/JobWindingMethod.proto | 14 +- .../PMR/Messages/Printing/ProcessParameters.proto | 12 +- .../Editors/ControllerElementEditor.xaml | 140 ++ .../Editors/ControllerElementEditor.xaml.cs | 90 ++ .../Images/controller.png | Bin 0 -> 1667 bytes .../PropertiesTemplates/ControllerTemplate.xaml | 41 + .../PropertiesTemplates/ControllerTemplate.xaml.cs | 28 + .../Tango.MachineStudio.Technician.csproj | 22 + .../TechItems/ControllerItem.cs | 121 ++ .../TechItems/TechItem.cs | 1 + .../ViewModels/MachineTechViewVM.cs | 72 +- .../Views/MachineTechView.xaml | 3 + .../Tango.BL/Entities/TechController.cs | 144 ++ .../Visual_Studio/Tango.BL/Entities/TechHeater.cs | 84 -- Software/Visual_Studio/Tango.BL/Entities/User.cs | 20 + .../Visual_Studio/Tango.BL/Enumerations/Sensors.cs | 181 --- .../Tango.BL/Enumerations/TechControllers.cs | 25 + .../Visual_Studio/Tango.BL/ObservablesContext.cs | 8 +- .../Tango.BL/ObservablesEntitiesAdapter.cs | 2 +- .../ObservablesEntitiesAdapterExtension.cs | 44 +- Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 3 +- .../Tango.CircularGauge/CircularGaugeControl.cs | 1419 ++++++++++++++++++++ .../Tango.CircularGauge/Properties/AssemblyInfo.cs | 18 + .../Properties/Resources.Designer.cs | 63 + .../Tango.CircularGauge/Properties/Resources.resx | 117 ++ .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + .../Tango.CircularGauge/Tango.CircularGauge.csproj | 128 ++ .../Tango.CircularGauge/Themes/Generic.xaml | 174 +++ .../Tango.CircularGauge/TypeConverters.cs | 277 ++++ .../Tango.CodeGeneration/ProtoMessageFile.cs | 6 +- .../Tango.CodeGeneration/ProtoProperty.cs | 26 + .../Tango.CodeGeneration.csproj | 1 + .../Templates/ProtoEnumFile.cshtml | 13 +- .../Templates/ProtoMessageFile.cshtml | 15 +- .../Tango.DAL.Remote/DB/RemoteADO.Context.cs | 2 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 68 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 132 +- .../Tango.DAL.Remote/DB/TECH_CONTROLLERS.cs | 27 + .../Tango.DAL.Remote/DB/TECH_HEATERS.cs | 24 - Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs | 1 + .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 4 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 75 +- .../Operation/IMachineOperator.cs | 7 + .../Tango.Integration/Operation/MachineOperator.cs | 10 + .../Visual_Studio/Tango.PMR/Common/MessageType.cs | 21 +- .../Tango.PMR/Diagnostics/DiagnosticsMonitors.cs | 1017 ++++++++++++++ .../Diagnostics/PushDiagnosticsResponse.cs | 353 ++--- .../Diagnostics/SetComponentValueRequest.cs | 189 +++ .../Diagnostics/SetComponentValueResponse.cs | 131 ++ .../Tango.PMR/Diagnostics/ValueComponent.cs | 52 + .../Tango.PMR/Diagnostics/ValueComponentState.cs | 189 +++ .../Visual_Studio/Tango.PMR/ExtensionMethods.cs | 2 +- .../Tango.PMR/Hardware/HardwareDancerType.cs | 9 + .../Tango.PMR/Hardware/HardwareMotorType.cs | 12 + .../Tango.PMR/Hardware/HardwarePidControlType.cs | 42 + .../Tango.PMR/Hardware/HardwareWinderType.cs | 3 + .../Tango.PMR/Printing/JobWindingMethod.cs | 6 + Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 5 + Software/Visual_Studio/Tango.sln | 32 + .../Utilities/Tango.PMRGenerator.CLI/Program.cs | 91 +- 86 files changed, 5480 insertions(+), 792 deletions(-) create mode 100644 Software/Graphics/controller.png create mode 100644 Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto create mode 100644 Software/PMR/Messages/Diagnostics/SetComponentValueRequest.proto create mode 100644 Software/PMR/Messages/Diagnostics/SetComponentValueResponse.proto create mode 100644 Software/PMR/Messages/Diagnostics/ValueComponent.proto create mode 100644 Software/PMR/Messages/Diagnostics/ValueComponentState.proto create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/controller.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs create mode 100644 Software/Visual_Studio/Tango.BL/Entities/TechController.cs delete mode 100644 Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs delete mode 100644 Software/Visual_Studio/Tango.BL/Enumerations/Sensors.cs create mode 100644 Software/Visual_Studio/Tango.BL/Enumerations/TechControllers.cs create mode 100644 Software/Visual_Studio/Tango.CircularGauge/CircularGaugeControl.cs create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.resx create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.settings create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj create mode 100644 Software/Visual_Studio/Tango.CircularGauge/Themes/Generic.xaml create mode 100644 Software/Visual_Studio/Tango.CircularGauge/TypeConverters.cs create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_CONTROLLERS.cs delete mode 100644 Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueRequest.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueResponse.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponent.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponentState.cs (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index a1dced350..632ab86ed 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 2b587c81f..1265c49c9 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/controller.png b/Software/Graphics/controller.png new file mode 100644 index 000000000..5794f6cd8 Binary files /dev/null and b/Software/Graphics/controller.png differ diff --git a/Software/PMR/Messages/ColorLab/ColorSpace.proto b/Software/PMR/Messages/ColorLab/ColorSpace.proto index e25e935f4..f7f162d10 100644 --- a/Software/PMR/Messages/ColorLab/ColorSpace.proto +++ b/Software/PMR/Messages/ColorLab/ColorSpace.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.ColorLab; option java_package = "com.twine.tango.pmr.colorlab"; diff --git a/Software/PMR/Messages/ColorLab/LiquidType.proto b/Software/PMR/Messages/ColorLab/LiquidType.proto index 88ea24c82..255d9607b 100644 --- a/Software/PMR/Messages/ColorLab/LiquidType.proto +++ b/Software/PMR/Messages/ColorLab/LiquidType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.ColorLab; option java_package = "com.twine.tango.pmr.colorlab"; diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index 8ba5158ff..6f7848c9e 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -107,6 +107,8 @@ enum MessageType ThreadJoggingResponse = 2021; ThreadAbortJoggingRequest = 2022; ThreadAbortJoggingResponse = 2023; + SetComponentValueRequest = 2024; + SetComponentValueResponse = 2025; //Printing diff --git a/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto b/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto new file mode 100644 index 000000000..6bba594d5 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto @@ -0,0 +1,129 @@ +//------------------------------------------------------------------------------ +// +// 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"; + +import "DoubleArray.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DiagnosticsMonitors +{ + + //Dancer 1 (Min = 0, Max = 255, PPF = 10) + repeated double Dancer1Angle = 1; + + //Dancer 2 (Min = 0, Max = 1200, PPF = 1) + repeated double Dancer2Angle = 2; + + //Dancer 3 (Min = 0, Max = 1200, PPF = 1) + repeated double Dancer3Angle = 3; + + //Feeder Motor (Min = 0, Max = 100, PPF = 1) + repeated double FeederMotorFrequency = 4; + + //Dryer Motor (Min = 0, Max = 100, PPF = 1) + repeated double DryerMotor = 5; + + //Poller Motor (Min = 0, Max = 100, PPF = 1) + repeated double PollerMotor = 6; + + //Winder Motor (Min = 0, Max = 100, PPF = 1) + repeated double WinderMotor = 7; + + //Screw Motor (Min = 0, Max = 100, PPF = 1) + repeated double ScrewMotor = 8; + + //Thread Speed (Min = 0, Max = 100, PPF = 1) + repeated double ThreadSpeed = 9; + + //Mixer (Min = 0, Max = 100, PPF = 1) + repeated double MixerTemperature = 10; + + //Head Zone 1 (Min = 0, Max = 100, PPF = 1) + repeated double HeadZone1Temperature = 11; + + //Head Zone 2 (Min = 0, Max = 100, PPF = 1) + repeated double HeadZone2Temperature = 12; + + //Head Zone 3 (Min = 0, Max = 100, PPF = 1) + repeated double HeadZone3Temperature = 13; + + //Head Air Flow (Min = 0, Max = 100, PPF = 1) + repeated double HeadAirFlow = 14; + + //Feeder Tension (Min = 0, Max = 100, PPF = 1) + repeated double FeederTension = 15; + + //Puller Tension (Min = 0, Max = 100, PPF = 1) + repeated double PullerTension = 16; + + //Dryer Zone 1 (Min = 0, Max = 100, PPF = 1) + repeated double DryerZone1Temperature = 17; + + //Dryer Zone 2 (Min = 0, Max = 100, PPF = 1) + repeated double DryerZone2Temperature = 18; + + //Dryer Zone 3 (Min = 0, Max = 100, PPF = 1) + repeated double DryerZone3Temperature = 19; + + //Dryer Air Flow (Min = 0, Max = 100, PPF = 1) + repeated double DryerAirFlow = 20; + + //Winder Tension (Min = 0, Max = 100, PPF = 1) + repeated double WinderTension = 21; + + //Dispensers Motors (Min = 0, Max = 1080, PPF = 10) Channel Count = 8 + repeated DoubleArray DispensersMotorsFrequency = 22; + + //Dispensers Angular Encoders (Min = 0, Max = 100, PPF = 1) Channel Count = 8 + repeated DoubleArray DispensersAngularEncoders = 23; + + //Dispensers Linear Positions (Min = 0, Max = 100, PPF = 1) Channel Count = 8 + repeated DoubleArray DispensersLinearPositions = 24; + + //Dispensers Pressure (Min = 0, Max = 100, PPF = 1) Channel Count = 8 + repeated DoubleArray DispensersPressure = 25; + + //Mid Tank Pressure (Min = 0, Max = 100, PPF = 1) + repeated double MidTankPressure = 26; + + //Filter Delta Pressure (Min = 0, Max = 100, PPF = 1) + repeated double FilterDeltaPressure = 27; + + //Chiller Temperature (Min = 0, Max = 100, PPF = 1) + repeated double ChillerTemperature = 28; + + //Dispenser 1 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser1MotorFrequency = 29; + + //Dispenser 2 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser2MotorFrequency = 30; + + //Dispenser 3 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser3MotorFrequency = 31; + + //Dispenser 4 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser4MotorFrequency = 32; + + //Dispenser 5 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser5MotorFrequency = 33; + + //Dispenser 6 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser6MotorFrequency = 34; + + //Dispenser 7 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser7MotorFrequency = 35; + + //Dispenser 8 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + repeated double Dispenser8MotorFrequency = 36; + +} diff --git a/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto b/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto index c6af16fce..5a0940b78 100644 --- a/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto +++ b/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto @@ -1,35 +1,25 @@ syntax = "proto3"; -import "DoubleArray.proto"; import "DigitalPin.proto"; +import "ValueComponentState.proto"; +import "DiagnosticsMonitors.proto"; package Tango.PMR.Diagnostics; option java_package = "com.twine.tango.pmr.diagnostics"; message PushDiagnosticsResponse { - repeated double Dancer1Angle = 1; - repeated double Dancer2Angle = 2; - repeated double Dancer3Angle = 3; - - //Dispensers Motors Frequency Multi - repeated DoubleArray DispensersMotorsFrequency = 4; - - //Dispensers Motors Frequency Singles - repeated double Dispenser1MotorFrequency = 5; - repeated double Dispenser2MotorFrequency = 6; - repeated double Dispenser3MotorFrequency = 7; - repeated double Dispenser4MotorFrequency = 8; - repeated double Dispenser5MotorFrequency = 9; - repeated double Dispenser6MotorFrequency = 10; - repeated double Dispenser7MotorFrequency = 11; - repeated double Dispenser8MotorFrequency = 12; + //Monitors + DiagnosticsMonitors Monitors = 1; //Digital Pins States - repeated DigitalPin DigitalPins = 13; + repeated DigitalPin DigitalPins = 2; + + //Value Components Effective Values + repeated ValueComponentState ComponentsStates = 3; //Software Information - string Version = 14; - string VersionName = 15; - string VersionBuildDate = 16; + string Version = 4; + string VersionName = 5; + string VersionBuildDate = 6; } \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/SetComponentValueRequest.proto b/Software/PMR/Messages/Diagnostics/SetComponentValueRequest.proto new file mode 100644 index 000000000..c38ec90d6 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/SetComponentValueRequest.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "ValueComponent.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message SetComponentValueRequest +{ + ValueComponent Component = 1; + double Value = 2; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/SetComponentValueResponse.proto b/Software/PMR/Messages/Diagnostics/SetComponentValueResponse.proto new file mode 100644 index 000000000..e590d0778 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/SetComponentValueResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message SetComponentValueResponse +{ + +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/ValueComponent.proto b/Software/PMR/Messages/Diagnostics/ValueComponent.proto new file mode 100644 index 000000000..a6bc1a50a --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/ValueComponent.proto @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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 ValueComponent +{ + + //Heater 1 Temperature (Min = 0, Max = 100) + Heater1Temp = 0; + + //Heater 2 Temperature (Min = 0, Max = 100) + Heater2Temp = 1; + +} diff --git a/Software/PMR/Messages/Diagnostics/ValueComponentState.proto b/Software/PMR/Messages/Diagnostics/ValueComponentState.proto new file mode 100644 index 000000000..d22c7ba97 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/ValueComponentState.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "ValueComponent.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message ValueComponentState +{ + ValueComponent Component = 1; + double Value = 2; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Hardware/HardwareDancer.proto b/Software/PMR/Messages/Hardware/HardwareDancer.proto index 43b9435ee..5933b7cb4 100644 --- a/Software/PMR/Messages/Hardware/HardwareDancer.proto +++ b/Software/PMR/Messages/Hardware/HardwareDancer.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; import "HardwareDancerType.proto"; diff --git a/Software/PMR/Messages/Hardware/HardwareDancerType.proto b/Software/PMR/Messages/Hardware/HardwareDancerType.proto index f61b00ec3..b51f10c7a 100644 --- a/Software/PMR/Messages/Hardware/HardwareDancerType.proto +++ b/Software/PMR/Messages/Hardware/HardwareDancerType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Hardware; option java_package = "com.twine.tango.pmr.hardware"; @@ -8,10 +16,13 @@ option java_package = "com.twine.tango.pmr.hardware"; enum HardwareDancerType { + //Left Dancer LeftDancer = 0; + //Middle Dancer MiddleDancer = 1; + //Right Dancer RightDancer = 2; } diff --git a/Software/PMR/Messages/Hardware/HardwareDispenser.proto b/Software/PMR/Messages/Hardware/HardwareDispenser.proto index 7e8461193..ab5d766df 100644 --- a/Software/PMR/Messages/Hardware/HardwareDispenser.proto +++ b/Software/PMR/Messages/Hardware/HardwareDispenser.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; import "HardwareDispenserType.proto"; diff --git a/Software/PMR/Messages/Hardware/HardwareDispenserType.proto b/Software/PMR/Messages/Hardware/HardwareDispenserType.proto index fd723f896..21dc87530 100644 --- a/Software/PMR/Messages/Hardware/HardwareDispenserType.proto +++ b/Software/PMR/Messages/Hardware/HardwareDispenserType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Hardware; option java_package = "com.twine.tango.pmr.hardware"; diff --git a/Software/PMR/Messages/Hardware/HardwareMotor.proto b/Software/PMR/Messages/Hardware/HardwareMotor.proto index accc2a5ff..dbce226c7 100644 --- a/Software/PMR/Messages/Hardware/HardwareMotor.proto +++ b/Software/PMR/Messages/Hardware/HardwareMotor.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; import "HardwareMotorType.proto"; diff --git a/Software/PMR/Messages/Hardware/HardwareMotorType.proto b/Software/PMR/Messages/Hardware/HardwareMotorType.proto index 46c6911f9..d67bb5b0a 100644 --- a/Software/PMR/Messages/Hardware/HardwareMotorType.proto +++ b/Software/PMR/Messages/Hardware/HardwareMotorType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Hardware; option java_package = "com.twine.tango.pmr.hardware"; @@ -8,12 +16,16 @@ option java_package = "com.twine.tango.pmr.hardware"; enum HardwareMotorType { + //Winder Motor WinderMotor = 0; + //Feeder Motor FeederMotor = 1; + //Dryer Motor DryerMotor = 2; + //Pooler Motor PoolerMotor = 3; } diff --git a/Software/PMR/Messages/Hardware/HardwarePidControl.proto b/Software/PMR/Messages/Hardware/HardwarePidControl.proto index 49f1928cd..d02ea14d1 100644 --- a/Software/PMR/Messages/Hardware/HardwarePidControl.proto +++ b/Software/PMR/Messages/Hardware/HardwarePidControl.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; import "HardwarePidControlType.proto"; diff --git a/Software/PMR/Messages/Hardware/HardwarePidControlType.proto b/Software/PMR/Messages/Hardware/HardwarePidControlType.proto index e9fa9fd30..38785e85b 100644 --- a/Software/PMR/Messages/Hardware/HardwarePidControlType.proto +++ b/Software/PMR/Messages/Hardware/HardwarePidControlType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Hardware; option java_package = "com.twine.tango.pmr.hardware"; @@ -8,32 +16,46 @@ option java_package = "com.twine.tango.pmr.hardware"; enum HardwarePidControlType { + //Dryer Heater 1000w DryerHeater1000w = 0; + //Dryer Heater 200w 1 DryerHeater200w1 = 1; + //Dryer Heater 200w 2 DryerHeater200w2 = 2; + //Head Heater Zone 1 HeadHeaterZ1 = 3; + //Head Heater Zone 2 HeadHeaterZ2 = 4; + //Head Heater Zone 3 HeadHeaterZ3 = 5; + //Head Heater Zone 4 HeadHeaterZ4 = 6; + //Mixer Heater MixerHeater = 7; + //Waste Control WasteControl = 8; + //Dryer Motor MotorDryer = 9; + //Feeder Motor MotorFeeder = 10; + //Pooler Motor MotorPooler = 11; + //Winder Motor MotorWinder = 12; + //Dryer Heater 400 DryerHeater400 = 13; } diff --git a/Software/PMR/Messages/Hardware/HardwareWinder.proto b/Software/PMR/Messages/Hardware/HardwareWinder.proto index a9ba73af2..c00b56c83 100644 --- a/Software/PMR/Messages/Hardware/HardwareWinder.proto +++ b/Software/PMR/Messages/Hardware/HardwareWinder.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; import "HardwareWinderType.proto"; diff --git a/Software/PMR/Messages/Hardware/HardwareWinderType.proto b/Software/PMR/Messages/Hardware/HardwareWinderType.proto index 4064c96af..d3cc0a74e 100644 --- a/Software/PMR/Messages/Hardware/HardwareWinderType.proto +++ b/Software/PMR/Messages/Hardware/HardwareWinderType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Hardware; option java_package = "com.twine.tango.pmr.hardware"; @@ -8,6 +16,7 @@ option java_package = "com.twine.tango.pmr.hardware"; enum HardwareWinderType { + //Internal Winder InternalWinder = 0; } diff --git a/Software/PMR/Messages/Printing/DispenserLiquidType.proto b/Software/PMR/Messages/Printing/DispenserLiquidType.proto index 27757a92d..0288ee949 100644 --- a/Software/PMR/Messages/Printing/DispenserLiquidType.proto +++ b/Software/PMR/Messages/Printing/DispenserLiquidType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Printing; option java_package = "com.twine.tango.pmr.printing"; diff --git a/Software/PMR/Messages/Printing/JobSpool.proto b/Software/PMR/Messages/Printing/JobSpool.proto index a431ff9f8..ba2fb4112 100644 --- a/Software/PMR/Messages/Printing/JobSpool.proto +++ b/Software/PMR/Messages/Printing/JobSpool.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; import "JobSpoolType.proto"; diff --git a/Software/PMR/Messages/Printing/JobSpoolType.proto b/Software/PMR/Messages/Printing/JobSpoolType.proto index c9bc45ed8..afe6b3331 100644 --- a/Software/PMR/Messages/Printing/JobSpoolType.proto +++ b/Software/PMR/Messages/Printing/JobSpoolType.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Printing; option java_package = "com.twine.tango.pmr.printing"; diff --git a/Software/PMR/Messages/Printing/JobWindingMethod.proto b/Software/PMR/Messages/Printing/JobWindingMethod.proto index a567915b7..32c354458 100644 --- a/Software/PMR/Messages/Printing/JobWindingMethod.proto +++ b/Software/PMR/Messages/Printing/JobWindingMethod.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Printing; option java_package = "com.twine.tango.pmr.printing"; @@ -8,8 +16,10 @@ option java_package = "com.twine.tango.pmr.printing"; enum JobWindingMethod { + //Embroidery Winding Embroidery = 0; + //Calibration Winding Calibration = 1; } diff --git a/Software/PMR/Messages/Printing/ProcessParameters.proto b/Software/PMR/Messages/Printing/ProcessParameters.proto index 9f4209571..7fd398fa0 100644 --- a/Software/PMR/Messages/Printing/ProcessParameters.proto +++ b/Software/PMR/Messages/Printing/ProcessParameters.proto @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; package Tango.PMR.Printing; option java_package = "com.twine.tango.pmr.printing"; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml new file mode 100644 index 000000000..60b96bc9d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs new file mode 100644 index 000000000..4d183dac6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs @@ -0,0 +1,90 @@ +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; + +namespace Tango.MachineStudio.Technician.Editors +{ + [ContentProperty("InnerContent")] + public partial class ControllerElementEditor : ElementEditor + { + public ControllerElementEditor() + : base() + { + InitializeComponent(); + } + + public ControllerElementEditor(ControllerItem controllerItem) + : this() + { + ControllerItem = controllerItem; + DataContext = ControllerItem; + } + + public ControllerElementEditor(ControllerItem controllerItem, Rect bounds) + : this(controllerItem) + { + Left = bounds.Left; + Top = bounds.Top; + Width = bounds.Width; + Height = bounds.Height; + } + + private ControllerItem _controllerItem; + + public ControllerItem ControllerItem + { + get { return _controllerItem; } + set { _controllerItem = value; RaisePropertyChanged(nameof(ControllerItem)); } + } + + + /// + /// Clones this instance. + /// + /// + public override IElementEditor Clone() + { + try + { + var clonedItem = ControllerItem.Clone() as ControllerItem; + ControllerElementEditor cloned = new ControllerElementEditor(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 ControllerItem; } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/controller.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/controller.png new file mode 100644 index 000000000..5794f6cd8 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/controller.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml new file mode 100644 index 000000000..57d807b09 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + Selected Input + + + Update Interval + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml.cs new file mode 100644 index 000000000..624eef296 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ControllerTemplate.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Technician.PropertiesTemplates +{ + /// + /// Interaction logic for MonitorTemplate.xaml + /// + public partial class ControllerTemplate : UserControl + { + public ControllerTemplate() + { + InitializeComponent(); + } + } +} 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 56bab4135..ecc235d02 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 @@ -102,6 +102,9 @@ + + ControllerElementEditor.xaml + DigitalInElementEditor.xaml @@ -146,6 +149,9 @@ DispenserTemplate.xaml + + ControllerTemplate.xaml + MotorGroupTemplate.xaml @@ -164,6 +170,7 @@ SingleGraphTemplate.xaml + @@ -202,6 +209,10 @@ GlobalVersionInfo.cs + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -258,6 +269,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -342,6 +357,10 @@ {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL + + {6efd5895-177b-4bbb-af52-29f4d53b3fbd} + Tango.CircularGauge + {a2f5af44-29ff-45d6-9d25-ecda5cce88b5} Tango.ColorPicker @@ -460,5 +479,8 @@ + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs new file mode 100644 index 000000000..67266ee66 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Xml.Serialization; +using Tango.BL.Entities; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Technician.TechItems +{ + /// + /// Represents a single component value controller and monitor. + /// + /// + [TechItem(10)] + public class ControllerItem : TechItem + { + /// + /// Occurs when the controller value has changed. + /// + public event EventHandler ValueChanged; + + private TechController _techController; + /// + /// Gets or sets the DB controller item. + /// + [XmlIgnore] + public TechController TechController + { + get { return _techController; } + set { _techController = value; RaisePropertyChangedAuto(); TechName = _techController != null ? _techController.Description : null; ItemGuid = value != null ? value.Guid : null; } + } + + private double _value; + /// + /// Gets or sets the component value. + /// + [XmlIgnore] + public double Value + { + get { return _value; } + set + { + _value = value; RaisePropertyChangedAuto(); + ValueChanged?.Invoke(this, _value); + } + } + + private int _updateInterval; + /// + /// Gets or sets the update interval. + /// + public int UpdateInterval + { + get { return _updateInterval; } + set { _updateInterval = value; RaisePropertyChangedAuto(); } + } + + /// + /// Gets or sets the last update time. + /// + [XmlIgnore] + public DateTime LastUpdateTime { get; set; } + + + private double _effectiveValue; + /// + /// Gets or sets the effective value received from the embedded device. + /// + [XmlIgnore] + public double EffectiveValue + { + get { return _effectiveValue; } + set + { + LastUpdateTime = DateTime.Now; + + if (_effectiveValue != value) + { + _effectiveValue = value; + RaisePropertyChangedAuto(); + } + } + } + + /// + /// Initializes a new instance of the class. + /// + public ControllerItem() : base() + { + Name = "Value Controller"; + Description = "Single component value controller"; + Image = ResourceHelper.GetImageFromResources("Images/controller.png"); + Color = Colors.DodgerBlue; + LastUpdateTime = DateTime.Now; + UpdateInterval = 10; + } + + /// + /// Initializes a new instance of the class. + /// + /// The db tech controller. + public ControllerItem(TechController techController) : this() + { + TechController = techController; + } + + /// + /// Clones this instance. + /// + /// + public override TechItem Clone() + { + ControllerItem cloned = base.Clone() as ControllerItem; + cloned.TechController = TechController; + 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 44d5d2c5a..e18250594 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 @@ -29,6 +29,7 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlInclude(typeof(ThreadMotionItem))] [XmlInclude(typeof(MotorGroupItem))] [XmlInclude(typeof(DigitalInItem))] + [XmlInclude(typeof(ControllerItem))] public abstract class TechItem : ExtendedObject { /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index a5a95fc35..63aca3e70 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -39,7 +39,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// public class MachineTechViewVM : ViewModel, IShutdownListener { - private List _diagnoticsDataProperties; + private List _diagnoticsMonitorsDataProperties; private Dictionary _singleControllers; private Dictionary _multiControllers; private static object _elementsLock = new object(); @@ -178,7 +178,7 @@ namespace Tango.MachineStudio.Technician.ViewModels _multiControllers = new Dictionary(); AvailableTechItems = TechItem.GetAvailableTechItems().ToObservableCollection(); SelectedTechItem = AvailableTechItems.FirstOrDefault(); - _diagnoticsDataProperties = typeof(PushDiagnosticsResponse).GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); + _diagnoticsMonitorsDataProperties = typeof(DiagnosticsMonitors).GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); ApplicationManager = applicationManager; ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; @@ -252,11 +252,11 @@ namespace Tango.MachineStudio.Technician.ViewModels if (DateTime.Now > monitorItem.LastUpdateTime.AddMilliseconds(monitorItem.UpdateInterval)) { - var prop = _diagnoticsDataProperties.SingleOrDefault(x => x.Name == monitorItem.TechMonitor.Name); + var prop = _diagnoticsMonitorsDataProperties.SingleOrDefault(x => x.Name == monitorItem.TechMonitor.Name); if (prop != null) { - monitorItem.Value = GetDataLastValue(monitorItem.TechMonitor, prop.GetValue(data)); + monitorItem.Value = GetDataLastValue(monitorItem.TechMonitor, prop.GetValue(data.Monitors)); } } } @@ -266,11 +266,11 @@ namespace Tango.MachineStudio.Technician.ViewModels if (DateTime.Now > meterItem.LastUpdateTime.AddMilliseconds(meterItem.UpdateInterval)) { - var prop = _diagnoticsDataProperties.SingleOrDefault(x => x.Name == meterItem.TechMonitor.Name); + var prop = _diagnoticsMonitorsDataProperties.SingleOrDefault(x => x.Name == meterItem.TechMonitor.Name); if (prop != null) { - meterItem.Value = GetDataLastValue(meterItem.TechMonitor, prop.GetValue(data)); + meterItem.Value = GetDataLastValue(meterItem.TechMonitor, prop.GetValue(data.Monitors)); } } } @@ -278,7 +278,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { SingleGraphItem graphItem = item as SingleGraphItem; - var prop = _diagnoticsDataProperties.SingleOrDefault(x => x.Name == graphItem.TechMonitor.Name); + var prop = _diagnoticsMonitorsDataProperties.SingleOrDefault(x => x.Name == graphItem.TechMonitor.Name); if (prop != null) { @@ -286,7 +286,7 @@ namespace Tango.MachineStudio.Technician.ViewModels if (_singleControllers.TryGetValue(graphItem, out controller)) { - controller.PushData(GetDataArray(graphItem.TechMonitor, prop.GetValue(data))); + controller.PushData(GetDataArray(graphItem.TechMonitor, prop.GetValue(data.Monitors))); } } } @@ -294,7 +294,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { MultiGraphItem graphItem = item as MultiGraphItem; - var prop = _diagnoticsDataProperties.SingleOrDefault(x => x.Name == graphItem.TechMonitor.Name); + var prop = _diagnoticsMonitorsDataProperties.SingleOrDefault(x => x.Name == graphItem.TechMonitor.Name); if (prop != null) { @@ -302,7 +302,7 @@ namespace Tango.MachineStudio.Technician.ViewModels if (_multiControllers.TryGetValue(graphItem, out controller)) { - controller.PushData(GetDataMatrix(graphItem.TechMonitor, prop.GetValue(data))); + controller.PushData(GetDataMatrix(graphItem.TechMonitor, prop.GetValue(data.Monitors))); } } } @@ -328,6 +328,20 @@ namespace Tango.MachineStudio.Technician.ViewModels digitalInItem.Value = digitalPin.Value; } } + else if (item.GetType() == typeof(ControllerItem)) + { + ControllerItem controllerItem = item as ControllerItem; + + if (DateTime.Now > controllerItem.LastUpdateTime.AddMilliseconds(controllerItem.UpdateInterval)) + { + var componentState = data.ComponentsStates.SingleOrDefault(x => (int)x.Component == controllerItem.TechController.Code); + + if (componentState != null) + { + controllerItem.EffectiveValue = componentState.Value; + } + } + } } } } @@ -466,6 +480,11 @@ namespace Tango.MachineStudio.Technician.ViewModels { CreateElement(bounds, Adapter.TechIos.Where(x => x.Type == IOType.DigitalInput.ToInt32()).FirstOrDefault()); } + else if (item is ControllerItem) + { + var editor = CreateElement(bounds, Adapter.TechControllers.FirstOrDefault()); + InitControllerItem(editor.ControllerItem); + } } /// @@ -559,6 +578,11 @@ namespace Tango.MachineStudio.Technician.ViewModels (item as DigitalInItem).TechIo = Adapter.TechIos.FirstOrDefault(x => x.Guid == item.ItemGuid); CreateElement(item); } + else if (item is ControllerItem) + { + (item as ControllerItem).TechController = Adapter.TechControllers.FirstOrDefault(x => x.Guid == item.ItemGuid); + CreateElement(item); + } } /// @@ -651,6 +675,11 @@ namespace Tango.MachineStudio.Technician.ViewModels var motorGroupItem = element.HostedElement as MotorGroupItem; InitMotorGroupItem(motorGroupItem); } + else if (element is ControllerItem) + { + var controllerItem = element.HostedElement as ControllerItem; + InitControllerItem(controllerItem); + } } } @@ -971,6 +1000,29 @@ namespace Tango.MachineStudio.Technician.ViewModels }; } + /// + /// Initializes the controller item. + /// + /// The controller item. + private void InitControllerItem(ControllerItem item) + { + item.ValueChanged += async (x, value) => + { + try + { + await MachineOperator.SetComponentValue(new SetComponentValueRequest() + { + Component = (ValueComponent)item.TechController.Code, + Value = value + }); + } + catch (Exception ex) + { + //TODO: Show Exception. + } + }; + } + #endregion #region Public Methods diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index 5996c351b..3d4ecdac1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -363,6 +363,9 @@ + + + diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechController.cs b/Software/Visual_Studio/Tango.BL/Entities/TechController.cs new file mode 100644 index 000000000..5f6b14463 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Entities/TechController.cs @@ -0,0 +1,144 @@ +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("TECH_CONTROLLERS")] + public partial class TechController : ObservableEntity + { + + protected Int32 _code; + /// + /// Gets or sets the techcontroller code. + /// + [Column("CODE")] + + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + protected String _name; + /// + /// Gets or sets the techcontroller name. + /// + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + protected String _description; + /// + /// Gets or sets the techcontroller description. + /// + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + _description = value; RaisePropertyChanged(nameof(Description)); + } + + } + + protected Double _min; + /// + /// Gets or sets the techcontroller min. + /// + [Column("MIN")] + + public Double Min + { + get + { + return _min; + } + + set + { + _min = value; RaisePropertyChanged(nameof(Min)); + } + + } + + protected Double _max; + /// + /// Gets or sets the techcontroller max. + /// + [Column("MAX")] + + public Double Max + { + get + { + return _max; + } + + set + { + _max = value; RaisePropertyChanged(nameof(Max)); + } + + } + + protected String _units; + /// + /// Gets or sets the techcontroller units. + /// + [Column("UNITS")] + + public String Units + { + get + { + return _units; + } + + set + { + _units = value; RaisePropertyChanged(nameof(Units)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public TechController() : base() + { + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs b/Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs deleted file mode 100644 index dff290eb1..000000000 --- a/Software/Visual_Studio/Tango.BL/Entities/TechHeater.cs +++ /dev/null @@ -1,84 +0,0 @@ -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("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/Entities/User.cs b/Software/Visual_Studio/Tango.BL/Entities/User.cs index 4d1cc4c54..546ff4a1a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/User.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/User.cs @@ -137,6 +137,26 @@ namespace Tango.BL.Entities } + protected Nullable _lastlogin; + /// + /// Gets or sets the user last login. + /// + [Column("LAST_LOGIN")] + + public Nullable LastLogin + { + get + { + return _lastlogin; + } + + set + { + _lastlogin = value; RaisePropertyChanged(nameof(LastLogin)); + } + + } + protected Address _address; /// /// Gets or sets the user address. diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/Sensors.cs b/Software/Visual_Studio/Tango.BL/Enumerations/Sensors.cs deleted file mode 100644 index 9d80595d2..000000000 --- a/Software/Visual_Studio/Tango.BL/Enumerations/Sensors.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.ComponentModel; - -namespace Tango.BL.Entities -{ - public enum Sensors - { - - /// - /// (Dancer 1) - /// - [Description("Dancer 1")] - Dancer1Angle = 0, - - /// - /// (Dancer 2) - /// - [Description("Dancer 2")] - Dancer2Angle = 1, - - /// - /// (Dancer 3) - /// - [Description("Dancer 3")] - Dancer3Angle = 2, - - /// - /// (Feeder Motor) - /// - [Description("Feeder Motor")] - FeederMotorFrequency = 3, - - /// - /// (Dryer Motor) - /// - [Description("Dryer Motor")] - DryerMotor = 4, - - /// - /// (Poller Motor) - /// - [Description("Poller Motor")] - PollerMotor = 5, - - /// - /// (Winder Motor) - /// - [Description("Winder Motor")] - WinderMotor = 6, - - /// - /// (Screw Motor) - /// - [Description("Screw Motor")] - ScrewMotor = 7, - - /// - /// (Thread Speed) - /// - [Description("Thread Speed")] - ThreadSpeed = 8, - - /// - /// (Mixer) - /// - [Description("Mixer")] - MixerTemperature = 9, - - /// - /// (Head Zone 1) - /// - [Description("Head Zone 1")] - HeadZone1Temperature = 10, - - /// - /// (Head Zone 2) - /// - [Description("Head Zone 2")] - HeadZone2Temperature = 11, - - /// - /// (Head Zone 3) - /// - [Description("Head Zone 3")] - HeadZone3Temperature = 12, - - /// - /// (Head Air Flow) - /// - [Description("Head Air Flow")] - HeadAirFlow = 13, - - /// - /// (Feeder Tension) - /// - [Description("Feeder Tension")] - FeederTension = 14, - - /// - /// (Puller Tension) - /// - [Description("Puller Tension")] - PullerTension = 15, - - /// - /// (Dryer Zone 1) - /// - [Description("Dryer Zone 1")] - DryerZone1Temperature = 16, - - /// - /// (Dryer Zone 2) - /// - [Description("Dryer Zone 2")] - DryerZone2Temperature = 17, - - /// - /// (Dryer Zone 3) - /// - [Description("Dryer Zone 3")] - DryerZone3Temperature = 18, - - /// - /// (Dryer Air Flow) - /// - [Description("Dryer Air Flow")] - DryerAirFlow = 19, - - /// - /// (Winder Tension) - /// - [Description("Winder Tension")] - WinderTension = 20, - - /// - /// (Dispensers Motors) - /// - [Description("Dispensers Motors")] - DispensersMotorsFrequency = 21, - - /// - /// (Dispensers Angular Encoders) - /// - [Description("Dispensers Angular Encoders")] - DispensersAngularEncoders = 22, - - /// - /// (Dispensers Linear Positions) - /// - [Description("Dispensers Linear Positions")] - DispensersLinearPositions = 23, - - /// - /// (Dispensers Pressure) - /// - [Description("Dispensers Pressure")] - DispensersPressure = 24, - - /// - /// (Mid Tank Pressure) - /// - [Description("Mid Tank Pressure")] - MidTankPressure = 25, - - /// - /// (Filter Delta Pressure) - /// - [Description("Filter Delta Pressure")] - FilterDeltaPressure = 26, - - /// - /// (Chiller Temperature) - /// - [Description("Chiller Temperature")] - ChillerTemperature = 27, - - } -} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/TechControllers.cs b/Software/Visual_Studio/Tango.BL/Enumerations/TechControllers.cs new file mode 100644 index 000000000..570f647c0 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/TechControllers.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.BL.Enumerations +{ + public enum TechControllers + { + + /// + /// (Heater 1 Temperature) + /// + [Description("Heater 1 Temperature")] + Heater1Temp = 0, + + /// + /// (Heater 2 Temperature) + /// + [Description("Heater 2 Temperature")] + Heater2Temp = 1, + + } +} diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs index aa64cebcb..20eabd0ae 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs @@ -469,17 +469,17 @@ namespace Tango.BL } /// - /// Gets or sets the TechDispensers. + /// Gets or sets the TechControllers. /// - public DbSet TechDispensers + public DbSet TechControllers { get; set; } /// - /// Gets or sets the TechHeaters. + /// Gets or sets the TechDispensers. /// - public DbSet TechHeaters + public DbSet TechDispensers { get; set; } diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs index 297de3b88..59f5d31fa 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs @@ -274,7 +274,7 @@ namespace Tango.BL TechIos = Context.TechIos.ToObservableCollection(); - TechHeaters = Context.TechHeaters.ToObservableCollection(); + TechControllers = Context.TechControllers.ToObservableCollection(); IdsPackFormulas = Context.IdsPackFormulas.ToObservableCollection(); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs index 0964f29f7..97265b8a8 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs @@ -2059,74 +2059,74 @@ namespace Tango.BL } - private ObservableCollection _techdispensers; + private ObservableCollection _techcontrollers; /// - /// Gets or sets the TechDispensers. + /// Gets or sets the TechControllers. /// - public ObservableCollection TechDispensers + public ObservableCollection TechControllers { get { - return _techdispensers; + return _techcontrollers; } set { - _techdispensers = value; RaisePropertyChanged(nameof(TechDispensers)); + _techcontrollers = value; RaisePropertyChanged(nameof(TechControllers)); } } - private ICollectionView _techdispensersViewSource; + private ICollectionView _techcontrollersViewSource; /// - /// Gets or sets the TechDispensers View Source. + /// Gets or sets the TechControllers View Source. /// - public ICollectionView TechDispensersViewSource + public ICollectionView TechControllersViewSource { get { - return _techdispensersViewSource; + return _techcontrollersViewSource; } set { - _techdispensersViewSource = value; RaisePropertyChanged(nameof(TechDispensersViewSource)); + _techcontrollersViewSource = value; RaisePropertyChanged(nameof(TechControllersViewSource)); } } - private ObservableCollection _techheaters; + private ObservableCollection _techdispensers; /// - /// Gets or sets the TechHeaters. + /// Gets or sets the TechDispensers. /// - public ObservableCollection TechHeaters + public ObservableCollection TechDispensers { get { - return _techheaters; + return _techdispensers; } set { - _techheaters = value; RaisePropertyChanged(nameof(TechHeaters)); + _techdispensers = value; RaisePropertyChanged(nameof(TechDispensers)); } } - private ICollectionView _techheatersViewSource; + private ICollectionView _techdispensersViewSource; /// - /// Gets or sets the TechHeaters View Source. + /// Gets or sets the TechDispensers View Source. /// - public ICollectionView TechHeatersViewSource + public ICollectionView TechDispensersViewSource { get { - return _techheatersViewSource; + return _techdispensersViewSource; } set { - _techheatersViewSource = value; RaisePropertyChanged(nameof(TechHeatersViewSource)); + _techdispensersViewSource = value; RaisePropertyChanged(nameof(TechDispensersViewSource)); } } @@ -2503,9 +2503,9 @@ namespace Tango.BL SyncConfigurationsViewSource = CreateCollectionView(SyncConfigurations); - TechDispensersViewSource = CreateCollectionView(TechDispensers); + TechControllersViewSource = CreateCollectionView(TechControllers); - TechHeatersViewSource = CreateCollectionView(TechHeaters); + TechDispensersViewSource = CreateCollectionView(TechDispensers); TechIosViewSource = CreateCollectionView(TechIos); diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index a3f952644..714d74b77 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -89,6 +89,7 @@ + @@ -149,7 +150,6 @@ - @@ -174,7 +174,6 @@ - diff --git a/Software/Visual_Studio/Tango.CircularGauge/CircularGaugeControl.cs b/Software/Visual_Studio/Tango.CircularGauge/CircularGaugeControl.cs new file mode 100644 index 000000000..1d1d598c6 --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/CircularGaugeControl.cs @@ -0,0 +1,1419 @@ +/*Copyright (c) 2009 T.Evelyn (evescode@gmail.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1.Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + +DAMAGE.*/ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Media.Animation; + +namespace Tango.CircularGauge +{ + /// + /// Represents a Circular Gauge control + /// + [TemplatePart(Name = "LayoutRoot", Type = typeof(Grid))] + [TemplatePart(Name = "Pointer", Type = typeof(Path))] + [TemplatePart(Name = "RangeIndicatorLight", Type = typeof(Ellipse))] + [TemplatePart(Name = "PointerCap", Type = typeof(Ellipse))] + public class CircularGaugeControl : Control + { + #region Private variables + + //Private variables + private Grid rootGrid; + private Path rangeIndicator; + private Path pointer; + private Ellipse pointerCap; + private Ellipse lightIndicator; + private bool isInitialValueSet = false; + private Double arcradius1; + private Double arcradius2; + private int animatingSpeedFactor = 6; + + #endregion + + #region Dependency properties + + /// + /// Dependency property to Get/Set the current value + /// + public static readonly DependencyProperty CurrentValueProperty = + DependencyProperty.Register("CurrentValue", typeof(double), typeof(CircularGaugeControl), + new PropertyMetadata(Double.MinValue, new PropertyChangedCallback(CircularGaugeControl.OnCurrentValuePropertyChanged))); + + /// + /// Dependency property to Get/Set the Minimum Value + /// + public static readonly DependencyProperty MinValueProperty = + DependencyProperty.Register("MinValue", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Maximum Value + /// + public static readonly DependencyProperty MaxValueProperty = + DependencyProperty.Register("MaxValue", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Radius of the gauge + /// + public static readonly DependencyProperty RadiusProperty = + DependencyProperty.Register("Radius", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Pointer cap Radius + /// + public static readonly DependencyProperty PointerCapRadiusProperty = + DependencyProperty.Register("PointerCapRadius", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the pointer length + /// + public static readonly DependencyProperty PointerLengthProperty = + DependencyProperty.Register("PointerLength", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the scale Radius + /// + public static readonly DependencyProperty ScaleRadiusProperty = + DependencyProperty.Register("ScaleRadius", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the starting angle of scale + /// + public static readonly DependencyProperty ScaleStartAngleProperty = + DependencyProperty.Register("ScaleStartAngle", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the sweep angle of scale + /// + public static readonly DependencyProperty ScaleSweepAngleProperty = + DependencyProperty.Register("ScaleSweepAngle", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the number of major divisions on the scale + /// + public static readonly DependencyProperty MajorDivisionsCountProperty = + DependencyProperty.Register("MajorDivisionsCount", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the number of minor divisions on the scale + /// + public static readonly DependencyProperty MinorDivisionsCountProperty = + DependencyProperty.Register("MinorDivisionsCount", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set Optimal Range End Value + /// + public static readonly DependencyProperty OptimalRangeEndValueProperty = + DependencyProperty.Register("OptimalRangeEndValue", typeof(double), typeof(CircularGaugeControl), new PropertyMetadata(new PropertyChangedCallback(CircularGaugeControl.OnOptimalRangeEndValuePropertyChanged))); + + /// + /// Dependency property to Get/Set Optimal Range Start Value + /// + public static readonly DependencyProperty OptimalRangeStartValueProperty = + DependencyProperty.Register("OptimalRangeStartValue", typeof(double), typeof(CircularGaugeControl), new PropertyMetadata(new PropertyChangedCallback(CircularGaugeControl.OnOptimalRangeStartValuePropertyChanged))); + + /// + /// Dependency property to Get/Set the image source + /// + public static readonly DependencyProperty ImageSourceProperty = + DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the image offset + /// + public static readonly DependencyProperty ImageOffsetProperty = + DependencyProperty.Register("ImageOffset", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the range indicator light offset + /// + public static readonly DependencyProperty RangeIndicatorLightOffsetProperty = + DependencyProperty.Register("RangeIndicatorLightOffset", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the image Size + /// + public static readonly DependencyProperty ImageSizeProperty = + DependencyProperty.Register("ImageSize", typeof(Size), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Range Indicator Radius + /// + public static readonly DependencyProperty RangeIndicatorRadiusProperty = + DependencyProperty.Register("RangeIndicatorRadius", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Range Indicator Thickness + /// + public static readonly DependencyProperty RangeIndicatorThicknessProperty = + DependencyProperty.Register("RangeIndicatorThickness", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the scale label Radius + /// + public static readonly DependencyProperty ScaleLabelRadiusProperty = + DependencyProperty.Register("ScaleLabelRadius", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Scale Label Size + /// + public static readonly DependencyProperty ScaleLabelSizeProperty = + DependencyProperty.Register("ScaleLabelSize", typeof(Size), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Scale Label FontSize + /// + public static readonly DependencyProperty ScaleLabelFontSizeProperty = + DependencyProperty.Register("ScaleLabelFontSize", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Scale Label Foreground + /// + + public static readonly DependencyProperty ScaleLabelForegroundProperty = + DependencyProperty.Register("ScaleLabelForeground", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Major Tick Size + /// + public static readonly DependencyProperty MajorTickSizeProperty = + DependencyProperty.Register("MajorTickRectSize", typeof(Size), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Minor Tick Size + /// + public static readonly DependencyProperty MinorTickSizeProperty = + DependencyProperty.Register("MinorTickSize", typeof(Size), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Major Tick Color + /// + public static readonly DependencyProperty MajorTickColorProperty = + DependencyProperty.Register("MajorTickColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Minor Tick Color + /// + public static readonly DependencyProperty MinorTickColorProperty = + DependencyProperty.Register("MinorTickColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Gauge Background Color + /// + public static readonly DependencyProperty GaugeBackgroundColorProperty = + DependencyProperty.Register("GaugeBackgroundColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Pointer Thickness + /// + public static readonly DependencyProperty PointerThicknessProperty = + DependencyProperty.Register("PointerThickness", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the an option to reset the pointer on start up to the minimum value + /// + public static readonly DependencyProperty ResetPointerOnStartUpProperty = + DependencyProperty.Register("ResetPointerOnStartUp", typeof(bool), typeof(CircularGaugeControl), new PropertyMetadata(false, null)); + + /// + /// Dependency property to Get/Set the Scale Value Precision + /// + public static readonly DependencyProperty ScaleValuePrecisionProperty = + DependencyProperty.Register("ScaleValuePrecision", typeof(int), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Below Optimal Range Color + /// + + public static readonly DependencyProperty BelowOptimalRangeColorProperty = + DependencyProperty.Register("BelowOptimalRangeColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Optimal Range Color + /// + + public static readonly DependencyProperty OptimalRangeColorProperty = + DependencyProperty.Register("OptimalRangeColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Above Optimal Range Color + /// + + public static readonly DependencyProperty AboveOptimalRangeColorProperty = + DependencyProperty.Register("AboveOptimalRangeColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Dial Text + /// + + public static readonly DependencyProperty DialTextProperty = + DependencyProperty.Register("DialText", typeof(string), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Dial Text Color + /// + + public static readonly DependencyProperty DialTextColorProperty = + DependencyProperty.Register("DialTextColor", typeof(Color), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Dial Text Font Size + /// + + public static readonly DependencyProperty DialTextFontSizeProperty = + DependencyProperty.Register("DialTextFontSize", typeof(int), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Dial Text Offset + /// + + public static readonly DependencyProperty DialTextOffsetProperty = + DependencyProperty.Register("DialTextOffset", typeof(double), typeof(CircularGaugeControl), null); + + /// + /// Dependency property to Get/Set the Range Indicator light Radius + /// + + public static readonly DependencyProperty RangeIndicatorLightRadiusProperty = + DependencyProperty.Register("RangeIndicatorLightRadius", typeof(double), typeof(CircularGaugeControl), null); + + + #endregion + + #region Wrapper properties + + /// + /// Gets/Sets the current value + /// + public double CurrentValue + { + get + { + return (double)GetValue(CurrentValueProperty); + } + set + { + SetValue(CurrentValueProperty, value); + } + } + + /// + /// Gets/Sets the Minimum Value + /// + public double MinValue + { + get + { + return (double)GetValue(MinValueProperty); + } + set + { + SetValue(MinValueProperty, value); + } + } + + /// + /// Gets/Sets the Maximum Value + /// + public double MaxValue + { + get + { + return (double)GetValue(MaxValueProperty); + } + set + { + SetValue(MaxValueProperty, value); + } + } + + /// + /// Gets/Sets the Minimum Value + /// + public double Radius + { + get + { + return (double)GetValue(RadiusProperty); + } + set + { + SetValue(RadiusProperty, value); + } + } + + /// + /// Gets/Sets the Pointer cap radius + /// + public double PointerCapRadius + { + get + { + return (double)GetValue(PointerCapRadiusProperty); + } + set + { + SetValue(PointerCapRadiusProperty, value); + } + } + + /// + /// Gets/Sets the Pointer Length + /// + public double PointerLength + { + get + { + return (double)GetValue(PointerLengthProperty); + } + set + { + SetValue(PointerLengthProperty, value); + } + } + + /// + /// Gets/Sets the Pointer Thickness + /// + public double PointerThickness + { + get + { + return (double)GetValue(PointerThicknessProperty); + } + set + { + SetValue(PointerThicknessProperty, value); + } + } + + /// + /// Gets/Sets the Scale radius + /// + public double ScaleRadius + { + get + { + return (double)GetValue(ScaleRadiusProperty); + } + set + { + SetValue(ScaleRadiusProperty, value); + } + } + + /// + /// Gets/Sets the scale start angle + /// + public double ScaleStartAngle + { + get + { + return (double)GetValue(ScaleStartAngleProperty); + } + set + { + SetValue(ScaleStartAngleProperty, value); + } + } + + /// + /// Gets/Sets the scale sweep angle + /// + public double ScaleSweepAngle + { + get + { + return (double)GetValue(ScaleSweepAngleProperty); + } + set + { + SetValue(ScaleSweepAngleProperty, value); + } + } + + /// + /// Gets/Sets the number of major divisions on the scale + /// + public double MajorDivisionsCount + { + get + { + return (double)GetValue(MajorDivisionsCountProperty); + } + set + { + SetValue(MajorDivisionsCountProperty, value); + } + } + + /// + /// Gets/Sets the number of minor divisions on the scale + /// + public double MinorDivisionsCount + { + get + { + return (double)GetValue(MinorDivisionsCountProperty); + } + set + { + SetValue(MinorDivisionsCountProperty, value); + } + } + + /// + /// Gets/Sets the Optimal range end value + /// + public double OptimalRangeEndValue + { + get + { + return (double)GetValue(OptimalRangeEndValueProperty); + } + set + { + SetValue(OptimalRangeEndValueProperty, value); + } + } + /// + /// Gets/Sets the Optimal Range Start Value + /// + public double OptimalRangeStartValue + { + get + { + return (double)GetValue(OptimalRangeStartValueProperty); + } + set + { + SetValue(OptimalRangeStartValueProperty, value); + } + } + + /// + /// Gets/Sets the Gauge image source + /// + public ImageSource ImageSource + { + get + { + return (ImageSource)GetValue(ImageSourceProperty); + } + set + { + SetValue(ImageSourceProperty, value); + } + } + + + /// + /// Gets/Sets the Image offset + /// + public double ImageOffset + { + get + { + return (double)GetValue(ImageOffsetProperty); + } + set + { + SetValue(ImageOffsetProperty, value); + } + } + + /// + /// Gets/Sets the Range Indicator Light offset + /// + public double RangeIndicatorLightOffset + { + get + { + return (double)GetValue(RangeIndicatorLightOffsetProperty); + } + set + { + SetValue(RangeIndicatorLightOffsetProperty, value); + } + } + + + /// + /// Gets/Sets the Image width and height + /// + public Size ImageSize + { + get + { + return (Size)GetValue(ImageSizeProperty); + } + set + { + SetValue(ImageSizeProperty, value); + } + } + /// + /// Gets/Sets the Range Indicator Radius + /// + public double RangeIndicatorRadius + { + get + { + return (double)GetValue(RangeIndicatorRadiusProperty); + } + set + { + SetValue(RangeIndicatorRadiusProperty, value); + } + } + + /// + /// Gets/Sets the Range Indicator Thickness + /// + public double RangeIndicatorThickness + { + get + { + return (double)GetValue(RangeIndicatorThicknessProperty); + } + set + { + SetValue(RangeIndicatorThicknessProperty, value); + } + } + /// + /// Gets/Sets the Scale Label Radius + /// + public double ScaleLabelRadius + { + get + { + return (double)GetValue(ScaleLabelRadiusProperty); + } + set + { + SetValue(ScaleLabelRadiusProperty, value); + } + } + /// + /// Gets/Sets the Scale Label Size + /// + public Size ScaleLabelSize + { + get + { + return (Size)GetValue(ScaleLabelSizeProperty); + } + set + { + SetValue(ScaleLabelSizeProperty, value); + } + } + /// + /// Gets/Sets the Scale Label Font Size + /// + public double ScaleLabelFontSize + { + get + { + return (double)GetValue(ScaleLabelFontSizeProperty); + } + set + { + SetValue(ScaleLabelFontSizeProperty, value); + } + } + /// + /// Gets/Sets the Scale Label Foreground + /// + public Color ScaleLabelForeground + { + get + { + return (Color)GetValue(ScaleLabelForegroundProperty); + } + set + { + SetValue(ScaleLabelForegroundProperty, value); + } + } + /// + /// Gets/Sets the Major Tick Size + /// + public Size MajorTickSize + { + get + { + return (Size)GetValue(MajorTickSizeProperty); + } + set + { + SetValue(MajorTickSizeProperty, value); + } + } + + /// + /// Gets/Sets the Minor Tick Size + /// + public Size MinorTickSize + { + get + { + return (Size)GetValue(MinorTickSizeProperty); + } + set + { + SetValue(MinorTickSizeProperty, value); + } + } + /// + /// Gets/Sets the Major Tick Color + /// + public Color MajorTickColor + { + get + { + return (Color)GetValue(MajorTickColorProperty); + } + set + { + SetValue(MajorTickColorProperty, value); + } + } + /// + /// Gets/Sets the Minor Tick Color + /// + public Color MinorTickColor + { + get + { + return (Color)GetValue(MinorTickColorProperty); + } + set + { + SetValue(MinorTickColorProperty, value); + } + } + + /// + /// Gets/Sets the Gauge Background color + /// + public Color GaugeBackgroundColor + { + get + { + return (Color)GetValue(GaugeBackgroundColorProperty); + } + set + { + SetValue(GaugeBackgroundColorProperty, value); + } + } + + + /// + /// Gets/Sets option to reset the pointer to minimum on start up, Default is true + /// + public bool ResetPointerOnStartUp + { + get + { + return (bool)GetValue(ResetPointerOnStartUpProperty); + } + set + { + SetValue(ResetPointerOnStartUpProperty, value); + } + } + + /// + /// Gets/Sets scale value precision + /// + public int ScaleValuePrecision + { + get + { + return (int)GetValue(ScaleValuePrecisionProperty); + } + set + { + SetValue(ScaleValuePrecisionProperty, value); + } + } + /// + /// Gets/Sets Below Optimal Range Color + /// + public Color BelowOptimalRangeColor + { + get + { + return (Color)GetValue(BelowOptimalRangeColorProperty); + } + set + { + SetValue(BelowOptimalRangeColorProperty, value); + } + } + + /// + /// Gets/Sets Optimal Range Color + /// + public Color OptimalRangeColor + { + get + { + return (Color)GetValue(OptimalRangeColorProperty); + } + set + { + SetValue(OptimalRangeColorProperty, value); + } + } + + /// + /// Gets/Sets Above Optimal Range Color + /// + public Color AboveOptimalRangeColor + { + get + { + return (Color)GetValue(AboveOptimalRangeColorProperty); + } + set + { + SetValue(AboveOptimalRangeColorProperty, value); + } + } + /// + /// Gets/Sets Dial Text + /// + public string DialText + { + get + { + return (string)GetValue(DialTextProperty); + } + set + { + SetValue(DialTextProperty, value); + } + } + /// + /// Gets/Sets Dial Text Color + /// + public Color DialTextColor + { + get + { + return (Color)GetValue(DialTextColorProperty); + } + set + { + SetValue(DialTextColorProperty, value); + } + } + /// + /// Gets/Sets Dial Text Font Size + /// + public int DialTextFontSize + { + get + { + return (int)GetValue(DialTextFontSizeProperty); + } + set + { + SetValue(DialTextFontSizeProperty, value); + } + } + /// + /// Gets/Sets Dial Text Offset + /// + public double DialTextOffset + { + get + { + return (double)GetValue(DialTextOffsetProperty); + } + set + { + SetValue(DialTextOffsetProperty, value); + } + } + + /// + /// Gets/Sets Range Indicator Light Radius + /// + public double RangeIndicatorLightRadius + { + get + { + return (double)GetValue(RangeIndicatorLightRadiusProperty); + } + set + { + SetValue(RangeIndicatorLightRadiusProperty, value); + } + } + + #endregion + + #region Constructor + static CircularGaugeControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(CircularGaugeControl), new FrameworkPropertyMetadata(typeof(CircularGaugeControl))); + } + #endregion + + #region Methods + private static void OnCurrentValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + //Get access to the instance of CircularGaugeConrol whose property value changed + CircularGaugeControl gauge = d as CircularGaugeControl; + gauge.OnCurrentValueChanged(e); + + } + + private static void OnOptimalRangeEndValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + //Get access to the instance of CircularGaugeConrol whose property value changed + CircularGaugeControl gauge = d as CircularGaugeControl; + if ((double)e.NewValue > gauge.MaxValue) + { + gauge.OptimalRangeEndValue = gauge.MaxValue; + } + + } + private static void OnOptimalRangeStartValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + //Get access to the instance of CircularGaugeConrol whose property value changed + CircularGaugeControl gauge = d as CircularGaugeControl; + if ((double)e.NewValue < gauge.MinValue) + { + gauge.OptimalRangeStartValue = gauge.MinValue; + } + + + } + + public virtual void OnCurrentValueChanged(DependencyPropertyChangedEventArgs e) + { + //Validate and set the new value + double newValue = (double)e.NewValue; + double oldValue = (double)e.OldValue; + + if (newValue > this.MaxValue) + { + newValue = this.MaxValue; + } + else if (newValue < this.MinValue) + { + newValue = this.MinValue; + } + + if (oldValue > this.MaxValue) + { + oldValue = this.MaxValue; + } + else if (oldValue < this.MinValue) + { + oldValue = this.MinValue; + } + + if (pointer != null) + { + double db1 = 0; + Double oldcurr_realworldunit = 0; + Double newcurr_realworldunit = 0; + Double realworldunit = (ScaleSweepAngle / (MaxValue - MinValue)); + //Resetting the old value to min value the very first time. + if (oldValue == 0 && !isInitialValueSet) + { + oldValue = MinValue; + isInitialValueSet = true; + + } + if (oldValue < 0) + { + db1 = MinValue + Math.Abs(oldValue); + oldcurr_realworldunit = ((double)(Math.Abs(db1 * realworldunit))); + } + else + { + db1 = Math.Abs(MinValue) + oldValue; + oldcurr_realworldunit = ((double)(db1 * realworldunit)); + } + if (newValue < 0) + { + db1 = MinValue + Math.Abs(newValue); + newcurr_realworldunit = ((double)(Math.Abs(db1 * realworldunit))); + } + else + { + db1 = Math.Abs(MinValue) + newValue; + newcurr_realworldunit = ((double)(db1 * realworldunit)); + } + + Double oldcurrentvalueAngle = (ScaleStartAngle + oldcurr_realworldunit); + Double newcurrentvalueAngle = (ScaleStartAngle + newcurr_realworldunit); + + //Animate the pointer from the old value to the new value + AnimatePointer(oldcurrentvalueAngle, newcurrentvalueAngle); + + } + + } + + /// + /// Animates the pointer to the current value to the new one + /// + /// + /// + void AnimatePointer(double oldcurrentvalueAngle, double newcurrentvalueAngle) + { + if (pointer != null) + { + DoubleAnimation da = new DoubleAnimation(); + da.From = oldcurrentvalueAngle; + da.To = newcurrentvalueAngle; + + double animDuration = Math.Abs(oldcurrentvalueAngle - newcurrentvalueAngle) * animatingSpeedFactor; + da.Duration = new Duration(TimeSpan.FromMilliseconds(animDuration)); + + Storyboard sb = new Storyboard(); + sb.Completed += new EventHandler(sb_Completed); + sb.Children.Add(da); + Storyboard.SetTarget(da, pointer); + Storyboard.SetTargetProperty(da, new PropertyPath("(Path.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)")); + + if (newcurrentvalueAngle != oldcurrentvalueAngle) + { + sb.Begin(); + } + } + } + + /// + /// Move pointer without animating + /// + /// + void MovePointer(double angleValue) + { + if (pointer != null) + { + TransformGroup tg = pointer.RenderTransform as TransformGroup; + RotateTransform rt = tg.Children[0] as RotateTransform; + rt.Angle = angleValue; + + } + } + + /// + /// Switch on the Range indicator light after the pointer completes animating + /// + /// + /// + void sb_Completed(object sender, EventArgs e) + { + if (this.CurrentValue > OptimalRangeEndValue) + { + lightIndicator.Fill = GetRangeIndicatorGradEffect(AboveOptimalRangeColor); + + } + else if (this.CurrentValue <= OptimalRangeEndValue && this.CurrentValue >= OptimalRangeStartValue) + { + lightIndicator.Fill = GetRangeIndicatorGradEffect(OptimalRangeColor); + + } + else if (this.CurrentValue < OptimalRangeStartValue) + { + lightIndicator.Fill = GetRangeIndicatorGradEffect(BelowOptimalRangeColor); + } + + } + + /// + /// Get gradient brush effect for the range indicator light + /// + /// + /// + private GradientBrush GetRangeIndicatorGradEffect(Color gradientColor) + { + + LinearGradientBrush gradient = new LinearGradientBrush(); + gradient.StartPoint = new Point(0, 0); + gradient.EndPoint = new Point(1, 1); + GradientStop color1 = new GradientStop(); + if (gradientColor == Colors.Transparent) + { + color1.Color = gradientColor; + } + else + color1.Color = Colors.LightGray; + + color1.Offset = 0.2; + gradient.GradientStops.Add(color1); + GradientStop color2 = new GradientStop(); + color2.Color = gradientColor; color2.Offset = 0.5; + gradient.GradientStops.Add(color2); + GradientStop color3 = new GradientStop(); + color3.Color = gradientColor; color3.Offset = 0.8; + gradient.GradientStops.Add(color3); + return gradient; + } + + + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + //Get reference to known elements on the control template + rootGrid = GetTemplateChild("LayoutRoot") as Grid; + pointer = GetTemplateChild("Pointer") as Path; + pointerCap = GetTemplateChild("PointerCap") as Ellipse; + lightIndicator = GetTemplateChild("RangeIndicatorLight") as Ellipse; + + //Draw scale and range indicator + DrawScale(); + DrawRangeIndicator(); + + //Set Zindex of pointer and pointer cap to a really high number so that it stays on top of the + //scale and the range indicator + Canvas.SetZIndex(pointer, 100000); + Canvas.SetZIndex(pointerCap, 100001); + + if (ResetPointerOnStartUp) + { + //Reset Pointer + MovePointer(ScaleStartAngle); + } + + + + } + + + //Drawing the scale with the Scale Radius + private void DrawScale() + { + //Calculate one major tick angle + Double majorTickUnitAngle = ScaleSweepAngle / MajorDivisionsCount; + + //Obtaining One minor tick angle + Double minorTickUnitAngle = ScaleSweepAngle / MinorDivisionsCount; + + //Obtaining One major ticks value + Double majorTicksUnitValue = (MaxValue - MinValue) / MajorDivisionsCount; + majorTicksUnitValue = Math.Round(majorTicksUnitValue, ScaleValuePrecision); + + Double minvalue = MinValue; ; + + // Drawing Major scale ticks + for (Double i = ScaleStartAngle; i <= (ScaleStartAngle + ScaleSweepAngle); i = i + majorTickUnitAngle) + { + + //Majortick is drawn as a rectangle + Rectangle majortickrect = new Rectangle(); + majortickrect.Height = MajorTickSize.Height; + majortickrect.Width = MajorTickSize.Width; + majortickrect.Fill = new SolidColorBrush(MajorTickColor); + Point p = new Point(0.5, 0.5); + majortickrect.RenderTransformOrigin = p; + majortickrect.HorizontalAlignment = HorizontalAlignment.Center; + majortickrect.VerticalAlignment = VerticalAlignment.Center; + + TransformGroup majortickgp = new TransformGroup(); + RotateTransform majortickrt = new RotateTransform(); + + //Obtaining the angle in radians for calulating the points + Double i_radian = (i * Math.PI) / 180; + majortickrt.Angle = i; + majortickgp.Children.Add(majortickrt); + TranslateTransform majorticktt = new TranslateTransform(); + + //Finding the point on the Scale where the major ticks are drawn + //here drawing the points with center as (0,0) + majorticktt.X = (int)((ScaleRadius) * Math.Cos(i_radian)); + majorticktt.Y = (int)((ScaleRadius) * Math.Sin(i_radian)); + + //Points for the textblock which hold the scale value + TranslateTransform majorscalevaluett = new TranslateTransform(); + //here drawing the points with center as (0,0) + majorscalevaluett.X = (int)((ScaleLabelRadius) * Math.Cos(i_radian)); + majorscalevaluett.Y = (int)((ScaleLabelRadius) * Math.Sin(i_radian)); + + //Defining the properties of the scale value textbox + TextBlock tb = new TextBlock(); + + tb.Height = ScaleLabelSize.Height; + tb.Width = ScaleLabelSize.Width; + tb.FontSize = ScaleLabelFontSize; + tb.Foreground = new SolidColorBrush(ScaleLabelForeground); + tb.TextAlignment = TextAlignment.Center; + tb.VerticalAlignment = VerticalAlignment.Center; + tb.HorizontalAlignment = HorizontalAlignment.Center; + + //Writing and appending the scale value + + //checking minvalue < maxvalue w.r.t scale precion value + if (Math.Round(minvalue, ScaleValuePrecision) <= Math.Round(MaxValue, ScaleValuePrecision)) + { + minvalue = Math.Round(minvalue, ScaleValuePrecision); + tb.Text = minvalue.ToString(); + minvalue = minvalue + majorTicksUnitValue; + + } + else + { + break; + } + majortickgp.Children.Add(majorticktt); + majortickrect.RenderTransform = majortickgp; + tb.RenderTransform = majorscalevaluett; + rootGrid.Children.Add(majortickrect); + rootGrid.Children.Add(tb); + + + //Drawing the minor axis ticks + Double onedegree = ((i + majorTickUnitAngle) - i) / (MinorDivisionsCount); + + if ((i < (ScaleStartAngle + ScaleSweepAngle)) && (Math.Round(minvalue, ScaleValuePrecision) <= Math.Round(MaxValue, ScaleValuePrecision))) + { + //Drawing the minor scale + for (Double mi = i + onedegree; mi < (i + majorTickUnitAngle); mi = mi + onedegree) + { + //here the minortick is drawn as a rectangle + Rectangle mr = new Rectangle(); + mr.Height = MinorTickSize.Height; + mr.Width = MinorTickSize.Width; + mr.Fill = new SolidColorBrush(MinorTickColor); + mr.HorizontalAlignment = HorizontalAlignment.Center; + mr.VerticalAlignment = VerticalAlignment.Center; + Point p1 = new Point(0.5, 0.5); + mr.RenderTransformOrigin = p1; + + TransformGroup minortickgp = new TransformGroup(); + RotateTransform minortickrt = new RotateTransform(); + minortickrt.Angle = mi; + minortickgp.Children.Add(minortickrt); + TranslateTransform minorticktt = new TranslateTransform(); + + //Obtaining the angle in radians for calulating the points + Double mi_radian = (mi * Math.PI) / 180; + //Finding the point on the Scale where the minor ticks are drawn + minorticktt.X = (int)((ScaleRadius) * Math.Cos(mi_radian)); + minorticktt.Y = (int)((ScaleRadius) * Math.Sin(mi_radian)); + + minortickgp.Children.Add(minorticktt); + mr.RenderTransform = minortickgp; + rootGrid.Children.Add(mr); + + + } + + } + + } + } + + /// + /// Obtaining the Point (x,y) in the circumference + /// + /// + /// + /// + private Point GetCircumferencePoint(Double angle, Double radius) + { + Double angle_radian = (angle * Math.PI) / 180; + //Radius-- is the Radius of the gauge + Double X = (Double)((Radius) + (radius) * Math.Cos(angle_radian)); + Double Y = (Double)((Radius) + (radius) * Math.Sin(angle_radian)); + Point p = new Point(X, Y); + return p; + } + + /// + /// Draw the range indicator + /// + private void DrawRangeIndicator() + { + Double realworldunit = (ScaleSweepAngle / (MaxValue - MinValue)); + Double optimalStartAngle; + Double optimalEndAngle; + double db; + + //Checking whether the OptimalRangeStartvalue is -ve + if (OptimalRangeStartValue < 0) + { + db = MinValue + Math.Abs(OptimalRangeStartValue); + optimalStartAngle = ((double)(Math.Abs(db * realworldunit))); + } + else + { + db = Math.Abs(MinValue) + OptimalRangeStartValue; + optimalStartAngle = ((double)(db * realworldunit)); + } + + //Checking whether the OptimalRangeEndvalue is -ve + if (OptimalRangeEndValue < 0) + { + db = MinValue + Math.Abs(OptimalRangeEndValue); + optimalEndAngle = ((double)(Math.Abs(db * realworldunit))); + } + else + { + db = Math.Abs(MinValue) + OptimalRangeEndValue; + optimalEndAngle = ((double)(db * realworldunit)); + } + // calculating the angle for optimal Start value + + Double optimalStartAngleFromStart = (ScaleStartAngle + optimalStartAngle); + + // calculating the angle for optimal Start value + + Double optimalEndAngleFromStart = (ScaleStartAngle + optimalEndAngle); + + //Calculating the Radius of the two arc for segment + arcradius1 = (RangeIndicatorRadius + RangeIndicatorThickness); + arcradius2 = RangeIndicatorRadius; + + double endAngle = ScaleStartAngle + ScaleSweepAngle; + + // Calculating the Points for the below Optimal Range segment from the center of the gauge + + Point A = GetCircumferencePoint(ScaleStartAngle, arcradius1); + Point B = GetCircumferencePoint(ScaleStartAngle, arcradius2); + Point C = GetCircumferencePoint(optimalStartAngleFromStart, arcradius2); + Point D = GetCircumferencePoint(optimalStartAngleFromStart, arcradius1); + + bool isReflexAngle = Math.Abs(optimalStartAngleFromStart - ScaleStartAngle) > 180.0; + DrawSegment(A, B, C, D, isReflexAngle, BelowOptimalRangeColor); + + // Calculating the Points for the Optimal Range segment from the center of the gauge + + Point A1 = GetCircumferencePoint(optimalStartAngleFromStart, arcradius1); + Point B1 = GetCircumferencePoint(optimalStartAngleFromStart, arcradius2); + Point C1 = GetCircumferencePoint(optimalEndAngleFromStart, arcradius2); + Point D1 = GetCircumferencePoint(optimalEndAngleFromStart, arcradius1); + bool isReflexAngle1 = Math.Abs(optimalEndAngleFromStart - optimalStartAngleFromStart) > 180.0; + DrawSegment(A1, B1, C1, D1, isReflexAngle1, OptimalRangeColor); + + // Calculating the Points for the Above Optimal Range segment from the center of the gauge + + Point A2 = GetCircumferencePoint(optimalEndAngleFromStart, arcradius1); + Point B2 = GetCircumferencePoint(optimalEndAngleFromStart, arcradius2); + Point C2 = GetCircumferencePoint(endAngle, arcradius2); + Point D2 = GetCircumferencePoint(endAngle, arcradius1); + bool isReflexAngle2 = Math.Abs(endAngle - optimalEndAngleFromStart) > 180.0; + DrawSegment(A2, B2, C2, D2, isReflexAngle2, AboveOptimalRangeColor); + } + + //Drawing the segment with two arc and two line + + private void DrawSegment(Point p1, Point p2, Point p3, Point p4, bool reflexangle, Color clr) + { + + // Segment Geometry + PathSegmentCollection segments = new PathSegmentCollection(); + + // First line segment from pt p1 - pt p2 + segments.Add(new LineSegment() { Point = p2 }); + + //Arc drawn from pt p2 - pt p3 with the RangeIndicatorRadius + segments.Add(new ArcSegment() + { + Size = new Size(arcradius2, arcradius2), + Point = p3, + SweepDirection = SweepDirection.Clockwise, + IsLargeArc = reflexangle + + }); + + // Second line segment from pt p3 - pt p4 + segments.Add(new LineSegment() { Point = p4 }); + + //Arc drawn from pt p4 - pt p1 with the Radius of arcradius1 + segments.Add(new ArcSegment() + { + Size = new Size(arcradius1, arcradius1), + Point = p1, + SweepDirection = SweepDirection.Counterclockwise, + IsLargeArc = reflexangle + + }); + + // Defining the segment path properties + Color rangestrokecolor; + if (clr == Colors.Transparent) + { + rangestrokecolor = clr; + } + else + rangestrokecolor = Colors.White; + + + + rangeIndicator = new Path() + { + StrokeLineJoin = PenLineJoin.Round, + Stroke = new SolidColorBrush(rangestrokecolor), + //Color.FromArgb(0xFF, 0xF5, 0x9A, 0x86) + Fill = new SolidColorBrush(clr), + Opacity = 0.65, + StrokeThickness = 0.25, + Data = new PathGeometry() + { + Figures = new PathFigureCollection() + { + new PathFigure() + { + IsClosed = true, + StartPoint = p1, + Segments = segments + } + } + } + }; + + //Set Z index of range indicator + rangeIndicator.SetValue(Canvas.ZIndexProperty, 150); + // Adding the segment to the root grid + rootGrid.Children.Add(rangeIndicator); + + } + + #endregion + } +} diff --git a/Software/Visual_Studio/Tango.CircularGauge/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.CircularGauge/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..eaecfc80d --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Circular Gauge Control")] +[assembly: ComVisible(false)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.Designer.cs new file mode 100644 index 000000000..92a65f881 --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.CircularGauge.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.CircularGauge.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.resx b/Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.Designer.cs new file mode 100644 index 000000000..791f73266 --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.CircularGauge.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.settings b/Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj b/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj new file mode 100644 index 000000000..1773852f7 --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj @@ -0,0 +1,128 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD} + library + Properties + Tango.CircularGauge + Tango.CircularGauge + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + 3.5 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + ..\Build\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + ..\Build\Release\ + TRACE + prompt + 4 + false + + + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + + + + + + MSBuild:Compile + Designer + + + GlobalVersionInfo.cs + + + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + False + .NET Framework 3.5 SP1 + true + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.CircularGauge/Themes/Generic.xaml b/Software/Visual_Studio/Tango.CircularGauge/Themes/Generic.xaml new file mode 100644 index 000000000..edef67f07 --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/Themes/Generic.xaml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.CircularGauge/TypeConverters.cs b/Software/Visual_Studio/Tango.CircularGauge/TypeConverters.cs new file mode 100644 index 000000000..98ef8933c --- /dev/null +++ b/Software/Visual_Studio/Tango.CircularGauge/TypeConverters.cs @@ -0,0 +1,277 @@ +/*Copyright (c) 2009 T.Evelyn (evescode@gmail.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1.Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE.*/ + + +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using System.Windows.Data; +using System.Globalization; + +namespace Tango.CircularGauge +{ + + /// + /// Converts the given color to a SolidColorBrush + /// + public class ColorToSolidColorBrushConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + Color c = (Color)value; + + return new SolidColorBrush(c); + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + + /// + /// A type converter for converting image offset into render transform + /// + public class ImageOffsetConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + double dblVal = (double)value; + TranslateTransform tt = new TranslateTransform(); + tt.Y = dblVal; + return tt; + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + + /// + /// Converts radius to diameter + /// + public class RadiusToDiameterConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + double dblVal = (double)value; + + return (dblVal *2); + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + /// + /// Calculates the pointer position + /// + public class PointerCenterConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + double dblVal = (double)value; + TransformGroup tg = new TransformGroup(); + RotateTransform rt = new RotateTransform(); + TranslateTransform tt = new TranslateTransform(); + + tt.X = dblVal / 2; + tg.Children.Add(rt); + tg.Children.Add(tt); + + return tg; + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + /// + /// Calculates the range indicator light position + /// + public class RangeIndicatorLightPositionConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + double dblVal = (double)value; + TransformGroup tg = new TransformGroup(); + RotateTransform rt = new RotateTransform(); + TranslateTransform tt = new TranslateTransform(); + + tt.Y = dblVal ; + tg.Children.Add(rt); + tg.Children.Add(tt); + + return tg; + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + /// + /// Converts the given Size to height and width + /// + public class SizeConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + double i = 0; + Size s = (Size)value; + if (parameter.ToString() == "Height") + { + i = s.Height; + } + else if (parameter.ToString() == "Width") + { + i = s.Width; + } + + return i; + + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + /// + /// Scaling factor for drawing the glass effect. + /// + public class GlassEffectWidthConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + double dbl = (double)value; + return (dbl*2) * 0.94; + + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + /// + /// Converts background color to Gradient effect + /// + public class BackgroundColorConverter : IValueConverter + { + public object Convert( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + Color c = (Color)value; + RadialGradientBrush radBrush = new RadialGradientBrush(); + GradientStop g1 = new GradientStop(); + g1.Offset = 0.982; + g1.Color = c; + GradientStop g2 = new GradientStop(); + g2.Color = Color.FromArgb(0xFF, 0xAF, 0xB2, 0xB0); + radBrush.GradientStops.Add(g1); + radBrush.GradientStops.Add(g2); + return radBrush; + + } + + public object ConvertBack( + object value, + Type targetType, + object parameter, + CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs index 6d771099a..2bcdac8b4 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs @@ -6,14 +6,18 @@ using System.Threading.Tasks; namespace Tango.CodeGeneration { - public class ProtoMessageFile : Class + public class ProtoMessageFile : CodeObject { + public String Name { get; set; } public String Package { get; set; } public List Imports { get; set; } + public List Properties { get; set; } + public ProtoMessageFile() { Imports = new List(); + Properties = new List(); } } } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs new file mode 100644 index 000000000..d63348b6b --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class ProtoProperty : Property + { + public bool Repeated { get; set; } + + public String Description { get; set; } + + public ProtoProperty() + { + + } + + public ProtoProperty(String name, String type) : this() + { + Name = name; + Type = type; + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index 0c093659f..3c6c9d085 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -70,6 +70,7 @@ + diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml index 790e5dd93..d659a028e 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; @foreach (var import in Model.Imports) { @@ -17,6 +25,7 @@ enum @(Model.Name) @foreach (var prop in Model.Fields) {
+ @(prop.Description != null ? ("//" + prop.Description) : "") @(prop.Name) = @(prop.Value);
} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml index 7452db6e6..c1aa28fb1 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml @@ -1,6 +1,14 @@ -syntax = "proto3"; +//------------------------------------------------------------------------------ +// +// 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! +// +//------------------------------------------------------------------------------ -//This file is auto-generated. Do not modify! +syntax = "proto3"; @foreach (var import in Model.Imports) { @@ -18,7 +26,8 @@ message @(Model.Name) @for (int i = 0; i < Model.Properties.Count; i++) {
- @(Model.Properties[i].Type) @(Model.Properties[i].Name) = @(i + 1); + @(Model.Properties[i].Description != null ? ("//" + Model.Properties[i].Description) : "") + @(Model.Properties[i].Repeated ? "repeated" : "") @(Model.Properties[i].Type) @(Model.Properties[i].Name) = @(i + 1);
} } 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 a7a534dea..366561053 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -82,8 +82,8 @@ namespace Tango.DAL.Remote.DB public virtual DbSet SEGMENTS { get; set; } public virtual DbSet SPOOL_TYPES { get; set; } public virtual DbSet SYNC_CONFIGURATIONS { 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_MOTORS { 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 d60100532..739e2f6dc 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -784,7 +784,7 @@ - + @@ -794,8 +794,11 @@ + + + - + @@ -874,6 +877,7 @@ + @@ -1308,7 +1312,9 @@ - + + + @@ -1420,7 +1426,9 @@ - + + + @@ -1700,7 +1708,9 @@ - + + + @@ -1712,7 +1722,9 @@ - + + + @@ -1821,8 +1833,8 @@ + - @@ -2165,8 +2177,8 @@ + - @@ -3352,7 +3364,7 @@ - + @@ -3362,8 +3374,11 @@ + + + - + @@ -3442,6 +3457,7 @@ + @@ -3502,7 +3518,9 @@ - + + + @@ -3742,7 +3760,9 @@ - + + + @@ -3780,7 +3800,9 @@ - + + + @@ -4010,7 +4032,9 @@ - + + + @@ -5183,9 +5207,12 @@ - - - + + + + + + @@ -5195,9 +5222,9 @@ - - - + + + @@ -5269,6 +5296,7 @@ + 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 77b727914..0ab9b672b 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,72 +5,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_CONTROLLERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_CONTROLLERS.cs new file mode 100644 index 000000000..d5e2119a4 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_CONTROLLERS.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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_CONTROLLERS + { + 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; } + public double MIN { get; set; } + public double MAX { get; set; } + public string UNITS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs deleted file mode 100644 index b37a0c5a1..000000000 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_HEATERS.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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/DB/USER.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs index 28dc2a2b8..6f4c40811 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/USER.cs @@ -32,6 +32,7 @@ namespace Tango.DAL.Remote.DB public string ORGANIZATION_GUID { get; set; } public string CONTACT_GUID { get; set; } public string ADDRESS_GUID { get; set; } + public Nullable LAST_LOGIN { get; set; } public virtual ADDRESS ADDRESS { get; set; } public virtual CONTACT CONTACT { 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 c9e2dbbed..83c839310 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -251,10 +251,10 @@ RemoteADO.tt - + RemoteADO.tt - + RemoteADO.tt diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 143a198eb..e6ad97427 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -42,6 +42,7 @@ namespace Tango.Emulations.Emulators private List _digitalOutputPinsStates; private List _digitalInputPinsStates; private LogManager LogManager = LogManager.Default; + private List _componentsStates; #region Constructors @@ -74,6 +75,7 @@ namespace Tango.Emulations.Emulators _dispenserJoggingRequestCodes = new List(); _dispenserHomingRequestCodes = new List(); _digitalOutputPinsStates = new List(); + _componentsStates = new List(); var adapter = ObservablesEntitiesAdapter.Instance; adapter.Initialize(); @@ -88,6 +90,15 @@ namespace Tango.Emulations.Emulators Port = x.Port, }).ToList(); + foreach (var item in adapter.TechControllers) + { + _componentsStates.Add(new ValueComponentState() + { + Component = (ValueComponent)item.Code, + Value = item.Min + }); + } + ResetGraphFactors(); } @@ -164,6 +175,9 @@ namespace Tango.Emulations.Emulators case MessageType.UploadProcessParametersRequest: HandleUploadProcessParametersRequest(MessageFactory.ParseTangoMessageFromContainer(container)); break; + case MessageType.SetComponentValueRequest: + HandleSetComponentValueRequest(MessageFactory.ParseTangoMessageFromContainer(container)); + break; } } @@ -214,17 +228,19 @@ namespace Tango.Emulations.Emulators while (Transporter.State == TransportComponentState.Connected) { PushDiagnosticsResponse res = new PushDiagnosticsResponse(); + DiagnosticsMonitors monitors = new DiagnosticsMonitors(); + res.Monitors = monitors; if (_diagnosticsRequest.PushSensors) { for (int i = 0; i < 10; i++) { value++; - res.Dancer1Angle.Add((int)(150 + _graphAmplitude * Math.Sin(2 * 3.14 * ((int)_graphFrequency) * value))); + monitors.Dancer1Angle.Add((int)(150 + _graphAmplitude * Math.Sin(2 * 3.14 * ((int)_graphFrequency) * value))); } - res.Dancer2Angle.Add(Cursor.Position.Y); - res.Dancer3Angle.Add(Cursor.Position.Y); + monitors.Dancer2Angle.Add(Cursor.Position.Y); + monitors.Dancer3Angle.Add(Cursor.Position.Y); } if (_diagnosticsRequest.PushMotors) @@ -245,19 +261,20 @@ namespace Tango.Emulations.Emulators dispenserFrequencies.Add(singleDispenser); } - res.DispensersMotorsFrequency.AddRange(dispenserFrequencies); + monitors.DispensersMotorsFrequency.AddRange(dispenserFrequencies); - res.Dispenser1MotorFrequency.AddRange(dispenserFrequencies[0].Data); - res.Dispenser2MotorFrequency.AddRange(dispenserFrequencies[1].Data); - res.Dispenser3MotorFrequency.AddRange(dispenserFrequencies[2].Data); - res.Dispenser4MotorFrequency.AddRange(dispenserFrequencies[3].Data); - res.Dispenser5MotorFrequency.AddRange(dispenserFrequencies[4].Data); - res.Dispenser6MotorFrequency.AddRange(dispenserFrequencies[5].Data); - res.Dispenser7MotorFrequency.AddRange(dispenserFrequencies[6].Data); - res.Dispenser8MotorFrequency.AddRange(dispenserFrequencies[7].Data); + monitors.Dispenser1MotorFrequency.AddRange(dispenserFrequencies[0].Data); + monitors.Dispenser2MotorFrequency.AddRange(dispenserFrequencies[1].Data); + monitors.Dispenser3MotorFrequency.AddRange(dispenserFrequencies[2].Data); + monitors.Dispenser4MotorFrequency.AddRange(dispenserFrequencies[3].Data); + monitors.Dispenser5MotorFrequency.AddRange(dispenserFrequencies[4].Data); + monitors.Dispenser6MotorFrequency.AddRange(dispenserFrequencies[5].Data); + monitors.Dispenser7MotorFrequency.AddRange(dispenserFrequencies[6].Data); + monitors.Dispenser8MotorFrequency.AddRange(dispenserFrequencies[7].Data); } res.DigitalPins.AddRange(_digitalOutputPinsStates.Concat(_digitalInputPinsStates)); + res.ComponentsStates.AddRange(_componentsStates); res.Version = "1.0.0.0"; res.VersionBuildDate = DateTime.Now.ToString(); @@ -531,7 +548,7 @@ namespace Tango.Emulations.Emulators { LogManager.Log("Upload process parameters request received: " + Environment.NewLine + request.Message.ToJsonString()); - Task.Factory.StartNew(() => + Task.Factory.StartNew(() => { Thread.Sleep(1000); @@ -540,6 +557,38 @@ namespace Tango.Emulations.Emulators }); } + private void HandleSetComponentValueRequest(TangoMessage request) + { + LogManager.Log("Set component value request received: " + Environment.NewLine + request.Message.ToJsonString()); + + var componentState = _componentsStates.SingleOrDefault(x => x.Component == request.Message.Component); + + double startValue = componentState.Value; + double targetValue = request.Message.Value; + + Transporter.SendResponse(new SetComponentValueResponse(), request.Container.Token); + + Task.Factory.StartNew(() => + { + if (targetValue > startValue) + { + while (componentState.Value < targetValue) + { + componentState.Value++; + Thread.Sleep(30); + } + } + else + { + while (componentState.Value > targetValue) + { + componentState.Value--; + Thread.Sleep(30); + } + } + }); + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index e17f515cc..5dfc1a1f4 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -139,5 +139,12 @@ namespace Tango.Integration.Operation /// The request. /// Task StopThreadJogging(ThreadAbortJoggingRequest request); + + /// + /// Sets the specified component value. + /// + /// The request. + /// + Task SetComponentValue(SetComponentValueRequest request); } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 4f7ebbbdd..e65b67e26 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -473,6 +473,16 @@ namespace Tango.Integration.Operation return await SendRequest(request); } + /// + /// Sets the specified component value. + /// + /// The request. + /// + public async Task SetComponentValue(SetComponentValueRequest request) + { + return await SendRequest(request); + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs index 04fb2c1c6..6301c2d03 100644 --- a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs +++ b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs @@ -22,7 +22,7 @@ namespace Tango.PMR.Common { static MessageTypeReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiqEFwoLTWVz", + "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbirDFwoLTWVz", "c2FnZVR5cGUSCAoETm9uZRAAEhQKEENhbGN1bGF0ZVJlcXVlc3QQAxIVChFD", "YWxjdWxhdGVSZXNwb25zZRAEEhMKD1Byb2dyZXNzUmVxdWVzdBAFEhQKEFBy", "b2dyZXNzUmVzcG9uc2UQBhIcChhTdHViQ2FydHJpZGdlUmVhZFJlcXVlc3QQ", @@ -82,14 +82,15 @@ namespace Tango.PMR.Common { "aWdpdGFsT3V0UmVzcG9uc2UQ4w8SGQoUVGhyZWFkSm9nZ2luZ1JlcXVlc3QQ", "5A8SGgoVVGhyZWFkSm9nZ2luZ1Jlc3BvbnNlEOUPEh4KGVRocmVhZEFib3J0", "Sm9nZ2luZ1JlcXVlc3QQ5g8SHwoaVGhyZWFkQWJvcnRKb2dnaW5nUmVzcG9u", - "c2UQ5w8SDwoKSm9iUmVxdWVzdBC4FxIQCgtKb2JSZXNwb25zZRC5FxIUCg9B", - "Ym9ydEpvYlJlcXVlc3QQuhcSFQoQQWJvcnRKb2JSZXNwb25zZRC7FxIjCh5V", - "cGxvYWRQcm9jZXNzUGFyYW1ldGVyc1JlcXVlc3QQvBcSJAofVXBsb2FkUHJv", - "Y2Vzc1BhcmFtZXRlcnNSZXNwb25zZRC9FxIUCg9EZWJ1Z0xvZ1JlcXVlc3QQ", - "oB8SFQoQRGVidWdMb2dSZXNwb25zZRChHxInCiJVcGxvYWRIYXJkd2FyZUNv", - "bmZpZ3VyYXRpb25SZXF1ZXN0EIgnEigKI1VwbG9hZEhhcmR3YXJlQ29uZmln", - "dXJhdGlvblJlc3BvbnNlEIknQhwKGmNvbS50d2luZS50YW5nby5wbXIuY29t", - "bW9uYgZwcm90bzM=")); + "c2UQ5w8SHQoYU2V0Q29tcG9uZW50VmFsdWVSZXF1ZXN0EOgPEh4KGVNldENv", + "bXBvbmVudFZhbHVlUmVzcG9uc2UQ6Q8SDwoKSm9iUmVxdWVzdBC4FxIQCgtK", + "b2JSZXNwb25zZRC5FxIUCg9BYm9ydEpvYlJlcXVlc3QQuhcSFQoQQWJvcnRK", + "b2JSZXNwb25zZRC7FxIjCh5VcGxvYWRQcm9jZXNzUGFyYW1ldGVyc1JlcXVl", + "c3QQvBcSJAofVXBsb2FkUHJvY2Vzc1BhcmFtZXRlcnNSZXNwb25zZRC9FxIU", + "Cg9EZWJ1Z0xvZ1JlcXVlc3QQoB8SFQoQRGVidWdMb2dSZXNwb25zZRChHxIn", + "CiJVcGxvYWRIYXJkd2FyZUNvbmZpZ3VyYXRpb25SZXF1ZXN0EIgnEigKI1Vw", + "bG9hZEhhcmR3YXJlQ29uZmlndXJhdGlvblJlc3BvbnNlEIknQhwKGmNvbS50", + "d2luZS50YW5nby5wbXIuY29tbW9uYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.MessageType), }, null)); @@ -203,6 +204,8 @@ namespace Tango.PMR.Common { [pbr::OriginalName("ThreadJoggingResponse")] ThreadJoggingResponse = 2021, [pbr::OriginalName("ThreadAbortJoggingRequest")] ThreadAbortJoggingRequest = 2022, [pbr::OriginalName("ThreadAbortJoggingResponse")] ThreadAbortJoggingResponse = 2023, + [pbr::OriginalName("SetComponentValueRequest")] SetComponentValueRequest = 2024, + [pbr::OriginalName("SetComponentValueResponse")] SetComponentValueResponse = 2025, /// ///Printing /// diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs new file mode 100644 index 000000000..3f558f414 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs @@ -0,0 +1,1017 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DiagnosticsMonitors.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 DiagnosticsMonitors.proto + public static partial class DiagnosticsMonitorsReflection { + + #region Descriptor + /// File descriptor for DiagnosticsMonitors.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DiagnosticsMonitorsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChlEaWFnbm9zdGljc01vbml0b3JzLnByb3RvEhVUYW5nby5QTVIuRGlhZ25v", + "c3RpY3MaEURvdWJsZUFycmF5LnByb3RvIpQJChNEaWFnbm9zdGljc01vbml0", + "b3JzEhQKDERhbmNlcjFBbmdsZRgBIAMoARIUCgxEYW5jZXIyQW5nbGUYAiAD", + "KAESFAoMRGFuY2VyM0FuZ2xlGAMgAygBEhwKFEZlZWRlck1vdG9yRnJlcXVl", + "bmN5GAQgAygBEhIKCkRyeWVyTW90b3IYBSADKAESEwoLUG9sbGVyTW90b3IY", + "BiADKAESEwoLV2luZGVyTW90b3IYByADKAESEgoKU2NyZXdNb3RvchgIIAMo", + "ARITCgtUaHJlYWRTcGVlZBgJIAMoARIYChBNaXhlclRlbXBlcmF0dXJlGAog", + "AygBEhwKFEhlYWRab25lMVRlbXBlcmF0dXJlGAsgAygBEhwKFEhlYWRab25l", + "MlRlbXBlcmF0dXJlGAwgAygBEhwKFEhlYWRab25lM1RlbXBlcmF0dXJlGA0g", + "AygBEhMKC0hlYWRBaXJGbG93GA4gAygBEhUKDUZlZWRlclRlbnNpb24YDyAD", + "KAESFQoNUHVsbGVyVGVuc2lvbhgQIAMoARIdChVEcnllclpvbmUxVGVtcGVy", + "YXR1cmUYESADKAESHQoVRHJ5ZXJab25lMlRlbXBlcmF0dXJlGBIgAygBEh0K", + "FURyeWVyWm9uZTNUZW1wZXJhdHVyZRgTIAMoARIUCgxEcnllckFpckZsb3cY", + "FCADKAESFQoNV2luZGVyVGVuc2lvbhgVIAMoARJFChlEaXNwZW5zZXJzTW90", + "b3JzRnJlcXVlbmN5GBYgAygLMiIuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkRv", + "dWJsZUFycmF5EkUKGURpc3BlbnNlcnNBbmd1bGFyRW5jb2RlcnMYFyADKAsy", + "Ii5UYW5nby5QTVIuRGlhZ25vc3RpY3MuRG91YmxlQXJyYXkSRQoZRGlzcGVu", + "c2Vyc0xpbmVhclBvc2l0aW9ucxgYIAMoCzIiLlRhbmdvLlBNUi5EaWFnbm9z", + "dGljcy5Eb3VibGVBcnJheRI+ChJEaXNwZW5zZXJzUHJlc3N1cmUYGSADKAsy", + "Ii5UYW5nby5QTVIuRGlhZ25vc3RpY3MuRG91YmxlQXJyYXkSFwoPTWlkVGFu", + "a1ByZXNzdXJlGBogAygBEhsKE0ZpbHRlckRlbHRhUHJlc3N1cmUYGyADKAES", + "GgoSQ2hpbGxlclRlbXBlcmF0dXJlGBwgAygBEiAKGERpc3BlbnNlcjFNb3Rv", + "ckZyZXF1ZW5jeRgdIAMoARIgChhEaXNwZW5zZXIyTW90b3JGcmVxdWVuY3kY", + "HiADKAESIAoYRGlzcGVuc2VyM01vdG9yRnJlcXVlbmN5GB8gAygBEiAKGERp", + "c3BlbnNlcjRNb3RvckZyZXF1ZW5jeRggIAMoARIgChhEaXNwZW5zZXI1TW90", + "b3JGcmVxdWVuY3kYISADKAESIAoYRGlzcGVuc2VyNk1vdG9yRnJlcXVlbmN5", + "GCIgAygBEiAKGERpc3BlbnNlcjdNb3RvckZyZXF1ZW5jeRgjIAMoARIgChhE", + "aXNwZW5zZXI4TW90b3JGcmVxdWVuY3kYJCADKAFCIQofY29tLnR3aW5lLnRh", + "bmdvLnBtci5kaWFnbm9zdGljc2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DoubleArrayReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DiagnosticsMonitors), global::Tango.PMR.Diagnostics.DiagnosticsMonitors.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "FeederMotorFrequency", "DryerMotor", "PollerMotor", "WinderMotor", "ScrewMotor", "ThreadSpeed", "MixerTemperature", "HeadZone1Temperature", "HeadZone2Temperature", "HeadZone3Temperature", "HeadAirFlow", "FeederTension", "PullerTension", "DryerZone1Temperature", "DryerZone2Temperature", "DryerZone3Temperature", "DryerAirFlow", "WinderTension", "DispensersMotorsFrequency", "DispensersAngularEncoders", "DispensersLinearPositions", "DispensersPressure", "MidTankPressure", "FilterDeltaPressure", "ChillerTemperature", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DiagnosticsMonitors : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DiagnosticsMonitors()); + [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.DiagnosticsMonitorsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DiagnosticsMonitors() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DiagnosticsMonitors(DiagnosticsMonitors other) : this() { + dancer1Angle_ = other.dancer1Angle_.Clone(); + dancer2Angle_ = other.dancer2Angle_.Clone(); + dancer3Angle_ = other.dancer3Angle_.Clone(); + feederMotorFrequency_ = other.feederMotorFrequency_.Clone(); + dryerMotor_ = other.dryerMotor_.Clone(); + pollerMotor_ = other.pollerMotor_.Clone(); + winderMotor_ = other.winderMotor_.Clone(); + screwMotor_ = other.screwMotor_.Clone(); + threadSpeed_ = other.threadSpeed_.Clone(); + mixerTemperature_ = other.mixerTemperature_.Clone(); + headZone1Temperature_ = other.headZone1Temperature_.Clone(); + headZone2Temperature_ = other.headZone2Temperature_.Clone(); + headZone3Temperature_ = other.headZone3Temperature_.Clone(); + headAirFlow_ = other.headAirFlow_.Clone(); + feederTension_ = other.feederTension_.Clone(); + pullerTension_ = other.pullerTension_.Clone(); + dryerZone1Temperature_ = other.dryerZone1Temperature_.Clone(); + dryerZone2Temperature_ = other.dryerZone2Temperature_.Clone(); + dryerZone3Temperature_ = other.dryerZone3Temperature_.Clone(); + dryerAirFlow_ = other.dryerAirFlow_.Clone(); + winderTension_ = other.winderTension_.Clone(); + dispensersMotorsFrequency_ = other.dispensersMotorsFrequency_.Clone(); + dispensersAngularEncoders_ = other.dispensersAngularEncoders_.Clone(); + dispensersLinearPositions_ = other.dispensersLinearPositions_.Clone(); + dispensersPressure_ = other.dispensersPressure_.Clone(); + midTankPressure_ = other.midTankPressure_.Clone(); + filterDeltaPressure_ = other.filterDeltaPressure_.Clone(); + chillerTemperature_ = other.chillerTemperature_.Clone(); + dispenser1MotorFrequency_ = other.dispenser1MotorFrequency_.Clone(); + dispenser2MotorFrequency_ = other.dispenser2MotorFrequency_.Clone(); + dispenser3MotorFrequency_ = other.dispenser3MotorFrequency_.Clone(); + dispenser4MotorFrequency_ = other.dispenser4MotorFrequency_.Clone(); + dispenser5MotorFrequency_ = other.dispenser5MotorFrequency_.Clone(); + dispenser6MotorFrequency_ = other.dispenser6MotorFrequency_.Clone(); + dispenser7MotorFrequency_ = other.dispenser7MotorFrequency_.Clone(); + dispenser8MotorFrequency_ = other.dispenser8MotorFrequency_.Clone(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DiagnosticsMonitors Clone() { + return new DiagnosticsMonitors(this); + } + + /// Field number for the "Dancer1Angle" field. + public const int Dancer1AngleFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_dancer1Angle_codec + = pb::FieldCodec.ForDouble(10); + private readonly pbc::RepeatedField dancer1Angle_ = new pbc::RepeatedField(); + /// + ///Dancer 1 (Min = 0, Max = 255, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dancer1Angle { + get { return dancer1Angle_; } + } + + /// Field number for the "Dancer2Angle" field. + public const int Dancer2AngleFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_dancer2Angle_codec + = pb::FieldCodec.ForDouble(18); + private readonly pbc::RepeatedField dancer2Angle_ = new pbc::RepeatedField(); + /// + ///Dancer 2 (Min = 0, Max = 1200, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dancer2Angle { + get { return dancer2Angle_; } + } + + /// Field number for the "Dancer3Angle" field. + public const int Dancer3AngleFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_dancer3Angle_codec + = pb::FieldCodec.ForDouble(26); + private readonly pbc::RepeatedField dancer3Angle_ = new pbc::RepeatedField(); + /// + ///Dancer 3 (Min = 0, Max = 1200, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dancer3Angle { + get { return dancer3Angle_; } + } + + /// Field number for the "FeederMotorFrequency" field. + public const int FeederMotorFrequencyFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_feederMotorFrequency_codec + = pb::FieldCodec.ForDouble(34); + private readonly pbc::RepeatedField feederMotorFrequency_ = new pbc::RepeatedField(); + /// + ///Feeder Motor (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField FeederMotorFrequency { + get { return feederMotorFrequency_; } + } + + /// Field number for the "DryerMotor" field. + public const int DryerMotorFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_dryerMotor_codec + = pb::FieldCodec.ForDouble(42); + private readonly pbc::RepeatedField dryerMotor_ = new pbc::RepeatedField(); + /// + ///Dryer Motor (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DryerMotor { + get { return dryerMotor_; } + } + + /// Field number for the "PollerMotor" field. + public const int PollerMotorFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_pollerMotor_codec + = pb::FieldCodec.ForDouble(50); + private readonly pbc::RepeatedField pollerMotor_ = new pbc::RepeatedField(); + /// + ///Poller Motor (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField PollerMotor { + get { return pollerMotor_; } + } + + /// Field number for the "WinderMotor" field. + public const int WinderMotorFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_winderMotor_codec + = pb::FieldCodec.ForDouble(58); + private readonly pbc::RepeatedField winderMotor_ = new pbc::RepeatedField(); + /// + ///Winder Motor (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField WinderMotor { + get { return winderMotor_; } + } + + /// Field number for the "ScrewMotor" field. + public const int ScrewMotorFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_screwMotor_codec + = pb::FieldCodec.ForDouble(66); + private readonly pbc::RepeatedField screwMotor_ = new pbc::RepeatedField(); + /// + ///Screw Motor (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ScrewMotor { + get { return screwMotor_; } + } + + /// Field number for the "ThreadSpeed" field. + public const int ThreadSpeedFieldNumber = 9; + private static readonly pb::FieldCodec _repeated_threadSpeed_codec + = pb::FieldCodec.ForDouble(74); + private readonly pbc::RepeatedField threadSpeed_ = new pbc::RepeatedField(); + /// + ///Thread Speed (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ThreadSpeed { + get { return threadSpeed_; } + } + + /// Field number for the "MixerTemperature" field. + public const int MixerTemperatureFieldNumber = 10; + private static readonly pb::FieldCodec _repeated_mixerTemperature_codec + = pb::FieldCodec.ForDouble(82); + private readonly pbc::RepeatedField mixerTemperature_ = new pbc::RepeatedField(); + /// + ///Mixer (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField MixerTemperature { + get { return mixerTemperature_; } + } + + /// Field number for the "HeadZone1Temperature" field. + public const int HeadZone1TemperatureFieldNumber = 11; + private static readonly pb::FieldCodec _repeated_headZone1Temperature_codec + = pb::FieldCodec.ForDouble(90); + private readonly pbc::RepeatedField headZone1Temperature_ = new pbc::RepeatedField(); + /// + ///Head Zone 1 (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField HeadZone1Temperature { + get { return headZone1Temperature_; } + } + + /// Field number for the "HeadZone2Temperature" field. + public const int HeadZone2TemperatureFieldNumber = 12; + private static readonly pb::FieldCodec _repeated_headZone2Temperature_codec + = pb::FieldCodec.ForDouble(98); + private readonly pbc::RepeatedField headZone2Temperature_ = new pbc::RepeatedField(); + /// + ///Head Zone 2 (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField HeadZone2Temperature { + get { return headZone2Temperature_; } + } + + /// Field number for the "HeadZone3Temperature" field. + public const int HeadZone3TemperatureFieldNumber = 13; + private static readonly pb::FieldCodec _repeated_headZone3Temperature_codec + = pb::FieldCodec.ForDouble(106); + private readonly pbc::RepeatedField headZone3Temperature_ = new pbc::RepeatedField(); + /// + ///Head Zone 3 (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField HeadZone3Temperature { + get { return headZone3Temperature_; } + } + + /// Field number for the "HeadAirFlow" field. + public const int HeadAirFlowFieldNumber = 14; + private static readonly pb::FieldCodec _repeated_headAirFlow_codec + = pb::FieldCodec.ForDouble(114); + private readonly pbc::RepeatedField headAirFlow_ = new pbc::RepeatedField(); + /// + ///Head Air Flow (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField HeadAirFlow { + get { return headAirFlow_; } + } + + /// Field number for the "FeederTension" field. + public const int FeederTensionFieldNumber = 15; + private static readonly pb::FieldCodec _repeated_feederTension_codec + = pb::FieldCodec.ForDouble(122); + private readonly pbc::RepeatedField feederTension_ = new pbc::RepeatedField(); + /// + ///Feeder Tension (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField FeederTension { + get { return feederTension_; } + } + + /// Field number for the "PullerTension" field. + public const int PullerTensionFieldNumber = 16; + private static readonly pb::FieldCodec _repeated_pullerTension_codec + = pb::FieldCodec.ForDouble(130); + private readonly pbc::RepeatedField pullerTension_ = new pbc::RepeatedField(); + /// + ///Puller Tension (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField PullerTension { + get { return pullerTension_; } + } + + /// Field number for the "DryerZone1Temperature" field. + public const int DryerZone1TemperatureFieldNumber = 17; + private static readonly pb::FieldCodec _repeated_dryerZone1Temperature_codec + = pb::FieldCodec.ForDouble(138); + private readonly pbc::RepeatedField dryerZone1Temperature_ = new pbc::RepeatedField(); + /// + ///Dryer Zone 1 (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DryerZone1Temperature { + get { return dryerZone1Temperature_; } + } + + /// Field number for the "DryerZone2Temperature" field. + public const int DryerZone2TemperatureFieldNumber = 18; + private static readonly pb::FieldCodec _repeated_dryerZone2Temperature_codec + = pb::FieldCodec.ForDouble(146); + private readonly pbc::RepeatedField dryerZone2Temperature_ = new pbc::RepeatedField(); + /// + ///Dryer Zone 2 (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DryerZone2Temperature { + get { return dryerZone2Temperature_; } + } + + /// Field number for the "DryerZone3Temperature" field. + public const int DryerZone3TemperatureFieldNumber = 19; + private static readonly pb::FieldCodec _repeated_dryerZone3Temperature_codec + = pb::FieldCodec.ForDouble(154); + private readonly pbc::RepeatedField dryerZone3Temperature_ = new pbc::RepeatedField(); + /// + ///Dryer Zone 3 (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DryerZone3Temperature { + get { return dryerZone3Temperature_; } + } + + /// Field number for the "DryerAirFlow" field. + public const int DryerAirFlowFieldNumber = 20; + private static readonly pb::FieldCodec _repeated_dryerAirFlow_codec + = pb::FieldCodec.ForDouble(162); + private readonly pbc::RepeatedField dryerAirFlow_ = new pbc::RepeatedField(); + /// + ///Dryer Air Flow (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DryerAirFlow { + get { return dryerAirFlow_; } + } + + /// Field number for the "WinderTension" field. + public const int WinderTensionFieldNumber = 21; + private static readonly pb::FieldCodec _repeated_winderTension_codec + = pb::FieldCodec.ForDouble(170); + private readonly pbc::RepeatedField winderTension_ = new pbc::RepeatedField(); + /// + ///Winder Tension (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField WinderTension { + get { return winderTension_; } + } + + /// Field number for the "DispensersMotorsFrequency" field. + public const int DispensersMotorsFrequencyFieldNumber = 22; + private static readonly pb::FieldCodec _repeated_dispensersMotorsFrequency_codec + = pb::FieldCodec.ForMessage(178, global::Tango.PMR.Diagnostics.DoubleArray.Parser); + private readonly pbc::RepeatedField dispensersMotorsFrequency_ = new pbc::RepeatedField(); + /// + ///Dispensers Motors (Min = 0, Max = 1080, PPF = 10) Channel Count = 8 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DispensersMotorsFrequency { + get { return dispensersMotorsFrequency_; } + } + + /// Field number for the "DispensersAngularEncoders" field. + public const int DispensersAngularEncodersFieldNumber = 23; + private static readonly pb::FieldCodec _repeated_dispensersAngularEncoders_codec + = pb::FieldCodec.ForMessage(186, global::Tango.PMR.Diagnostics.DoubleArray.Parser); + private readonly pbc::RepeatedField dispensersAngularEncoders_ = new pbc::RepeatedField(); + /// + ///Dispensers Angular Encoders (Min = 0, Max = 100, PPF = 1) Channel Count = 8 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DispensersAngularEncoders { + get { return dispensersAngularEncoders_; } + } + + /// Field number for the "DispensersLinearPositions" field. + public const int DispensersLinearPositionsFieldNumber = 24; + private static readonly pb::FieldCodec _repeated_dispensersLinearPositions_codec + = pb::FieldCodec.ForMessage(194, global::Tango.PMR.Diagnostics.DoubleArray.Parser); + private readonly pbc::RepeatedField dispensersLinearPositions_ = new pbc::RepeatedField(); + /// + ///Dispensers Linear Positions (Min = 0, Max = 100, PPF = 1) Channel Count = 8 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DispensersLinearPositions { + get { return dispensersLinearPositions_; } + } + + /// Field number for the "DispensersPressure" field. + public const int DispensersPressureFieldNumber = 25; + private static readonly pb::FieldCodec _repeated_dispensersPressure_codec + = pb::FieldCodec.ForMessage(202, global::Tango.PMR.Diagnostics.DoubleArray.Parser); + private readonly pbc::RepeatedField dispensersPressure_ = new pbc::RepeatedField(); + /// + ///Dispensers Pressure (Min = 0, Max = 100, PPF = 1) Channel Count = 8 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DispensersPressure { + get { return dispensersPressure_; } + } + + /// Field number for the "MidTankPressure" field. + public const int MidTankPressureFieldNumber = 26; + private static readonly pb::FieldCodec _repeated_midTankPressure_codec + = pb::FieldCodec.ForDouble(210); + private readonly pbc::RepeatedField midTankPressure_ = new pbc::RepeatedField(); + /// + ///Mid Tank Pressure (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField MidTankPressure { + get { return midTankPressure_; } + } + + /// Field number for the "FilterDeltaPressure" field. + public const int FilterDeltaPressureFieldNumber = 27; + private static readonly pb::FieldCodec _repeated_filterDeltaPressure_codec + = pb::FieldCodec.ForDouble(218); + private readonly pbc::RepeatedField filterDeltaPressure_ = new pbc::RepeatedField(); + /// + ///Filter Delta Pressure (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField FilterDeltaPressure { + get { return filterDeltaPressure_; } + } + + /// Field number for the "ChillerTemperature" field. + public const int ChillerTemperatureFieldNumber = 28; + private static readonly pb::FieldCodec _repeated_chillerTemperature_codec + = pb::FieldCodec.ForDouble(226); + private readonly pbc::RepeatedField chillerTemperature_ = new pbc::RepeatedField(); + /// + ///Chiller Temperature (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ChillerTemperature { + get { return chillerTemperature_; } + } + + /// Field number for the "Dispenser1MotorFrequency" field. + public const int Dispenser1MotorFrequencyFieldNumber = 29; + private static readonly pb::FieldCodec _repeated_dispenser1MotorFrequency_codec + = pb::FieldCodec.ForDouble(234); + private readonly pbc::RepeatedField dispenser1MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 1 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser1MotorFrequency { + get { return dispenser1MotorFrequency_; } + } + + /// Field number for the "Dispenser2MotorFrequency" field. + public const int Dispenser2MotorFrequencyFieldNumber = 30; + private static readonly pb::FieldCodec _repeated_dispenser2MotorFrequency_codec + = pb::FieldCodec.ForDouble(242); + private readonly pbc::RepeatedField dispenser2MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 2 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser2MotorFrequency { + get { return dispenser2MotorFrequency_; } + } + + /// Field number for the "Dispenser3MotorFrequency" field. + public const int Dispenser3MotorFrequencyFieldNumber = 31; + private static readonly pb::FieldCodec _repeated_dispenser3MotorFrequency_codec + = pb::FieldCodec.ForDouble(250); + private readonly pbc::RepeatedField dispenser3MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 3 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser3MotorFrequency { + get { return dispenser3MotorFrequency_; } + } + + /// Field number for the "Dispenser4MotorFrequency" field. + public const int Dispenser4MotorFrequencyFieldNumber = 32; + private static readonly pb::FieldCodec _repeated_dispenser4MotorFrequency_codec + = pb::FieldCodec.ForDouble(258); + private readonly pbc::RepeatedField dispenser4MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 4 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser4MotorFrequency { + get { return dispenser4MotorFrequency_; } + } + + /// Field number for the "Dispenser5MotorFrequency" field. + public const int Dispenser5MotorFrequencyFieldNumber = 33; + private static readonly pb::FieldCodec _repeated_dispenser5MotorFrequency_codec + = pb::FieldCodec.ForDouble(266); + private readonly pbc::RepeatedField dispenser5MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 5 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser5MotorFrequency { + get { return dispenser5MotorFrequency_; } + } + + /// Field number for the "Dispenser6MotorFrequency" field. + public const int Dispenser6MotorFrequencyFieldNumber = 34; + private static readonly pb::FieldCodec _repeated_dispenser6MotorFrequency_codec + = pb::FieldCodec.ForDouble(274); + private readonly pbc::RepeatedField dispenser6MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 6 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser6MotorFrequency { + get { return dispenser6MotorFrequency_; } + } + + /// Field number for the "Dispenser7MotorFrequency" field. + public const int Dispenser7MotorFrequencyFieldNumber = 35; + private static readonly pb::FieldCodec _repeated_dispenser7MotorFrequency_codec + = pb::FieldCodec.ForDouble(282); + private readonly pbc::RepeatedField dispenser7MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 7 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser7MotorFrequency { + get { return dispenser7MotorFrequency_; } + } + + /// Field number for the "Dispenser8MotorFrequency" field. + public const int Dispenser8MotorFrequencyFieldNumber = 36; + private static readonly pb::FieldCodec _repeated_dispenser8MotorFrequency_codec + = pb::FieldCodec.ForDouble(290); + private readonly pbc::RepeatedField dispenser8MotorFrequency_ = new pbc::RepeatedField(); + /// + ///Dispenser 8 Motor Frequency (Min = 0, Max = 1080, PPF = 10) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Dispenser8MotorFrequency { + get { return dispenser8MotorFrequency_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DiagnosticsMonitors); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DiagnosticsMonitors other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!dancer1Angle_.Equals(other.dancer1Angle_)) return false; + if(!dancer2Angle_.Equals(other.dancer2Angle_)) return false; + if(!dancer3Angle_.Equals(other.dancer3Angle_)) return false; + if(!feederMotorFrequency_.Equals(other.feederMotorFrequency_)) return false; + if(!dryerMotor_.Equals(other.dryerMotor_)) return false; + if(!pollerMotor_.Equals(other.pollerMotor_)) return false; + if(!winderMotor_.Equals(other.winderMotor_)) return false; + if(!screwMotor_.Equals(other.screwMotor_)) return false; + if(!threadSpeed_.Equals(other.threadSpeed_)) return false; + if(!mixerTemperature_.Equals(other.mixerTemperature_)) return false; + if(!headZone1Temperature_.Equals(other.headZone1Temperature_)) return false; + if(!headZone2Temperature_.Equals(other.headZone2Temperature_)) return false; + if(!headZone3Temperature_.Equals(other.headZone3Temperature_)) return false; + if(!headAirFlow_.Equals(other.headAirFlow_)) return false; + if(!feederTension_.Equals(other.feederTension_)) return false; + if(!pullerTension_.Equals(other.pullerTension_)) return false; + if(!dryerZone1Temperature_.Equals(other.dryerZone1Temperature_)) return false; + if(!dryerZone2Temperature_.Equals(other.dryerZone2Temperature_)) return false; + if(!dryerZone3Temperature_.Equals(other.dryerZone3Temperature_)) return false; + if(!dryerAirFlow_.Equals(other.dryerAirFlow_)) return false; + if(!winderTension_.Equals(other.winderTension_)) return false; + if(!dispensersMotorsFrequency_.Equals(other.dispensersMotorsFrequency_)) return false; + if(!dispensersAngularEncoders_.Equals(other.dispensersAngularEncoders_)) return false; + if(!dispensersLinearPositions_.Equals(other.dispensersLinearPositions_)) return false; + if(!dispensersPressure_.Equals(other.dispensersPressure_)) return false; + if(!midTankPressure_.Equals(other.midTankPressure_)) return false; + if(!filterDeltaPressure_.Equals(other.filterDeltaPressure_)) return false; + if(!chillerTemperature_.Equals(other.chillerTemperature_)) return false; + if(!dispenser1MotorFrequency_.Equals(other.dispenser1MotorFrequency_)) return false; + if(!dispenser2MotorFrequency_.Equals(other.dispenser2MotorFrequency_)) return false; + if(!dispenser3MotorFrequency_.Equals(other.dispenser3MotorFrequency_)) return false; + if(!dispenser4MotorFrequency_.Equals(other.dispenser4MotorFrequency_)) return false; + if(!dispenser5MotorFrequency_.Equals(other.dispenser5MotorFrequency_)) return false; + if(!dispenser6MotorFrequency_.Equals(other.dispenser6MotorFrequency_)) return false; + if(!dispenser7MotorFrequency_.Equals(other.dispenser7MotorFrequency_)) return false; + if(!dispenser8MotorFrequency_.Equals(other.dispenser8MotorFrequency_)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= dancer1Angle_.GetHashCode(); + hash ^= dancer2Angle_.GetHashCode(); + hash ^= dancer3Angle_.GetHashCode(); + hash ^= feederMotorFrequency_.GetHashCode(); + hash ^= dryerMotor_.GetHashCode(); + hash ^= pollerMotor_.GetHashCode(); + hash ^= winderMotor_.GetHashCode(); + hash ^= screwMotor_.GetHashCode(); + hash ^= threadSpeed_.GetHashCode(); + hash ^= mixerTemperature_.GetHashCode(); + hash ^= headZone1Temperature_.GetHashCode(); + hash ^= headZone2Temperature_.GetHashCode(); + hash ^= headZone3Temperature_.GetHashCode(); + hash ^= headAirFlow_.GetHashCode(); + hash ^= feederTension_.GetHashCode(); + hash ^= pullerTension_.GetHashCode(); + hash ^= dryerZone1Temperature_.GetHashCode(); + hash ^= dryerZone2Temperature_.GetHashCode(); + hash ^= dryerZone3Temperature_.GetHashCode(); + hash ^= dryerAirFlow_.GetHashCode(); + hash ^= winderTension_.GetHashCode(); + hash ^= dispensersMotorsFrequency_.GetHashCode(); + hash ^= dispensersAngularEncoders_.GetHashCode(); + hash ^= dispensersLinearPositions_.GetHashCode(); + hash ^= dispensersPressure_.GetHashCode(); + hash ^= midTankPressure_.GetHashCode(); + hash ^= filterDeltaPressure_.GetHashCode(); + hash ^= chillerTemperature_.GetHashCode(); + hash ^= dispenser1MotorFrequency_.GetHashCode(); + hash ^= dispenser2MotorFrequency_.GetHashCode(); + hash ^= dispenser3MotorFrequency_.GetHashCode(); + hash ^= dispenser4MotorFrequency_.GetHashCode(); + hash ^= dispenser5MotorFrequency_.GetHashCode(); + hash ^= dispenser6MotorFrequency_.GetHashCode(); + hash ^= dispenser7MotorFrequency_.GetHashCode(); + hash ^= dispenser8MotorFrequency_.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) { + dancer1Angle_.WriteTo(output, _repeated_dancer1Angle_codec); + dancer2Angle_.WriteTo(output, _repeated_dancer2Angle_codec); + dancer3Angle_.WriteTo(output, _repeated_dancer3Angle_codec); + feederMotorFrequency_.WriteTo(output, _repeated_feederMotorFrequency_codec); + dryerMotor_.WriteTo(output, _repeated_dryerMotor_codec); + pollerMotor_.WriteTo(output, _repeated_pollerMotor_codec); + winderMotor_.WriteTo(output, _repeated_winderMotor_codec); + screwMotor_.WriteTo(output, _repeated_screwMotor_codec); + threadSpeed_.WriteTo(output, _repeated_threadSpeed_codec); + mixerTemperature_.WriteTo(output, _repeated_mixerTemperature_codec); + headZone1Temperature_.WriteTo(output, _repeated_headZone1Temperature_codec); + headZone2Temperature_.WriteTo(output, _repeated_headZone2Temperature_codec); + headZone3Temperature_.WriteTo(output, _repeated_headZone3Temperature_codec); + headAirFlow_.WriteTo(output, _repeated_headAirFlow_codec); + feederTension_.WriteTo(output, _repeated_feederTension_codec); + pullerTension_.WriteTo(output, _repeated_pullerTension_codec); + dryerZone1Temperature_.WriteTo(output, _repeated_dryerZone1Temperature_codec); + dryerZone2Temperature_.WriteTo(output, _repeated_dryerZone2Temperature_codec); + dryerZone3Temperature_.WriteTo(output, _repeated_dryerZone3Temperature_codec); + dryerAirFlow_.WriteTo(output, _repeated_dryerAirFlow_codec); + winderTension_.WriteTo(output, _repeated_winderTension_codec); + dispensersMotorsFrequency_.WriteTo(output, _repeated_dispensersMotorsFrequency_codec); + dispensersAngularEncoders_.WriteTo(output, _repeated_dispensersAngularEncoders_codec); + dispensersLinearPositions_.WriteTo(output, _repeated_dispensersLinearPositions_codec); + dispensersPressure_.WriteTo(output, _repeated_dispensersPressure_codec); + midTankPressure_.WriteTo(output, _repeated_midTankPressure_codec); + filterDeltaPressure_.WriteTo(output, _repeated_filterDeltaPressure_codec); + chillerTemperature_.WriteTo(output, _repeated_chillerTemperature_codec); + dispenser1MotorFrequency_.WriteTo(output, _repeated_dispenser1MotorFrequency_codec); + dispenser2MotorFrequency_.WriteTo(output, _repeated_dispenser2MotorFrequency_codec); + dispenser3MotorFrequency_.WriteTo(output, _repeated_dispenser3MotorFrequency_codec); + dispenser4MotorFrequency_.WriteTo(output, _repeated_dispenser4MotorFrequency_codec); + dispenser5MotorFrequency_.WriteTo(output, _repeated_dispenser5MotorFrequency_codec); + dispenser6MotorFrequency_.WriteTo(output, _repeated_dispenser6MotorFrequency_codec); + dispenser7MotorFrequency_.WriteTo(output, _repeated_dispenser7MotorFrequency_codec); + dispenser8MotorFrequency_.WriteTo(output, _repeated_dispenser8MotorFrequency_codec); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += dancer1Angle_.CalculateSize(_repeated_dancer1Angle_codec); + size += dancer2Angle_.CalculateSize(_repeated_dancer2Angle_codec); + size += dancer3Angle_.CalculateSize(_repeated_dancer3Angle_codec); + size += feederMotorFrequency_.CalculateSize(_repeated_feederMotorFrequency_codec); + size += dryerMotor_.CalculateSize(_repeated_dryerMotor_codec); + size += pollerMotor_.CalculateSize(_repeated_pollerMotor_codec); + size += winderMotor_.CalculateSize(_repeated_winderMotor_codec); + size += screwMotor_.CalculateSize(_repeated_screwMotor_codec); + size += threadSpeed_.CalculateSize(_repeated_threadSpeed_codec); + size += mixerTemperature_.CalculateSize(_repeated_mixerTemperature_codec); + size += headZone1Temperature_.CalculateSize(_repeated_headZone1Temperature_codec); + size += headZone2Temperature_.CalculateSize(_repeated_headZone2Temperature_codec); + size += headZone3Temperature_.CalculateSize(_repeated_headZone3Temperature_codec); + size += headAirFlow_.CalculateSize(_repeated_headAirFlow_codec); + size += feederTension_.CalculateSize(_repeated_feederTension_codec); + size += pullerTension_.CalculateSize(_repeated_pullerTension_codec); + size += dryerZone1Temperature_.CalculateSize(_repeated_dryerZone1Temperature_codec); + size += dryerZone2Temperature_.CalculateSize(_repeated_dryerZone2Temperature_codec); + size += dryerZone3Temperature_.CalculateSize(_repeated_dryerZone3Temperature_codec); + size += dryerAirFlow_.CalculateSize(_repeated_dryerAirFlow_codec); + size += winderTension_.CalculateSize(_repeated_winderTension_codec); + size += dispensersMotorsFrequency_.CalculateSize(_repeated_dispensersMotorsFrequency_codec); + size += dispensersAngularEncoders_.CalculateSize(_repeated_dispensersAngularEncoders_codec); + size += dispensersLinearPositions_.CalculateSize(_repeated_dispensersLinearPositions_codec); + size += dispensersPressure_.CalculateSize(_repeated_dispensersPressure_codec); + size += midTankPressure_.CalculateSize(_repeated_midTankPressure_codec); + size += filterDeltaPressure_.CalculateSize(_repeated_filterDeltaPressure_codec); + size += chillerTemperature_.CalculateSize(_repeated_chillerTemperature_codec); + size += dispenser1MotorFrequency_.CalculateSize(_repeated_dispenser1MotorFrequency_codec); + size += dispenser2MotorFrequency_.CalculateSize(_repeated_dispenser2MotorFrequency_codec); + size += dispenser3MotorFrequency_.CalculateSize(_repeated_dispenser3MotorFrequency_codec); + size += dispenser4MotorFrequency_.CalculateSize(_repeated_dispenser4MotorFrequency_codec); + size += dispenser5MotorFrequency_.CalculateSize(_repeated_dispenser5MotorFrequency_codec); + size += dispenser6MotorFrequency_.CalculateSize(_repeated_dispenser6MotorFrequency_codec); + size += dispenser7MotorFrequency_.CalculateSize(_repeated_dispenser7MotorFrequency_codec); + size += dispenser8MotorFrequency_.CalculateSize(_repeated_dispenser8MotorFrequency_codec); + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DiagnosticsMonitors other) { + if (other == null) { + return; + } + dancer1Angle_.Add(other.dancer1Angle_); + dancer2Angle_.Add(other.dancer2Angle_); + dancer3Angle_.Add(other.dancer3Angle_); + feederMotorFrequency_.Add(other.feederMotorFrequency_); + dryerMotor_.Add(other.dryerMotor_); + pollerMotor_.Add(other.pollerMotor_); + winderMotor_.Add(other.winderMotor_); + screwMotor_.Add(other.screwMotor_); + threadSpeed_.Add(other.threadSpeed_); + mixerTemperature_.Add(other.mixerTemperature_); + headZone1Temperature_.Add(other.headZone1Temperature_); + headZone2Temperature_.Add(other.headZone2Temperature_); + headZone3Temperature_.Add(other.headZone3Temperature_); + headAirFlow_.Add(other.headAirFlow_); + feederTension_.Add(other.feederTension_); + pullerTension_.Add(other.pullerTension_); + dryerZone1Temperature_.Add(other.dryerZone1Temperature_); + dryerZone2Temperature_.Add(other.dryerZone2Temperature_); + dryerZone3Temperature_.Add(other.dryerZone3Temperature_); + dryerAirFlow_.Add(other.dryerAirFlow_); + winderTension_.Add(other.winderTension_); + dispensersMotorsFrequency_.Add(other.dispensersMotorsFrequency_); + dispensersAngularEncoders_.Add(other.dispensersAngularEncoders_); + dispensersLinearPositions_.Add(other.dispensersLinearPositions_); + dispensersPressure_.Add(other.dispensersPressure_); + midTankPressure_.Add(other.midTankPressure_); + filterDeltaPressure_.Add(other.filterDeltaPressure_); + chillerTemperature_.Add(other.chillerTemperature_); + dispenser1MotorFrequency_.Add(other.dispenser1MotorFrequency_); + dispenser2MotorFrequency_.Add(other.dispenser2MotorFrequency_); + dispenser3MotorFrequency_.Add(other.dispenser3MotorFrequency_); + dispenser4MotorFrequency_.Add(other.dispenser4MotorFrequency_); + dispenser5MotorFrequency_.Add(other.dispenser5MotorFrequency_); + dispenser6MotorFrequency_.Add(other.dispenser6MotorFrequency_); + dispenser7MotorFrequency_.Add(other.dispenser7MotorFrequency_); + dispenser8MotorFrequency_.Add(other.dispenser8MotorFrequency_); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: + case 9: { + dancer1Angle_.AddEntriesFrom(input, _repeated_dancer1Angle_codec); + break; + } + case 18: + case 17: { + dancer2Angle_.AddEntriesFrom(input, _repeated_dancer2Angle_codec); + break; + } + case 26: + case 25: { + dancer3Angle_.AddEntriesFrom(input, _repeated_dancer3Angle_codec); + break; + } + case 34: + case 33: { + feederMotorFrequency_.AddEntriesFrom(input, _repeated_feederMotorFrequency_codec); + break; + } + case 42: + case 41: { + dryerMotor_.AddEntriesFrom(input, _repeated_dryerMotor_codec); + break; + } + case 50: + case 49: { + pollerMotor_.AddEntriesFrom(input, _repeated_pollerMotor_codec); + break; + } + case 58: + case 57: { + winderMotor_.AddEntriesFrom(input, _repeated_winderMotor_codec); + break; + } + case 66: + case 65: { + screwMotor_.AddEntriesFrom(input, _repeated_screwMotor_codec); + break; + } + case 74: + case 73: { + threadSpeed_.AddEntriesFrom(input, _repeated_threadSpeed_codec); + break; + } + case 82: + case 81: { + mixerTemperature_.AddEntriesFrom(input, _repeated_mixerTemperature_codec); + break; + } + case 90: + case 89: { + headZone1Temperature_.AddEntriesFrom(input, _repeated_headZone1Temperature_codec); + break; + } + case 98: + case 97: { + headZone2Temperature_.AddEntriesFrom(input, _repeated_headZone2Temperature_codec); + break; + } + case 106: + case 105: { + headZone3Temperature_.AddEntriesFrom(input, _repeated_headZone3Temperature_codec); + break; + } + case 114: + case 113: { + headAirFlow_.AddEntriesFrom(input, _repeated_headAirFlow_codec); + break; + } + case 122: + case 121: { + feederTension_.AddEntriesFrom(input, _repeated_feederTension_codec); + break; + } + case 130: + case 129: { + pullerTension_.AddEntriesFrom(input, _repeated_pullerTension_codec); + break; + } + case 138: + case 137: { + dryerZone1Temperature_.AddEntriesFrom(input, _repeated_dryerZone1Temperature_codec); + break; + } + case 146: + case 145: { + dryerZone2Temperature_.AddEntriesFrom(input, _repeated_dryerZone2Temperature_codec); + break; + } + case 154: + case 153: { + dryerZone3Temperature_.AddEntriesFrom(input, _repeated_dryerZone3Temperature_codec); + break; + } + case 162: + case 161: { + dryerAirFlow_.AddEntriesFrom(input, _repeated_dryerAirFlow_codec); + break; + } + case 170: + case 169: { + winderTension_.AddEntriesFrom(input, _repeated_winderTension_codec); + break; + } + case 178: { + dispensersMotorsFrequency_.AddEntriesFrom(input, _repeated_dispensersMotorsFrequency_codec); + break; + } + case 186: { + dispensersAngularEncoders_.AddEntriesFrom(input, _repeated_dispensersAngularEncoders_codec); + break; + } + case 194: { + dispensersLinearPositions_.AddEntriesFrom(input, _repeated_dispensersLinearPositions_codec); + break; + } + case 202: { + dispensersPressure_.AddEntriesFrom(input, _repeated_dispensersPressure_codec); + break; + } + case 210: + case 209: { + midTankPressure_.AddEntriesFrom(input, _repeated_midTankPressure_codec); + break; + } + case 218: + case 217: { + filterDeltaPressure_.AddEntriesFrom(input, _repeated_filterDeltaPressure_codec); + break; + } + case 226: + case 225: { + chillerTemperature_.AddEntriesFrom(input, _repeated_chillerTemperature_codec); + break; + } + case 234: + case 233: { + dispenser1MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser1MotorFrequency_codec); + break; + } + case 242: + case 241: { + dispenser2MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser2MotorFrequency_codec); + break; + } + case 250: + case 249: { + dispenser3MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser3MotorFrequency_codec); + break; + } + case 258: + case 257: { + dispenser4MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser4MotorFrequency_codec); + break; + } + case 266: + case 265: { + dispenser5MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser5MotorFrequency_codec); + break; + } + case 274: + case 273: { + dispenser6MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser6MotorFrequency_codec); + break; + } + case 282: + case 281: { + dispenser7MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser7MotorFrequency_codec); + break; + } + case 290: + case 289: { + dispenser8MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser8MotorFrequency_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs index d08eb25dc..ed66a97c4 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs @@ -23,25 +23,19 @@ namespace Tango.PMR.Diagnostics { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Ch1QdXNoRGlhZ25vc3RpY3NSZXNwb25zZS5wcm90bxIVVGFuZ28uUE1SLkRp", - "YWdub3N0aWNzGhFEb3VibGVBcnJheS5wcm90bxoQRGlnaXRhbFBpbi5wcm90", - "byKqBAoXUHVzaERpYWdub3N0aWNzUmVzcG9uc2USFAoMRGFuY2VyMUFuZ2xl", - "GAEgAygBEhQKDERhbmNlcjJBbmdsZRgCIAMoARIUCgxEYW5jZXIzQW5nbGUY", - "AyADKAESRQoZRGlzcGVuc2Vyc01vdG9yc0ZyZXF1ZW5jeRgEIAMoCzIiLlRh", - "bmdvLlBNUi5EaWFnbm9zdGljcy5Eb3VibGVBcnJheRIgChhEaXNwZW5zZXIx", - "TW90b3JGcmVxdWVuY3kYBSADKAESIAoYRGlzcGVuc2VyMk1vdG9yRnJlcXVl", - "bmN5GAYgAygBEiAKGERpc3BlbnNlcjNNb3RvckZyZXF1ZW5jeRgHIAMoARIg", - "ChhEaXNwZW5zZXI0TW90b3JGcmVxdWVuY3kYCCADKAESIAoYRGlzcGVuc2Vy", - "NU1vdG9yRnJlcXVlbmN5GAkgAygBEiAKGERpc3BlbnNlcjZNb3RvckZyZXF1", - "ZW5jeRgKIAMoARIgChhEaXNwZW5zZXI3TW90b3JGcmVxdWVuY3kYCyADKAES", - "IAoYRGlzcGVuc2VyOE1vdG9yRnJlcXVlbmN5GAwgAygBEjYKC0RpZ2l0YWxQ", - "aW5zGA0gAygLMiEuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkRpZ2l0YWxQaW4S", - "DwoHVmVyc2lvbhgOIAEoCRITCgtWZXJzaW9uTmFtZRgPIAEoCRIYChBWZXJz", - "aW9uQnVpbGREYXRlGBAgASgJQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlh", - "Z25vc3RpY3NiBnByb3RvMw==")); + "YWdub3N0aWNzGhBEaWdpdGFsUGluLnByb3RvGhlWYWx1ZUNvbXBvbmVudFN0", + "YXRlLnByb3RvGhlEaWFnbm9zdGljc01vbml0b3JzLnByb3RvIpUCChdQdXNo", + "RGlhZ25vc3RpY3NSZXNwb25zZRI8CghNb25pdG9ycxgBIAEoCzIqLlRhbmdv", + "LlBNUi5EaWFnbm9zdGljcy5EaWFnbm9zdGljc01vbml0b3JzEjYKC0RpZ2l0", + "YWxQaW5zGAIgAygLMiEuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkRpZ2l0YWxQ", + "aW4SRAoQQ29tcG9uZW50c1N0YXRlcxgDIAMoCzIqLlRhbmdvLlBNUi5EaWFn", + "bm9zdGljcy5WYWx1ZUNvbXBvbmVudFN0YXRlEg8KB1ZlcnNpb24YBCABKAkS", + "EwoLVmVyc2lvbk5hbWUYBSABKAkSGAoQVmVyc2lvbkJ1aWxkRGF0ZRgGIAEo", + "CUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DoubleArrayReflection.Descriptor, global::Tango.PMR.Diagnostics.DigitalPinReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DigitalPinReflection.Descriptor, global::Tango.PMR.Diagnostics.ValueComponentStateReflection.Descriptor, global::Tango.PMR.Diagnostics.DiagnosticsMonitorsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.PushDiagnosticsResponse), global::Tango.PMR.Diagnostics.PushDiagnosticsResponse.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "DispensersMotorsFrequency", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "DigitalPins", "Version", "VersionName", "VersionBuildDate" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.PushDiagnosticsResponse), global::Tango.PMR.Diagnostics.PushDiagnosticsResponse.Parser, new[]{ "Monitors", "DigitalPins", "ComponentsStates", "Version", "VersionName", "VersionBuildDate" }, null, null, null) })); } #endregion @@ -72,19 +66,9 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PushDiagnosticsResponse(PushDiagnosticsResponse other) : this() { - dancer1Angle_ = other.dancer1Angle_.Clone(); - dancer2Angle_ = other.dancer2Angle_.Clone(); - dancer3Angle_ = other.dancer3Angle_.Clone(); - dispensersMotorsFrequency_ = other.dispensersMotorsFrequency_.Clone(); - dispenser1MotorFrequency_ = other.dispenser1MotorFrequency_.Clone(); - dispenser2MotorFrequency_ = other.dispenser2MotorFrequency_.Clone(); - dispenser3MotorFrequency_ = other.dispenser3MotorFrequency_.Clone(); - dispenser4MotorFrequency_ = other.dispenser4MotorFrequency_.Clone(); - dispenser5MotorFrequency_ = other.dispenser5MotorFrequency_.Clone(); - dispenser6MotorFrequency_ = other.dispenser6MotorFrequency_.Clone(); - dispenser7MotorFrequency_ = other.dispenser7MotorFrequency_.Clone(); - dispenser8MotorFrequency_ = other.dispenser8MotorFrequency_.Clone(); + Monitors = other.monitors_ != null ? other.Monitors.Clone() : null; digitalPins_ = other.digitalPins_.Clone(); + componentsStates_ = other.componentsStates_.Clone(); version_ = other.version_; versionName_ = other.versionName_; versionBuildDate_ = other.versionBuildDate_; @@ -95,136 +79,24 @@ namespace Tango.PMR.Diagnostics { return new PushDiagnosticsResponse(this); } - /// Field number for the "Dancer1Angle" field. - public const int Dancer1AngleFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_dancer1Angle_codec - = pb::FieldCodec.ForDouble(10); - private readonly pbc::RepeatedField dancer1Angle_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dancer1Angle { - get { return dancer1Angle_; } - } - - /// Field number for the "Dancer2Angle" field. - public const int Dancer2AngleFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_dancer2Angle_codec - = pb::FieldCodec.ForDouble(18); - private readonly pbc::RepeatedField dancer2Angle_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dancer2Angle { - get { return dancer2Angle_; } - } - - /// Field number for the "Dancer3Angle" field. - public const int Dancer3AngleFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_dancer3Angle_codec - = pb::FieldCodec.ForDouble(26); - private readonly pbc::RepeatedField dancer3Angle_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dancer3Angle { - get { return dancer3Angle_; } - } - - /// Field number for the "DispensersMotorsFrequency" field. - public const int DispensersMotorsFrequencyFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_dispensersMotorsFrequency_codec - = pb::FieldCodec.ForMessage(34, global::Tango.PMR.Diagnostics.DoubleArray.Parser); - private readonly pbc::RepeatedField dispensersMotorsFrequency_ = new pbc::RepeatedField(); + /// Field number for the "Monitors" field. + public const int MonitorsFieldNumber = 1; + private global::Tango.PMR.Diagnostics.DiagnosticsMonitors monitors_; /// - ///Dispensers Motors Frequency Multi + ///Monitors /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField DispensersMotorsFrequency { - get { return dispensersMotorsFrequency_; } - } - - /// Field number for the "Dispenser1MotorFrequency" field. - public const int Dispenser1MotorFrequencyFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_dispenser1MotorFrequency_codec - = pb::FieldCodec.ForDouble(42); - private readonly pbc::RepeatedField dispenser1MotorFrequency_ = new pbc::RepeatedField(); - /// - ///Dispensers Motors Frequency Singles - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser1MotorFrequency { - get { return dispenser1MotorFrequency_; } - } - - /// Field number for the "Dispenser2MotorFrequency" field. - public const int Dispenser2MotorFrequencyFieldNumber = 6; - private static readonly pb::FieldCodec _repeated_dispenser2MotorFrequency_codec - = pb::FieldCodec.ForDouble(50); - private readonly pbc::RepeatedField dispenser2MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser2MotorFrequency { - get { return dispenser2MotorFrequency_; } - } - - /// Field number for the "Dispenser3MotorFrequency" field. - public const int Dispenser3MotorFrequencyFieldNumber = 7; - private static readonly pb::FieldCodec _repeated_dispenser3MotorFrequency_codec - = pb::FieldCodec.ForDouble(58); - private readonly pbc::RepeatedField dispenser3MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser3MotorFrequency { - get { return dispenser3MotorFrequency_; } - } - - /// Field number for the "Dispenser4MotorFrequency" field. - public const int Dispenser4MotorFrequencyFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_dispenser4MotorFrequency_codec - = pb::FieldCodec.ForDouble(66); - private readonly pbc::RepeatedField dispenser4MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser4MotorFrequency { - get { return dispenser4MotorFrequency_; } - } - - /// Field number for the "Dispenser5MotorFrequency" field. - public const int Dispenser5MotorFrequencyFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_dispenser5MotorFrequency_codec - = pb::FieldCodec.ForDouble(74); - private readonly pbc::RepeatedField dispenser5MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser5MotorFrequency { - get { return dispenser5MotorFrequency_; } - } - - /// Field number for the "Dispenser6MotorFrequency" field. - public const int Dispenser6MotorFrequencyFieldNumber = 10; - private static readonly pb::FieldCodec _repeated_dispenser6MotorFrequency_codec - = pb::FieldCodec.ForDouble(82); - private readonly pbc::RepeatedField dispenser6MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser6MotorFrequency { - get { return dispenser6MotorFrequency_; } - } - - /// Field number for the "Dispenser7MotorFrequency" field. - public const int Dispenser7MotorFrequencyFieldNumber = 11; - private static readonly pb::FieldCodec _repeated_dispenser7MotorFrequency_codec - = pb::FieldCodec.ForDouble(90); - private readonly pbc::RepeatedField dispenser7MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser7MotorFrequency { - get { return dispenser7MotorFrequency_; } - } - - /// Field number for the "Dispenser8MotorFrequency" field. - public const int Dispenser8MotorFrequencyFieldNumber = 12; - private static readonly pb::FieldCodec _repeated_dispenser8MotorFrequency_codec - = pb::FieldCodec.ForDouble(98); - private readonly pbc::RepeatedField dispenser8MotorFrequency_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Dispenser8MotorFrequency { - get { return dispenser8MotorFrequency_; } + public global::Tango.PMR.Diagnostics.DiagnosticsMonitors Monitors { + get { return monitors_; } + set { + monitors_ = value; + } } /// Field number for the "DigitalPins" field. - public const int DigitalPinsFieldNumber = 13; + public const int DigitalPinsFieldNumber = 2; private static readonly pb::FieldCodec _repeated_digitalPins_codec - = pb::FieldCodec.ForMessage(106, global::Tango.PMR.Diagnostics.DigitalPin.Parser); + = pb::FieldCodec.ForMessage(18, global::Tango.PMR.Diagnostics.DigitalPin.Parser); private readonly pbc::RepeatedField digitalPins_ = new pbc::RepeatedField(); /// ///Digital Pins States @@ -234,8 +106,21 @@ namespace Tango.PMR.Diagnostics { get { return digitalPins_; } } + /// Field number for the "ComponentsStates" field. + public const int ComponentsStatesFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_componentsStates_codec + = pb::FieldCodec.ForMessage(26, global::Tango.PMR.Diagnostics.ValueComponentState.Parser); + private readonly pbc::RepeatedField componentsStates_ = new pbc::RepeatedField(); + /// + ///Value Components Effective Values + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ComponentsStates { + get { return componentsStates_; } + } + /// Field number for the "Version" field. - public const int VersionFieldNumber = 14; + public const int VersionFieldNumber = 4; private string version_ = ""; /// ///Software Information @@ -249,7 +134,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "VersionName" field. - public const int VersionNameFieldNumber = 15; + public const int VersionNameFieldNumber = 5; private string versionName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string VersionName { @@ -260,7 +145,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "VersionBuildDate" field. - public const int VersionBuildDateFieldNumber = 16; + public const int VersionBuildDateFieldNumber = 6; private string versionBuildDate_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string VersionBuildDate { @@ -283,19 +168,9 @@ namespace Tango.PMR.Diagnostics { if (ReferenceEquals(other, this)) { return true; } - if(!dancer1Angle_.Equals(other.dancer1Angle_)) return false; - if(!dancer2Angle_.Equals(other.dancer2Angle_)) return false; - if(!dancer3Angle_.Equals(other.dancer3Angle_)) return false; - if(!dispensersMotorsFrequency_.Equals(other.dispensersMotorsFrequency_)) return false; - if(!dispenser1MotorFrequency_.Equals(other.dispenser1MotorFrequency_)) return false; - if(!dispenser2MotorFrequency_.Equals(other.dispenser2MotorFrequency_)) return false; - if(!dispenser3MotorFrequency_.Equals(other.dispenser3MotorFrequency_)) return false; - if(!dispenser4MotorFrequency_.Equals(other.dispenser4MotorFrequency_)) return false; - if(!dispenser5MotorFrequency_.Equals(other.dispenser5MotorFrequency_)) return false; - if(!dispenser6MotorFrequency_.Equals(other.dispenser6MotorFrequency_)) return false; - if(!dispenser7MotorFrequency_.Equals(other.dispenser7MotorFrequency_)) return false; - if(!dispenser8MotorFrequency_.Equals(other.dispenser8MotorFrequency_)) return false; + if (!object.Equals(Monitors, other.Monitors)) return false; if(!digitalPins_.Equals(other.digitalPins_)) return false; + if(!componentsStates_.Equals(other.componentsStates_)) return false; if (Version != other.Version) return false; if (VersionName != other.VersionName) return false; if (VersionBuildDate != other.VersionBuildDate) return false; @@ -305,19 +180,9 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - hash ^= dancer1Angle_.GetHashCode(); - hash ^= dancer2Angle_.GetHashCode(); - hash ^= dancer3Angle_.GetHashCode(); - hash ^= dispensersMotorsFrequency_.GetHashCode(); - hash ^= dispenser1MotorFrequency_.GetHashCode(); - hash ^= dispenser2MotorFrequency_.GetHashCode(); - hash ^= dispenser3MotorFrequency_.GetHashCode(); - hash ^= dispenser4MotorFrequency_.GetHashCode(); - hash ^= dispenser5MotorFrequency_.GetHashCode(); - hash ^= dispenser6MotorFrequency_.GetHashCode(); - hash ^= dispenser7MotorFrequency_.GetHashCode(); - hash ^= dispenser8MotorFrequency_.GetHashCode(); + if (monitors_ != null) hash ^= Monitors.GetHashCode(); hash ^= digitalPins_.GetHashCode(); + hash ^= componentsStates_.GetHashCode(); if (Version.Length != 0) hash ^= Version.GetHashCode(); if (VersionName.Length != 0) hash ^= VersionName.GetHashCode(); if (VersionBuildDate.Length != 0) hash ^= VersionBuildDate.GetHashCode(); @@ -331,29 +196,22 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { - dancer1Angle_.WriteTo(output, _repeated_dancer1Angle_codec); - dancer2Angle_.WriteTo(output, _repeated_dancer2Angle_codec); - dancer3Angle_.WriteTo(output, _repeated_dancer3Angle_codec); - dispensersMotorsFrequency_.WriteTo(output, _repeated_dispensersMotorsFrequency_codec); - dispenser1MotorFrequency_.WriteTo(output, _repeated_dispenser1MotorFrequency_codec); - dispenser2MotorFrequency_.WriteTo(output, _repeated_dispenser2MotorFrequency_codec); - dispenser3MotorFrequency_.WriteTo(output, _repeated_dispenser3MotorFrequency_codec); - dispenser4MotorFrequency_.WriteTo(output, _repeated_dispenser4MotorFrequency_codec); - dispenser5MotorFrequency_.WriteTo(output, _repeated_dispenser5MotorFrequency_codec); - dispenser6MotorFrequency_.WriteTo(output, _repeated_dispenser6MotorFrequency_codec); - dispenser7MotorFrequency_.WriteTo(output, _repeated_dispenser7MotorFrequency_codec); - dispenser8MotorFrequency_.WriteTo(output, _repeated_dispenser8MotorFrequency_codec); + if (monitors_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Monitors); + } digitalPins_.WriteTo(output, _repeated_digitalPins_codec); + componentsStates_.WriteTo(output, _repeated_componentsStates_codec); if (Version.Length != 0) { - output.WriteRawTag(114); + output.WriteRawTag(34); output.WriteString(Version); } if (VersionName.Length != 0) { - output.WriteRawTag(122); + output.WriteRawTag(42); output.WriteString(VersionName); } if (VersionBuildDate.Length != 0) { - output.WriteRawTag(130, 1); + output.WriteRawTag(50); output.WriteString(VersionBuildDate); } } @@ -361,19 +219,11 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - size += dancer1Angle_.CalculateSize(_repeated_dancer1Angle_codec); - size += dancer2Angle_.CalculateSize(_repeated_dancer2Angle_codec); - size += dancer3Angle_.CalculateSize(_repeated_dancer3Angle_codec); - size += dispensersMotorsFrequency_.CalculateSize(_repeated_dispensersMotorsFrequency_codec); - size += dispenser1MotorFrequency_.CalculateSize(_repeated_dispenser1MotorFrequency_codec); - size += dispenser2MotorFrequency_.CalculateSize(_repeated_dispenser2MotorFrequency_codec); - size += dispenser3MotorFrequency_.CalculateSize(_repeated_dispenser3MotorFrequency_codec); - size += dispenser4MotorFrequency_.CalculateSize(_repeated_dispenser4MotorFrequency_codec); - size += dispenser5MotorFrequency_.CalculateSize(_repeated_dispenser5MotorFrequency_codec); - size += dispenser6MotorFrequency_.CalculateSize(_repeated_dispenser6MotorFrequency_codec); - size += dispenser7MotorFrequency_.CalculateSize(_repeated_dispenser7MotorFrequency_codec); - size += dispenser8MotorFrequency_.CalculateSize(_repeated_dispenser8MotorFrequency_codec); + if (monitors_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Monitors); + } size += digitalPins_.CalculateSize(_repeated_digitalPins_codec); + size += componentsStates_.CalculateSize(_repeated_componentsStates_codec); if (Version.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Version); } @@ -381,7 +231,7 @@ namespace Tango.PMR.Diagnostics { size += 1 + pb::CodedOutputStream.ComputeStringSize(VersionName); } if (VersionBuildDate.Length != 0) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(VersionBuildDate); + size += 1 + pb::CodedOutputStream.ComputeStringSize(VersionBuildDate); } return size; } @@ -391,19 +241,14 @@ namespace Tango.PMR.Diagnostics { if (other == null) { return; } - dancer1Angle_.Add(other.dancer1Angle_); - dancer2Angle_.Add(other.dancer2Angle_); - dancer3Angle_.Add(other.dancer3Angle_); - dispensersMotorsFrequency_.Add(other.dispensersMotorsFrequency_); - dispenser1MotorFrequency_.Add(other.dispenser1MotorFrequency_); - dispenser2MotorFrequency_.Add(other.dispenser2MotorFrequency_); - dispenser3MotorFrequency_.Add(other.dispenser3MotorFrequency_); - dispenser4MotorFrequency_.Add(other.dispenser4MotorFrequency_); - dispenser5MotorFrequency_.Add(other.dispenser5MotorFrequency_); - dispenser6MotorFrequency_.Add(other.dispenser6MotorFrequency_); - dispenser7MotorFrequency_.Add(other.dispenser7MotorFrequency_); - dispenser8MotorFrequency_.Add(other.dispenser8MotorFrequency_); + if (other.monitors_ != null) { + if (monitors_ == null) { + monitors_ = new global::Tango.PMR.Diagnostics.DiagnosticsMonitors(); + } + Monitors.MergeFrom(other.Monitors); + } digitalPins_.Add(other.digitalPins_); + componentsStates_.Add(other.componentsStates_); if (other.Version.Length != 0) { Version = other.Version; } @@ -423,78 +268,30 @@ namespace Tango.PMR.Diagnostics { default: input.SkipLastField(); break; - case 10: - case 9: { - dancer1Angle_.AddEntriesFrom(input, _repeated_dancer1Angle_codec); + case 10: { + if (monitors_ == null) { + monitors_ = new global::Tango.PMR.Diagnostics.DiagnosticsMonitors(); + } + input.ReadMessage(monitors_); break; } - case 18: - case 17: { - dancer2Angle_.AddEntriesFrom(input, _repeated_dancer2Angle_codec); + case 18: { + digitalPins_.AddEntriesFrom(input, _repeated_digitalPins_codec); break; } - case 26: - case 25: { - dancer3Angle_.AddEntriesFrom(input, _repeated_dancer3Angle_codec); + case 26: { + componentsStates_.AddEntriesFrom(input, _repeated_componentsStates_codec); break; } case 34: { - dispensersMotorsFrequency_.AddEntriesFrom(input, _repeated_dispensersMotorsFrequency_codec); - break; - } - case 42: - case 41: { - dispenser1MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser1MotorFrequency_codec); - break; - } - case 50: - case 49: { - dispenser2MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser2MotorFrequency_codec); - break; - } - case 58: - case 57: { - dispenser3MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser3MotorFrequency_codec); - break; - } - case 66: - case 65: { - dispenser4MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser4MotorFrequency_codec); - break; - } - case 74: - case 73: { - dispenser5MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser5MotorFrequency_codec); - break; - } - case 82: - case 81: { - dispenser6MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser6MotorFrequency_codec); - break; - } - case 90: - case 89: { - dispenser7MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser7MotorFrequency_codec); - break; - } - case 98: - case 97: { - dispenser8MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser8MotorFrequency_codec); - break; - } - case 106: { - digitalPins_.AddEntriesFrom(input, _repeated_digitalPins_codec); - break; - } - case 114: { Version = input.ReadString(); break; } - case 122: { + case 42: { VersionName = input.ReadString(); break; } - case 130: { + case 50: { VersionBuildDate = input.ReadString(); break; } diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueRequest.cs new file mode 100644 index 000000000..a7149ed48 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueRequest.cs @@ -0,0 +1,189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SetComponentValueRequest.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 SetComponentValueRequest.proto + public static partial class SetComponentValueRequestReflection { + + #region Descriptor + /// File descriptor for SetComponentValueRequest.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SetComponentValueRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch5TZXRDb21wb25lbnRWYWx1ZVJlcXVlc3QucHJvdG8SFVRhbmdvLlBNUi5E", + "aWFnbm9zdGljcxoUVmFsdWVDb21wb25lbnQucHJvdG8iYwoYU2V0Q29tcG9u", + "ZW50VmFsdWVSZXF1ZXN0EjgKCUNvbXBvbmVudBgBIAEoDjIlLlRhbmdvLlBN", + "Ui5EaWFnbm9zdGljcy5WYWx1ZUNvbXBvbmVudBINCgVWYWx1ZRgCIAEoAUIh", + "Ch9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.ValueComponentReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetComponentValueRequest), global::Tango.PMR.Diagnostics.SetComponentValueRequest.Parser, new[]{ "Component", "Value" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SetComponentValueRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetComponentValueRequest()); + [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.SetComponentValueRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetComponentValueRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetComponentValueRequest(SetComponentValueRequest other) : this() { + component_ = other.component_; + value_ = other.value_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetComponentValueRequest Clone() { + return new SetComponentValueRequest(this); + } + + /// Field number for the "Component" field. + public const int ComponentFieldNumber = 1; + private global::Tango.PMR.Diagnostics.ValueComponent component_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Diagnostics.ValueComponent Component { + get { return component_; } + set { + component_ = value; + } + } + + /// Field number for the "Value" field. + public const int ValueFieldNumber = 2; + private double value_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Value { + get { return value_; } + set { + value_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SetComponentValueRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SetComponentValueRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Component != other.Component) return false; + if (Value != other.Value) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Component != 0) hash ^= Component.GetHashCode(); + if (Value != 0D) hash ^= Value.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 (Component != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Component); + } + if (Value != 0D) { + output.WriteRawTag(17); + output.WriteDouble(Value); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Component != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Component); + } + if (Value != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(SetComponentValueRequest other) { + if (other == null) { + return; + } + if (other.Component != 0) { + Component = other.Component; + } + if (other.Value != 0D) { + Value = other.Value; + } + } + + [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: { + component_ = (global::Tango.PMR.Diagnostics.ValueComponent) input.ReadEnum(); + break; + } + case 17: { + Value = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueResponse.cs new file mode 100644 index 000000000..0c498dccf --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetComponentValueResponse.cs @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SetComponentValueResponse.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 SetComponentValueResponse.proto + public static partial class SetComponentValueResponseReflection { + + #region Descriptor + /// File descriptor for SetComponentValueResponse.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static SetComponentValueResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch9TZXRDb21wb25lbnRWYWx1ZVJlc3BvbnNlLnByb3RvEhVUYW5nby5QTVIu", + "RGlhZ25vc3RpY3MiGwoZU2V0Q29tcG9uZW50VmFsdWVSZXNwb25zZUIhCh9j", + "b20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetComponentValueResponse), global::Tango.PMR.Diagnostics.SetComponentValueResponse.Parser, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class SetComponentValueResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SetComponentValueResponse()); + [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.SetComponentValueResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetComponentValueResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetComponentValueResponse(SetComponentValueResponse other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public SetComponentValueResponse Clone() { + return new SetComponentValueResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as SetComponentValueResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(SetComponentValueResponse 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(SetComponentValueResponse 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/ValueComponent.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponent.cs new file mode 100644 index 000000000..88ba622ee --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponent.cs @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ValueComponent.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 ValueComponent.proto + public static partial class ValueComponentReflection { + + #region Descriptor + /// File descriptor for ValueComponent.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ValueComponentReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChRWYWx1ZUNvbXBvbmVudC5wcm90bxIVVGFuZ28uUE1SLkRpYWdub3N0aWNz", + "KjIKDlZhbHVlQ29tcG9uZW50Eg8KC0hlYXRlcjFUZW1wEAASDwoLSGVhdGVy", + "MlRlbXAQAUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZw", + "cm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Diagnostics.ValueComponent), }, null)); + } + #endregion + + } + #region Enums + public enum ValueComponent { + /// + ///Heater 1 Temperature (Min = 0, Max = 100) + /// + [pbr::OriginalName("Heater1Temp")] Heater1Temp = 0, + /// + ///Heater 2 Temperature (Min = 0, Max = 100) + /// + [pbr::OriginalName("Heater2Temp")] Heater2Temp = 1, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponentState.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponentState.cs new file mode 100644 index 000000000..a48590aec --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/ValueComponentState.cs @@ -0,0 +1,189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ValueComponentState.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 ValueComponentState.proto + public static partial class ValueComponentStateReflection { + + #region Descriptor + /// File descriptor for ValueComponentState.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ValueComponentStateReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChlWYWx1ZUNvbXBvbmVudFN0YXRlLnByb3RvEhVUYW5nby5QTVIuRGlhZ25v", + "c3RpY3MaFFZhbHVlQ29tcG9uZW50LnByb3RvIl4KE1ZhbHVlQ29tcG9uZW50", + "U3RhdGUSOAoJQ29tcG9uZW50GAEgASgOMiUuVGFuZ28uUE1SLkRpYWdub3N0", + "aWNzLlZhbHVlQ29tcG9uZW50Eg0KBVZhbHVlGAIgASgBQiEKH2NvbS50d2lu", + "ZS50YW5nby5wbXIuZGlhZ25vc3RpY3NiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.ValueComponentReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.ValueComponentState), global::Tango.PMR.Diagnostics.ValueComponentState.Parser, new[]{ "Component", "Value" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class ValueComponentState : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValueComponentState()); + [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.ValueComponentStateReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueComponentState() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueComponentState(ValueComponentState other) : this() { + component_ = other.component_; + value_ = other.value_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueComponentState Clone() { + return new ValueComponentState(this); + } + + /// Field number for the "Component" field. + public const int ComponentFieldNumber = 1; + private global::Tango.PMR.Diagnostics.ValueComponent component_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Diagnostics.ValueComponent Component { + get { return component_; } + set { + component_ = value; + } + } + + /// Field number for the "Value" field. + public const int ValueFieldNumber = 2; + private double value_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Value { + get { return value_; } + set { + value_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ValueComponentState); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ValueComponentState other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Component != other.Component) return false; + if (Value != other.Value) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Component != 0) hash ^= Component.GetHashCode(); + if (Value != 0D) hash ^= Value.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 (Component != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Component); + } + if (Value != 0D) { + output.WriteRawTag(17); + output.WriteDouble(Value); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Component != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Component); + } + if (Value != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ValueComponentState other) { + if (other == null) { + return; + } + if (other.Component != 0) { + Component = other.Component; + } + if (other.Value != 0D) { + Value = other.Value; + } + } + + [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: { + component_ = (global::Tango.PMR.Diagnostics.ValueComponent) input.ReadEnum(); + break; + } + case 17: { + Value = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs b/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs index 40bd0724c..6f9e53bf5 100644 --- a/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs +++ b/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs @@ -13,7 +13,7 @@ namespace Tango.PMR /// /// Contains PMR extension methods. /// - public static class ExtensionMethods + public static class ExtensionMethods { /// /// Gets the protobuf attribute value from the message type. diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs index a314c8996..f9273789e 100644 --- a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs @@ -35,8 +35,17 @@ namespace Tango.PMR.Hardware { } #region Enums public enum HardwareDancerType { + /// + ///Left Dancer + /// [pbr::OriginalName("LeftDancer")] LeftDancer = 0, + /// + ///Middle Dancer + /// [pbr::OriginalName("MiddleDancer")] MiddleDancer = 1, + /// + ///Right Dancer + /// [pbr::OriginalName("RightDancer")] RightDancer = 2, } diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs index 49aa1d688..c19e8b58c 100644 --- a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs @@ -35,9 +35,21 @@ namespace Tango.PMR.Hardware { } #region Enums public enum HardwareMotorType { + /// + ///Winder Motor + /// [pbr::OriginalName("WinderMotor")] WinderMotor = 0, + /// + ///Feeder Motor + /// [pbr::OriginalName("FeederMotor")] FeederMotor = 1, + /// + ///Dryer Motor + /// [pbr::OriginalName("DryerMotor")] DryerMotor = 2, + /// + ///Pooler Motor + /// [pbr::OriginalName("PoolerMotor")] PoolerMotor = 3, } diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs index 1ef856a75..fe6f6ab97 100644 --- a/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs @@ -40,19 +40,61 @@ namespace Tango.PMR.Hardware { } #region Enums public enum HardwarePidControlType { + /// + ///Dryer Heater 1000w + /// [pbr::OriginalName("DryerHeater1000w")] DryerHeater1000W = 0, + /// + ///Dryer Heater 200w 1 + /// [pbr::OriginalName("DryerHeater200w1")] DryerHeater200W1 = 1, + /// + ///Dryer Heater 200w 2 + /// [pbr::OriginalName("DryerHeater200w2")] DryerHeater200W2 = 2, + /// + ///Head Heater Zone 1 + /// [pbr::OriginalName("HeadHeaterZ1")] HeadHeaterZ1 = 3, + /// + ///Head Heater Zone 2 + /// [pbr::OriginalName("HeadHeaterZ2")] HeadHeaterZ2 = 4, + /// + ///Head Heater Zone 3 + /// [pbr::OriginalName("HeadHeaterZ3")] HeadHeaterZ3 = 5, + /// + ///Head Heater Zone 4 + /// [pbr::OriginalName("HeadHeaterZ4")] HeadHeaterZ4 = 6, + /// + ///Mixer Heater + /// [pbr::OriginalName("MixerHeater")] MixerHeater = 7, + /// + ///Waste Control + /// [pbr::OriginalName("WasteControl")] WasteControl = 8, + /// + ///Dryer Motor + /// [pbr::OriginalName("MotorDryer")] MotorDryer = 9, + /// + ///Feeder Motor + /// [pbr::OriginalName("MotorFeeder")] MotorFeeder = 10, + /// + ///Pooler Motor + /// [pbr::OriginalName("MotorPooler")] MotorPooler = 11, + /// + ///Winder Motor + /// [pbr::OriginalName("MotorWinder")] MotorWinder = 12, + /// + ///Dryer Heater 400 + /// [pbr::OriginalName("DryerHeater400")] DryerHeater400 = 13, } diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareWinderType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareWinderType.cs index af7e964bd..28aa18876 100644 --- a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareWinderType.cs +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareWinderType.cs @@ -34,6 +34,9 @@ namespace Tango.PMR.Hardware { } #region Enums public enum HardwareWinderType { + /// + ///Internal Winder + /// [pbr::OriginalName("InternalWinder")] InternalWinder = 0, } diff --git a/Software/Visual_Studio/Tango.PMR/Printing/JobWindingMethod.cs b/Software/Visual_Studio/Tango.PMR/Printing/JobWindingMethod.cs index af7a23b95..5172571c1 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/JobWindingMethod.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/JobWindingMethod.cs @@ -35,7 +35,13 @@ namespace Tango.PMR.Printing { } #region Enums public enum JobWindingMethod { + /// + ///Embroidery Winding + /// [pbr::OriginalName("Embroidery")] Embroidery = 0, + /// + ///Calibration Winding + /// [pbr::OriginalName("Calibration")] Calibration = 1, } diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 2506e2373..4bb843619 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -61,6 +61,7 @@ + @@ -82,12 +83,16 @@ + + + + diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index e8ae075d8..bb416646e 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -157,6 +157,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.ColorLa EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.UsersAndRoles", "MachineStudio\Modules\Tango.MachineStudio.UsersAndRoles\Tango.MachineStudio.UsersAndRoles.csproj", "{88028F14-0028-4DED-B119-19B8EE23CF32}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.CircularGauge", "Tango.CircularGauge\Tango.CircularGauge.csproj", "{6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2066,6 +2068,36 @@ Global {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x64.Build.0 = Release|Any CPU {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x86.ActiveCfg = Release|Any CPU {88028F14-0028-4DED-B119-19B8EE23CF32}.Release|x86.Build.0 = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|ARM.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|ARM64.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|x64.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|x64.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|x86.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Debug|x86.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|Any CPU.Build.0 = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|ARM.ActiveCfg = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|ARM.Build.0 = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|ARM64.ActiveCfg = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|ARM64.Build.0 = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|x64.ActiveCfg = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|x64.Build.0 = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|x86.ActiveCfg = Release|Any CPU + {6EFD5895-177B-4BBB-AF52-29F4D53B3FBD}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs index 6fc87e085..b782952a9 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs @@ -36,6 +36,8 @@ namespace Tango.PMRGenerator.CLI GenerateColorLabColorSpaces(db, pmrFolder); GenerateColorLabLiquidTypes(db, pmrFolder); + GenerateDiagnosticsValueComponents(db, pmrFolder); + GenerateDiagnosticsMonitors(db, pmrFolder); } Console.WriteLine("Done"); @@ -55,6 +57,7 @@ namespace Tango.PMRGenerator.CLI { Name = field.Name.Replace(" ", ""), Value = field.Code, + Description = field.Description, }); } @@ -64,11 +67,11 @@ namespace Tango.PMRGenerator.CLI messageFile.Package = "Tango.PMR.Hardware"; messageFile.Imports.Add("HardwareMotorType.proto"); - messageFile.Properties.Add(new Property("HardwareMotorType", "HardwareMotorType")); + messageFile.Properties.Add(new ProtoProperty("HardwareMotorType", "HardwareMotorType")); foreach (var prop in typeof(HardwareMotor).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } String enumString = enumFile.GenerateCode(); @@ -92,6 +95,7 @@ namespace Tango.PMRGenerator.CLI { Name = field.Name.Replace(" ", ""), Value = field.Code, + Description = field.Description, }); } @@ -102,11 +106,11 @@ namespace Tango.PMRGenerator.CLI messageFile.Package = "Tango.PMR.Hardware"; messageFile.Imports.Add("HardwareDancerType.proto"); - messageFile.Properties.Add(new Property("HardwareDancerType", "HardwareDancerType")); + messageFile.Properties.Add(new ProtoProperty("HardwareDancerType", "HardwareDancerType")); foreach (var prop in typeof(HardwareDancer).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } String enumString = enumFile.GenerateCode(); @@ -130,6 +134,7 @@ namespace Tango.PMRGenerator.CLI { Name = field.Name.Replace(" ", ""), Value = field.Code, + Description = field.Description, }); } @@ -140,11 +145,11 @@ namespace Tango.PMRGenerator.CLI messageFile.Package = "Tango.PMR.Hardware"; messageFile.Imports.Add("HardwarePidControlType.proto"); - messageFile.Properties.Add(new Property("HardwarePidControlType", "HardwarePidControlType")); + messageFile.Properties.Add(new ProtoProperty("HardwarePidControlType", "HardwarePidControlType")); foreach (var prop in typeof(HardwarePidControl).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } String enumString = enumFile.GenerateCode(); @@ -178,13 +183,13 @@ namespace Tango.PMRGenerator.CLI messageFile.Package = "Tango.PMR.Hardware"; messageFile.Imports.Add("HardwareDispenserType.proto"); - messageFile.Properties.Add(new Property("HardwareDispenserType", "HardwareDispenserType")); + messageFile.Properties.Add(new ProtoProperty("HardwareDispenserType", "HardwareDispenserType")); foreach (var prop in typeof(DispenserType).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { if (prop.Name != "Name" && prop.Name != "Code") { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } } @@ -209,6 +214,7 @@ namespace Tango.PMRGenerator.CLI { Name = field.Name.Replace(" ", ""), Value = field.Code, + Description = field.Description, }); } @@ -218,11 +224,11 @@ namespace Tango.PMRGenerator.CLI messageFile.Package = "Tango.PMR.Hardware"; messageFile.Imports.Add("HardwareWinderType.proto"); - messageFile.Properties.Add(new Property("HardwareWinderType", "HardwareWinderType")); + messageFile.Properties.Add(new ProtoProperty("HardwareWinderType", "HardwareWinderType")); foreach (var prop in typeof(HardwareWinder).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } String enumString = enumFile.GenerateCode(); @@ -268,6 +274,7 @@ namespace Tango.PMRGenerator.CLI { Name = field.Name.Replace(" ", ""), Value = field.Code, + Description = field.Description, }); } @@ -299,13 +306,13 @@ namespace Tango.PMRGenerator.CLI messageFile.Package = "Tango.PMR.Printing"; messageFile.Imports.Add("JobSpoolType.proto"); - messageFile.Properties.Add(new Property("JobSpoolType", "JobSpoolType")); + messageFile.Properties.Add(new ProtoProperty("JobSpoolType", "JobSpoolType")); foreach (var prop in typeof(SpoolType).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { if (prop.Name != "Name" && prop.Name != "Code") { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } } @@ -325,7 +332,7 @@ namespace Tango.PMRGenerator.CLI foreach (var prop in typeof(ProcessParametersTable).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Where(x => x.PropertyType.IsPrimitive)) { - messageFile.Properties.Add(new Property(prop.Name, CoercePropertyType(prop.PropertyType))); + messageFile.Properties.Add(new ProtoProperty(prop.Name, CoercePropertyType(prop.PropertyType))); } String messageString = messageFile.GenerateCode(); @@ -377,6 +384,64 @@ namespace Tango.PMRGenerator.CLI File.WriteAllText(Path.Combine(pmrFolder, "ColorLab", enumFile.Name + ".proto"), enumString); } + private static void GenerateDiagnosticsValueComponents(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Diagnostics Value Component..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "ValueComponent"; + enumFile.Package = "Tango.PMR.Diagnostics"; + + foreach (var field in db.TechControllers.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Description = field.Description + String.Format(" (Min = {0}, Max = {1})", field.Min, field.Max), + Value = field.Code, + }); + } + + String enumString = enumFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Diagnostics", enumFile.Name + ".proto"), enumString); + } + + private static void GenerateDiagnosticsMonitors(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Monitors..."); + + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "DiagnosticsMonitors"; + messageFile.Package = "Tango.PMR.Diagnostics"; + + messageFile.Imports.Add("DoubleArray.proto"); + + foreach (var monitor in db.TechMonitors.ToList().OrderBy(x => x.Code)) + { + var prop = new ProtoProperty(); + prop.Name = monitor.Name.Replace(" ", ""); + prop.Description = monitor.Description + String.Format(" (Min = {0}, Max = {1}, PPF = {2})", monitor.Min, monitor.Max, monitor.PointsPerFrame); + prop.Repeated = true; + + if (!monitor.MultiChannel) + { + prop.Type = "double"; + } + else + { + prop.Type = "DoubleArray"; + prop.Description += String.Format(" Channel Count = {0}", monitor.ChannelCount); + } + + messageFile.Properties.Add(prop); + } + + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Diagnostics", messageFile.Name + ".proto"), messageString); + } + private static String CoercePropertyType(Type type) { if (type == typeof(bool)) -- cgit v1.3.1