From 872be2e105f818fef6d208a4352931a765efd207 Mon Sep 17 00:00:00 2001 From: Bradley Born Date: Mon, 22 Dec 2025 14:37:43 +0000 Subject: [PATCH] Changes: - Code refactored, DIagsPt1 and 2 moved into there own folder called DIagnostics - Pre tests and final tests moved into a AiQ tests - Mobile Pre Tests added - Mobile pre test - Added firmware check for the SRZ --- AiQ Tests/AiQTests.cs | 162 +++++++++++ AiQ Tests/Diagnostics.cs | 242 ++++++++++++++++ AiQ_GUI.Designer.cs | 118 +++++--- AiQ_GUI.cs | 530 +++++++--------------------------- Microsoft/Access.cs | 1 + Mobile Tests/MobilePreTest.cs | 85 ++++++ 6 files changed, 667 insertions(+), 471 deletions(-) create mode 100644 AiQ Tests/AiQTests.cs create mode 100644 AiQ Tests/Diagnostics.cs create mode 100644 Mobile Tests/MobilePreTest.cs diff --git a/AiQ Tests/AiQTests.cs b/AiQ Tests/AiQTests.cs new file mode 100644 index 0000000..f33d62c --- /dev/null +++ b/AiQ Tests/AiQTests.cs @@ -0,0 +1,162 @@ +using AiQ_GUI; +using AiQ_GUI.AiQ_Tests; +public class AiQTests +{ + public static async void AiQPreTest() + { + + if (!await CameraModules.SetZoomLockOn(MainForm.Instance.CamOnTest.IP)) + Helper.RestartApp(); + + string LEDreply = await FlexiAPI.APIHTTPLED(MainForm.Instance.CamOnTest.IP, LEDPOWER.MID); // Set LED's to medium (0x30) + + if (!LEDreply.Contains("Power levels set successfully")) + MainForm.Instance.AddToActionsList($"LED level could not be set: {LEDreply}", Level.ERROR); + + await CameraModules.FactoryResetModules(MainForm.Instance.CamOnTest.IP); // Reset both modules and double check + + MainForm.Instance.sshData = SSH.CollectSSHData(MainForm.Instance.CamOnTest.IP); // SSH into camera to get Vaxtor packages, filesystem size and if tailscale is installed. + await SSH.CheckFSSize(MainForm.Instance.CamOnTest.IP, MainForm.Instance.LblFilesystemSize, MainForm.Instance.sshData); // Check Filesystem size is between 100GB & 150GB + + Helper.DCPowerCheck(MainForm.Instance.LblDC); // If the camera is DC powered check it is within limits + + // Requests, deserialises and checks the diagnostics API is correct + await TestingFunctions.CheckDiagsAPIPt1(); + + // Check module has gone to default config + CameraModules.CheckCamModule(TestingFunctions.DiagsAPI.IRmodule, MainForm.Instance.LblIRModule, MainForm.Instance.CamOnTest); // IR + CameraModules.CheckCamModule(TestingFunctions.DiagsAPI.OVmodule, MainForm.Instance.LblOVModule, MainForm.Instance.CamOnTest); // OV + + // Check voltage and current are OK. + LED.CheckLEDs(TestingFunctions.DiagsAPI.LedVoltage, MainForm.Instance.LblLEDV, "V", CameraAccessInfo.LED_V); // Voltage + LED.CheckLEDs(TestingFunctions.DiagsAPI.LedCurrent, MainForm.Instance.LblLEDI, "mA", CameraAccessInfo.LED_I); // Current + + MainForm.Instance.Refresh(); // Make sure all labels are updated before checking them + + // If there are any actions identified then fail the test. + // If any labels are red then fail. Only labels in panel so can foreach on labels not controls + if (MainForm.Instance.RhTxBxActions.Text.Length < 2 && MainForm.Instance.PnlLbls.Controls.OfType