StatusBar - Check file engine.bat exist
This commit is contained in:
parent
b441c2d70a
commit
3d08edea71
|
@ -13,7 +13,6 @@ namespace AIParkingApplication
|
|||
private StatusBar statusBar;
|
||||
private Statistic statistic;
|
||||
|
||||
|
||||
public AIParkingApplicationForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
@ -11,6 +12,7 @@ namespace AIParkingApplication
|
|||
private string webServerIP;
|
||||
private string doorAccessControlDeviceIP;
|
||||
private TimeSpan updateInterval;
|
||||
private const string engineFilePath = @"\engine.bat";
|
||||
|
||||
public StatusBar(string webServerIP, string doorAccessControlDeviceIP, TimeSpan updateInterval)
|
||||
{
|
||||
|
@ -39,9 +41,16 @@ namespace AIParkingApplication
|
|||
|
||||
if (Process.GetProcessesByName("tmux").Length == 0)
|
||||
{
|
||||
string engineBatFilePath = Application.StartupPath + @"\engine.bat";
|
||||
Util.ExecuteCommand(engineBatFilePath);
|
||||
lblEngineStatus.UpdateLabel("DỪNG HOẠT ĐỘNG", Color.Red);
|
||||
if (File.Exists(engineFilePath))
|
||||
{
|
||||
string engineBatFilePath = Application.StartupPath + engineFilePath;
|
||||
Util.ExecuteCommand(engineBatFilePath);
|
||||
lblEngineStatus.UpdateLabel("DỪNG HOẠT ĐỘNG", Color.Red);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblEngineStatus.UpdateLabel("KHÔNG TÌM THẤY FILE", Color.Red);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user