diff --git a/SlnMesnac.Business/ProdCompletionBusiness.cs b/SlnMesnac.Business/ProdCompletionBusiness.cs
index a357427..6974b36 100644
--- a/SlnMesnac.Business/ProdCompletionBusiness.cs
+++ b/SlnMesnac.Business/ProdCompletionBusiness.cs
@@ -54,6 +54,8 @@ namespace SlnMesnac.Business
private FJ500Comm.FJ500SP fj500s = new FJ500Comm.FJ500SP();
//喷码机喷码失败或者设备状态检查重试次数
private int PmTryAmount = 0;
+ //喷码机心跳,每次收到回复刷新时间,如果超过1分钟,则认为喷码机断开连接,添加一条报警
+ private DateTime PmHeartTime = DateTime.Now;
private readonly IMesProductPlanService _mesProductPlanService;
private readonly IMesProductOrderService _mesProductOrderService;
private readonly IMesPrdBarCodeService _barCodeTaskService;
@@ -135,6 +137,15 @@ namespace SlnMesnac.Business
_logger.LogError("checkStatus异常:" + ex.Message);
}
Thread.Sleep(1000 * 30);
+
+ if (DateTime.Now - PmHeartTime > TimeSpan.FromMinutes(2))
+ {
+ //报警
+ _logger.LogError("====================喷码机通讯心跳失败预警,推送报警");
+ AddAlarm(WarnStatusEnum.喷码机设备状态检查故障或者喷印失败预警超过30次);
+ PmTryAmount++;
+
+ }
}
});
}
@@ -149,6 +160,7 @@ namespace SlnMesnac.Business
///
private void PmCodeHandler(string str)
{
+ PmHeartTime = DateTime.Now;
try
{
int LastTryAmount = PmTryAmount;
diff --git a/SlnMesnac.Business/ProdMgmtBusiness.cs b/SlnMesnac.Business/ProdMgmtBusiness.cs
index e8fa77d..9bbac2a 100644
--- a/SlnMesnac.Business/ProdMgmtBusiness.cs
+++ b/SlnMesnac.Business/ProdMgmtBusiness.cs
@@ -84,10 +84,12 @@ namespace SlnMesnac.Business
_mesPrdBarCodeService = serviceProvider.GetRequiredService();
_configInfoBusiness = configInfoBusiness;
-
+
}
+
+
public void TestTran()
{
diff --git a/SlnMesnac.Serilog/SerilogExtensions.cs b/SlnMesnac.Serilog/SerilogExtensions.cs
index d65e0b6..6f9b303 100644
--- a/SlnMesnac.Serilog/SerilogExtensions.cs
+++ b/SlnMesnac.Serilog/SerilogExtensions.cs
@@ -46,9 +46,9 @@ namespace SlnMesnac.Serilog
#endregion
Log.Logger = new LoggerConfiguration().MinimumLevel.Information().WriteTo.Console()
- .WriteTo.File(Path.Combine(logPath, "Info.log"), LogEventLevel.Information, fileSizeLimitBytes: 5 * 1024)
- .WriteTo.File(Path.Combine(logPath, "Error.log"), LogEventLevel.Error, fileSizeLimitBytes: 5 * 1024)
- .WriteTo.File(Path.Combine(logPath, "Warn.log"), LogEventLevel.Warning, fileSizeLimitBytes: 5 * 1024)
+ .WriteTo.File(Path.Combine(logPath, "Info.log"), LogEventLevel.Information)
+ .WriteTo.File(Path.Combine(logPath, "Error.log"), LogEventLevel.Error)
+ .WriteTo.File(Path.Combine(logPath, "Warn.log"), LogEventLevel.Warning)
//.WriteTo.File(Path.Combine(logPath, "Debug.log"), LogEventLevel.Debug, fileSizeLimitBytes: 5 * 1024)
.CreateLogger();
app.UseSerilogRequestLogging();
diff --git a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs
index d861802..daf3a3d 100644
--- a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs
+++ b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs
@@ -238,7 +238,6 @@ namespace SlnMesnac.WPF.Page
}
-
///
/// OEE璁惧鍏虫満閲囬泦
///