if (ExcuteControl.GetInstance.mqttCollection.ContainsKey($"Stock{IpAddress.Split(".")[3].Substring(0,1)}") && ExcuteControl.GetInstance.mqttCollection[$"Stock{IpAddress.Split(".")[3].Substring(0, 1)}"]._mqttClient.IsConnected)
}), $"{DeviceName} 开始监听", true);
TaskManage.GetInstance.StartLong(new Action(() =>
{
Thread.Sleep(1000);
if (ExcuteControl.GetInstance.mqttCollection.ContainsKey($"Stock{IpAddress.Split(".")[3].Substring(0, 1)}") && ExcuteControl.GetInstance.mqttCollection[$"Stock{IpAddress.Split(".")[3].Substring(0, 1)}"]._mqttClient.IsConnected)
if (ExcuteControl.GetInstance.AliyunIsConnect && RTrig.GetInstance("stop1").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1))
try
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockJerk1StatusEvent", AliyunMaterialModelType.StockModel);
}
if (ExcuteControl.GetInstance.AliyunIsConnect && RTrig.GetInstance("Servo").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo))
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockServoFalutEvent", AliyunMaterialModelType.StockModel);
}
if (RTrig.GetInstance($"stop1:{IpAddress}").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1))
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockJerk1StatusEvent", AliyunMaterialModelType.StockModel);
}
if (RTrig.GetInstance($"Servo:{IpAddress}").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo))
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockServoFalutEvent", AliyunMaterialModelType.StockModel);
}
if (ExcuteControl.GetInstance.AliyunIsConnect && RTrig.GetInstance("EStop2").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2))
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockJerk2StatusEvent", AliyunMaterialModelType.StockModel);
}
if (ExcuteControl.GetInstance.AliyunIsConnect && RTrig.GetInstance("SiloUpperLimit").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit))
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockUpLimitEvent", AliyunMaterialModelType.StockModel);
if (RTrig.GetInstance($"EStop2:{IpAddress}").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2))
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockJerk2StatusEvent", AliyunMaterialModelType.StockModel);
}
if (RTrig.GetInstance($"SiloUpperLimit:{IpAddress}").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit))
{
if (DeviceName == "盐")
MessageNotify.GetInstance.ShowRunLog("料仓1 上限报警");
if (DeviceName == "A20")
MessageNotify.GetInstance.ShowRunLog("料仓2 上限报警");
if (DeviceName == "A30")
MessageNotify.GetInstance.ShowRunLog("料仓3 上限报警");
if (DeviceName == "A40")
MessageNotify.GetInstance.ShowRunLog("料仓4 上限报警");
if (DeviceName == "A50")
MessageNotify.GetInstance.ShowRunLog("料仓5 上限报警");
if (DeviceName == "A60")
MessageNotify.GetInstance.ShowRunLog("料仓6 上限报警");
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockUpLimitEvent", AliyunMaterialModelType.StockModel);
}
if (RTrig.GetInstance($"SiloLowerLimit:{IpAddress}").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit))
{
if (DeviceName == "盐")
MessageNotify.GetInstance.ShowRunLog("料仓1 下限报警");
if (DeviceName == "A20")
MessageNotify.GetInstance.ShowRunLog("料仓2 下限报警");
if (DeviceName == "A30")
MessageNotify.GetInstance.ShowRunLog("料仓3 下限报警");
if (DeviceName == "A40")
MessageNotify.GetInstance.ShowRunLog("料仓4 下限报警");
if (DeviceName == "A50")
MessageNotify.GetInstance.ShowRunLog("料仓5 下限报警");
if (DeviceName == "A60")
MessageNotify.GetInstance.ShowRunLog("料仓6 下限报警");
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockDownLimitEvent", AliyunMaterialModelType.StockModel);
}
}
if (ExcuteControl.GetInstance.AliyunIsConnect && RTrig.GetInstance("SiloLowerLimit").Start(AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit))
catch (Exception)
{
ExcuteControl.GetInstance.AliyunEventReport(IpAddress, new AliyunStockEventReportModel { Result = "1" }, "StockDownLimitEvent", AliyunMaterialModelType.StockModel);