断连后重连交接柜时间间隔2s

This commit is contained in:
maqiao 2025-01-15 18:52:59 +08:00
parent 946fe26a17
commit 35270de250
3 changed files with 8 additions and 7 deletions

View File

@ -94,6 +94,7 @@ namespace DM_Weight.Port
{ {
if (i <= 3) if (i <= 3)
{ {
Thread.Sleep(1950);
//没连上会再连两次 //没连上会再连两次
SocketConnect(); SocketConnect();
} }

View File

@ -875,11 +875,11 @@ namespace DM_Weight.ViewModels
{ {
AlertMsg alertMsg = new AlertMsg AlertMsg alertMsg = new AlertMsg
{ {
Message = $"网口连接异常,正在重试{ex.Message}", Message = $"网口连接异常,开药箱正在重试{ex.Message}",
Type = MsgType.ERROR, Type = MsgType.ERROR,
}; };
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
logger.Info($"网口连接异常,正在重试{ex.Message}"); logger.Info($"网口连接异常,开药箱正在重试{ex.Message}");
return; return;
} }
_socketHelper.OpenStatus = true; _socketHelper.OpenStatus = true;
@ -939,11 +939,11 @@ namespace DM_Weight.ViewModels
// _socketHelper.OpenStatus = false; // _socketHelper.OpenStatus = false;
AlertMsg alertMsg = new AlertMsg AlertMsg alertMsg = new AlertMsg
{ {
Message = $"网口连接异常,正在重试{ex.Message}", Message = $"网口连接异常,查状态正在重试{ex.Message}",
Type = MsgType.ERROR, Type = MsgType.ERROR,
}; };
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
logger.Info($"网口连接异常,正在重试{ex.Message}"); logger.Info($"网口连接异常,查状态正在重试{ex.Message}");
next(); next();
} }
}); });

View File

@ -675,7 +675,7 @@ namespace DM_Weight.ViewModels
{ {
AlertMsg alertMsg = new AlertMsg AlertMsg alertMsg = new AlertMsg
{ {
Message = $"网口连接异常,正在重试{ex.Message}", Message = $"网口连接异常,开药箱正在重试{ex.Message}",
Type = MsgType.ERROR, Type = MsgType.ERROR,
}; };
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
@ -771,11 +771,11 @@ namespace DM_Weight.ViewModels
} }
AlertMsg alertMsg = new AlertMsg AlertMsg alertMsg = new AlertMsg
{ {
Message = $"网口连接异常,正在重试{ex.Message}", Message = $"网口连接异常,查状态正在重试{ex.Message}",
Type = MsgType.ERROR, Type = MsgType.ERROR,
}; };
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
logger.Info($"网口连接异常,正在重试{ex.Message}"); logger.Info($"网口连接异常,查状态正在重试{ex.Message}");
next(); next();
} }
}); });