This commit is contained in:
2025-12-02 11:02:24 +00:00
parent e29d104d47
commit 4c624d7e29
7 changed files with 76 additions and 45 deletions

View File

@@ -47,7 +47,7 @@ namespace AiQ_GUI
Task<LocalDataStore> LDSWAIT = Task.Run(() => LDS.GetLDS()); // Get and deserialise LDS.json
Task<string> guiVerTask = Task.Run(() => GUIUpdate.FindGUIVersion()); // Get GUI Version
Network.Initialize("admin", "admin"); // Initialise HTTP client
Network.Initialize("admin", "admin"); // Initialise HTTP client with basic auth creds.
if (await Network.PingIP("8.8.8.8")) // Ping to check if we're online
{
@@ -145,10 +145,10 @@ namespace AiQ_GUI
Task VisCheck = Helper.VisualCheck(BtnStartTest);
if (!await FlexiAPI.ZoomModules("1F40", CamOnTest.IP)) // Zoom to 8000 (1F40h) at the same time.
if (!await CameraModules.ZoomModules("1F40", CamOnTest.IP)) // Zoom to 8000 (1F40h) at the same time.
await TestFailed(BtnStartTest, "Could not zoom modules to 8000");
if (!await FlexiAPI.SetZoomLockOn(CamOnTest.IP))
if (!await CameraModules.SetZoomLockOn(CamOnTest.IP))
Helper.RestartApp();
await Task.Delay(1000); // Without sleep it kept failing the factory reset as camera modules were not ready yet
@@ -169,6 +169,9 @@ namespace AiQ_GUI
// TODO - Force expire sighting.
Task Wait = Task.Delay(5000); // Wait for 5 seconds to allow the camera to zoom in, set settings and capture some plates before auto trim
if (CameraAccessInfo.HardwareExtras.Contains("GPS")) // Check GPS if the hardware has it
await FlexiAPI.GPSFix(CamOnTest.IP);
// While waiting do the SSH tasks.
sshData = SSH.CollectSSHData(CamOnTest.IP); // SSH into camera to get Vaxtor packages, filesystem size and if tailscale is installed.
await SSH.CheckFSSize(CamOnTest.IP, LblFilesystemSize, sshData); // Check Filesystem size is between 100GB & 150GB
@@ -188,7 +191,7 @@ namespace AiQ_GUI
await Wait; // Finished to 5s wait
await FlexiAPI.SetTrim(CamOnTest.IP, LblTestTubePing.Text); // Auto trims the cameras, some plates should have been captured in the meantime
if (!await FlexiAPI.ZoomModules("0000", CamOnTest.IP)) // Zoom to full wide
if (!await CameraModules.ZoomModules("0000", CamOnTest.IP)) // Zoom to full wide
await TestFailed(BtnStartTest, "Could not zoom modules to full wide");
await Task.Delay(1000); // Wait to be sure cameras are zoomed out.
@@ -235,7 +238,7 @@ namespace AiQ_GUI
BtnPreTest.Enabled = BtnStartTest.Enabled = false; // Disable buttons to stop user rnning multiple tests at the same time.
Logging.LogMessage("Pre Test Started");
if (!await FlexiAPI.SetZoomLockOn(CamOnTest.IP))
if (!await CameraModules.SetZoomLockOn(CamOnTest.IP))
Helper.RestartApp();
string LEDreply = await FlexiAPI.APIHTTPLED(CamOnTest.IP, LEDPOWER.MID); // Set LED's to medium (0x30)
@@ -1465,7 +1468,7 @@ namespace AiQ_GUI
private async void BtnZoomWide_Click(object sender, EventArgs e)
{
if (await FlexiAPI.ZoomModules("0000", CamOnTest.IP))
if (await CameraModules.ZoomModules("0000", CamOnTest.IP))
BtnZoomWide.BackColor = Color.Green;
else
BtnZoomWide.BackColor = Color.Red;
@@ -1475,7 +1478,7 @@ namespace AiQ_GUI
private async void BtnZoom8000_Click(object sender, EventArgs e)
{
if (await FlexiAPI.ZoomModules("1F40", CamOnTest.IP))
if (await CameraModules.ZoomModules("1F40", CamOnTest.IP))
BtnZoom8000.BackColor = Color.Green;
else
BtnZoom8000.BackColor = Color.Red;
@@ -1579,7 +1582,7 @@ namespace AiQ_GUI
CancellationTokenSource cts = new();
soakCtsList.Add(cts);
soakTasks.Add(SoakTest.StartSoak(SCL, SCL.CheckBox, cts.Token));
soakTasks.Add(SoakTest.StartSoak(SCL, cts));
await Task.Delay(10000);
}
}