public VariableGrid(VariableGrid tocopy) { this.VarNameID = tocopy.VarNameID; this.Type = tocopy.Type; this.ConnectedtoChannel = tocopy.ConnectedtoChannel; this.AEB = tocopy.AEB; this.ALB = tocopy.ALB; this.SampleTime = tocopy.SampleTime; this.RTT = tocopy.RTT; this.Interval = tocopy.Interval; this.Archive = tocopy.Archive; this.ArchiveInterval = tocopy.ArchiveInterval; foreach (AlarmObject alarmobject in tocopy.m_AlarmCollection) { AlarmObject _alarmobject = new AlarmObject(); //_alarmobject.StatusBit = alarmobject.StatusBit; _alarmobject.ID = alarmobject.ID; _alarmobject.VarNameID = alarmobject.VarNameID; _alarmobject.StatusBit = (AlarmStatusBit)alarmobject.StatusBit; _alarmobject.Type = (AlarmGroupType)alarmobject.Type; _alarmobject._IAlarmGroup = _alarmobject.InitAlarmGroup(alarmobject._IAlarmGroup.ID); //_alarmobject._IAlarmGroup = alarmobject._IAlarmGroup; _alarmobject.EnableTagID = alarmobject.EnableTagID; _alarmobject.EnableTagDirection = alarmobject.EnableTagDirection; _alarmobject.EnableTagDelayOn = alarmobject.EnableTagDelayOn; _alarmobject.EnableTagDealyOff = alarmobject.EnableTagDealyOff; _alarmobject.DelayOn = alarmobject.DelayOn; _alarmobject.DelayOff = alarmobject.DelayOff; _alarmobject.SourceAlarmTagID = alarmobject.SourceAlarmTagID; _alarmobject.FirstOutGroupID = alarmobject.FirstOutGroupID; _alarmobject.hysteresis = alarmobject.hysteresis; _alarmobject.UpperLevelGroupID = alarmobject.UpperLevelGroupID; this.m_AlarmCollection.Add(_alarmobject); } }
public void CopyVariableGrid(VariableGrid tocopy) { this.VarName = tocopy.VarName; this.VarNameID = tocopy.VarNameID; this.pouID = tocopy.pouID; this.Description = tocopy.Description; this.InitialVal = tocopy.InitialVal; this.Type = tocopy.Type; this.Option = (int)tocopy.Option; this.PlantStructureID = tocopy.PlantStructureID; this.DispalyID = tocopy.DispalyID; this.AEB = tocopy.AEB; this.ALB = tocopy.ALB; this.SampleTime = tocopy.SampleTime; this.RTT = tocopy.RTT; this.Interval = tocopy.Interval; this.Archive = tocopy.Archive; this.ArchiveInterval = tocopy.ArchiveInterval; bool found = false; tblAlarm tblaralm; int count = m_tblAlarmCollection.Count; for (int i = count - 1; i >= 0; i--) { found = false; tblaralm = m_tblAlarmCollection[i]; foreach (AlarmObject alarmobject in tocopy.m_AlarmCollection) { if (tblaralm.ID == alarmobject.ID) { found = true; break; } } if (!found) { tblaralm.Delete(); m_tblAlarmCollection.Remove(tblaralm); } } foreach (AlarmObject alarmobject in tocopy.m_AlarmCollection) { if (alarmobject.ID == -1) { tblAlarm tblalarm = new tblAlarm(); tblalarm.AlarmObjectCopy(alarmobject); tblalarm.Insert(); m_tblAlarmCollection.Add(tblalarm); } else { foreach (tblAlarm tblalarm in m_tblAlarmCollection) { if (tblalarm.ID == alarmobject.ID) { tblalarm.AlarmObjectCopy(alarmobject); tblalarm.Update(); } } } } }
public AlarmCollection(VariableGrid _parent) { _VarNameID_VariableGrid = _parent; }