aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.PMR/Jobs/Motor.cs
blob: b0ce0abe2348579855ce4bdbae2b57538df3a236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: motor.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.Jobs {

  /// <summary>Holder for reflection information generated from motor.proto</summary>
  public static partial class MotorReflection {

    #region Descriptor
    /// <summary>File descriptor for motor.proto</summary>
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static MotorReflection() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "Cgttb3Rvci5wcm90bxIOVGFuZ28uUE1SLkpvYnMisAIKC01vdG9yQ29uZmln",
            "EiMKAklkGAEgASgOMhcuVGFuZ28uUE1SLkpvYnMuTW90b3JJZBIPCgdtaW5m",
            "cmVxGAIgASgNEg8KB21heGZyZXEYAyABKA0SFAoMbWlubWljcm9zdGVwGAQg",
            "ASgNEhQKDG1heG1pY3Jvc3RlcBgFIAEoDRITCgtsaW5lYXJyYXRpbxgGIAEo",
            "ARIWCg5tZWRpYW5wb3NpdGlvbhgHIAEoDRIWCg5jb3JyZWN0aW9uZ2FpbhgI",
            "IAEoARIXCg9yYXRpb24yZHJ5ZXJzcGQYCSABKAESCgoCS3AYCiABKAESCgoC",
            "S2kYCyABKAESCgoCS2QYDCABKAESEwoLY2hhbmdlU2xvcGUYDSABKAESFwoP",
            "aGlnaHRpbWVvdXRtU2VjGA4gASgBKjgKB01vdG9ySWQSCgoGRmVlZGVyEAAS",
            "CQoFRHJ5ZXIQARIKCgZQb29sZXIQAhIKCgZXaW5kZXIQA0IaChhjb20udHdp",
            "bmUudGFuZ28ucG1yLmpvYnNiBnByb3RvMw=="));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { },
          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Jobs.MotorId), }, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Jobs.MotorConfig), global::Tango.PMR.Jobs.MotorConfig.Parser, new[]{ "Id", "Minfreq", "Maxfreq", "Minmicrostep", "Maxmicrostep", "Linearratio", "Medianposition", "Correctiongain", "Ration2Dryerspd", "Kp", "Ki", "Kd", "ChangeSlope", "HightimeoutmSec" }, null, null, null)
          }));
    }
    #endregion

  }
  #region Enums
  public enum MotorId {
    [pbr::OriginalName("Feeder")] Feeder = 0,
    [pbr::OriginalName("Dryer")] Dryer = 1,
    [pbr::OriginalName("Pooler")] Pooler = 2,
    [pbr::OriginalName("Winder")] Winder = 3,
  }

  #endregion

  #region Messages
  public sealed partial class MotorConfig : pb::IMessage<MotorConfig> {
    private static readonly pb::MessageParser<MotorConfig> _parser = new pb::MessageParser<MotorConfig>(() => new MotorConfig());
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pb::MessageParser<MotorConfig> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Tango.PMR.Jobs.MotorReflection.Descriptor.MessageTypes[0]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public MotorConfig() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public MotorConfig(MotorConfig other) : this() {
      id_ = other.id_;
      minfreq_ = other.minfreq_;
      maxfreq_ = other.maxfreq_;
      minmicrostep_ = other.minmicrostep_;
      maxmicrostep_ = other.maxmicrostep_;
      linearratio_ = other.linearratio_;
      medianposition_ = other.medianposition_;
      correctiongain_ = other.correctiongain_;
      ration2Dryerspd_ = other.ration2Dryerspd_;
      kp_ = other.kp_;
      ki_ = other.ki_;
      kd_ = other.kd_;
      changeSlope_ = other.changeSlope_;
      hightimeoutmSec_ = other.hightimeoutmSec_;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public MotorConfig Clone() {
      return new MotorConfig(this);
    }

    /// <summary>Field number for the "Id" field.</summary>
    public const int IdFieldNumber = 1;
    private global::Tango.PMR.Jobs.MotorId id_ = 0;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public global::Tango.PMR.Jobs.MotorId Id {
      get { return id_; }
      set {
        id_ = value;
      }
    }

    /// <summary>Field number for the "minfreq" field.</summary>
    public const int MinfreqFieldNumber = 2;
    private uint minfreq_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint Minfreq {
      get { return minfreq_; }
      set {
        minfreq_ = value;
      }
    }

    /// <summary>Field number for the "maxfreq" field.</summary>
    public const int MaxfreqFieldNumber = 3;
    private uint maxfreq_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint Maxfreq {
      get { return maxfreq_; }
      set {
        maxfreq_ = value;
      }
    }

    /// <summary>Field number for the "minmicrostep" field.</summary>
    public const int MinmicrostepFieldNumber = 4;
    private uint minmicrostep_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint Minmicrostep {
      get { return minmicrostep_; }
      set {
        minmicrostep_ = value;
      }
    }

    /// <summary>Field number for the "maxmicrostep" field.</summary>
    public const int MaxmicrostepFieldNumber = 5;
    private uint maxmicrostep_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint 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 uint medianposition_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint 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 "ration2dryerspd" field.</summary>
    public const int Ration2DryerspdFieldNumber = 9;
    private double ration2Dryerspd_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double Ration2Dryerspd {
      get { return ration2Dryerspd_; }
      set {
        ration2Dryerspd_ = 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 "hightimeoutmSec" field.</summary>
    public const int HightimeoutmSecFieldNumber = 14;
    private double hightimeoutmSec_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double HightimeoutmSec {
      get { return hightimeoutmSec_; }
      set {
        hightimeoutmSec_ = value;
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override bool Equals(object other) {
      return Equals(other as MotorConfig);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool Equals(MotorConfig other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (Id != other.Id) return false;
      if (Minfreq != other.Minfreq) return false;
      if (Maxfreq != other.Maxfreq) 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 (Ration2Dryerspd != other.Ration2Dryerspd) 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 (HightimeoutmSec != other.HightimeoutmSec) return false;
      return true;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override int GetHashCode() {
      int hash = 1;
      if (Id != 0) hash ^= Id.GetHashCode();
      if (Minfreq != 0) hash ^= Minfreq.GetHashCode();
      if (Maxfreq != 0) hash ^= Maxfreq.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 (Ration2Dryerspd != 0D) hash ^= Ration2Dryerspd.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 (HightimeoutmSec != 0D) hash ^= HightimeoutmSec.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 (Id != 0) {
        output.WriteRawTag(8);
        output.WriteEnum((int) Id);
      }
      if (Minfreq != 0) {
        output.WriteRawTag(16);
        output.WriteUInt32(Minfreq);
      }
      if (Maxfreq != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(Maxfreq);
      }
      if (Minmicrostep != 0) {
        output.WriteRawTag(32);
        output.WriteUInt32(Minmicrostep);
      }
      if (Maxmicrostep != 0) {
        output.WriteRawTag(40);
        output.WriteUInt32(Maxmicrostep);
      }
      if (Linearratio != 0D) {
        output.WriteRawTag(49);
        output.WriteDouble(Linearratio);
      }
      if (Medianposition != 0) {
        output.WriteRawTag(56);
        output.WriteUInt32(Medianposition);
      }
      if (Correctiongain != 0D) {
        output.WriteRawTag(65);
        output.WriteDouble(Correctiongain);
      }
      if (Ration2Dryerspd != 0D) {
        output.WriteRawTag(73);
        output.WriteDouble(Ration2Dryerspd);
      }
      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 (HightimeoutmSec != 0D) {
        output.WriteRawTag(113);
        output.WriteDouble(HightimeoutmSec);
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int CalculateSize() {
      int size = 0;
      if (Id != 0) {
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Id);
      }
      if (Minfreq != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Minfreq);
      }
      if (Maxfreq != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Maxfreq);
      }
      if (Minmicrostep != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Minmicrostep);
      }
      if (Maxmicrostep != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Maxmicrostep);
      }
      if (Linearratio != 0D) {
        size += 1 + 8;
      }
      if (Medianposition != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Medianposition);
      }
      if (Correctiongain != 0D) {
        size += 1 + 8;
      }
      if (Ration2Dryerspd != 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 (HightimeoutmSec != 0D) {
        size += 1 + 8;
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(MotorConfig other) {
      if (other == null) {
        return;
      }
      if (other.Id != 0) {
        Id = other.Id;
      }
      if (other.Minfreq != 0) {
        Minfreq = other.Minfreq;
      }
      if (other.Maxfreq != 0) {
        Maxfreq = other.Maxfreq;
      }
      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.Ration2Dryerspd != 0D) {
        Ration2Dryerspd = other.Ration2Dryerspd;
      }
      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.HightimeoutmSec != 0D) {
        HightimeoutmSec = other.HightimeoutmSec;
      }
    }

    [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: {
            id_ = (global::Tango.PMR.Jobs.MotorId) input.ReadEnum();
            break;
          }
          case 16: {
            Minfreq = input.ReadUInt32();
            break;
          }
          case 24: {
            Maxfreq = input.ReadUInt32();
            break;
          }
          case 32: {
            Minmicrostep = input.ReadUInt32();
            break;
          }
          case 40: {
            Maxmicrostep = input.ReadUInt32();
            break;
          }
          case 49: {
            Linearratio = input.ReadDouble();
            break;
          }
          case 56: {
            Medianposition = input.ReadUInt32();
            break;
          }
          case 65: {
            Correctiongain = input.ReadDouble();
            break;
          }
          case 73: {
            Ration2Dryerspd = 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: {
            HightimeoutmSec = input.ReadDouble();
            break;
          }
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code