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 StatusBar statusBar;
|
||||||
private Statistic statistic;
|
private Statistic statistic;
|
||||||
|
|
||||||
|
|
||||||
public AIParkingApplicationForm()
|
public AIParkingApplicationForm()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
@ -11,6 +12,7 @@ namespace AIParkingApplication
|
||||||
private string webServerIP;
|
private string webServerIP;
|
||||||
private string doorAccessControlDeviceIP;
|
private string doorAccessControlDeviceIP;
|
||||||
private TimeSpan updateInterval;
|
private TimeSpan updateInterval;
|
||||||
|
private const string engineFilePath = @"\engine.bat";
|
||||||
|
|
||||||
public StatusBar(string webServerIP, string doorAccessControlDeviceIP, TimeSpan updateInterval)
|
public StatusBar(string webServerIP, string doorAccessControlDeviceIP, TimeSpan updateInterval)
|
||||||
{
|
{
|
||||||
|
@ -39,11 +41,18 @@ namespace AIParkingApplication
|
||||||
|
|
||||||
if (Process.GetProcessesByName("tmux").Length == 0)
|
if (Process.GetProcessesByName("tmux").Length == 0)
|
||||||
{
|
{
|
||||||
string engineBatFilePath = Application.StartupPath + @"\engine.bat";
|
if (File.Exists(engineFilePath))
|
||||||
|
{
|
||||||
|
string engineBatFilePath = Application.StartupPath + engineFilePath;
|
||||||
Util.ExecuteCommand(engineBatFilePath);
|
Util.ExecuteCommand(engineBatFilePath);
|
||||||
lblEngineStatus.UpdateLabel("DỪNG HOẠT ĐỘNG", Color.Red);
|
lblEngineStatus.UpdateLabel("DỪNG HOẠT ĐỘNG", Color.Red);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
lblEngineStatus.UpdateLabel("KHÔNG TÌM THẤY FILE", Color.Red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
lblEngineStatus.UpdateLabel("ĐANG HOẠT ĐỘNG", Color.Green);
|
lblEngineStatus.UpdateLabel("ĐANG HOẠT ĐỘNG", Color.Green);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user