From cf441513c1010eb4363e985b3b7af61a8503456e Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Mon, 16 Apr 2018 09:27:20 +0300 Subject: update motor driver --- .../Visual_Studio/Tango.PMR/Printing/JobSpool.cs | 93 +++++++++++++--------- 1 file changed, 57 insertions(+), 36 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs b/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs index afe846303..b67bd0fa8 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/JobSpool.cs @@ -23,17 +23,17 @@ namespace Tango.PMR.Printing { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Cg5Kb2JTcG9vbC5wcm90bxISVGFuZ28uUE1SLlByaW50aW5nGhJKb2JTcG9v", - "bFR5cGUucHJvdG8i+QEKCEpvYlNwb29sEjYKDEpvYlNwb29sVHlwZRgBIAEo", + "bFR5cGUucHJvdG8ihQIKCEpvYlNwb29sEjYKDEpvYlNwb29sVHlwZRgBIAEo", "DjIgLlRhbmdvLlBNUi5QcmludGluZy5Kb2JTcG9vbFR5cGUSDgoGTGVuZ3Ro", "GAIgASgBEg4KBldlaWdodBgDIAEoARIQCghEaWFtZXRlchgEIAEoARIZChFT", "dGFydE9mZnNldFB1bHNlcxgFIAEoBRITCgtCYWNraW5nUmF0ZRgGIAEoBRIb", - "ChNTZWdtZW50T2Zmc2V0UHVsc2VzGAcgASgFEhkKEUJvdHRvbUJhY2tpbmdS", - "YXRlGAggASgFEhsKE1JvdGF0aW9uc1BlclBhc3NhZ2UYCSABKAFCHgocY29t", - "LnR3aW5lLnRhbmdvLnBtci5wcmludGluZ2IGcHJvdG8z")); + "ChNTZWdtZW50T2Zmc2V0UHVsc2VzGAcgASgFEh4KFlNwb29sQm90dG9tQmFj", + "a2luZ1JhdGUYCCABKAUSIgoaTnVtYmVyT2ZSb3RhdGlvblBlclBhc3NhZ2UY", + "CSABKAFCHgocY29tLnR3aW5lLnRhbmdvLnBtci5wcmludGluZ2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSpoolTypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobSpool), global::Tango.PMR.Printing.JobSpool.Parser, new[]{ "JobSpoolType", "Length", "Weight", "Diameter", "StartOffsetPulses", "BackingRate", "SegmentOffsetPulses", "BottomBackingRate", "RotationsPerPassage" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobSpool), global::Tango.PMR.Printing.JobSpool.Parser, new[]{ "JobSpoolType", "Length", "Weight", "Diameter", "StartOffsetPulses", "BackingRate", "SegmentOffsetPulses", "SpoolBottomBackingRate", "NumberOfRotationPerPassage" }, null, null, null) })); } #endregion @@ -71,8 +71,8 @@ namespace Tango.PMR.Printing { startOffsetPulses_ = other.startOffsetPulses_; backingRate_ = other.backingRate_; segmentOffsetPulses_ = other.segmentOffsetPulses_; - bottomBackingRate_ = other.bottomBackingRate_; - rotationsPerPassage_ = other.rotationsPerPassage_; + spoolBottomBackingRate_ = other.spoolBottomBackingRate_; + numberOfRotationPerPassage_ = other.numberOfRotationPerPassage_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -94,6 +94,9 @@ namespace Tango.PMR.Printing { /// Field number for the "Length" field. public const int LengthFieldNumber = 2; private double length_; + /// + /// the spool winding initial length in mm + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Length { get { return length_; } @@ -116,6 +119,9 @@ namespace Tango.PMR.Printing { /// Field number for the "Diameter" field. public const int DiameterFieldNumber = 4; private double diameter_; + /// + /// in mm initial data required for speed calculation + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Diameter { get { return diameter_; } @@ -127,6 +133,9 @@ namespace Tango.PMR.Printing { /// Field number for the "StartOffsetPulses" field. public const int StartOffsetPulsesFieldNumber = 5; private int startOffsetPulses_; + /// + /// distance between the limit switch and the initial spool home position + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int StartOffsetPulses { get { return startOffsetPulses_; } @@ -138,6 +147,9 @@ namespace Tango.PMR.Printing { /// Field number for the "BackingRate" field. public const int BackingRateFieldNumber = 6; private int backingRate_; + /// + /// the angle of the top of the spool + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int BackingRate { get { return backingRate_; } @@ -149,6 +161,9 @@ namespace Tango.PMR.Printing { /// Field number for the "SegmentOffsetPulses" field. public const int SegmentOffsetPulsesFieldNumber = 7; private int segmentOffsetPulses_; + /// + /// the spool winding initial length in mm + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int SegmentOffsetPulses { get { return segmentOffsetPulses_; } @@ -157,25 +172,31 @@ namespace Tango.PMR.Printing { } } - /// Field number for the "BottomBackingRate" field. - public const int BottomBackingRateFieldNumber = 8; - private int bottomBackingRate_; + /// Field number for the "SpoolBottomBackingRate" field. + public const int SpoolBottomBackingRateFieldNumber = 8; + private int spoolBottomBackingRate_; + /// + /// the angle of the bottom of the spool + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int BottomBackingRate { - get { return bottomBackingRate_; } + public int SpoolBottomBackingRate { + get { return spoolBottomBackingRate_; } set { - bottomBackingRate_ = value; + spoolBottomBackingRate_ = value; } } - /// Field number for the "RotationsPerPassage" field. - public const int RotationsPerPassageFieldNumber = 9; - private double rotationsPerPassage_; + /// Field number for the "NumberOfRotationPerPassage" field. + public const int NumberOfRotationPerPassageFieldNumber = 9; + private double numberOfRotationPerPassage_; + /// + /// how many rotations per spool passage + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double RotationsPerPassage { - get { return rotationsPerPassage_; } + public double NumberOfRotationPerPassage { + get { return numberOfRotationPerPassage_; } set { - rotationsPerPassage_ = value; + numberOfRotationPerPassage_ = value; } } @@ -199,8 +220,8 @@ namespace Tango.PMR.Printing { if (StartOffsetPulses != other.StartOffsetPulses) return false; if (BackingRate != other.BackingRate) return false; if (SegmentOffsetPulses != other.SegmentOffsetPulses) return false; - if (BottomBackingRate != other.BottomBackingRate) return false; - if (RotationsPerPassage != other.RotationsPerPassage) return false; + if (SpoolBottomBackingRate != other.SpoolBottomBackingRate) return false; + if (NumberOfRotationPerPassage != other.NumberOfRotationPerPassage) return false; return true; } @@ -214,8 +235,8 @@ namespace Tango.PMR.Printing { if (StartOffsetPulses != 0) hash ^= StartOffsetPulses.GetHashCode(); if (BackingRate != 0) hash ^= BackingRate.GetHashCode(); if (SegmentOffsetPulses != 0) hash ^= SegmentOffsetPulses.GetHashCode(); - if (BottomBackingRate != 0) hash ^= BottomBackingRate.GetHashCode(); - if (RotationsPerPassage != 0D) hash ^= RotationsPerPassage.GetHashCode(); + if (SpoolBottomBackingRate != 0) hash ^= SpoolBottomBackingRate.GetHashCode(); + if (NumberOfRotationPerPassage != 0D) hash ^= NumberOfRotationPerPassage.GetHashCode(); return hash; } @@ -254,13 +275,13 @@ namespace Tango.PMR.Printing { output.WriteRawTag(56); output.WriteInt32(SegmentOffsetPulses); } - if (BottomBackingRate != 0) { + if (SpoolBottomBackingRate != 0) { output.WriteRawTag(64); - output.WriteInt32(BottomBackingRate); + output.WriteInt32(SpoolBottomBackingRate); } - if (RotationsPerPassage != 0D) { + if (NumberOfRotationPerPassage != 0D) { output.WriteRawTag(73); - output.WriteDouble(RotationsPerPassage); + output.WriteDouble(NumberOfRotationPerPassage); } } @@ -288,10 +309,10 @@ namespace Tango.PMR.Printing { if (SegmentOffsetPulses != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(SegmentOffsetPulses); } - if (BottomBackingRate != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(BottomBackingRate); + if (SpoolBottomBackingRate != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SpoolBottomBackingRate); } - if (RotationsPerPassage != 0D) { + if (NumberOfRotationPerPassage != 0D) { size += 1 + 8; } return size; @@ -323,11 +344,11 @@ namespace Tango.PMR.Printing { if (other.SegmentOffsetPulses != 0) { SegmentOffsetPulses = other.SegmentOffsetPulses; } - if (other.BottomBackingRate != 0) { - BottomBackingRate = other.BottomBackingRate; + if (other.SpoolBottomBackingRate != 0) { + SpoolBottomBackingRate = other.SpoolBottomBackingRate; } - if (other.RotationsPerPassage != 0D) { - RotationsPerPassage = other.RotationsPerPassage; + if (other.NumberOfRotationPerPassage != 0D) { + NumberOfRotationPerPassage = other.NumberOfRotationPerPassage; } } @@ -368,11 +389,11 @@ namespace Tango.PMR.Printing { break; } case 64: { - BottomBackingRate = input.ReadInt32(); + SpoolBottomBackingRate = input.ReadInt32(); break; } case 73: { - RotationsPerPassage = input.ReadDouble(); + NumberOfRotationPerPassage = input.ReadDouble(); break; } } -- cgit v1.3.1