mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 18:05:40 +02:00
Performance upgrade - status icons reloaded only when really needed
This commit is contained in:
@@ -7,6 +7,10 @@ internal class Globals
|
|||||||
public static string[] arrLogHistory = new string[10]; // Log history for GUI
|
public static string[] arrLogHistory = new string[10]; // Log history for GUI
|
||||||
public static bool bLogHistoryUpdate = true; // Mark if log control require update
|
public static bool bLogHistoryUpdate = true; // Mark if log control require update
|
||||||
public static string strPerunTitleText = "";
|
public static string strPerunTitleText = "";
|
||||||
|
|
||||||
|
public static bool bdcConnection = false; // Historic db connection status
|
||||||
|
public static bool btcpcServer = false; // Historic tcp connection status
|
||||||
|
public static bool bSRSStatus = false; // Historic srs connection status
|
||||||
|
public static bool bLotATCStatus = false; // Historic lotatc connection status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -367,38 +367,51 @@ namespace Perun_v1
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update status icons at main form
|
// Update status icons at main form
|
||||||
if (dcConnection.bStatus)
|
if (dcConnection.bStatus != Globals.bdcConnection) {
|
||||||
{
|
if (dcConnection.bStatus)
|
||||||
con_img_db.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_db");
|
{
|
||||||
} else
|
con_img_db.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_db");
|
||||||
{
|
} else
|
||||||
con_img_db.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
{
|
||||||
|
con_img_db.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
||||||
|
}
|
||||||
|
Globals.bdcConnection = dcConnection.bStatus;
|
||||||
}
|
}
|
||||||
if (tcpcServer.bStatus)
|
|
||||||
{
|
if (tcpcServer.bStatus != Globals.btcpcServer) {
|
||||||
con_img_dcs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_game");
|
if (tcpcServer.bStatus)
|
||||||
|
{
|
||||||
|
con_img_dcs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_game");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
con_img_dcs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
||||||
|
}
|
||||||
|
Globals.btcpcServer = tcpcServer.bStatus;
|
||||||
}
|
}
|
||||||
else
|
if (bSRSStatus != Globals.bSRSStatus) {
|
||||||
{
|
if (bSRSStatus)
|
||||||
con_img_dcs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
{
|
||||||
|
con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_srs");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{;
|
||||||
|
con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
||||||
|
}
|
||||||
|
Globals.bSRSStatus = bSRSStatus;
|
||||||
}
|
}
|
||||||
if (bSRSStatus)
|
if (bLotATCStatus != Globals.bLotATCStatus)
|
||||||
{
|
{
|
||||||
con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_srs");
|
if (bLotATCStatus)
|
||||||
|
{
|
||||||
|
con_img_lotATC.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_lotatc");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
con_img_lotATC.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
||||||
|
}
|
||||||
|
Globals.bLotATCStatus = bLotATCStatus;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
con_img_srs.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
|
||||||
}
|
|
||||||
if (bLotATCStatus)
|
|
||||||
{
|
|
||||||
con_img_lotATC.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_lotatc");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
con_img_lotATC.Image = (Image)Properties.Resources.ResourceManager.GetObject("ico_error");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user