Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OPCClientGroup"/> class.
        /// </summary>
        /// <param name="group">The group description from XML configuration file<see cref="OPCCliConfiguration.SubscriptionsRow"/>.</param>
        /// <param name="items">The table of items <see cref="OPCCliConfiguration.ItemsRow"/>.</param>
        /// <param name="server">Server that this group should belong to</param>
        /// <param name="parent">The parent.</param>
        /// <param name="volumeConstrain">The volume constrain.</param>
        private void OPCClientGroup
        (
            OPCCliConfiguration.SubscriptionsRow group,
            OPCCliConfiguration.ItemsRow[] items,
            OPC_Interface server,
            ref uint?volumeConstrain
        )
        {
            if (volumeConstrain.HasValue)
            {
                if (volumeConstrain.Value < items.Length)
                {
                    throw new LicenseException(typeof(DataBindingsManager), this, CAS.Lib.CodeProtect.Properties.Resources.Tx_LicVolumeConstrainErr);
                }
                else
                {
                    volumeConstrain = volumeConstrain.Value - Convert.ToUInt32(items.Length);
                }
            }
            SubscriptionState state = group.CreateSubscriptionState;

            OPC_Interface.OPCGroup m_OPCGroup;
            m_OPCGroup      = server.CreateOPCGroup((uint)group.ID, (uint)group.ID_server, group.Asynchronous, state);
            m_OPCGroup.Tags = Tags(items, server, m_OPCGroup);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="OPCClientGroup"/> class.
 /// </summary>
 /// <param name="group">The group description from XML configuration file<see cref="OPCCliConfiguration.SubscriptionsRow"/>.</param>
 /// <param name="items">The table of items <see cref="OPCCliConfiguration.ItemsRow"/>.</param>
 /// <param name="server">Server that this group should belong to</param>
 /// <param name="parent">The parent.</param>
 /// <param name="volumeConstrain">The volume constrain.</param>
 internal OPCClientGroup
   (
   OPCCliConfiguration.SubscriptionsRow group,
   OPCCliConfiguration.ItemsRow[] items,
   OPC_Interface server,
   OPCDataQueue parent,
   ref uint? volumeConstrain
   )
 {
   if ( volumeConstrain.HasValue )
     if ( volumeConstrain.Value < items.Length )
       throw new LicenseException( typeof( Main ), Main.MainComponent, CAS.Lib.CodeProtect.Properties.Resources.Tx_LicVolumeConstrainErr );
     else
       volumeConstrain = volumeConstrain.Value - Convert.ToUInt32( items.Length );
   OpcDa.SubscriptionState state = group.CreateSubscriptionState;
   m_OPCGroup = server.CreateOPCGroup( (uint)group.ID, (uint)group.ID_server, group.Asynchronous, state );
   m_OPCGroup.Tags = Tags( items, server, m_OPCGroup );
   m_AllGroups.Add( this );
 }