diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-27 19:04:50 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-27 19:04:50 +0200 |
| commit | 687910bc052e1430c8132a5eefe63e20ba6937e0 (patch) | |
| tree | 0ec042a8a5cad0615a82d1e10862a904efe79762 /Software/Visual_Studio | |
| parent | f1a77b05c2e56cd073180803947aa991a09f9b40 (diff) | |
| download | Tango-687910bc052e1430c8132a5eefe63e20ba6937e0.tar.gz Tango-687910bc052e1430c8132a5eefe63e20ba6937e0.zip | |
Implemented PMR Generator for hardware objects !
Diffstat (limited to 'Software/Visual_Studio')
20 files changed, 2529 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoEnumFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoEnumFile.cs new file mode 100644 index 000000000..2a4ad5d35 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoEnumFile.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class ProtoEnumFile : EnumerationFile + { + public String Package { get; set; } + public List<String> Imports { get; set; } + + public ProtoEnumFile() + { + Imports = new List<string>(); + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs new file mode 100644 index 000000000..6d771099a --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoMessageFile.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class ProtoMessageFile : Class + { + public String Package { get; set; } + public List<String> Imports { get; set; } + + public ProtoMessageFile() + { + Imports = new List<string>(); + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index ff9072a1a..d622bd6a0 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -68,6 +68,8 @@ <Compile Include="EntityCodeFile.cs" /> <Compile Include="EnumerationField.cs" /> <Compile Include="ObservablesContextCodeFile.cs" /> + <Compile Include="ProtoEnumFile.cs" /> + <Compile Include="ProtoMessageFile.cs" /> <Compile Include="TangoDAOJavaFile.cs" /> <Compile Include="EnumerationFileJava.cs" /> <Compile Include="EnumerationFile.cs" /> @@ -106,6 +108,8 @@ <EmbeddedResource Include="Templates\EnumerationFileJava.cshtml" /> <EmbeddedResource Include="Templates\TangoDAOJavaFile.cshtml" /> <EmbeddedResource Include="Templates\ObservablesContextCodeFile.cshtml" /> + <EmbeddedResource Include="Templates\ProtoMessageFile.cshtml" /> + <EmbeddedResource Include="Templates\ProtoEnumFile.cshtml" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml new file mode 100644 index 000000000..790e5dd93 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoEnumFile.cshtml @@ -0,0 +1,23 @@ +syntax = "proto3"; + +//This file is auto-generated. Do not modify! + +@foreach (var import in Model.Imports) +{ + <div> + import "@(import)"; + </div> +} + +package @(Model.Package); +option java_package = "com.twine.@(Model.Package.ToLower())"; + +enum @(Model.Name) +{ + @foreach (var prop in Model.Fields) + { + <div> + @(prop.Name) = @(prop.Value); + </div> + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml new file mode 100644 index 000000000..7452db6e6 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ProtoMessageFile.cshtml @@ -0,0 +1,24 @@ +syntax = "proto3"; + +//This file is auto-generated. Do not modify! + +@foreach (var import in Model.Imports) +{ + <div> + import "@(import)"; + </div> +} + +package @(Model.Package); +option java_package = "com.twine.@(Model.Package.ToLower())"; + +message @(Model.Name) +{ + +@for (int i = 0; i < Model.Properties.Count; i++) +{ +<div> + @(Model.Properties[i].Type) @(Model.Properties[i].Name) = @(i + 1); +</div> +} +} diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancer.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancer.cs new file mode 100644 index 000000000..38c04472c --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancer.cs @@ -0,0 +1,274 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareDancer.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwareDancer.proto</summary> + public static partial class HardwareDancerReflection { + + #region Descriptor + /// <summary>File descriptor for HardwareDancer.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareDancerReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChRIYXJkd2FyZURhbmNlci5wcm90bxISVGFuZ28uUE1SLkhhcmR3YXJlGhhI", + "YXJkd2FyZURhbmNlclR5cGUucHJvdG8ilQEKDkhhcmR3YXJlRGFuY2VyEkIK", + "EkhhcmR3YXJlRGFuY2VyVHlwZRgBIAEoDjImLlRhbmdvLlBNUi5IYXJkd2Fy", + "ZS5IYXJkd2FyZURhbmNlclR5cGUSDwoHR3JhZHVhbBgCIAEoCBIJCgFLGAMg", + "ASgBEgkKAVgYBCABKAESGAoQUHVsc2VQZXJNbVNwcmluZxgFIAEoBUIeChxj", + "b20udHdpbmUudGFuZ28ucG1yLmhhcmR3YXJlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwareDancerTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Hardware.HardwareDancer), global::Tango.PMR.Hardware.HardwareDancer.Parser, new[]{ "HardwareDancerType", "Gradual", "K", "X", "PulsePerMmSpring" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HardwareDancer : pb::IMessage<HardwareDancer> { + private static readonly pb::MessageParser<HardwareDancer> _parser = new pb::MessageParser<HardwareDancer>(() => new HardwareDancer()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<HardwareDancer> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Hardware.HardwareDancerReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareDancer() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareDancer(HardwareDancer other) : this() { + hardwareDancerType_ = other.hardwareDancerType_; + gradual_ = other.gradual_; + k_ = other.k_; + x_ = other.x_; + pulsePerMmSpring_ = other.pulsePerMmSpring_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareDancer Clone() { + return new HardwareDancer(this); + } + + /// <summary>Field number for the "HardwareDancerType" field.</summary> + public const int HardwareDancerTypeFieldNumber = 1; + private global::Tango.PMR.Hardware.HardwareDancerType hardwareDancerType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Hardware.HardwareDancerType HardwareDancerType { + get { return hardwareDancerType_; } + set { + hardwareDancerType_ = value; + } + } + + /// <summary>Field number for the "Gradual" field.</summary> + public const int GradualFieldNumber = 2; + private bool gradual_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Gradual { + get { return gradual_; } + set { + gradual_ = value; + } + } + + /// <summary>Field number for the "K" field.</summary> + public const int KFieldNumber = 3; + private double k_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double K { + get { return k_; } + set { + k_ = value; + } + } + + /// <summary>Field number for the "X" field.</summary> + public const int XFieldNumber = 4; + private double x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double X { + get { return x_; } + set { + x_ = value; + } + } + + /// <summary>Field number for the "PulsePerMmSpring" field.</summary> + public const int PulsePerMmSpringFieldNumber = 5; + private int pulsePerMmSpring_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PulsePerMmSpring { + get { return pulsePerMmSpring_; } + set { + pulsePerMmSpring_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HardwareDancer); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HardwareDancer other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HardwareDancerType != other.HardwareDancerType) return false; + if (Gradual != other.Gradual) return false; + if (K != other.K) return false; + if (X != other.X) return false; + if (PulsePerMmSpring != other.PulsePerMmSpring) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HardwareDancerType != 0) hash ^= HardwareDancerType.GetHashCode(); + if (Gradual != false) hash ^= Gradual.GetHashCode(); + if (K != 0D) hash ^= K.GetHashCode(); + if (X != 0D) hash ^= X.GetHashCode(); + if (PulsePerMmSpring != 0) hash ^= PulsePerMmSpring.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 (HardwareDancerType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HardwareDancerType); + } + if (Gradual != false) { + output.WriteRawTag(16); + output.WriteBool(Gradual); + } + if (K != 0D) { + output.WriteRawTag(25); + output.WriteDouble(K); + } + if (X != 0D) { + output.WriteRawTag(33); + output.WriteDouble(X); + } + if (PulsePerMmSpring != 0) { + output.WriteRawTag(40); + output.WriteInt32(PulsePerMmSpring); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HardwareDancerType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HardwareDancerType); + } + if (Gradual != false) { + size += 1 + 1; + } + if (K != 0D) { + size += 1 + 8; + } + if (X != 0D) { + size += 1 + 8; + } + if (PulsePerMmSpring != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PulsePerMmSpring); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HardwareDancer other) { + if (other == null) { + return; + } + if (other.HardwareDancerType != 0) { + HardwareDancerType = other.HardwareDancerType; + } + if (other.Gradual != false) { + Gradual = other.Gradual; + } + if (other.K != 0D) { + K = other.K; + } + if (other.X != 0D) { + X = other.X; + } + if (other.PulsePerMmSpring != 0) { + PulsePerMmSpring = other.PulsePerMmSpring; + } + } + + [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: { + hardwareDancerType_ = (global::Tango.PMR.Hardware.HardwareDancerType) input.ReadEnum(); + break; + } + case 16: { + Gradual = input.ReadBool(); + break; + } + case 25: { + K = input.ReadDouble(); + break; + } + case 33: { + X = input.ReadDouble(); + break; + } + case 40: { + PulsePerMmSpring = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs new file mode 100644 index 000000000..a314c8996 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDancerType.cs @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareDancerType.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwareDancerType.proto</summary> + public static partial class HardwareDancerTypeReflection { + + #region Descriptor + /// <summary>File descriptor for HardwareDancerType.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareDancerTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChhIYXJkd2FyZURhbmNlclR5cGUucHJvdG8SElRhbmdvLlBNUi5IYXJkd2Fy", + "ZSpHChJIYXJkd2FyZURhbmNlclR5cGUSDgoKTGVmdERhbmNlchAAEhAKDE1p", + "ZGRsZURhbmNlchABEg8KC1JpZ2h0RGFuY2VyEAJCHgocY29tLnR3aW5lLnRh", + "bmdvLnBtci5oYXJkd2FyZWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Hardware.HardwareDancerType), }, null)); + } + #endregion + + } + #region Enums + public enum HardwareDancerType { + [pbr::OriginalName("LeftDancer")] LeftDancer = 0, + [pbr::OriginalName("MiddleDancer")] MiddleDancer = 1, + [pbr::OriginalName("RightDancer")] RightDancer = 2, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDispenser.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDispenser.cs new file mode 100644 index 000000000..97d08a931 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareDispenser.cs @@ -0,0 +1,561 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareDispenser.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwareDispenser.proto</summary> + public static partial class HardwareDispenserReflection { + + #region Descriptor + /// <summary>File descriptor for HardwareDispenser.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareDispenserReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChdIYXJkd2FyZURpc3BlbnNlci5wcm90bxISVGFuZ28uUE1SLkhhcmR3YXJl", + "ItgDChFIYXJkd2FyZURpc3BlbnNlchIMCgRDb2RlGAEgASgFEiQKHE91dHB1", + "dFByb3BvcnRpb25hbFBvd2VyTGltaXQYAiABKAUSHgoWT3V0cHV0UHJvcG9y", + "dGlvbmFsQmFuZBgDIAEoBRIUCgxJbnRlZ3JhbFRpbWUYBCABKAUSFgoORGVy", + "aXZhdGl2ZVRpbWUYBSABKAUSIgoaU2Vuc29yQ29ycmVjdGlvbkFkanVzdG1l", + "bnQYBiABKAUSFgoOU2Vuc29yTWluVmFsdWUYByABKAUSFgoOU2Vuc29yTWF4", + "VmFsdWUYCCABKAUSJwofU2V0UG9pbnRSYW1wUmF0ZW9yU29mdFN0YXJ0UmFt", + "cBgJIAEoBRIhChlTZXRQb2ludENvbnRyb2xPdXRwdXRSYXRlGAogASgFEhkK", + "EUNvbnRyb2xPdXRwdXRUeXBlGAsgASgFEhwKFFNzckNvbnRyb2xPdXRwdXRU", + "eXBlGAwgASgFEiIKGk91dHB1dE9uT2ZmSHlzdGVyZXNpc1ZhbHVlGA0gASgF", + "EiMKG1Byb2Nlc3NWYXJpYWJsZVNhbXBsaW5nUmF0ZRgOIAEoBRIfChdQdklu", + "cHV0RmlsdGVyRmFjdG9yTW9kZRgPIAEoBUIeChxjb20udHdpbmUudGFuZ28u", + "cG1yLmhhcmR3YXJlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Hardware.HardwareDispenser), global::Tango.PMR.Hardware.HardwareDispenser.Parser, new[]{ "Code", "OutputProportionalPowerLimit", "OutputProportionalBand", "IntegralTime", "DerivativeTime", "SensorCorrectionAdjustment", "SensorMinValue", "SensorMaxValue", "SetPointRampRateorSoftStartRamp", "SetPointControlOutputRate", "ControlOutputType", "SsrControlOutputType", "OutputOnOffHysteresisValue", "ProcessVariableSamplingRate", "PvInputFilterFactorMode" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HardwareDispenser : pb::IMessage<HardwareDispenser> { + private static readonly pb::MessageParser<HardwareDispenser> _parser = new pb::MessageParser<HardwareDispenser>(() => new HardwareDispenser()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<HardwareDispenser> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Hardware.HardwareDispenserReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareDispenser() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareDispenser(HardwareDispenser other) : this() { + code_ = other.code_; + outputProportionalPowerLimit_ = other.outputProportionalPowerLimit_; + outputProportionalBand_ = other.outputProportionalBand_; + integralTime_ = other.integralTime_; + derivativeTime_ = other.derivativeTime_; + sensorCorrectionAdjustment_ = other.sensorCorrectionAdjustment_; + sensorMinValue_ = other.sensorMinValue_; + sensorMaxValue_ = other.sensorMaxValue_; + setPointRampRateorSoftStartRamp_ = other.setPointRampRateorSoftStartRamp_; + setPointControlOutputRate_ = other.setPointControlOutputRate_; + controlOutputType_ = other.controlOutputType_; + ssrControlOutputType_ = other.ssrControlOutputType_; + outputOnOffHysteresisValue_ = other.outputOnOffHysteresisValue_; + processVariableSamplingRate_ = other.processVariableSamplingRate_; + pvInputFilterFactorMode_ = other.pvInputFilterFactorMode_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareDispenser Clone() { + return new HardwareDispenser(this); + } + + /// <summary>Field number for the "Code" field.</summary> + public const int CodeFieldNumber = 1; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + /// <summary>Field number for the "OutputProportionalPowerLimit" field.</summary> + public const int OutputProportionalPowerLimitFieldNumber = 2; + private int outputProportionalPowerLimit_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputProportionalPowerLimit { + get { return outputProportionalPowerLimit_; } + set { + outputProportionalPowerLimit_ = value; + } + } + + /// <summary>Field number for the "OutputProportionalBand" field.</summary> + public const int OutputProportionalBandFieldNumber = 3; + private int outputProportionalBand_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputProportionalBand { + get { return outputProportionalBand_; } + set { + outputProportionalBand_ = value; + } + } + + /// <summary>Field number for the "IntegralTime" field.</summary> + public const int IntegralTimeFieldNumber = 4; + private int integralTime_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IntegralTime { + get { return integralTime_; } + set { + integralTime_ = value; + } + } + + /// <summary>Field number for the "DerivativeTime" field.</summary> + public const int DerivativeTimeFieldNumber = 5; + private int derivativeTime_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int DerivativeTime { + get { return derivativeTime_; } + set { + derivativeTime_ = value; + } + } + + /// <summary>Field number for the "SensorCorrectionAdjustment" field.</summary> + public const int SensorCorrectionAdjustmentFieldNumber = 6; + private int sensorCorrectionAdjustment_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SensorCorrectionAdjustment { + get { return sensorCorrectionAdjustment_; } + set { + sensorCorrectionAdjustment_ = value; + } + } + + /// <summary>Field number for the "SensorMinValue" field.</summary> + public const int SensorMinValueFieldNumber = 7; + private int sensorMinValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SensorMinValue { + get { return sensorMinValue_; } + set { + sensorMinValue_ = value; + } + } + + /// <summary>Field number for the "SensorMaxValue" field.</summary> + public const int SensorMaxValueFieldNumber = 8; + private int sensorMaxValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SensorMaxValue { + get { return sensorMaxValue_; } + set { + sensorMaxValue_ = value; + } + } + + /// <summary>Field number for the "SetPointRampRateorSoftStartRamp" field.</summary> + public const int SetPointRampRateorSoftStartRampFieldNumber = 9; + private int setPointRampRateorSoftStartRamp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SetPointRampRateorSoftStartRamp { + get { return setPointRampRateorSoftStartRamp_; } + set { + setPointRampRateorSoftStartRamp_ = value; + } + } + + /// <summary>Field number for the "SetPointControlOutputRate" field.</summary> + public const int SetPointControlOutputRateFieldNumber = 10; + private int setPointControlOutputRate_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SetPointControlOutputRate { + get { return setPointControlOutputRate_; } + set { + setPointControlOutputRate_ = value; + } + } + + /// <summary>Field number for the "ControlOutputType" field.</summary> + public const int ControlOutputTypeFieldNumber = 11; + private int controlOutputType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ControlOutputType { + get { return controlOutputType_; } + set { + controlOutputType_ = value; + } + } + + /// <summary>Field number for the "SsrControlOutputType" field.</summary> + public const int SsrControlOutputTypeFieldNumber = 12; + private int ssrControlOutputType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SsrControlOutputType { + get { return ssrControlOutputType_; } + set { + ssrControlOutputType_ = value; + } + } + + /// <summary>Field number for the "OutputOnOffHysteresisValue" field.</summary> + public const int OutputOnOffHysteresisValueFieldNumber = 13; + private int outputOnOffHysteresisValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputOnOffHysteresisValue { + get { return outputOnOffHysteresisValue_; } + set { + outputOnOffHysteresisValue_ = value; + } + } + + /// <summary>Field number for the "ProcessVariableSamplingRate" field.</summary> + public const int ProcessVariableSamplingRateFieldNumber = 14; + private int processVariableSamplingRate_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ProcessVariableSamplingRate { + get { return processVariableSamplingRate_; } + set { + processVariableSamplingRate_ = value; + } + } + + /// <summary>Field number for the "PvInputFilterFactorMode" field.</summary> + public const int PvInputFilterFactorModeFieldNumber = 15; + private int pvInputFilterFactorMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PvInputFilterFactorMode { + get { return pvInputFilterFactorMode_; } + set { + pvInputFilterFactorMode_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HardwareDispenser); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HardwareDispenser other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Code != other.Code) return false; + if (OutputProportionalPowerLimit != other.OutputProportionalPowerLimit) return false; + if (OutputProportionalBand != other.OutputProportionalBand) return false; + if (IntegralTime != other.IntegralTime) return false; + if (DerivativeTime != other.DerivativeTime) return false; + if (SensorCorrectionAdjustment != other.SensorCorrectionAdjustment) return false; + if (SensorMinValue != other.SensorMinValue) return false; + if (SensorMaxValue != other.SensorMaxValue) return false; + if (SetPointRampRateorSoftStartRamp != other.SetPointRampRateorSoftStartRamp) return false; + if (SetPointControlOutputRate != other.SetPointControlOutputRate) return false; + if (ControlOutputType != other.ControlOutputType) return false; + if (SsrControlOutputType != other.SsrControlOutputType) return false; + if (OutputOnOffHysteresisValue != other.OutputOnOffHysteresisValue) return false; + if (ProcessVariableSamplingRate != other.ProcessVariableSamplingRate) return false; + if (PvInputFilterFactorMode != other.PvInputFilterFactorMode) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Code != 0) hash ^= Code.GetHashCode(); + if (OutputProportionalPowerLimit != 0) hash ^= OutputProportionalPowerLimit.GetHashCode(); + if (OutputProportionalBand != 0) hash ^= OutputProportionalBand.GetHashCode(); + if (IntegralTime != 0) hash ^= IntegralTime.GetHashCode(); + if (DerivativeTime != 0) hash ^= DerivativeTime.GetHashCode(); + if (SensorCorrectionAdjustment != 0) hash ^= SensorCorrectionAdjustment.GetHashCode(); + if (SensorMinValue != 0) hash ^= SensorMinValue.GetHashCode(); + if (SensorMaxValue != 0) hash ^= SensorMaxValue.GetHashCode(); + if (SetPointRampRateorSoftStartRamp != 0) hash ^= SetPointRampRateorSoftStartRamp.GetHashCode(); + if (SetPointControlOutputRate != 0) hash ^= SetPointControlOutputRate.GetHashCode(); + if (ControlOutputType != 0) hash ^= ControlOutputType.GetHashCode(); + if (SsrControlOutputType != 0) hash ^= SsrControlOutputType.GetHashCode(); + if (OutputOnOffHysteresisValue != 0) hash ^= OutputOnOffHysteresisValue.GetHashCode(); + if (ProcessVariableSamplingRate != 0) hash ^= ProcessVariableSamplingRate.GetHashCode(); + if (PvInputFilterFactorMode != 0) hash ^= PvInputFilterFactorMode.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 (Code != 0) { + output.WriteRawTag(8); + output.WriteInt32(Code); + } + if (OutputProportionalPowerLimit != 0) { + output.WriteRawTag(16); + output.WriteInt32(OutputProportionalPowerLimit); + } + if (OutputProportionalBand != 0) { + output.WriteRawTag(24); + output.WriteInt32(OutputProportionalBand); + } + if (IntegralTime != 0) { + output.WriteRawTag(32); + output.WriteInt32(IntegralTime); + } + if (DerivativeTime != 0) { + output.WriteRawTag(40); + output.WriteInt32(DerivativeTime); + } + if (SensorCorrectionAdjustment != 0) { + output.WriteRawTag(48); + output.WriteInt32(SensorCorrectionAdjustment); + } + if (SensorMinValue != 0) { + output.WriteRawTag(56); + output.WriteInt32(SensorMinValue); + } + if (SensorMaxValue != 0) { + output.WriteRawTag(64); + output.WriteInt32(SensorMaxValue); + } + if (SetPointRampRateorSoftStartRamp != 0) { + output.WriteRawTag(72); + output.WriteInt32(SetPointRampRateorSoftStartRamp); + } + if (SetPointControlOutputRate != 0) { + output.WriteRawTag(80); + output.WriteInt32(SetPointControlOutputRate); + } + if (ControlOutputType != 0) { + output.WriteRawTag(88); + output.WriteInt32(ControlOutputType); + } + if (SsrControlOutputType != 0) { + output.WriteRawTag(96); + output.WriteInt32(SsrControlOutputType); + } + if (OutputOnOffHysteresisValue != 0) { + output.WriteRawTag(104); + output.WriteInt32(OutputOnOffHysteresisValue); + } + if (ProcessVariableSamplingRate != 0) { + output.WriteRawTag(112); + output.WriteInt32(ProcessVariableSamplingRate); + } + if (PvInputFilterFactorMode != 0) { + output.WriteRawTag(120); + output.WriteInt32(PvInputFilterFactorMode); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + if (OutputProportionalPowerLimit != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputProportionalPowerLimit); + } + if (OutputProportionalBand != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputProportionalBand); + } + if (IntegralTime != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntegralTime); + } + if (DerivativeTime != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DerivativeTime); + } + if (SensorCorrectionAdjustment != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SensorCorrectionAdjustment); + } + if (SensorMinValue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SensorMinValue); + } + if (SensorMaxValue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SensorMaxValue); + } + if (SetPointRampRateorSoftStartRamp != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SetPointRampRateorSoftStartRamp); + } + if (SetPointControlOutputRate != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SetPointControlOutputRate); + } + if (ControlOutputType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ControlOutputType); + } + if (SsrControlOutputType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SsrControlOutputType); + } + if (OutputOnOffHysteresisValue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputOnOffHysteresisValue); + } + if (ProcessVariableSamplingRate != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ProcessVariableSamplingRate); + } + if (PvInputFilterFactorMode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PvInputFilterFactorMode); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HardwareDispenser other) { + if (other == null) { + return; + } + if (other.Code != 0) { + Code = other.Code; + } + if (other.OutputProportionalPowerLimit != 0) { + OutputProportionalPowerLimit = other.OutputProportionalPowerLimit; + } + if (other.OutputProportionalBand != 0) { + OutputProportionalBand = other.OutputProportionalBand; + } + if (other.IntegralTime != 0) { + IntegralTime = other.IntegralTime; + } + if (other.DerivativeTime != 0) { + DerivativeTime = other.DerivativeTime; + } + if (other.SensorCorrectionAdjustment != 0) { + SensorCorrectionAdjustment = other.SensorCorrectionAdjustment; + } + if (other.SensorMinValue != 0) { + SensorMinValue = other.SensorMinValue; + } + if (other.SensorMaxValue != 0) { + SensorMaxValue = other.SensorMaxValue; + } + if (other.SetPointRampRateorSoftStartRamp != 0) { + SetPointRampRateorSoftStartRamp = other.SetPointRampRateorSoftStartRamp; + } + if (other.SetPointControlOutputRate != 0) { + SetPointControlOutputRate = other.SetPointControlOutputRate; + } + if (other.ControlOutputType != 0) { + ControlOutputType = other.ControlOutputType; + } + if (other.SsrControlOutputType != 0) { + SsrControlOutputType = other.SsrControlOutputType; + } + if (other.OutputOnOffHysteresisValue != 0) { + OutputOnOffHysteresisValue = other.OutputOnOffHysteresisValue; + } + if (other.ProcessVariableSamplingRate != 0) { + ProcessVariableSamplingRate = other.ProcessVariableSamplingRate; + } + if (other.PvInputFilterFactorMode != 0) { + PvInputFilterFactorMode = other.PvInputFilterFactorMode; + } + } + + [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: { + Code = input.ReadInt32(); + break; + } + case 16: { + OutputProportionalPowerLimit = input.ReadInt32(); + break; + } + case 24: { + OutputProportionalBand = input.ReadInt32(); + break; + } + case 32: { + IntegralTime = input.ReadInt32(); + break; + } + case 40: { + DerivativeTime = input.ReadInt32(); + break; + } + case 48: { + SensorCorrectionAdjustment = input.ReadInt32(); + break; + } + case 56: { + SensorMinValue = input.ReadInt32(); + break; + } + case 64: { + SensorMaxValue = input.ReadInt32(); + break; + } + case 72: { + SetPointRampRateorSoftStartRamp = input.ReadInt32(); + break; + } + case 80: { + SetPointControlOutputRate = input.ReadInt32(); + break; + } + case 88: { + ControlOutputType = input.ReadInt32(); + break; + } + case 96: { + SsrControlOutputType = input.ReadInt32(); + break; + } + case 104: { + OutputOnOffHysteresisValue = input.ReadInt32(); + break; + } + case 112: { + ProcessVariableSamplingRate = input.ReadInt32(); + break; + } + case 120: { + PvInputFilterFactorMode = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotor.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotor.cs new file mode 100644 index 000000000..eb6743fba --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotor.cs @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareMotor.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwareMotor.proto</summary> + public static partial class HardwareMotorReflection { + + #region Descriptor + /// <summary>File descriptor for HardwareMotor.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareMotorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChNIYXJkd2FyZU1vdG9yLnByb3RvEhJUYW5nby5QTVIuSGFyZHdhcmUaF0hh", + "cmR3YXJlTW90b3JUeXBlLnByb3RvIvYCCg1IYXJkd2FyZU1vdG9yEkAKEUhh", + "cmR3YXJlTW90b3JUeXBlGAEgASgOMiUuVGFuZ28uUE1SLkhhcmR3YXJlLkhh", + "cmR3YXJlTW90b3JUeXBlEhQKDE1pbkZyZXF1ZW5jeRgCIAEoBRIUCgxNYXhG", + "cmVxdWVuY3kYAyABKAUSFAoMTWluTWljcm9TdGVwGAQgASgFEhQKDE1heE1p", + "Y3JvU3RlcBgFIAEoBRITCgtMaW5lYXJSYXRpbxgGIAEoARIWCg5NZWRpYW5Q", + "b3NpdGlvbhgHIAEoBRIWCg5Db3JyZWN0aW9uR2FpbhgIIAEoARIZChFSYXRp", + "b1RvRHJ5ZXJTcGVlZBgJIAEoARIKCgJLcBgKIAEoARIKCgJLaRgLIAEoARIK", + "CgJLZBgMIAEoARITCgtDaGFuZ2VTbG9wZRgNIAEoARIdChVIaWdoTGVuZ3Ro", + "TWljcm9TZWNvbmQYDiABKAESEwoLU3BlZWRNYXN0ZXIYDyABKAhCHgocY29t", + "LnR3aW5lLnRhbmdvLnBtci5oYXJkd2FyZWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwareMotorTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Hardware.HardwareMotor), global::Tango.PMR.Hardware.HardwareMotor.Parser, new[]{ "HardwareMotorType", "MinFrequency", "MaxFrequency", "MinMicroStep", "MaxMicroStep", "LinearRatio", "MedianPosition", "CorrectionGain", "RatioToDryerSpeed", "Kp", "Ki", "Kd", "ChangeSlope", "HighLengthMicroSecond", "SpeedMaster" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HardwareMotor : pb::IMessage<HardwareMotor> { + private static readonly pb::MessageParser<HardwareMotor> _parser = new pb::MessageParser<HardwareMotor>(() => new HardwareMotor()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<HardwareMotor> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Hardware.HardwareMotorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareMotor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareMotor(HardwareMotor other) : this() { + hardwareMotorType_ = other.hardwareMotorType_; + minFrequency_ = other.minFrequency_; + maxFrequency_ = other.maxFrequency_; + minMicroStep_ = other.minMicroStep_; + maxMicroStep_ = other.maxMicroStep_; + linearRatio_ = other.linearRatio_; + medianPosition_ = other.medianPosition_; + correctionGain_ = other.correctionGain_; + ratioToDryerSpeed_ = other.ratioToDryerSpeed_; + kp_ = other.kp_; + ki_ = other.ki_; + kd_ = other.kd_; + changeSlope_ = other.changeSlope_; + highLengthMicroSecond_ = other.highLengthMicroSecond_; + speedMaster_ = other.speedMaster_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwareMotor Clone() { + return new HardwareMotor(this); + } + + /// <summary>Field number for the "HardwareMotorType" field.</summary> + public const int HardwareMotorTypeFieldNumber = 1; + private global::Tango.PMR.Hardware.HardwareMotorType hardwareMotorType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Hardware.HardwareMotorType HardwareMotorType { + get { return hardwareMotorType_; } + set { + hardwareMotorType_ = value; + } + } + + /// <summary>Field number for the "MinFrequency" field.</summary> + public const int MinFrequencyFieldNumber = 2; + private int minFrequency_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int MinFrequency { + get { return minFrequency_; } + set { + minFrequency_ = value; + } + } + + /// <summary>Field number for the "MaxFrequency" field.</summary> + public const int MaxFrequencyFieldNumber = 3; + private int maxFrequency_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int MaxFrequency { + get { return maxFrequency_; } + set { + maxFrequency_ = value; + } + } + + /// <summary>Field number for the "MinMicroStep" field.</summary> + public const int MinMicroStepFieldNumber = 4; + private int minMicroStep_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int MinMicroStep { + get { return minMicroStep_; } + set { + minMicroStep_ = value; + } + } + + /// <summary>Field number for the "MaxMicroStep" field.</summary> + public const int MaxMicroStepFieldNumber = 5; + private int maxMicroStep_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int MaxMicroStep { + get { return maxMicroStep_; } + set { + maxMicroStep_ = value; + } + } + + /// <summary>Field number for the "LinearRatio" field.</summary> + public const int LinearRatioFieldNumber = 6; + private double linearRatio_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double LinearRatio { + get { return linearRatio_; } + set { + linearRatio_ = value; + } + } + + /// <summary>Field number for the "MedianPosition" field.</summary> + public const int MedianPositionFieldNumber = 7; + private int medianPosition_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int MedianPosition { + get { return medianPosition_; } + set { + medianPosition_ = value; + } + } + + /// <summary>Field number for the "CorrectionGain" field.</summary> + public const int CorrectionGainFieldNumber = 8; + private double correctionGain_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double CorrectionGain { + get { return correctionGain_; } + set { + correctionGain_ = value; + } + } + + /// <summary>Field number for the "RatioToDryerSpeed" field.</summary> + public const int RatioToDryerSpeedFieldNumber = 9; + private double ratioToDryerSpeed_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double RatioToDryerSpeed { + get { return ratioToDryerSpeed_; } + set { + ratioToDryerSpeed_ = value; + } + } + + /// <summary>Field number for the "Kp" field.</summary> + public const int KpFieldNumber = 10; + private double kp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Kp { + get { return kp_; } + set { + kp_ = value; + } + } + + /// <summary>Field number for the "Ki" field.</summary> + public const int KiFieldNumber = 11; + private double ki_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Ki { + get { return ki_; } + set { + ki_ = value; + } + } + + /// <summary>Field number for the "Kd" field.</summary> + public const int KdFieldNumber = 12; + private double kd_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Kd { + get { return kd_; } + set { + kd_ = value; + } + } + + /// <summary>Field number for the "ChangeSlope" field.</summary> + public const int ChangeSlopeFieldNumber = 13; + private double changeSlope_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double ChangeSlope { + get { return changeSlope_; } + set { + changeSlope_ = value; + } + } + + /// <summary>Field number for the "HighLengthMicroSecond" field.</summary> + public const int HighLengthMicroSecondFieldNumber = 14; + private double highLengthMicroSecond_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double HighLengthMicroSecond { + get { return highLengthMicroSecond_; } + set { + highLengthMicroSecond_ = value; + } + } + + /// <summary>Field number for the "SpeedMaster" field.</summary> + public const int SpeedMasterFieldNumber = 15; + private bool speedMaster_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool SpeedMaster { + get { return speedMaster_; } + set { + speedMaster_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HardwareMotor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HardwareMotor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HardwareMotorType != other.HardwareMotorType) return false; + if (MinFrequency != other.MinFrequency) return false; + if (MaxFrequency != other.MaxFrequency) return false; + if (MinMicroStep != other.MinMicroStep) return false; + if (MaxMicroStep != other.MaxMicroStep) return false; + if (LinearRatio != other.LinearRatio) return false; + if (MedianPosition != other.MedianPosition) return false; + if (CorrectionGain != other.CorrectionGain) return false; + if (RatioToDryerSpeed != other.RatioToDryerSpeed) return false; + if (Kp != other.Kp) return false; + if (Ki != other.Ki) return false; + if (Kd != other.Kd) return false; + if (ChangeSlope != other.ChangeSlope) return false; + if (HighLengthMicroSecond != other.HighLengthMicroSecond) return false; + if (SpeedMaster != other.SpeedMaster) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HardwareMotorType != 0) hash ^= HardwareMotorType.GetHashCode(); + if (MinFrequency != 0) hash ^= MinFrequency.GetHashCode(); + if (MaxFrequency != 0) hash ^= MaxFrequency.GetHashCode(); + if (MinMicroStep != 0) hash ^= MinMicroStep.GetHashCode(); + if (MaxMicroStep != 0) hash ^= MaxMicroStep.GetHashCode(); + if (LinearRatio != 0D) hash ^= LinearRatio.GetHashCode(); + if (MedianPosition != 0) hash ^= MedianPosition.GetHashCode(); + if (CorrectionGain != 0D) hash ^= CorrectionGain.GetHashCode(); + if (RatioToDryerSpeed != 0D) hash ^= RatioToDryerSpeed.GetHashCode(); + if (Kp != 0D) hash ^= Kp.GetHashCode(); + if (Ki != 0D) hash ^= Ki.GetHashCode(); + if (Kd != 0D) hash ^= Kd.GetHashCode(); + if (ChangeSlope != 0D) hash ^= ChangeSlope.GetHashCode(); + if (HighLengthMicroSecond != 0D) hash ^= HighLengthMicroSecond.GetHashCode(); + if (SpeedMaster != false) hash ^= SpeedMaster.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 (HardwareMotorType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HardwareMotorType); + } + if (MinFrequency != 0) { + output.WriteRawTag(16); + output.WriteInt32(MinFrequency); + } + if (MaxFrequency != 0) { + output.WriteRawTag(24); + output.WriteInt32(MaxFrequency); + } + if (MinMicroStep != 0) { + output.WriteRawTag(32); + output.WriteInt32(MinMicroStep); + } + if (MaxMicroStep != 0) { + output.WriteRawTag(40); + output.WriteInt32(MaxMicroStep); + } + if (LinearRatio != 0D) { + output.WriteRawTag(49); + output.WriteDouble(LinearRatio); + } + if (MedianPosition != 0) { + output.WriteRawTag(56); + output.WriteInt32(MedianPosition); + } + if (CorrectionGain != 0D) { + output.WriteRawTag(65); + output.WriteDouble(CorrectionGain); + } + if (RatioToDryerSpeed != 0D) { + output.WriteRawTag(73); + output.WriteDouble(RatioToDryerSpeed); + } + if (Kp != 0D) { + output.WriteRawTag(81); + output.WriteDouble(Kp); + } + if (Ki != 0D) { + output.WriteRawTag(89); + output.WriteDouble(Ki); + } + if (Kd != 0D) { + output.WriteRawTag(97); + output.WriteDouble(Kd); + } + if (ChangeSlope != 0D) { + output.WriteRawTag(105); + output.WriteDouble(ChangeSlope); + } + if (HighLengthMicroSecond != 0D) { + output.WriteRawTag(113); + output.WriteDouble(HighLengthMicroSecond); + } + if (SpeedMaster != false) { + output.WriteRawTag(120); + output.WriteBool(SpeedMaster); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HardwareMotorType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HardwareMotorType); + } + if (MinFrequency != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinFrequency); + } + if (MaxFrequency != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxFrequency); + } + if (MinMicroStep != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinMicroStep); + } + if (MaxMicroStep != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxMicroStep); + } + if (LinearRatio != 0D) { + size += 1 + 8; + } + if (MedianPosition != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(MedianPosition); + } + if (CorrectionGain != 0D) { + size += 1 + 8; + } + if (RatioToDryerSpeed != 0D) { + size += 1 + 8; + } + if (Kp != 0D) { + size += 1 + 8; + } + if (Ki != 0D) { + size += 1 + 8; + } + if (Kd != 0D) { + size += 1 + 8; + } + if (ChangeSlope != 0D) { + size += 1 + 8; + } + if (HighLengthMicroSecond != 0D) { + size += 1 + 8; + } + if (SpeedMaster != false) { + size += 1 + 1; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HardwareMotor other) { + if (other == null) { + return; + } + if (other.HardwareMotorType != 0) { + HardwareMotorType = other.HardwareMotorType; + } + if (other.MinFrequency != 0) { + MinFrequency = other.MinFrequency; + } + if (other.MaxFrequency != 0) { + MaxFrequency = other.MaxFrequency; + } + if (other.MinMicroStep != 0) { + MinMicroStep = other.MinMicroStep; + } + if (other.MaxMicroStep != 0) { + MaxMicroStep = other.MaxMicroStep; + } + if (other.LinearRatio != 0D) { + LinearRatio = other.LinearRatio; + } + if (other.MedianPosition != 0) { + MedianPosition = other.MedianPosition; + } + if (other.CorrectionGain != 0D) { + CorrectionGain = other.CorrectionGain; + } + if (other.RatioToDryerSpeed != 0D) { + RatioToDryerSpeed = other.RatioToDryerSpeed; + } + if (other.Kp != 0D) { + Kp = other.Kp; + } + if (other.Ki != 0D) { + Ki = other.Ki; + } + if (other.Kd != 0D) { + Kd = other.Kd; + } + if (other.ChangeSlope != 0D) { + ChangeSlope = other.ChangeSlope; + } + if (other.HighLengthMicroSecond != 0D) { + HighLengthMicroSecond = other.HighLengthMicroSecond; + } + if (other.SpeedMaster != false) { + SpeedMaster = other.SpeedMaster; + } + } + + [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: { + hardwareMotorType_ = (global::Tango.PMR.Hardware.HardwareMotorType) input.ReadEnum(); + break; + } + case 16: { + MinFrequency = input.ReadInt32(); + break; + } + case 24: { + MaxFrequency = input.ReadInt32(); + break; + } + case 32: { + MinMicroStep = input.ReadInt32(); + break; + } + case 40: { + MaxMicroStep = input.ReadInt32(); + break; + } + case 49: { + LinearRatio = input.ReadDouble(); + break; + } + case 56: { + MedianPosition = input.ReadInt32(); + break; + } + case 65: { + CorrectionGain = input.ReadDouble(); + break; + } + case 73: { + RatioToDryerSpeed = input.ReadDouble(); + break; + } + case 81: { + Kp = input.ReadDouble(); + break; + } + case 89: { + Ki = input.ReadDouble(); + break; + } + case 97: { + Kd = input.ReadDouble(); + break; + } + case 105: { + ChangeSlope = input.ReadDouble(); + break; + } + case 113: { + HighLengthMicroSecond = input.ReadDouble(); + break; + } + case 120: { + SpeedMaster = input.ReadBool(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs new file mode 100644 index 000000000..49aa1d688 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs @@ -0,0 +1,48 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwareMotorType.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwareMotorType.proto</summary> + public static partial class HardwareMotorTypeReflection { + + #region Descriptor + /// <summary>File descriptor for HardwareMotorType.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwareMotorTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChdIYXJkd2FyZU1vdG9yVHlwZS5wcm90bxISVGFuZ28uUE1SLkhhcmR3YXJl", + "KlYKEUhhcmR3YXJlTW90b3JUeXBlEg8KC1dpbmRlck1vdG9yEAASDwoLRmVl", + "ZGVyTW90b3IQARIOCgpEcnllck1vdG9yEAISDwoLUG9vbGVyTW90b3IQA0Ie", + "Chxjb20udHdpbmUudGFuZ28ucG1yLmhhcmR3YXJlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Hardware.HardwareMotorType), }, null)); + } + #endregion + + } + #region Enums + public enum HardwareMotorType { + [pbr::OriginalName("WinderMotor")] WinderMotor = 0, + [pbr::OriginalName("FeederMotor")] FeederMotor = 1, + [pbr::OriginalName("DryerMotor")] DryerMotor = 2, + [pbr::OriginalName("PoolerMotor")] PoolerMotor = 3, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControl.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControl.cs new file mode 100644 index 000000000..c59f07cc1 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControl.cs @@ -0,0 +1,563 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwarePidControl.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwarePidControl.proto</summary> + public static partial class HardwarePidControlReflection { + + #region Descriptor + /// <summary>File descriptor for HardwarePidControl.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwarePidControlReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChhIYXJkd2FyZVBpZENvbnRyb2wucHJvdG8SElRhbmdvLlBNUi5IYXJkd2Fy", + "ZRocSGFyZHdhcmVQaWRDb250cm9sVHlwZS5wcm90byKXBAoSSGFyZHdhcmVQ", + "aWRDb250cm9sEkoKFkhhcmR3YXJlUGlkQ29udHJvbFR5cGUYASABKA4yKi5U", + "YW5nby5QTVIuSGFyZHdhcmUuSGFyZHdhcmVQaWRDb250cm9sVHlwZRIkChxP", + "dXRwdXRQcm9wb3J0aW9uYWxQb3dlckxpbWl0GAIgASgFEh4KFk91dHB1dFBy", + "b3BvcnRpb25hbEJhbmQYAyABKAUSFAoMSW50ZWdyYWxUaW1lGAQgASgFEhYK", + "DkRlcml2YXRpdmVUaW1lGAUgASgFEiIKGlNlbnNvckNvcnJlY3Rpb25BZGp1", + "c3RtZW50GAYgASgFEhYKDlNlbnNvck1pblZhbHVlGAcgASgFEhYKDlNlbnNv", + "ck1heFZhbHVlGAggASgFEicKH1NldFBvaW50UmFtcFJhdGVvclNvZnRTdGFy", + "dFJhbXAYCSABKAUSIQoZU2V0UG9pbnRDb250cm9sT3V0cHV0UmF0ZRgKIAEo", + "BRIZChFDb250cm9sT3V0cHV0VHlwZRgLIAEoBRIcChRTc3JDb250cm9sT3V0", + "cHV0VHlwZRgMIAEoBRIiChpPdXRwdXRPbk9mZkh5c3RlcmVzaXNWYWx1ZRgN", + "IAEoBRIjChtQcm9jZXNzVmFyaWFibGVTYW1wbGluZ1JhdGUYDiABKAUSHwoX", + "UHZJbnB1dEZpbHRlckZhY3Rvck1vZGUYDyABKAVCHgocY29tLnR3aW5lLnRh", + "bmdvLnBtci5oYXJkd2FyZWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwarePidControlTypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Hardware.HardwarePidControl), global::Tango.PMR.Hardware.HardwarePidControl.Parser, new[]{ "HardwarePidControlType", "OutputProportionalPowerLimit", "OutputProportionalBand", "IntegralTime", "DerivativeTime", "SensorCorrectionAdjustment", "SensorMinValue", "SensorMaxValue", "SetPointRampRateorSoftStartRamp", "SetPointControlOutputRate", "ControlOutputType", "SsrControlOutputType", "OutputOnOffHysteresisValue", "ProcessVariableSamplingRate", "PvInputFilterFactorMode" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HardwarePidControl : pb::IMessage<HardwarePidControl> { + private static readonly pb::MessageParser<HardwarePidControl> _parser = new pb::MessageParser<HardwarePidControl>(() => new HardwarePidControl()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<HardwarePidControl> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Hardware.HardwarePidControlReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwarePidControl() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwarePidControl(HardwarePidControl other) : this() { + hardwarePidControlType_ = other.hardwarePidControlType_; + outputProportionalPowerLimit_ = other.outputProportionalPowerLimit_; + outputProportionalBand_ = other.outputProportionalBand_; + integralTime_ = other.integralTime_; + derivativeTime_ = other.derivativeTime_; + sensorCorrectionAdjustment_ = other.sensorCorrectionAdjustment_; + sensorMinValue_ = other.sensorMinValue_; + sensorMaxValue_ = other.sensorMaxValue_; + setPointRampRateorSoftStartRamp_ = other.setPointRampRateorSoftStartRamp_; + setPointControlOutputRate_ = other.setPointControlOutputRate_; + controlOutputType_ = other.controlOutputType_; + ssrControlOutputType_ = other.ssrControlOutputType_; + outputOnOffHysteresisValue_ = other.outputOnOffHysteresisValue_; + processVariableSamplingRate_ = other.processVariableSamplingRate_; + pvInputFilterFactorMode_ = other.pvInputFilterFactorMode_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HardwarePidControl Clone() { + return new HardwarePidControl(this); + } + + /// <summary>Field number for the "HardwarePidControlType" field.</summary> + public const int HardwarePidControlTypeFieldNumber = 1; + private global::Tango.PMR.Hardware.HardwarePidControlType hardwarePidControlType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Hardware.HardwarePidControlType HardwarePidControlType { + get { return hardwarePidControlType_; } + set { + hardwarePidControlType_ = value; + } + } + + /// <summary>Field number for the "OutputProportionalPowerLimit" field.</summary> + public const int OutputProportionalPowerLimitFieldNumber = 2; + private int outputProportionalPowerLimit_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputProportionalPowerLimit { + get { return outputProportionalPowerLimit_; } + set { + outputProportionalPowerLimit_ = value; + } + } + + /// <summary>Field number for the "OutputProportionalBand" field.</summary> + public const int OutputProportionalBandFieldNumber = 3; + private int outputProportionalBand_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputProportionalBand { + get { return outputProportionalBand_; } + set { + outputProportionalBand_ = value; + } + } + + /// <summary>Field number for the "IntegralTime" field.</summary> + public const int IntegralTimeFieldNumber = 4; + private int integralTime_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IntegralTime { + get { return integralTime_; } + set { + integralTime_ = value; + } + } + + /// <summary>Field number for the "DerivativeTime" field.</summary> + public const int DerivativeTimeFieldNumber = 5; + private int derivativeTime_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int DerivativeTime { + get { return derivativeTime_; } + set { + derivativeTime_ = value; + } + } + + /// <summary>Field number for the "SensorCorrectionAdjustment" field.</summary> + public const int SensorCorrectionAdjustmentFieldNumber = 6; + private int sensorCorrectionAdjustment_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SensorCorrectionAdjustment { + get { return sensorCorrectionAdjustment_; } + set { + sensorCorrectionAdjustment_ = value; + } + } + + /// <summary>Field number for the "SensorMinValue" field.</summary> + public const int SensorMinValueFieldNumber = 7; + private int sensorMinValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SensorMinValue { + get { return sensorMinValue_; } + set { + sensorMinValue_ = value; + } + } + + /// <summary>Field number for the "SensorMaxValue" field.</summary> + public const int SensorMaxValueFieldNumber = 8; + private int sensorMaxValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SensorMaxValue { + get { return sensorMaxValue_; } + set { + sensorMaxValue_ = value; + } + } + + /// <summary>Field number for the "SetPointRampRateorSoftStartRamp" field.</summary> + public const int SetPointRampRateorSoftStartRampFieldNumber = 9; + private int setPointRampRateorSoftStartRamp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SetPointRampRateorSoftStartRamp { + get { return setPointRampRateorSoftStartRamp_; } + set { + setPointRampRateorSoftStartRamp_ = value; + } + } + + /// <summary>Field number for the "SetPointControlOutputRate" field.</summary> + public const int SetPointControlOutputRateFieldNumber = 10; + private int setPointControlOutputRate_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SetPointControlOutputRate { + get { return setPointControlOutputRate_; } + set { + setPointControlOutputRate_ = value; + } + } + + /// <summary>Field number for the "ControlOutputType" field.</summary> + public const int ControlOutputTypeFieldNumber = 11; + private int controlOutputType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ControlOutputType { + get { return controlOutputType_; } + set { + controlOutputType_ = value; + } + } + + /// <summary>Field number for the "SsrControlOutputType" field.</summary> + public const int SsrControlOutputTypeFieldNumber = 12; + private int ssrControlOutputType_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SsrControlOutputType { + get { return ssrControlOutputType_; } + set { + ssrControlOutputType_ = value; + } + } + + /// <summary>Field number for the "OutputOnOffHysteresisValue" field.</summary> + public const int OutputOnOffHysteresisValueFieldNumber = 13; + private int outputOnOffHysteresisValue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputOnOffHysteresisValue { + get { return outputOnOffHysteresisValue_; } + set { + outputOnOffHysteresisValue_ = value; + } + } + + /// <summary>Field number for the "ProcessVariableSamplingRate" field.</summary> + public const int ProcessVariableSamplingRateFieldNumber = 14; + private int processVariableSamplingRate_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ProcessVariableSamplingRate { + get { return processVariableSamplingRate_; } + set { + processVariableSamplingRate_ = value; + } + } + + /// <summary>Field number for the "PvInputFilterFactorMode" field.</summary> + public const int PvInputFilterFactorModeFieldNumber = 15; + private int pvInputFilterFactorMode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PvInputFilterFactorMode { + get { return pvInputFilterFactorMode_; } + set { + pvInputFilterFactorMode_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HardwarePidControl); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HardwarePidControl other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (HardwarePidControlType != other.HardwarePidControlType) return false; + if (OutputProportionalPowerLimit != other.OutputProportionalPowerLimit) return false; + if (OutputProportionalBand != other.OutputProportionalBand) return false; + if (IntegralTime != other.IntegralTime) return false; + if (DerivativeTime != other.DerivativeTime) return false; + if (SensorCorrectionAdjustment != other.SensorCorrectionAdjustment) return false; + if (SensorMinValue != other.SensorMinValue) return false; + if (SensorMaxValue != other.SensorMaxValue) return false; + if (SetPointRampRateorSoftStartRamp != other.SetPointRampRateorSoftStartRamp) return false; + if (SetPointControlOutputRate != other.SetPointControlOutputRate) return false; + if (ControlOutputType != other.ControlOutputType) return false; + if (SsrControlOutputType != other.SsrControlOutputType) return false; + if (OutputOnOffHysteresisValue != other.OutputOnOffHysteresisValue) return false; + if (ProcessVariableSamplingRate != other.ProcessVariableSamplingRate) return false; + if (PvInputFilterFactorMode != other.PvInputFilterFactorMode) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (HardwarePidControlType != 0) hash ^= HardwarePidControlType.GetHashCode(); + if (OutputProportionalPowerLimit != 0) hash ^= OutputProportionalPowerLimit.GetHashCode(); + if (OutputProportionalBand != 0) hash ^= OutputProportionalBand.GetHashCode(); + if (IntegralTime != 0) hash ^= IntegralTime.GetHashCode(); + if (DerivativeTime != 0) hash ^= DerivativeTime.GetHashCode(); + if (SensorCorrectionAdjustment != 0) hash ^= SensorCorrectionAdjustment.GetHashCode(); + if (SensorMinValue != 0) hash ^= SensorMinValue.GetHashCode(); + if (SensorMaxValue != 0) hash ^= SensorMaxValue.GetHashCode(); + if (SetPointRampRateorSoftStartRamp != 0) hash ^= SetPointRampRateorSoftStartRamp.GetHashCode(); + if (SetPointControlOutputRate != 0) hash ^= SetPointControlOutputRate.GetHashCode(); + if (ControlOutputType != 0) hash ^= ControlOutputType.GetHashCode(); + if (SsrControlOutputType != 0) hash ^= SsrControlOutputType.GetHashCode(); + if (OutputOnOffHysteresisValue != 0) hash ^= OutputOnOffHysteresisValue.GetHashCode(); + if (ProcessVariableSamplingRate != 0) hash ^= ProcessVariableSamplingRate.GetHashCode(); + if (PvInputFilterFactorMode != 0) hash ^= PvInputFilterFactorMode.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 (HardwarePidControlType != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) HardwarePidControlType); + } + if (OutputProportionalPowerLimit != 0) { + output.WriteRawTag(16); + output.WriteInt32(OutputProportionalPowerLimit); + } + if (OutputProportionalBand != 0) { + output.WriteRawTag(24); + output.WriteInt32(OutputProportionalBand); + } + if (IntegralTime != 0) { + output.WriteRawTag(32); + output.WriteInt32(IntegralTime); + } + if (DerivativeTime != 0) { + output.WriteRawTag(40); + output.WriteInt32(DerivativeTime); + } + if (SensorCorrectionAdjustment != 0) { + output.WriteRawTag(48); + output.WriteInt32(SensorCorrectionAdjustment); + } + if (SensorMinValue != 0) { + output.WriteRawTag(56); + output.WriteInt32(SensorMinValue); + } + if (SensorMaxValue != 0) { + output.WriteRawTag(64); + output.WriteInt32(SensorMaxValue); + } + if (SetPointRampRateorSoftStartRamp != 0) { + output.WriteRawTag(72); + output.WriteInt32(SetPointRampRateorSoftStartRamp); + } + if (SetPointControlOutputRate != 0) { + output.WriteRawTag(80); + output.WriteInt32(SetPointControlOutputRate); + } + if (ControlOutputType != 0) { + output.WriteRawTag(88); + output.WriteInt32(ControlOutputType); + } + if (SsrControlOutputType != 0) { + output.WriteRawTag(96); + output.WriteInt32(SsrControlOutputType); + } + if (OutputOnOffHysteresisValue != 0) { + output.WriteRawTag(104); + output.WriteInt32(OutputOnOffHysteresisValue); + } + if (ProcessVariableSamplingRate != 0) { + output.WriteRawTag(112); + output.WriteInt32(ProcessVariableSamplingRate); + } + if (PvInputFilterFactorMode != 0) { + output.WriteRawTag(120); + output.WriteInt32(PvInputFilterFactorMode); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (HardwarePidControlType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HardwarePidControlType); + } + if (OutputProportionalPowerLimit != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputProportionalPowerLimit); + } + if (OutputProportionalBand != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputProportionalBand); + } + if (IntegralTime != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntegralTime); + } + if (DerivativeTime != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DerivativeTime); + } + if (SensorCorrectionAdjustment != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SensorCorrectionAdjustment); + } + if (SensorMinValue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SensorMinValue); + } + if (SensorMaxValue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SensorMaxValue); + } + if (SetPointRampRateorSoftStartRamp != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SetPointRampRateorSoftStartRamp); + } + if (SetPointControlOutputRate != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SetPointControlOutputRate); + } + if (ControlOutputType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ControlOutputType); + } + if (SsrControlOutputType != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SsrControlOutputType); + } + if (OutputOnOffHysteresisValue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputOnOffHysteresisValue); + } + if (ProcessVariableSamplingRate != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ProcessVariableSamplingRate); + } + if (PvInputFilterFactorMode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PvInputFilterFactorMode); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HardwarePidControl other) { + if (other == null) { + return; + } + if (other.HardwarePidControlType != 0) { + HardwarePidControlType = other.HardwarePidControlType; + } + if (other.OutputProportionalPowerLimit != 0) { + OutputProportionalPowerLimit = other.OutputProportionalPowerLimit; + } + if (other.OutputProportionalBand != 0) { + OutputProportionalBand = other.OutputProportionalBand; + } + if (other.IntegralTime != 0) { + IntegralTime = other.IntegralTime; + } + if (other.DerivativeTime != 0) { + DerivativeTime = other.DerivativeTime; + } + if (other.SensorCorrectionAdjustment != 0) { + SensorCorrectionAdjustment = other.SensorCorrectionAdjustment; + } + if (other.SensorMinValue != 0) { + SensorMinValue = other.SensorMinValue; + } + if (other.SensorMaxValue != 0) { + SensorMaxValue = other.SensorMaxValue; + } + if (other.SetPointRampRateorSoftStartRamp != 0) { + SetPointRampRateorSoftStartRamp = other.SetPointRampRateorSoftStartRamp; + } + if (other.SetPointControlOutputRate != 0) { + SetPointControlOutputRate = other.SetPointControlOutputRate; + } + if (other.ControlOutputType != 0) { + ControlOutputType = other.ControlOutputType; + } + if (other.SsrControlOutputType != 0) { + SsrControlOutputType = other.SsrControlOutputType; + } + if (other.OutputOnOffHysteresisValue != 0) { + OutputOnOffHysteresisValue = other.OutputOnOffHysteresisValue; + } + if (other.ProcessVariableSamplingRate != 0) { + ProcessVariableSamplingRate = other.ProcessVariableSamplingRate; + } + if (other.PvInputFilterFactorMode != 0) { + PvInputFilterFactorMode = other.PvInputFilterFactorMode; + } + } + + [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: { + hardwarePidControlType_ = (global::Tango.PMR.Hardware.HardwarePidControlType) input.ReadEnum(); + break; + } + case 16: { + OutputProportionalPowerLimit = input.ReadInt32(); + break; + } + case 24: { + OutputProportionalBand = input.ReadInt32(); + break; + } + case 32: { + IntegralTime = input.ReadInt32(); + break; + } + case 40: { + DerivativeTime = input.ReadInt32(); + break; + } + case 48: { + SensorCorrectionAdjustment = input.ReadInt32(); + break; + } + case 56: { + SensorMinValue = input.ReadInt32(); + break; + } + case 64: { + SensorMaxValue = input.ReadInt32(); + break; + } + case 72: { + SetPointRampRateorSoftStartRamp = input.ReadInt32(); + break; + } + case 80: { + SetPointControlOutputRate = input.ReadInt32(); + break; + } + case 88: { + ControlOutputType = input.ReadInt32(); + break; + } + case 96: { + SsrControlOutputType = input.ReadInt32(); + break; + } + case 104: { + OutputOnOffHysteresisValue = input.ReadInt32(); + break; + } + case 112: { + ProcessVariableSamplingRate = input.ReadInt32(); + break; + } + case 120: { + PvInputFilterFactorMode = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs new file mode 100644 index 000000000..1ef856a75 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwarePidControlType.cs @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HardwarePidControlType.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Hardware { + + /// <summary>Holder for reflection information generated from HardwarePidControlType.proto</summary> + public static partial class HardwarePidControlTypeReflection { + + #region Descriptor + /// <summary>File descriptor for HardwarePidControlType.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HardwarePidControlTypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChxIYXJkd2FyZVBpZENvbnRyb2xUeXBlLnByb3RvEhJUYW5nby5QTVIuSGFy", + "ZHdhcmUqnAIKFkhhcmR3YXJlUGlkQ29udHJvbFR5cGUSFAoQRHJ5ZXJIZWF0", + "ZXIxMDAwdxAAEhQKEERyeWVySGVhdGVyMjAwdzEQARIUChBEcnllckhlYXRl", + "cjIwMHcyEAISEAoMSGVhZEhlYXRlcloxEAMSEAoMSGVhZEhlYXRlcloyEAQS", + "EAoMSGVhZEhlYXRlclozEAUSEAoMSGVhZEhlYXRlclo0EAYSDwoLTWl4ZXJI", + "ZWF0ZXIQBxIQCgxXYXN0ZUNvbnRyb2wQCBIOCgpNb3RvckRyeWVyEAkSDwoL", + "TW90b3JGZWVkZXIQChIPCgtNb3RvclBvb2xlchALEg8KC01vdG9yV2luZGVy", + "EAwSEgoORHJ5ZXJIZWF0ZXI0MDAQDUIeChxjb20udHdpbmUudGFuZ28ucG1y", + "LmhhcmR3YXJlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Hardware.HardwarePidControlType), }, null)); + } + #endregion + + } + #region Enums + public enum HardwarePidControlType { + [pbr::OriginalName("DryerHeater1000w")] DryerHeater1000W = 0, + [pbr::OriginalName("DryerHeater200w1")] DryerHeater200W1 = 1, + [pbr::OriginalName("DryerHeater200w2")] DryerHeater200W2 = 2, + [pbr::OriginalName("HeadHeaterZ1")] HeadHeaterZ1 = 3, + [pbr::OriginalName("HeadHeaterZ2")] HeadHeaterZ2 = 4, + [pbr::OriginalName("HeadHeaterZ3")] HeadHeaterZ3 = 5, + [pbr::OriginalName("HeadHeaterZ4")] HeadHeaterZ4 = 6, + [pbr::OriginalName("MixerHeater")] MixerHeater = 7, + [pbr::OriginalName("WasteControl")] WasteControl = 8, + [pbr::OriginalName("MotorDryer")] MotorDryer = 9, + [pbr::OriginalName("MotorFeeder")] MotorFeeder = 10, + [pbr::OriginalName("MotorPooler")] MotorPooler = 11, + [pbr::OriginalName("MotorWinder")] MotorWinder = 12, + [pbr::OriginalName("DryerHeater400")] DryerHeater400 = 13, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 45f1f06a3..be8bd22ee 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -86,6 +86,13 @@ <Compile Include="Diagnostics\ThreadJoggingRequest.cs" /> <Compile Include="Diagnostics\ThreadJoggingResponse.cs" /> <Compile Include="ExtensionMethods.cs" /> + <Compile Include="Hardware\HardwareDancer.cs" /> + <Compile Include="Hardware\HardwareDancerType.cs" /> + <Compile Include="Hardware\HardwareDispenser.cs" /> + <Compile Include="Hardware\HardwareMotor.cs" /> + <Compile Include="Hardware\HardwareMotorType.cs" /> + <Compile Include="Hardware\HardwarePidControl.cs" /> + <Compile Include="Hardware\HardwarePidControlType.cs" /> <Compile Include="Integration\DirectSynchronizationRequest.cs" /> <Compile Include="Integration\DirectSynchronizationResponse.cs" /> <Compile Include="Integration\ExternalBridgeUdpDiscoveryPacket.cs" /> diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index a048d7f99..b1a0d1ce2 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27004.2010 +VisualStudioVersion = 15.0.26430.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" EndProject @@ -145,6 +145,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEmbroideryTest", "Embroi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.HardwareDesigner", "MachineStudio\Modules\Tango.MachineStudio.HardwareDesigner\Tango.MachineStudio.HardwareDesigner.csproj", "{69DB0564-268C-4B3C-B5D6-A3CDC7D14EAE}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.PMRGenerator.CLI", "Utilities\Tango.PMRGenerator.CLI\Tango.PMRGenerator.CLI.csproj", "{5AFD5B7D-757A-400C-B0C9-118834F5D67E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1886,6 +1888,36 @@ Global {69DB0564-268C-4B3C-B5D6-A3CDC7D14EAE}.Release|x64.Build.0 = Release|Any CPU {69DB0564-268C-4B3C-B5D6-A3CDC7D14EAE}.Release|x86.ActiveCfg = Release|Any CPU {69DB0564-268C-4B3C-B5D6-A3CDC7D14EAE}.Release|x86.Build.0 = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|ARM.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|ARM.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|ARM64.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|x64.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|x64.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|x86.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Debug|x86.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|Any CPU.Build.0 = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|ARM.ActiveCfg = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|ARM.Build.0 = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|ARM64.ActiveCfg = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|ARM64.Build.0 = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|x64.ActiveCfg = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|x64.Build.0 = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|x86.ActiveCfg = Release|Any CPU + {5AFD5B7D-757A-400C-B0C9-118834F5D67E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1929,6 +1961,7 @@ Global {BD30C7BD-9230-4ED7-B581-11F14041909D} = {34839F9A-61D3-4ED3-B3F7-7DA3424CB0B6} {0565AEEC-ED1B-4F0E-A277-D33F852207BC} = {34839F9A-61D3-4ED3-B3F7-7DA3424CB0B6} {69DB0564-268C-4B3C-B5D6-A3CDC7D14EAE} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} + {5AFD5B7D-757A-400C-B0C9-118834F5D67E} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Properties/AssemblyInfo.cs index 9260e2580..ac044393e 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Properties/AssemblyInfo.cs @@ -2,5 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Tango - Machine Designer")] +[assembly: AssemblyTitle("Tango - DAL Observables Generator")] [assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config new file mode 100644 index 000000000..92aa00bf9 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> + <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> + </configSections> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> + </startup> + <entityFramework> + <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> + <providers> + <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> + </providers> + </entityFramework> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs new file mode 100644 index 000000000..cbda9849e --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Tango.CodeGeneration; +using Tango.Integration.Observables; + +namespace Tango.PMRGenerator.CLI +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Generating PMR's..."); + Console.WriteLine(); + + Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); + String pmrFolder = "..\\..\\..\\PMR\\Messages"; + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + db.Configuration.LazyLoadingEnabled = false; + GenerateHardwareMotors(db, pmrFolder); + GenerateHardwareDancers(db, pmrFolder); + GenerateHardwarePidControls(db, pmrFolder); + GenerateHardwareDispensers(db, pmrFolder); + } + + Console.WriteLine("Done"); + } + + private static void GenerateHardwareMotors(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Hardware Motor Types..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "HardwareMotorType"; + enumFile.Package = "Tango.PMR.Hardware"; + + foreach (var field in db.HardwareMotorTypes.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Value = field.Code, + }); + } + + Console.WriteLine("Generating Hardware Motor..."); + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "HardwareMotor"; + messageFile.Package = "Tango.PMR.Hardware"; + messageFile.Imports.Add("HardwareMotorType.proto"); + + messageFile.Properties.Add(new Property("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))); + } + + String enumString = enumFile.GenerateCode(); + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", enumFile.Name + ".proto"), enumString); + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); + } + + private static void GenerateHardwareDancers(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Hardware Dancer Types..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "HardwareDancerType"; + enumFile.Package = "Tango.PMR.Hardware"; + + foreach (var field in db.HardwareDancerTypes.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Value = field.Code, + }); + } + + Console.WriteLine("Generating Hardware Dancer..."); + + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "HardwareDancer"; + messageFile.Package = "Tango.PMR.Hardware"; + messageFile.Imports.Add("HardwareDancerType.proto"); + + messageFile.Properties.Add(new Property("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))); + } + + String enumString = enumFile.GenerateCode(); + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", enumFile.Name + ".proto"), enumString); + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); + } + + private static void GenerateHardwarePidControls(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Hardware PID Control Types..."); + + ProtoEnumFile enumFile = new ProtoEnumFile(); + enumFile.Name = "HardwarePidControlType"; + enumFile.Package = "Tango.PMR.Hardware"; + + foreach (var field in db.HardwarePidControlTypes.ToList().OrderBy(x => x.Code)) + { + enumFile.Fields.Add(new EnumerationField() + { + Name = field.Name.Replace(" ", ""), + Value = field.Code, + }); + } + + Console.WriteLine("Generating Hardware PID Control..."); + + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "HardwarePidControl"; + messageFile.Package = "Tango.PMR.Hardware"; + messageFile.Imports.Add("HardwarePidControlType.proto"); + + messageFile.Properties.Add(new Property("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))); + } + + String enumString = enumFile.GenerateCode(); + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", enumFile.Name + ".proto"), enumString); + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); + } + + private static void GenerateHardwareDispensers(ObservablesContext db, String pmrFolder) + { + Console.WriteLine("Generating Dispenser Control..."); + + ProtoMessageFile messageFile = new ProtoMessageFile(); + messageFile.Name = "HardwareDispenser"; + messageFile.Package = "Tango.PMR.Hardware"; + + messageFile.Properties.Add(new Property("Code", "int32")); + + 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))); + } + + String messageString = messageFile.GenerateCode(); + + File.WriteAllText(Path.Combine(pmrFolder, "Hardware", messageFile.Name + ".proto"), messageString); + } + + private static String CoercePropertyType(Type type) + { + if (type == typeof(bool)) + { + return "bool"; + } + else + { + return type.Name.ToLower(); + } + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..349d5d4a4 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - PMR Generator")] +[assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj new file mode 100644 index 000000000..813f80cb4 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{5AFD5B7D-757A-400C-B0C9-118834F5D67E}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>Tango.PMRGenerator.CLI</RootNamespace> + <AssemblyName>Tango.PMRGenerator.CLI</AssemblyName> + <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\Build\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath> + </Reference> + <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="..\..\Versioning\GlobalVersionInfo.cs"> + <Link>GlobalVersionInfo.cs</Link> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Tango.CodeGeneration\Tango.CodeGeneration.csproj"> + <Project>{caedae94-11ed-473c-888a-268a6d38cd20}</Project> + <Name>Tango.CodeGeneration</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Integration\Tango.Integration.csproj"> + <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project> + <Name>Tango.Integration</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config new file mode 100644 index 000000000..9256e1591 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> +</packages>
\ No newline at end of file |
