Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemWrapper"/> class.
 /// </summary>
 /// <param name="item">The item.</param>
 public ItemWrapper(OpcDa.ItemResult item)
     : this()
 {
     m_Item = item;
     if (m_Item.ResultID.Failed())
     {
         m_Item.ClientHandle = Guid.NewGuid();
     }
 }
 /// <summary>
 /// Modifies the items.
 /// </summary>
 /// <param name="masks">The masks.</param>
 /// <param name="items">The items.</param>
 /// <returns>Results <see cref="OpcDa.ItemResult"/></returns>
 internal OpcDa.ItemResult[] ModifyItems(OpcDa::StateMask masks, OpcDa::Item[] items)
 {
     if (Tag != null)
     {
         Tag.SetResultFilters((int)OpcDa.ResultFilter.All);
         return(Tag.ModifyItems((int)masks, items));
     }
     else
     {
         OpcDa.ItemResult[] ret = new OpcDa.ItemResult[items.Length];
         for (int i = 0; i < items.Length; i++)
         {
             ret[i] = new OpcDa.ItemResult(items[0])
             {
                 ResultID = Opc.ResultID.S_OK
             }
         }
         ;
         return(ret);
     }
 }
Example #3
0
 /// <summary>
 /// Adds a set of items to a subscription.
 /// </summary>
 protected virtual void DoAddItems()
 {
     // assign globally unique client handle.
     OpcDa.Item[]       items   = m_ItemsCTRL.GetItems();
     OpcDa.ItemResult[] results = new OpcDa.ItemResult[items.Length];
     for (int ix = 0; ix < items.Length; ix++)
     {
         items[ix].ClientHandle = Guid.NewGuid();
         results[ix]            = new global::Opc.Da.ItemResult(items[ix]);
         results[ix].ResultID   = Opc.ResultID.S_OK;
     }
     GetItems = items;
     // move to add items panel.
     BackBTN.Enabled       = true;
     NextBTN.Visible       = false;
     DoneBTN.Visible       = true;
     OptionsBTN.Visible    = false;
     m_BrowseCTRL.Visible  = false;
     m_ItemsCTRL.Visible   = false;
     m_ResultsCTRL.Visible = true;
     // update controls with actual values.
     m_ResultsCTRL.Initialize(results);
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemWrapper"/> class.
 /// </summary>
 /// <param name="row">The row representing the Item.</param>
 public ItemWrapper(OPCCliConfiguration.ItemsRow row)
     : this()
 {
     m_Item = new PrivateItem(row);
     GetLastDBIdentifier = row.ID;
 }