Merged colours
This commit is contained in:
@@ -19,7 +19,7 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (WebDriverTimeoutException)
|
||||
{
|
||||
MainForm.Instance.AddToActionsList("Could not load web page " + url + "1. Check camera has no password set. " + Environment.NewLine + "2. If unable to fix speak to supervisor.");
|
||||
MainForm.Instance.AddToActionsList($"Could not load web page {Level.ERROR}" + url + $"1. Check camera has no password set. {Level.ERROR}" + Environment.NewLine + $"2. If unable to fix speak to supervisor.{Level.ERROR}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace AiQ_GUI
|
||||
|
||||
loginBtn.Click();
|
||||
|
||||
MainForm.Instance.AddToActionsList("Switched user and logged in.");
|
||||
MainForm.Instance.AddToActionsList($"Switched user and logged in.{Level.Success}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MainForm.Instance.AddToActionsList("SwitchUser failed: " + ex.Message);
|
||||
MainForm.Instance.AddToActionsList($"SwitchUser failed: {Level.ERROR}" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace AiQ_GUI
|
||||
ClickElementByID(elementID, driver, false);
|
||||
}
|
||||
|
||||
MainForm.Instance.AddToActionsList("Could not click " + elementID);
|
||||
MainForm.Instance.AddToActionsList($"Could not click {Level.WARNING}" + elementID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MainForm.Instance.AddToActionsList("Failed to create ChromeDriver: " + ex.Message);
|
||||
MainForm.Instance.AddToActionsList($"Failed to create ChromeDriver: {Level.ERROR}" + ex.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace AiQ_GUI
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoakError($"Initial connection failed: {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
MainForm.Instance.AddToActionsList($"[{CamInfo.IP}] Initial connection failed: {ex.Message}");
|
||||
MainForm.Instance.AddToActionsList($"[{CamInfo.IP}] Initial connection failed: {Level.ERROR}{ex.Message}");
|
||||
|
||||
// Wait 10 seconds before trying again
|
||||
await Task.Delay(TimeSpan.FromSeconds(10), token);
|
||||
@@ -52,7 +52,7 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoakError($"Failed to get element IDs: {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
SoakError($"Failed to get element IDs: {Level.ERROR} {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace AiQ_GUI
|
||||
// Retry ping until camera responds or cancelled
|
||||
while (!await Network.PingIP(CamInfo.IP) && !token.IsCancellationRequested)
|
||||
{
|
||||
SoakError($"Camera did not respond after restart.", SoakLogFile, CamInfo.CheckBox);
|
||||
SoakError($"Camera did not respond after restart.{Level.ERROR}", SoakLogFile, CamInfo.CheckBox);
|
||||
await Task.Delay(TimeSpan.FromMinutes(1), token); // Retry after delay of 1 minute
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoakError($"Error during power cycle: {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
SoakError($"Error during power cycle: {Level.ERROR} {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoakError($"ImageCheck failed: {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
SoakError($"ImageCheck failed: {Level.ERROR}{Level.ERROR} {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
}
|
||||
lastHour = currentHour;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoakError($"ChangeRandomDropdown failed: {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
SoakError($"ChangeRandomDropdown failed: {Level.WARNING} {ex.Message}", SoakLogFile, CamInfo.CheckBox);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -184,13 +184,13 @@ namespace AiQ_GUI
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MainForm.Instance.AddToActionsList($"Failed to find final test report: {ex.Message}");
|
||||
MainForm.Instance.AddToActionsList($"Failed to find final test report: {Level.ERROR}{ex.Message}");
|
||||
}
|
||||
|
||||
// Link PDFs if both exist
|
||||
if (!string.IsNullOrEmpty(finalTestPath) && File.Exists(finalTestPath) && !string.IsNullOrEmpty(SoakTestPath) && File.Exists(SoakTestPath))
|
||||
{
|
||||
string outputPath = finalTestDir + $"Final&SoakTestReport_{CamInfo.Model}_{CamInfo.Serial}_{DateTime.Now.ToString("dd-MM-yyyy_HH-mm-ss")}.pdf";
|
||||
string outputPath = finalTestDir + $"Final&SoakTestReport_{CamInfo.Model}_{CamInfo.Serial}_{DateTime.Now.ToString("dd-MM-yyyy_HH-mm-ss")}.pdf{Level.Success}";
|
||||
try
|
||||
{
|
||||
if (PDF.LinkPDFs(finalTestPath, SoakTestPath, outputPath)) // Delete the separate soak and final test reports if Linking was successful
|
||||
@@ -200,7 +200,7 @@ namespace AiQ_GUI
|
||||
File.Delete(SoakTestPath);
|
||||
}
|
||||
else
|
||||
MainForm.Instance.AddToActionsList($"Failed to link or delete PDFs");
|
||||
MainForm.Instance.AddToActionsList($"Failed to link or delete PDFs {Level.ERROR}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ namespace AiQ_GUI
|
||||
if (ImageBright == null)
|
||||
{
|
||||
Logging.LogWarningMessage($"Bright image is null for {controlType} at setting {SettingMinMax[0]}", SoakLogFile);
|
||||
MainForm.Instance.AddToActionsList($"Bright image is null for {controlType} at setting {SettingMinMax[0]}");
|
||||
MainForm.Instance.AddToActionsList($"Bright image is null for {controlType} at setting {SettingMinMax[0]}{Level.WARNING}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace AiQ_GUI
|
||||
if (ImageDark == null)
|
||||
{
|
||||
Logging.LogWarningMessage($"Dark image is null for {controlType} at setting {SettingMinMax[1]}", SoakLogFile);
|
||||
MainForm.Instance.AddToActionsList($"Dark image is null for {controlType} at setting {SettingMinMax[1]}");
|
||||
MainForm.Instance.AddToActionsList($"Dark image is null for {controlType} at setting {SettingMinMax[1]}{Level.WARNING}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace AiQ_GUI
|
||||
if (Bright_Lum < Dark_Lum * 1.01)
|
||||
{
|
||||
SoakError(
|
||||
$"Insufficient luminance contrast. Bright: {Bright_Lum:F2}, Dark: {Dark_Lum:F2} | Type: {controlType} | Bright Setting: {SettingMinMax[0]}, Dark Setting: {SettingMinMax[1]}",
|
||||
$"Insufficient luminance contrast. Bright: {Bright_Lum:F2}, Dark: {Dark_Lum:F2} | Type: {controlType} | Bright Setting: {SettingMinMax[0]}, Dark Setting: {SettingMinMax[1]}{Level.WARNING}",
|
||||
SoakLogFile,
|
||||
CamInfo.CheckBox
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user