From 791cee91d28fdccba6fdb4529500e86f46d69d25 Mon Sep 17 00:00:00 2001 From: Bradley Relyea Date: Tue, 11 Nov 2025 14:17:31 +0000 Subject: [PATCH] V4.4 with modified god mode and 211 at end of soak test. --- AiQ_GUI.cs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/AiQ_GUI.cs b/AiQ_GUI.cs index a6c289d..f038e49 100644 --- a/AiQ_GUI.cs +++ b/AiQ_GUI.cs @@ -1596,20 +1596,16 @@ namespace AiQ_GUI continue; try { - Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera - await CameraModules.FactoryResetModules(SCL.IP); // Reset camera modules - await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, GOD_JSON); - await FlexiAPI.HTTP_Update("GLOBAL--NetworkConfig", SCL.IP, Network_JSON); AddToActionsList($"Setting 211 & God Mode off for camera {SCL.IP}", false); + Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera + await CameraModules.FactoryResetModules(SCL.IP); // Reset camera modules - string[,] godJson = { { "propGodMode", "false" } }; // Set God mode explicitly off - string GOD = await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, godJson); + string GOD = await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, GOD_JSON); if (GOD.Contains("Error")) throw new Exception("Could not set God mode off"); // 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); + await FlexiAPI.HTTP_Update("GLOBAL--NetworkConfig", SCL.IP, Network_JSON); i--; // Decriment count becuase they will stack into 211 } catch (Exception ex) @@ -1621,13 +1617,13 @@ namespace AiQ_GUI await Task.Delay(5000); // Wait for 5 seconds to allow the camera to restart IList 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 + if ((FoundCams.Count == i && FoundCams.Contains("192.168.1.211")) || FoundCams.Count == 1) { - // GOOD?? + AddToActionsList("All cameras successfully changed to 211.", false); } else { - // BAD?? + AddToActionsList($"Some cameras failed: Found {FoundCams.Count}, expected {i}.", true); } } } @@ -1747,13 +1743,15 @@ namespace AiQ_GUI } // ***** Test & Debug ***** - private void BtnTest_Click(object sender, EventArgs e) + private async void BtnTest_Click(object sender, EventArgs e) { Stopwatch stopWatchTest = Stopwatch.StartNew(); - StatsExcel excelExporter = new(); - excelExporter.ExportDatabaseToExcel(); + //StatsExcel excelExporter = new(); + //excelExporter.ExportDatabaseToExcel(); + string ans = await FlexiAPI.HTTP_Fetch("GLOBAL--Device", "192.168.0.71"); + AddToActionsList(ans); // /api/config-ids - For getting all available config IDs stopWatchTest.Stop();