update mqttClient

This commit is contained in:
2248356998 qq.com
2023-05-12 16:40:55 +08:00
parent 676b25acf9
commit 02700b83eb

View File

@@ -372,15 +372,19 @@ public class MqttClient : UpLoadBase
_uploadVariables = tags;
_collectDevice= _globalCollectDeviceData.CollectDevices.Where(a => _uploadVariables.Select(b => b.DeviceId).Contains(a.Id)).ToList();
_collectDevice.ForEach(a =>
_collectDevice = _globalCollectDeviceData.CollectDevices.Where(a => _uploadVariables.Select(b => b.DeviceId).Contains(a.Id)).ToList();
if (!driverPropertys.IsInterval)
{
a.DeviceStatusCahnge += DeviceStatusCahnge;
});
_uploadVariables.ForEach(a =>
{
a.VariableValueChange += VariableValueChange;
});
_collectDevice.ForEach(a =>
{
a.DeviceStatusCahnge += DeviceStatusCahnge;
});
_uploadVariables.ForEach(a =>
{
a.VariableValueChange += VariableValueChange;
});
}
if (driverPropertys.UploadInterval <= 1000) driverPropertys.UploadInterval = 1000;
exTimerTick = new(driverPropertys.UploadInterval);