public void RefreshFromEvents(OPCController opcgroup) { for (int opcIndex = 1; opcIndex < opcgroup.TotalItemNumber + 1; opcIndex++) { string tag = opcgroup.GetTagName(opcIndex); int index = SearchTag(tag); if (index > -1) { InternalTag dt = Values[index]; if (Convert.ToInt32(dt.LastValue) != Convert.ToInt32(dt.Value)) { dt.LastValue = dt.Value; dt.Activated = Convert.ToInt32(dt.Value) > 0; dt.Deactivated = !dt.Activated; } else { if (dt.Activated) { dt.LastValue = 0; dt.Value = 0; dt.Activated = false; dt.Deactivated = true; } else { dt.Deactivated = false; } } Values[index] = dt; } } }
public void RefreshFromGroup(OPCController opcgroup) { for (int index = 1; index < opcgroup.TotalItemNumber + 1; index++) { for (int i = 0; i < Values.Count; i++) { InternalTag dt = Values[i]; if (dt.Tag == opcgroup.GetTagName(index)) { dt.Value = opcgroup.GetTagValue(dt.Tag); dt.Activated = opcgroup.Activated(dt.Tag); dt.Deactivated = opcgroup.Deactivated(dt.Tag); } Values[i] = dt; } } }