/// <summary> /// Prompts the user to specify values to insert for an item. /// </summary> public bool ShowDialog(TsCHdaServer server, OpcItem item, bool synchronous) { if (server == null) throw new ArgumentNullException("server"); mServer_ = server; mSynchronous_ = synchronous; mItem_ = item; mValues_ = null; mResults_ = null; // create new trend. mTrend_ = new TsCHdaTrend(mServer_); // set reasonable defaults. mTrend_.StartTime = new TsCHdaTime("YEAR"); mTrend_.EndTime = new TsCHdaTime("YEAR+1H"); browseCtrl_.Browse(mServer_, null); valuesCtrl_.Initialize(mServer_, null); resultsCtrl_.Initialize(mServer_, mValues_, mResults_); asyncResultsCtrl_.Initialize(mServer_, null); // update dialog state. SetState(); // show dialog. bool result = (ShowDialog() == DialogResult.OK); // release item handles. mTrend_.ClearItems(); // return dialog result. return result; }
/// <summary> /// Prompts the user to select attributes to read for an item. /// </summary> public TsCHdaItemAttributeCollection ShowDialog( TsCHdaServer server, OpcItem item, TsCHdaTime startTime, TsCHdaTime endTime, bool synchronous) { if (server == null) { throw new ArgumentNullException("server"); } m_server = server; m_item = item; m_fixedItem = item != null; m_synchronous = synchronous; m_results = null; // create new trend. m_trend = new TsCHdaTrend(m_server); // set reasonable defaults. m_trend.StartTime = startTime; m_trend.EndTime = endTime; BrowseCTRL.Browse(m_server, null); TrendCTRL.Initialize(m_trend, RequestType.ReadAttributes); AttributesCTRL.Initialize(m_server, null); ResultsCTRL.Initialize(m_server, m_results); AsyncResultsCTRL.Initialize(m_server, null); // update dialog state. SetState(); // show dialog. bool result = (ShowDialog() == DialogResult.OK); // release item handles. m_trend.ClearItems(); // return item values. return((result)?m_results:null); }
/// <summary> /// Prompts the user to select attributes to read for an item. /// </summary> public TsCHdaItemAttributeCollection ShowDialog( TsCHdaServer server, OpcItem item, TsCHdaTime startTime, TsCHdaTime endTime, bool synchronous) { if (server == null) { throw new ArgumentNullException("server"); } mServer_ = server; mItem_ = item; mFixedItem_ = item != null; mSynchronous_ = synchronous; mResults_ = null; // create new trend. mTrend_ = new TsCHdaTrend(mServer_); // set reasonable defaults. mTrend_.StartTime = startTime; mTrend_.EndTime = endTime; browseCtrl_.Browse(mServer_, null); trendCtrl_.Initialize(mTrend_, RequestType.ReadAttributes); attributesCtrl_.Initialize(mServer_, null); resultsCtrl_.Initialize(mServer_, mResults_); asyncResultsCtrl_.Initialize(mServer_, null); // update dialog state. SetState(); // show dialog. bool result = (ShowDialog() == DialogResult.OK); // release item handles. mTrend_.ClearItems(); // return item values. return((result)?mResults_:null); }
/// <summary> /// Prompts the user to select an item and specify trend properties. /// </summary> public TsCHdaResultCollection[] ShowDialog(TsCHdaServer server, RequestType type, bool synchronous) { if (server == null) { throw new ArgumentNullException("server"); } m_server = server; m_type = type; m_synchronous = synchronous; m_singleItem = true; m_results = null; // create new trend. m_trend = new TsCHdaTrend(m_server); // set reasonable defaults. m_trend.StartTime = new TsCHdaTime("YEAR"); m_trend.EndTime = new TsCHdaTime("YEAR+1H"); BrowseCTRL.Browse(m_server, null); TrendItemsCTRL.Initialize(m_trend, false, null); TrendCTRL.Initialize(m_trend, type); ItemsCTRL.Initialize(null); ResultsCTRL.Initialize(m_server, null); AsyncResultsCTRL.Initialize(m_server, null); // update dialog state. SetState(); // show dialog. bool result = (ShowDialog() == DialogResult.OK); // release item handles. m_trend.ClearItems(); // return item values. return(m_results); }
/// <summary> /// Prompts the user to select an item and specify trend properties. /// </summary> public TsCHdaItemValueCollection ShowDialog(TsCHdaServer server, RequestType type, bool synchronous) { if (server == null) { throw new ArgumentNullException("server"); } mServer_ = server; mType_ = type; mSynchronous_ = synchronous; mSingleItem_ = true; mResults_ = null; // create new trend. mTrend_ = new TsCHdaTrend(mServer_); // set reasonable defaults. mTrend_.StartTime = new TsCHdaTime("YEAR"); mTrend_.EndTime = new TsCHdaTime("YEAR+1H"); browseCtrl_.Browse(mServer_, null); trendItemsCtrl_.Initialize(mTrend_, false, null); trendCtrl_.Initialize(mTrend_, type); itemsCtrl_.Initialize(null); resultsCtrl_.Initialize(mServer_, null); asyncResultsCtrl_.Initialize(mServer_, null); // update dialog state. SetState(); // show dialog. bool result = (ShowDialog() == DialogResult.OK); // release item handles. mTrend_.ClearItems(); // return item values. return((result)?mResults_[0]:null); }
/// <summary> /// Prompts the user to specify values to insert for an item. /// </summary> public bool ShowDialog(TsCHdaServer server, OpcItem item, bool replace, bool synchronous) { if (server == null) { throw new ArgumentNullException("server"); } m_server = server; m_replace = replace; m_synchronous = synchronous; m_item = item; m_values = null; m_results = null; // create new trend. m_trend = new TsCHdaTrend(m_server); // set reasonable defaults. m_trend.StartTime = new TsCHdaTime("YEAR"); m_trend.EndTime = new TsCHdaTime("YEAR+1H"); BrowseCTRL.Browse(m_server, null); ValuesCTRL.Initialize(m_server, null); ResultsCTRL.Initialize(m_server, m_values, m_results); AsyncResultsCTRL.Initialize(m_server, null); // update dialog state. SetState(); // show dialog. bool result = (ShowDialog() == DialogResult.OK); // release item handles. m_trend.ClearItems(); // return dialog result. return(result); }