V4.3 Changes - Bradley B

This commit is contained in:
2025-11-04 12:56:16 +00:00
parent 1c89cf2847
commit dd8e87258f
6 changed files with 215 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ namespace AiQ_GUI
public static HttpClient? SingleHTTPClient;
public static HttpClient Client => SingleHTTPClient ?? throw new InvalidOperationException("Client not initialized.");
public static void Initialize(string username, string password)
public async static void Initialize(string username, string password)
{
HttpClientHandler handler = new()
{
@@ -23,6 +23,21 @@ namespace AiQ_GUI
{
Timeout = TimeSpan.FromSeconds(20)
};
bool UP = false;
int i = 0;
while (!UP)
{
UP = await PingIP("10.10.10.137");
await Task.Delay(500);
if (i >= 5)
{
//MainForm.Instance.AddToActionsList($"Could not initialise new network with USER: {username} & PSWD: {password}");
return; // Try 5 times max
}
i++;
}
}
// Handles get and post to the camera API