public Trend(Opc.Hda.Server server) { this.m_server = null; this.m_name = null; this.m_aggregateID = 0; this.m_startTime = null; this.m_endTime = null; this.m_maxValues = 0; this.m_includeBounds = false; this.m_resampleInterval = 0M; this.m_timestamps = new ItemTimeCollection(); this.m_items = new ItemCollection(); this.m_updateInterval = 0M; this.m_playbackInterval = 0M; this.m_playbackDuration = 0M; this.m_subscription = null; this.m_playback = null; if (server == null) { throw new ArgumentNullException("server"); } this.m_server = server; do { this.Name = string.Format("Trend{0,2:00}", ++m_count); }while (this.m_server.Trends[this.Name] != null); }
public ItemTimeCollection(ItemTimeCollection item) : base(item) { this.m_times = new ArrayList(); this.m_times = new ArrayList(item.m_times.Count); foreach (DateTime time in item.m_times) { this.m_times.Add(time); } }
public override object Clone() { ItemTimeCollection times = (ItemTimeCollection)base.Clone(); times.m_times = new ArrayList(this.m_times.Count); foreach (DateTime time in this.m_times) { times.m_times.Add(time); } return(times); }
public IdentifiedResult[] DeleteAtTime(Item[] items, object requestHandle, UpdateCompleteEventHandler callback, out IRequest request) { ItemTimeCollection[] timesArray = new ItemTimeCollection[items.Length]; for (int i = 0; i < items.Length; i++) { timesArray[i] = (ItemTimeCollection)this.Timestamps.Clone(); timesArray[i].ItemName = items[i].ItemName; timesArray[i].ItemPath = items[i].ItemPath; timesArray[i].ClientHandle = items[i].ClientHandle; timesArray[i].ServerHandle = items[i].ServerHandle; } return(this.m_server.DeleteAtTime(timesArray, requestHandle, callback, out request)); }
public ResultCollection[] DeleteAtTime(Item[] items) { ItemTimeCollection[] timesArray = new ItemTimeCollection[items.Length]; for (int i = 0; i < items.Length; i++) { timesArray[i] = (ItemTimeCollection)this.Timestamps.Clone(); timesArray[i].ItemName = items[i].ItemName; timesArray[i].ItemPath = items[i].ItemPath; timesArray[i].ClientHandle = items[i].ClientHandle; timesArray[i].ServerHandle = items[i].ServerHandle; } return(this.m_server.DeleteAtTime(timesArray)); }
protected Trend(SerializationInfo info, StreamingContext context) { this.m_server = null; this.m_name = null; this.m_aggregateID = 0; this.m_startTime = null; this.m_endTime = null; this.m_maxValues = 0; this.m_includeBounds = false; this.m_resampleInterval = 0M; this.m_timestamps = new ItemTimeCollection(); this.m_items = new ItemCollection(); this.m_updateInterval = 0M; this.m_playbackInterval = 0M; this.m_playbackDuration = 0M; this.m_subscription = null; this.m_playback = null; this.m_name = (string)info.GetValue("Name", typeof(string)); this.m_aggregateID = (int)info.GetValue("AggregateID", typeof(int)); this.m_startTime = (Time)info.GetValue("StartTime", typeof(Time)); this.m_endTime = (Time)info.GetValue("EndTime", typeof(Time)); this.m_maxValues = (int)info.GetValue("MaxValues", typeof(int)); this.m_includeBounds = (bool)info.GetValue("IncludeBounds", typeof(bool)); this.m_resampleInterval = (decimal)info.GetValue("ResampleInterval", typeof(decimal)); this.m_updateInterval = (decimal)info.GetValue("UpdateInterval", typeof(decimal)); this.m_playbackInterval = (decimal)info.GetValue("PlaybackInterval", typeof(decimal)); this.m_playbackDuration = (decimal)info.GetValue("PlaybackDuration", typeof(decimal)); DateTime[] timeArray = (DateTime[])info.GetValue("Timestamps", typeof(DateTime[])); if (timeArray != null) { foreach (DateTime time in timeArray) { this.m_timestamps.Add(time); } } Item[] itemArray = (Item[])info.GetValue("Items", typeof(Item[])); if (itemArray != null) { foreach (Item item in itemArray) { this.m_items.Add(item); } } }