|
|
@@ -1,4 +1,5 @@
|
|
|
-using CCDCount.DLL.SqlDataClass;
|
|
|
+using CCDCount.DLL.AlarmTools;
|
|
|
+using CCDCount.DLL.SqlDataClass;
|
|
|
using CCDCount.DLL.Tools;
|
|
|
using CCDCount.MODEL.CameraClass;
|
|
|
using CCDCount.MODEL.ConfigModel;
|
|
|
@@ -86,10 +87,12 @@ namespace CCDCount.DLL
|
|
|
{
|
|
|
if (!modbusTcpClient.Connect(ipAddress))
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage($"MianThread{cameraConfig.CamerNo}-Modbus通讯连接失败,目标IP:{ipAddress}");
|
|
|
+ //FaultLog.RecordErrorMessage($"MianThread{cameraConfig.CamerNo}-Modbus通讯连接失败,目标IP:{ipAddress}");
|
|
|
+ SystemAlarm.AlarmAlert(AlarmMessageList.PLC通讯连接失败, $"Modbus通讯连接失败,目标IP:{ipAddress}", "DLL:MainThreadClass-ConnectModbus");
|
|
|
return;
|
|
|
}
|
|
|
IsConnectModbus = true;
|
|
|
+ SystemAlarm.AlarmCancel(AlarmMessageList.PLC通讯连接失败);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -131,17 +134,21 @@ namespace CCDCount.DLL
|
|
|
cameraClass.GetCameraList(out List<CameraInfoClass> list);
|
|
|
if (list.Count == 0)
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage(string.Format("{0}:没有相机", "MainThreadClass-StartMianThread"));
|
|
|
+ //FaultLog.RecordErrorMessage(string.Format("{0}:没有相机", "MainThreadClass-StartMianThread"));
|
|
|
+ SystemAlarm.AlarmAlert(AlarmMessageList.未检测到相机, "未检测到相机", "DLL:MainThreadClass-LoadCamera");
|
|
|
// 如果没有相机,则退出
|
|
|
return result;
|
|
|
}
|
|
|
+ SystemAlarm.AlarmCancel(AlarmMessageList.未检测到相机);
|
|
|
// 加载相机
|
|
|
// cameraClass.LoadCamereDevice(list.First().DeviceSN);
|
|
|
if (!cameraClass.LoadCamereDevice(cameraConfig))
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage(string.Format("{0}:相机加载失败", "MainThreadClass-StartMianThread"));
|
|
|
+ //FaultLog.RecordErrorMessage(string.Format("{0}:相机加载失败", "MainThreadClass-StartMianThread"));
|
|
|
+ SystemAlarm.AlarmAlert(AlarmMessageList.相机加载失败, "相机加载失败", "DLL:MainThreadClass-LoadCamera");
|
|
|
return result;
|
|
|
}
|
|
|
+ SystemAlarm.AlarmCancel(AlarmMessageList.相机加载失败);
|
|
|
CameraConfigIsChange = false;
|
|
|
}
|
|
|
catch(Exception ex)
|
|
|
@@ -666,10 +673,12 @@ namespace CCDCount.DLL
|
|
|
IsSwitch = false;
|
|
|
if (SwitchIdentifyImageThread != null && SwitchIdentifyImageThread.IsAlive)
|
|
|
SwitchIdentifyImageThread.Join();
|
|
|
+ SystemAlarm.AlarmCancel(AlarmMessageList.数据分配线程停止失败);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage("MainThreadClass-StopSwitchThread:Stop thread failed!, " + ex.Message);
|
|
|
+ SystemAlarm.AlarmAlert(AlarmMessageList.数据分配线程停止失败, "stop thread failed!, " + ex.Message, "DLL:MainThreadClass-StopSwitchThread");
|
|
|
+ //FaultLog.RecordErrorMessage("MainThreadClass-StopSwitchThread:Stop thread failed!, " + ex.Message);
|
|
|
Console.WriteLine("MainThreadClass-StopSwitchThread:Stop thread failed!, " + ex.Message);
|
|
|
throw;
|
|
|
}
|
|
|
@@ -730,10 +739,12 @@ namespace CCDCount.DLL
|
|
|
IsSend = true;
|
|
|
SendBottLogicMessageThread = new Thread(SendBottLogicMessageProcess);
|
|
|
SendBottLogicMessageThread.Start();
|
|
|
+ SystemAlarm.AlarmCancel(AlarmMessageList.结果发送线程启动失败);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage("MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message);
|
|
|
+ //FaultLog.RecordErrorMessage("MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message);
|
|
|
+ SystemAlarm.AlarmAlert(AlarmMessageList.结果发送线程启动失败, "MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message, "DLL:MainThreadClass-StartSendBottLogicMessageThread");
|
|
|
Console.WriteLine("MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message);
|
|
|
throw;
|
|
|
}
|
|
|
@@ -750,10 +761,12 @@ namespace CCDCount.DLL
|
|
|
if (SendBottLogicMessageThread != null && SendBottLogicMessageThread.IsAlive)
|
|
|
SendBottLogicMessageThread.Join();
|
|
|
//if (modbusTcpClient != null) modbusTcpClient.Disconnect();
|
|
|
+ SystemAlarm.AlarmCancel(AlarmMessageList.结果发送线程停止失败);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage("Start thread failed!, " + ex.Message);
|
|
|
+ //FaultLog.RecordErrorMessage("Start thread failed!, " + ex.Message);
|
|
|
+ SystemAlarm.AlarmAlert(AlarmMessageList.结果发送线程停止失败, "MianThread-StopSendBottLogicMessageThread:Stop thread failed!, " + ex.Message, "DLL:MainThreadClass-StopSendBottLogicMessageThread");
|
|
|
throw;
|
|
|
}
|
|
|
}
|
|
|
@@ -792,7 +805,7 @@ namespace CCDCount.DLL
|
|
|
{
|
|
|
if (!SendQueue.TryDequeue(out sendMessage))
|
|
|
{
|
|
|
- FaultLog.RecordErrorMessage("MainThreadClass-SendBottLogicMessageProcess-SendQueue.TryDequeue failed!");
|
|
|
+ //FaultLog.RecordErrorMessage("MainThreadClass-SendBottLogicMessageProcess-SendQueue.TryDequeue failed!");
|
|
|
}
|
|
|
}
|
|
|
if (sendMessage != 0)
|