Пример #1
0
        public VSPair AddVSPair(double Value,
                                string Status,
                                ePairControlUse ControlUse,
                                string Graphic = null,
                                ePairStatusControl Status_Control = ePairStatusControl.Both
                                )
        {
            var svPair = new VSPair(Status_Control)
            {
                PairType      = VSVGPairType.SingleValue,
                Value         = Value,
                Status        = Status,
                ControlUse    = ControlUse,
                Render        = Enums.CAPIControlType.Button,
                IncludeValues = true
            };

            bool ret = hs.DeviceVSP_AddPair(RefId, svPair);

            if (Graphic != null)
            {
                var vgPair = new VGPair();
                vgPair.PairType  = VSVGPairType.SingleValue;
                vgPair.Set_Value = Value;
                vgPair.Graphic   = Graphic;
                ret = hs.DeviceVGP_AddPair(RefId, vgPair);
            }
            return(svPair);
        }
Пример #2
0
        public VSPair AddVSRangePair(double Start,
                                     double End,
                                     string Prefix                     = "",
                                     string Suffix                     = "",
                                     int RangeStatusDecimals           = 0,
                                     ePairControlUse ControlUse        = ePairControlUse.Not_Specified,
                                     CAPIControlType ControlType       = CAPIControlType.ValuesRange,
                                     string Graphic                    = null,
                                     ePairStatusControl Status_Control = ePairStatusControl.Both
                                     )
        {
            var svPair = new VSPair(Status_Control)
            {
                PairType            = VSVGPairType.Range,
                RangeStart          = Start,
                RangeEnd            = End,
                ControlUse          = ControlUse,
                Render              = ControlType,
                IncludeValues       = true,
                RangeStatusPrefix   = Prefix,
                RangeStatusSuffix   = Suffix,
                RangeStatusDecimals = RangeStatusDecimals
            };

            bool ret = hs.DeviceVSP_AddPair(RefId, svPair);

            if (Graphic != null)
            {
                var vgPair = new VGPair();
                vgPair.PairType   = VSVGPairType.Range;
                vgPair.RangeStart = Start;
                vgPair.RangeEnd   = End;
                vgPair.Graphic    = Graphic;
                ret = hs.DeviceVGP_AddPair(RefId, vgPair);
            }
            return(svPair);
        }