Exemplo n.º 1
0
        /// <summary>
        /// Returns a clone of the current SignalAlarmsProperties object
        /// </summary>
        /// <returns>Clone of the current SignalAlarmsProperties object</returns>
        public SignalAlarmsProperties Get_Clone()
        {
            SignalAlarmsProperties oClone = new SignalAlarmsProperties();

            oClone.Enabled = this.Enabled;

            oClone.WarningLimitMin.Enabled   = this.WarningLimitMin.Enabled;
            oClone.WarningLimitMin.Value     = this.WarningLimitMin.Value;
            oClone.WarningLimitMin.BackColor = this.WarningLimitMin.BackColor;
            oClone.WarningLimitMin.ForeColor = this.WarningLimitMin.ForeColor;

            oClone.WarningLimitMax.Enabled   = this.WarningLimitMax.Enabled;
            oClone.WarningLimitMax.Value     = this.WarningLimitMax.Value;
            oClone.WarningLimitMax.BackColor = this.WarningLimitMax.BackColor;
            oClone.WarningLimitMax.ForeColor = this.WarningLimitMax.ForeColor;

            oClone.AlarmLimitMin.Enabled   = this.AlarmLimitMin.Enabled;
            oClone.AlarmLimitMin.Value     = this.AlarmLimitMin.Value;
            oClone.AlarmLimitMin.BackColor = this.AlarmLimitMin.BackColor;
            oClone.AlarmLimitMin.ForeColor = this.AlarmLimitMin.ForeColor;

            oClone.AlarmLimitMax.Enabled   = this.AlarmLimitMax.Enabled;
            oClone.AlarmLimitMax.Value     = this.AlarmLimitMax.Value;
            oClone.AlarmLimitMax.BackColor = this.AlarmLimitMax.BackColor;
            oClone.AlarmLimitMax.ForeColor = this.AlarmLimitMax.ForeColor;

            return(oClone);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Convert a CANStream SignalAlarmsProperties class into a list of Ctrl_GraphWindow GraphReferenceLine class
        /// </summary>
        /// <param name="oSigAlarms">CANStream SignalAlarmsProperties object to convert</param>
        /// <returns>List of Ctrl_GraphWindow GraphReferenceLine class</returns>
        public static List <GraphReferenceLine> Convert_CSAlarmsToSerieReferenceLines(SignalAlarmsProperties oSigAlarms)
        {
            List <GraphReferenceLine> oSerieRefLines = new List <GraphReferenceLine>();

            if (oSigAlarms.Enabled)
            {
                GraphReferenceLine oLine;
                int iLineKey = 0;

                if (oSigAlarms.AlarmLimitMin.Enabled)
                {
                    oLine = GetSerieReferenceLineFromAlarm(oSigAlarms.AlarmLimitMin);
                    oLine.ReferenceTitle = "Alarm Min";
                    oLine.iKey           = iLineKey;
                    iLineKey++;

                    oSerieRefLines.Add(oLine);
                }

                if (oSigAlarms.AlarmLimitMax.Enabled)
                {
                    oLine = GetSerieReferenceLineFromAlarm(oSigAlarms.AlarmLimitMax);
                    oLine.ReferenceTitle = "Alarm Max";
                    oLine.iKey           = iLineKey;
                    iLineKey++;

                    oSerieRefLines.Add(oLine);
                }

                if (oSigAlarms.WarningLimitMin.Enabled)
                {
                    oLine = GetSerieReferenceLineFromAlarm(oSigAlarms.WarningLimitMin);
                    oLine.ReferenceTitle = "Warning Min";
                    oLine.iKey           = iLineKey;
                    iLineKey++;

                    oSerieRefLines.Add(oLine);
                }

                if (oSigAlarms.WarningLimitMax.Enabled)
                {
                    oLine = GetSerieReferenceLineFromAlarm(oSigAlarms.WarningLimitMax);
                    oLine.ReferenceTitle = "Warning Max";
                    oLine.iKey           = iLineKey;
                    iLineKey++;

                    oSerieRefLines.Add(oLine);
                }
            }

            return(oSerieRefLines);
        }