添加自动退出检测线程停止以重新计时

This commit is contained in:
maqiao 2024-11-15 11:26:02 +08:00
parent 3c6b56f95e
commit 74829d0382
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@
<!-- 按处方还药或者按取药记录还药 1:处方ReturnDrugWindow22药品ReturnDrugWindow--> <!-- 按处方还药或者按取药记录还药 1:处方ReturnDrugWindow22药品ReturnDrugWindow-->
<add key="returnDrugMode" value="2" /> <add key="returnDrugMode" value="2" />
<!-- 自动退出时间单位秒为0时不自动退出 --> <!-- 自动退出时间单位秒为0时不自动退出 -->
<add key="autoExit" value="0"/> <add key="autoExit" value="5"/>
<!-- 无操作退出录像时间单位秒为0时不退出录像 --> <!-- 无操作退出录像时间单位秒为0时不退出录像 -->
<add key="stopRecord" value="180"/> <add key="stopRecord" value="180"/>

View File

@ -28,7 +28,7 @@ namespace DM_Weight.Views
public partial class HomeWindow : UserControl public partial class HomeWindow : UserControl
{ {
int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0"); int autoExit = Convert.ToInt32(ConfigurationManager.AppSettings["autoExit"] ?? "0");
System.Timers.Timer idleTimer; System.Timers.Timer idleTimer;//= new System.Timers.Timer(60000);
IEventAggregator _eventAggregator; IEventAggregator _eventAggregator;
public HomeWindow(IEventAggregator eventAggregator) public HomeWindow(IEventAggregator eventAggregator)
{ {
@ -57,6 +57,7 @@ namespace DM_Weight.Views
//logger.Info($"进入自动退出定时方法{allTrue}"); //logger.Info($"进入自动退出定时方法{allTrue}");
if (allTrue) if (allTrue)
{ {
idleTimer.Stop();
//无人操作,自动退出 //无人操作,自动退出
_eventAggregator.GetEvent<LoginOutEvent>().Publish(); _eventAggregator.GetEvent<LoginOutEvent>().Publish();
} }