Find cams timeout extended

This commit is contained in:
2025-11-11 13:49:42 +00:00
parent 42a4778555
commit e94a1f1f5c
8 changed files with 127 additions and 57 deletions

View File

@@ -771,7 +771,7 @@ namespace AiQ_GUI
private async void BtnFindCams_Click(object sender, EventArgs e)
{
CbBxFoundCams.Text = "Searching";
BtnFindCams.Enabled = BtnSetAll211.Enabled = BtnSoak.Enabled = BtnSet211.Enabled = BtnSetGodMode.Enabled = BtnUploadBlob.Enabled = SetGodModeAll.Enabled = BtnFactoryDefault.Enabled = false;
BtnFindCams.Enabled = BtnSetAll211.Enabled = BtnSoak.Enabled = BtnSet211.Enabled = BtnSetGodMode.Enabled = BtnUploadBlob.Enabled = SetGodModeAll.Enabled = BtnFactoryDefault.Enabled = BtnUploadWonwooSetIR.Enabled = BtnUploadWonwooSetOV.Enabled = false;
BtnSetGodMode.BackColor = BtnUploadBlob.BackColor = BtnFactoryDefault.BackColor = BtnSetAll211.BackColor = BtnColour;
CbBxFoundCams.Items.Clear();
soakCameraList.Clear();
@@ -887,7 +887,7 @@ namespace AiQ_GUI
else
{
CbBxFoundCams.BackColor = Color.Red;
BtnSecret.Enabled = BtnOpenWebpage.Enabled = BtnSet211.Enabled = BtnSetGodMode.Enabled = false;
BtnSecret.Enabled = BtnOpenWebpage.Enabled = BtnSet211.Enabled = BtnSetGodMode.Enabled = BtnUploadWonwooSetIR.Enabled = BtnUploadWonwooSetOV.Enabled = false;
}
TestStartConditions();
@@ -972,7 +972,7 @@ namespace AiQ_GUI
if (CbBxFoundCams.BackColor != BtnColour || CbBxFoundCams.Text.Contains("Found"))
TSC = SetInvalid("Select camera IP address.");
else
BtnOpenWebpage.Enabled = BtnSet211.Enabled = BtnSetGodMode.Enabled = BtnZoom8000.Enabled = BtnZoomWide.Enabled = true; // Allow user to go to camera webpage & change DHCP/211
BtnOpenWebpage.Enabled = BtnSet211.Enabled = BtnSetGodMode.Enabled = BtnZoom8000.Enabled = BtnZoomWide.Enabled = BtnUploadWonwooSetIR.Enabled = BtnUploadWonwooSetOV.Enabled = true; // Allow user to go to camera webpage & change DHCP/211
// Name chosen
if (CbBxUserName.Text == "Select Operator to Begin Test" || CbBxUserName.Text.Length < 2)
@@ -1586,11 +1586,13 @@ namespace AiQ_GUI
cts.Cancel();
soakCtsList.Clear();
soakTasks.Clear();
int i = soakCameraList.Count + 1; // Add 1 for 211 itself staying in the list
foreach (Camera SCL in soakCameraList) // Reset all cameras that were being soaked to default module settings
{
if (!SCL.IsChecked)
continue;
try
{
Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera, cannot be done in soak test finally becuase of this.
@@ -1601,15 +1603,28 @@ namespace AiQ_GUI
if (GOD.Contains("Error"))
throw new Exception("Could not set God mode off");
bool Pass = await FlexiAPI.ChangeNetwork211(SCL.IP); // set camera to 211
if (!Pass)
throw new Exception("Could not set camera to 211");
// Update GLOBAL--NetworkConfig with fixed IP and turn off DHCP
string[,] TEST_JSON = { { "propDHCP", "false" }, { "propHost", "192.168.1.211" }, { "propNetmask", "255.255.255.0" }, { "propGateway", "192.168.1.1" } };
await FlexiAPI.HTTP_Update("GLOBAL--NetworkConfig", SCL.IP, TEST_JSON);
i--; // Decriment count becuase they will stack into 211
}
catch (Exception ex)
{
AddToActionsList("Failed to set God mode, reset camera modules or 211 for camera " + SCL.IP + ". Reason: " + ex.Message);
}
}
await Task.Delay(5000); // Wait for 5 seconds to allow the camera to restart
IList<string> FoundCams = await Network.SearchForCams(); // Have to check via broadcast becuase Ping sometimes fails across subnets
if (FoundCams.Count == i && FoundCams.Contains("192.168.1.211")) // Check the right number of cameras are seen
{
// GOOD??
}
else
{
// BAD??
}
}
}
@@ -1739,7 +1754,6 @@ namespace AiQ_GUI
stopWatchTest.Stop();
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"));
}
}
}