public HiLevComm(MqttClient _client, IControler _controler, SensData sensData_) { sensors = new Sensors(sensData_); controler = _controler; client = _client; StartTimer(OnTimeEvent, 10000); client.MqttMsgPublishReceived += Client_MqttMsgPublishReceived; client.Subscribe(new string[] { dataTopic }, new byte[] { MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE }); OnTimeEvent(null, null); }
public void getSensData(SensData data) { deviation_prev = deviation; deviation = val.HUM_expected - data.SoilSens; deviation = -deviation; Console.WriteLine($"dev {deviation}."); if (deviation < 0) { deviation = 0; } if (deviation < deviationTreshold && deviation > -deviationTreshold) { deviation = 0; } }
public Sensors(SensData data_) { data = data_; }