StatusBar - Remove updateInterval
This commit is contained in:
parent
50301189d8
commit
728f65cd90
|
@ -40,7 +40,7 @@ namespace AIParkingApplication
|
|||
};
|
||||
Controls.Add(sidebar);
|
||||
|
||||
statusBar = new StatusBar("192.168.1.122", doorAccessControlDeviceIP, TimeSpan.FromSeconds(1))
|
||||
statusBar = new StatusBar("192.168.1.122", doorAccessControlDeviceIP)
|
||||
{
|
||||
Location = new Point(0, sidebar.Location.Y + sidebar.Height + 26),
|
||||
Anchor = AnchorStyles.Bottom | AnchorStyles.Left
|
||||
|
|
|
@ -11,17 +11,15 @@ namespace AIParkingApplication
|
|||
{
|
||||
private string webServerIP;
|
||||
private string doorAccessControlDeviceIP;
|
||||
private TimeSpan updateInterval;
|
||||
private const string engineFilePath = @"\engine.bat";
|
||||
private Thread updateInfoThread;
|
||||
|
||||
public StatusBar(string webServerIP, string doorAccessControlDeviceIP, TimeSpan updateInterval)
|
||||
public StatusBar(string webServerIP, string doorAccessControlDeviceIP)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.webServerIP = webServerIP;
|
||||
this.doorAccessControlDeviceIP = doorAccessControlDeviceIP;
|
||||
this.updateInterval = updateInterval;
|
||||
updateInfoThread = new Thread(new ThreadStart(UpdateStatus)) { IsBackground = true };
|
||||
updateInfoThread = new Thread(UpdateStatus) { IsBackground = true };
|
||||
}
|
||||
|
||||
private void UpdateStatus()
|
||||
|
@ -56,7 +54,7 @@ namespace AIParkingApplication
|
|||
lblEngineStatus.UpdateLabel("ĐANG HOẠT ĐỘNG", Color.Green);
|
||||
}
|
||||
}
|
||||
Thread.Sleep(updateInterval);
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user