Example #1
0
 private void onPingTimeoutChanged(cdeP obj)
 {
     MyBaseThing.DeclareSensorProperty(nameof(RoundTripTime), ePropertyTypes.TNumber, new cdeP.TheSensorMeta {
         RangeMin = 0, RangeMax = PingTimeOut, Units = "ms"
     });
     //MyBaseThing.DeclareSensorProperty(nameof(MyBaseThing.Value), ePropertyTypes.TNumber, new cdeP.TheSensorMeta { RangeMin = 0, RangeMax = PingTimeOut, Units = "ms" });
 }
Example #2
0
        public override bool Init()
        {
            if (!base.Init(false))
            {
                return(false);
            }
            MyBaseThing.LastMessage = "Ping ready";
            if (FailureLimit < 1)
            {
                FailureLimit = 1;
            }
            if (PingDelay == 0)
            {
                PingDelay = 3000;
            }
            if (PingTimeOut == 0)
            {
                PingTimeOut = 3000;
            }
            if (PingDelay < 1000)
            {
                PingDelay = 1000;
            }
            if (PingTimeOut < 50)
            {
                PingTimeOut = 50;
            }
            MyBaseThing.DeclareSensorProperty(nameof(RoundTripTime), ePropertyTypes.TNumber, new cdeP.TheSensorMeta {
                RangeMin = 0, RangeMax = PingTimeOut, Units = "ms"
            })
            .RegisterEvent(eThingEvents.PropertyChanged, onPingTimeoutChanged);
            if (AutoConnect)
            {
                Connect();
            }

            mIsInitialized = true;
            return(true);
        }
Example #3
0
 private void SinkRangeChanged(cdeP obj)
 {
     MyBaseThing.DeclareSensorProperty("Value", ePropertyTypes.TNumber, new cdeP.TheSensorMeta {
         RangeMax = Amplitude / 2 + Shift, RangeMin = Amplitude / 2 - Shift
     });
 }