/// <summary> /// Create server handles for new items. /// </summary> private void DoRead() { // fetch the new trend parameters. trendCtrl_.Update(mTrend_); // create item (if necessary). TsCHdaItem item = mTrend_.Items[mItem_]; if (item == null) { item = mTrend_.AddItem(mItem_); } // read data. TsCHdaItemValueCollection[] results = mTrend_.Read(new TsCHdaItem[] { item }); if (results == null || results.Length != 1) { ////throw new InvalidResponseException(); } // save results. mValues_ = results; // display results. valuesCtrl_.Initialize(mServer_, mValues_[0]); }
/// <summary> /// Create server handles for new items. /// </summary> private void DoRead() { // fetch the new trend parameters. TrendCTRL.Update(m_trend); // create item (if necessary). TsCHdaItem item = m_trend.Items[m_item]; if (item == null) { item = m_trend.AddItem(m_item); } // read data. TsCHdaItemValueCollection[] results = m_trend.Read(new TsCHdaItem[] { item }); if (results == null || results.Length != 1) { ////throw new InvalidResponseException(); } // save results. m_values = results; // display results. ValuesCTRL.Initialize(m_server, m_values[0]); }
/// <summary> /// Synchronously eads the values from the server. /// </summary> private TsCHdaItemValueCollection[] SyncRead(TsCHdaItem[] items) { switch (mType_) { // synchronous read raw or read processed. case RequestType.Read: { return(mTrend_.Read(items)); } // synchronous read raw. case RequestType.ReadRaw: { return(mTrend_.ReadRaw(items)); } // synchronous read processed. case RequestType.ReadProcessed: { return(mTrend_.ReadProcessed(items)); } // synchronous read modified. case RequestType.ReadModified: { return(mTrend_.ReadModified(items)); } // synchronous read at time. case RequestType.ReadAtTime: { return(mTrend_.ReadAtTime(items)); } } return(null); }