Пример #1
0
        public int CompareTo(Subscription sub)
        {
            var cmpPLCName = PLCName.CompareTo(sub.PLCName);

            if (cmpPLCName == 0)
            {
                return(TagAddress.CompareTo(sub.TagAddress));
            }
            return(cmpPLCName);
        }
Пример #2
0
        public Boolean AddItem(string newTag, string newAddress, string newDescprition, string newPLCName = null)
        {
            TotalItemNumber++;
            opcgrp_arrayPaths     = ResizeArray(opcgrp_arrayPaths, TotalItemNumber + 1);
            opcgrp_arrayHandles   = ResizeArray(opcgrp_arrayHandles, TotalItemNumber + 1);
            opcgrp_itemVar        = ResizeArray(opcgrp_itemVar, TotalItemNumber + 1);
            opcgrp_arrayValues    = ResizeArray(opcgrp_arrayValues, TotalItemNumber + 1);
            opcgrp_arrayErrors    = ResizeArray(opcgrp_arrayErrors, TotalItemNumber + 1);
            opcgrp_arraySHandles  = ResizeArray(opcgrp_arraySHandles, TotalItemNumber + 1);
            opcgrp_arrayQualities = ResizeArray(opcgrp_arrayQualities, TotalItemNumber + 1);
            OPCItems itemV;

            itemV = new OPCItems
            {
                Tag         = newTag.Trim(),
                Address     = newAddress.Trim(),
                Description = newDescprition.Trim(),
                PLCName     = newPLCName == null?PLCName.Trim() : newPLCName.Trim()
            };
            opcgrp_arrayHandles.SetValue(TotalItemNumber, TotalItemNumber);
            opcgrp_itemVar.SetValue(itemV, TotalItemNumber);
            opcgrp_arrayPaths.SetValue(newPLCName.Trim() + newAddress.Trim(), TotalItemNumber);
            return(true);
        }