aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/UndoRedoCommands/RepeatCommand.cs
blob: 37dcdd6f658f76010d11bb21e9eaaa913bd881d1 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.PPC.Jobs.Models;

namespace Tango.PPC.Jobs.UndoRedoCommands
{
    public class RepeatCommand : IUndoRedoCommand
    {
        private JobModel _jobModel;
        private Dictionary<int, ISegmentModel> _indexToSegmentsDict;
        private SegmentsGroupModel _group;
        
        public RepeatCommand(JobModel job)
        {
            _jobModel = job;
            _indexToSegmentsDict = new Dictionary<int, ISegmentModel>();
            for (int index = 0; index < _jobModel.GroupingSegments.Count; index++)
            {
                var segment = _jobModel.GroupingSegments[index];
                if (segment.IsSelected )
                {
                    _indexToSegmentsDict[index] = segment;
                }
                else if (_indexToSegmentsDict.Count > 0)//selected items should be in turn
                {
                    break;
                }
            }
        }

        public void Execute()
        {
            if (_indexToSegmentsDict.Count == 0)
                return;
            
            List<SegmentModel> selectedsegments = new List<SegmentModel>();
            foreach (var obj in _indexToSegmentsDict)
            {
                if (obj.Value is SegmentModel simpleSegment)
                {
                    selectedsegments.Add(simpleSegment);
                    _jobModel.GroupingSegments.Remove(simpleSegment);
                }  
                else if (obj.Value is SegmentsGroupModel segmentsGroup)
                {
                    selectedsegments.AddRange(segmentsGroup.Segments);
                    _jobModel.SegmentsGroups.Remove(segmentsGroup);
                    _jobModel.GroupingSegments.Remove(segmentsGroup);
                    
                }
                obj.Value.IsSelected = false;
            }

            _group = new SegmentsGroupModel(_jobModel, selectedsegments) ;
            selectedsegments.ForEach(x => x.SegmentsGroupModel = _group);
            _group.SegmentIndex = _group.FirstSegmentIndex;

            _jobModel.SegmentsGroups.Add(_group);
            
            if((_group.SegmentIndex - 1) < _jobModel.GroupingSegments.Count)
            {
                _jobModel.GroupingSegments.Insert((_group.SegmentIndex - 1), _group);
            }
            else
                _jobModel.GroupingSegments.Add( _group);

            _jobModel.ArrangeSegmentsIndixes();
        }

        public void UnExecute()
        {
            if (_indexToSegmentsDict.Count == 0)
                return;

            _jobModel.SegmentsGroups.Remove(_group);
            _jobModel.GroupingSegments.Remove(_group);
            foreach (var obj in _indexToSegmentsDict)
            {
                if (obj.Value is SegmentModel innerSegment)
                {
                    innerSegment.SegmentsGroupModel = null;
                }
                else if (obj.Value is SegmentsGroupModel group)
                {
                    _jobModel.SegmentsGroups.Add(group);
                    group.Segments.ToList().ForEach(x => x.SegmentsGroupModel = group);
                }
                if (_jobModel.GroupingSegments.Count <= obj.Key)
                    _jobModel.GroupingSegments.Add(obj.Value);
                else
                {
                    _jobModel.GroupingSegments.Insert(obj.Key, obj.Value);
                }
            }

            _jobModel.ArrangeSegmentsIndixes();
        }
    }
}
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
// 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",
            "ZRocSGFyZHdhcmVQaWRDb250cm9sVHlwZS5wcm90byKaBQoSSGFyZHdhcmVQ",
            "aWRDb250cm9sEkoKFkhhcmR3YXJlUGlkQ29udHJvbFR5cGUYASABKA4yKi5U",
            "YW5nby5QTVIuSGFyZHdhcmUuSGFyZHdhcmVQaWRDb250cm9sVHlwZRIkChxP",
            "dXRwdXRQcm9wb3J0aW9uYWxQb3dlckxpbWl0GAIgASgBEh4KFk91dHB1dFBy",
            "b3BvcnRpb25hbEJhbmQYAyABKAESFAoMSW50ZWdyYWxUaW1lGAQgASgBEhYK",
            "DkRlcml2YXRpdmVUaW1lGAUgASgBEiIKGlNlbnNvckNvcnJlY3Rpb25BZGp1",
            "c3RtZW50GAYgASgBEhYKDlNlbnNvck1pblZhbHVlGAcgASgBEhYKDlNlbnNv",
            "ck1heFZhbHVlGAggASgBEicKH1NldFBvaW50UmFtcFJhdGVvclNvZnRTdGFy",
            "dFJhbXAYCSABKAESIQoZU2V0UG9pbnRDb250cm9sT3V0cHV0UmF0ZRgKIAEo",
            "ARIZChFDb250cm9sT3V0cHV0VHlwZRgLIAEoARIcChRTc3JDb250cm9sT3V0",
            "cHV0VHlwZRgMIAEoARIiChpPdXRwdXRPbk9mZkh5c3RlcmVzaXNWYWx1ZRgN",
            "IAEoARIjChtQcm9jZXNzVmFyaWFibGVTYW1wbGluZ1JhdGUYDiABKAESHwoX",
            "UHZJbnB1dEZpbHRlckZhY3Rvck1vZGUYDyABKAESIwobT3V0cHV0UHJvcG9y",
            "dGlvbmFsQ3ljbGVUaW1lGBAgASgFEh4KFkFjSGVhdGVyc0hhbGZDeWNsZVRp",
            "bWUYESABKAUSGAoQUHJvcG9ydGlvbmFsR2FpbhgSIAEoARIRCglQaWRBY3Rp",
            "dmUYEyABKAgSDwoHRXBzaWxvbhgUIAEoAUIeChxjb20udHdpbmUudGFuZ28u",
            "cG1yLmhhcmR3YXJlYgZwcm90bzM="));
      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", "OutputProportionalCycleTime", "AcHeatersHalfCycleTime", "ProportionalGain", "PidActive", "Epsilon" }, 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_;
      outputProportionalCycleTime_ = other.outputProportionalCycleTime_;
      acHeatersHalfCycleTime_ = other.acHeatersHalfCycleTime_;
      proportionalGain_ = other.proportionalGain_;
      pidActive_ = other.pidActive_;
      epsilon_ = other.epsilon_;
    }

    [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 double outputProportionalPowerLimit_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double OutputProportionalPowerLimit {
      get { return outputProportionalPowerLimit_; }
      set {
        outputProportionalPowerLimit_ = value;
      }
    }

    /// <summary>Field number for the "OutputProportionalBand" field.</summary>
    public const int OutputProportionalBandFieldNumber = 3;
    private double outputProportionalBand_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double OutputProportionalBand {
      get { return outputProportionalBand_; }
      set {
        outputProportionalBand_ = value;
      }
    }

    /// <summary>Field number for the "IntegralTime" field.</summary>
    public const int IntegralTimeFieldNumber = 4;
    private double integralTime_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double IntegralTime {
      get { return integralTime_; }
      set {
        integralTime_ = value;
      }
    }

    /// <summary>Field number for the "DerivativeTime" field.</summary>
    public const int DerivativeTimeFieldNumber = 5;
    private double derivativeTime_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double DerivativeTime {
      get { return derivativeTime_; }
      set {
        derivativeTime_ = value;
      }
    }

    /// <summary>Field number for the "SensorCorrectionAdjustment" field.</summary>
    public const int SensorCorrectionAdjustmentFieldNumber = 6;
    private double sensorCorrectionAdjustment_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double SensorCorrectionAdjustment {
      get { return sensorCorrectionAdjustment_; }
      set {
        sensorCorrectionAdjustment_ = value;
      }
    }

    /// <summary>Field number for the "SensorMinValue" field.</summary>
    public const int SensorMinValueFieldNumber = 7;
    private double sensorMinValue_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double SensorMinValue {
      get { return sensorMinValue_; }
      set {
        sensorMinValue_ = value;
      }
    }

    /// <summary>Field number for the "SensorMaxValue" field.</summary>
    public const int SensorMaxValueFieldNumber = 8;
    private double sensorMaxValue_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double SensorMaxValue {
      get { return sensorMaxValue_; }
      set {
        sensorMaxValue_ = value;
      }
    }

    /// <summary>Field number for the "SetPointRampRateorSoftStartRamp" field.</summary>
    public const int SetPointRampRateorSoftStartRampFieldNumber = 9;
    private double setPointRampRateorSoftStartRamp_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double SetPointRampRateorSoftStartRamp {
      get { return setPointRampRateorSoftStartRamp_; }
      set {
        setPointRampRateorSoftStartRamp_ = value;
      }
    }

    /// <summary>Field number for the "SetPointControlOutputRate" field.</summary>
    public const int SetPointControlOutputRateFieldNumber = 10;
    private double setPointControlOutputRate_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double SetPointControlOutputRate {
      get { return setPointControlOutputRate_; }
      set {
        setPointControlOutputRate_ = value;
      }
    }

    /// <summary>Field number for the "ControlOutputType" field.</summary>
    public const int ControlOutputTypeFieldNumber = 11;
    private double controlOutputType_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double ControlOutputType {
      get { return controlOutputType_; }
      set {
        controlOutputType_ = value;
      }
    }

    /// <summary>Field number for the "SsrControlOutputType" field.</summary>
    public const int SsrControlOutputTypeFieldNumber = 12;
    private double ssrControlOutputType_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double SsrControlOutputType {
      get { return ssrControlOutputType_; }
      set {
        ssrControlOutputType_ = value;
      }
    }

    /// <summary>Field number for the "OutputOnOffHysteresisValue" field.</summary>
    public const int OutputOnOffHysteresisValueFieldNumber = 13;
    private double outputOnOffHysteresisValue_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double OutputOnOffHysteresisValue {
      get { return outputOnOffHysteresisValue_; }
      set {
        outputOnOffHysteresisValue_ = value;
      }
    }

    /// <summary>Field number for the "ProcessVariableSamplingRate" field.</summary>
    public const int ProcessVariableSamplingRateFieldNumber = 14;
    private double processVariableSamplingRate_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double ProcessVariableSamplingRate {
      get { return processVariableSamplingRate_; }
      set {
        processVariableSamplingRate_ = value;
      }
    }

    /// <summary>Field number for the "PvInputFilterFactorMode" field.</summary>
    public const int PvInputFilterFactorModeFieldNumber = 15;
    private double pvInputFilterFactorMode_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double PvInputFilterFactorMode {
      get { return pvInputFilterFactorMode_; }
      set {
        pvInputFilterFactorMode_ = value;
      }
    }

    /// <summary>Field number for the "OutputProportionalCycleTime" field.</summary>
    public const int OutputProportionalCycleTimeFieldNumber = 16;
    private int outputProportionalCycleTime_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int OutputProportionalCycleTime {
      get { return outputProportionalCycleTime_; }
      set {
        outputProportionalCycleTime_ = value;
      }
    }

    /// <summary>Field number for the "AcHeatersHalfCycleTime" field.</summary>
    public const int AcHeatersHalfCycleTimeFieldNumber = 17;
    private int acHeatersHalfCycleTime_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int AcHeatersHalfCycleTime {
      get { return acHeatersHalfCycleTime_; }
      set {
        acHeatersHalfCycleTime_ = value;
      }
    }

    /// <summary>Field number for the "ProportionalGain" field.</summary>
    public const int ProportionalGainFieldNumber = 18;
    private double proportionalGain_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double ProportionalGain {
      get { return proportionalGain_; }
      set {
        proportionalGain_ = value;
      }
    }

    /// <summary>Field number for the "PidActive" field.</summary>
    public const int PidActiveFieldNumber = 19;
    private bool pidActive_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool PidActive {
      get { return pidActive_; }
      set {
        pidActive_ = value;
      }
    }

    /// <summary>Field number for the "Epsilon" field.</summary>
    public const int EpsilonFieldNumber = 20;
    private double epsilon_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public double Epsilon {
      get { return epsilon_; }
      set {
        epsilon_ = 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;
      if (OutputProportionalCycleTime != other.OutputProportionalCycleTime) return false;
      if (AcHeatersHalfCycleTime != other.AcHeatersHalfCycleTime) return false;
      if (ProportionalGain != other.ProportionalGain) return false;
      if (PidActive != other.PidActive) return false;
      if (Epsilon != other.Epsilon) return false;
      return true;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override int GetHashCode() {
      int hash = 1;
      if (HardwarePidControlType != 0) hash ^= HardwarePidControlType.GetHashCode();
      if (OutputProportionalPowerLimit != 0D) hash ^= OutputProportionalPowerLimit.GetHashCode();
      if (OutputProportionalBand != 0D) hash ^= OutputProportionalBand.GetHashCode();
      if (IntegralTime != 0D) hash ^= IntegralTime.GetHashCode();
      if (DerivativeTime != 0D) hash ^= DerivativeTime.GetHashCode();
      if (SensorCorrectionAdjustment != 0D) hash ^= SensorCorrectionAdjustment.GetHashCode();
      if (SensorMinValue != 0D) hash ^= SensorMinValue.GetHashCode();
      if (SensorMaxValue != 0D) hash ^= SensorMaxValue.GetHashCode();
      if (SetPointRampRateorSoftStartRamp != 0D) hash ^= SetPointRampRateorSoftStartRamp.GetHashCode();
      if (SetPointControlOutputRate != 0D) hash ^= SetPointControlOutputRate.GetHashCode();
      if (ControlOutputType != 0D) hash ^= ControlOutputType.GetHashCode();
      if (SsrControlOutputType != 0D) hash ^= SsrControlOutputType.GetHashCode();
      if (OutputOnOffHysteresisValue != 0D) hash ^= OutputOnOffHysteresisValue.GetHashCode();
      if (ProcessVariableSamplingRate != 0D) hash ^= ProcessVariableSamplingRate.GetHashCode();
      if (PvInputFilterFactorMode != 0D) hash ^= PvInputFilterFactorMode.GetHashCode();
      if (OutputProportionalCycleTime != 0) hash ^= OutputProportionalCycleTime.GetHashCode();
      if (AcHeatersHalfCycleTime != 0) hash ^= AcHeatersHalfCycleTime.GetHashCode();
      if (ProportionalGain != 0D) hash ^= ProportionalGain.GetHashCode();
      if (PidActive != false) hash ^= PidActive.GetHashCode();
      if (Epsilon != 0D) hash ^= Epsilon.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 != 0D) {
        output.WriteRawTag(17);
        output.WriteDouble(OutputProportionalPowerLimit);
      }
      if (OutputProportionalBand != 0D) {
        output.WriteRawTag(25);
        output.WriteDouble(OutputProportionalBand);
      }
      if (IntegralTime != 0D) {
        output.WriteRawTag(33);
        output.WriteDouble(IntegralTime);
      }
      if (DerivativeTime != 0D) {
        output.WriteRawTag(41);
        output.WriteDouble(DerivativeTime);
      }
      if (SensorCorrectionAdjustment != 0D) {
        output.WriteRawTag(49);
        output.WriteDouble(SensorCorrectionAdjustment);
      }
      if (SensorMinValue != 0D) {
        output.WriteRawTag(57);
        output.WriteDouble(SensorMinValue);
      }
      if (SensorMaxValue != 0D) {
        output.WriteRawTag(65);
        output.WriteDouble(SensorMaxValue);
      }
      if (SetPointRampRateorSoftStartRamp != 0D) {
        output.WriteRawTag(73);
        output.WriteDouble(SetPointRampRateorSoftStartRamp);
      }
      if (SetPointControlOutputRate != 0D) {
        output.WriteRawTag(81);
        output.WriteDouble(SetPointControlOutputRate);
      }
      if (ControlOutputType != 0D) {
        output.WriteRawTag(89);
        output.WriteDouble(ControlOutputType);
      }
      if (SsrControlOutputType != 0D) {
        output.WriteRawTag(97);
        output.WriteDouble(SsrControlOutputType);
      }
      if (OutputOnOffHysteresisValue != 0D) {
        output.WriteRawTag(105);
        output.WriteDouble(OutputOnOffHysteresisValue);
      }
      if (ProcessVariableSamplingRate != 0D) {
        output.WriteRawTag(113);
        output.WriteDouble(ProcessVariableSamplingRate);
      }
      if (PvInputFilterFactorMode != 0D) {
        output.WriteRawTag(121);
        output.WriteDouble(PvInputFilterFactorMode);
      }
      if (OutputProportionalCycleTime != 0) {
        output.WriteRawTag(128, 1);
        output.WriteInt32(OutputProportionalCycleTime);
      }
      if (AcHeatersHalfCycleTime != 0) {
        output.WriteRawTag(136, 1);
        output.WriteInt32(AcHeatersHalfCycleTime);
      }
      if (ProportionalGain != 0D) {
        output.WriteRawTag(145, 1);
        output.WriteDouble(ProportionalGain);
      }
      if (PidActive != false) {
        output.WriteRawTag(152, 1);
        output.WriteBool(PidActive);
      }
      if (Epsilon != 0D) {
        output.WriteRawTag(161, 1);
        output.WriteDouble(Epsilon);
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int CalculateSize() {
      int size = 0;
      if (HardwarePidControlType != 0) {
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) HardwarePidControlType);
      }
      if (OutputProportionalPowerLimit != 0D) {
        size += 1 + 8;
      }
      if (OutputProportionalBand != 0D) {
        size += 1 + 8;
      }
      if (IntegralTime != 0D) {
        size += 1 + 8;
      }
      if (DerivativeTime != 0D) {
        size += 1 + 8;
      }
      if (SensorCorrectionAdjustment != 0D) {
        size += 1 + 8;
      }
      if (SensorMinValue != 0D) {
        size += 1 + 8;
      }
      if (SensorMaxValue != 0D) {
        size += 1 + 8;
      }
      if (SetPointRampRateorSoftStartRamp != 0D) {
        size += 1 + 8;
      }
      if (SetPointControlOutputRate != 0D) {
        size += 1 + 8;
      }
      if (ControlOutputType != 0D) {
        size += 1 + 8;
      }
      if (SsrControlOutputType != 0D) {
        size += 1 + 8;
      }
      if (OutputOnOffHysteresisValue != 0D) {
        size += 1 + 8;
      }
      if (ProcessVariableSamplingRate != 0D) {
        size += 1 + 8;
      }
      if (PvInputFilterFactorMode != 0D) {
        size += 1 + 8;
      }
      if (OutputProportionalCycleTime != 0) {
        size += 2 + pb::CodedOutputStream.ComputeInt32Size(OutputProportionalCycleTime);
      }
      if (AcHeatersHalfCycleTime != 0) {
        size += 2 + pb::CodedOutputStream.ComputeInt32Size(AcHeatersHalfCycleTime);
      }
      if (ProportionalGain != 0D) {
        size += 2 + 8;
      }
      if (PidActive != false) {
        size += 2 + 1;
      }
      if (Epsilon != 0D) {
        size += 2 + 8;
      }
      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 != 0D) {
        OutputProportionalPowerLimit = other.OutputProportionalPowerLimit;
      }
      if (other.OutputProportionalBand != 0D) {
        OutputProportionalBand = other.OutputProportionalBand;
      }
      if (other.IntegralTime != 0D) {
        IntegralTime = other.IntegralTime;
      }
      if (other.DerivativeTime != 0D) {
        DerivativeTime = other.DerivativeTime;
      }
      if (other.SensorCorrectionAdjustment != 0D) {
        SensorCorrectionAdjustment = other.SensorCorrectionAdjustment;
      }
      if (other.SensorMinValue != 0D) {
        SensorMinValue = other.SensorMinValue;
      }
      if (other.SensorMaxValue != 0D) {
        SensorMaxValue = other.SensorMaxValue;
      }
      if (other.SetPointRampRateorSoftStartRamp != 0D) {
        SetPointRampRateorSoftStartRamp = other.SetPointRampRateorSoftStartRamp;
      }
      if (other.SetPointControlOutputRate != 0D) {
        SetPointControlOutputRate = other.SetPointControlOutputRate;
      }
      if (other.ControlOutputType != 0D) {
        ControlOutputType = other.ControlOutputType;
      }
      if (other.SsrControlOutputType != 0D) {
        SsrControlOutputType = other.SsrControlOutputType;
      }
      if (other.OutputOnOffHysteresisValue != 0D) {
        OutputOnOffHysteresisValue = other.OutputOnOffHysteresisValue;
      }
      if (other.ProcessVariableSamplingRate != 0D) {
        ProcessVariableSamplingRate = other.ProcessVariableSamplingRate;
      }
      if (other.PvInputFilterFactorMode != 0D) {
        PvInputFilterFactorMode = other.PvInputFilterFactorMode;
      }
      if (other.OutputProportionalCycleTime != 0) {
        OutputProportionalCycleTime = other.OutputProportionalCycleTime;
      }
      if (other.AcHeatersHalfCycleTime != 0) {
        AcHeatersHalfCycleTime = other.AcHeatersHalfCycleTime;
      }
      if (other.ProportionalGain != 0D) {
        ProportionalGain = other.ProportionalGain;
      }
      if (other.PidActive != false) {
        PidActive = other.PidActive;
      }
      if (other.Epsilon != 0D) {
        Epsilon = other.Epsilon;
      }
    }

    [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 17: {
            OutputProportionalPowerLimit = input.ReadDouble();
            break;
          }
          case 25: {
            OutputProportionalBand = input.ReadDouble();
            break;
          }
          case 33: {
            IntegralTime = input.ReadDouble();
            break;
          }
          case 41: {
            DerivativeTime = input.ReadDouble();
            break;
          }
          case 49: {
            SensorCorrectionAdjustment = input.ReadDouble();
            break;
          }
          case 57: {
            SensorMinValue = input.ReadDouble();
            break;
          }
          case 65: {
            SensorMaxValue = input.ReadDouble();
            break;
          }
          case 73: {
            SetPointRampRateorSoftStartRamp = input.ReadDouble();
            break;
          }
          case 81: {
            SetPointControlOutputRate = input.ReadDouble();
            break;
          }
          case 89: {
            ControlOutputType = input.ReadDouble();
            break;
          }
          case 97: {
            SsrControlOutputType = input.ReadDouble();
            break;
          }
          case 105: {
            OutputOnOffHysteresisValue = input.ReadDouble();
            break;
          }
          case 113: {
            ProcessVariableSamplingRate = input.ReadDouble();
            break;
          }
          case 121: {
            PvInputFilterFactorMode = input.ReadDouble();
            break;
          }
          case 128: {
            OutputProportionalCycleTime = input.ReadInt32();
            break;
          }
          case 136: {
            AcHeatersHalfCycleTime = input.ReadInt32();
            break;
          }
          case 145: {
            ProportionalGain = input.ReadDouble();
            break;
          }
          case 152: {
            PidActive = input.ReadBool();
            break;
          }
          case 161: {
            Epsilon = input.ReadDouble();
            break;
          }
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code