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

@@ -192,32 +192,16 @@ namespace AiQ_GUI
}
}
public static async Task<bool> SetZoomLockOn(string IP)
public static async Task GPSFix(string IPAddress)
{
// Set Zoomlock on and if it fails ask user to set it manually
if (!(await APIHTTPRequest("/api/zoomLock?enable=true", IP)).Contains("Zoom lock enabled.")
&& !await MainForm.Instance.DisplayQuestion("Could not set zoomlock on" + Environment.NewLine + "Set Zoomlock to on then click YES. Click NO to restart."))
string sysstatus = await APIHTTPRequest("/sysstatus", IPAddress, 5);
SysStatus status = JsonConvert.DeserializeObject<SysStatus>(sysstatus);
if (status.gpsState == 0 || status.gpsPresent == "Not Fitted")
{
return false;
MainForm.Instance.AddToActionsList($"GPS not present in camera. State: {status.gpsState} & Status: {status.gpsPresent}");
return;
}
return true;
}
public static async Task<bool> ZoomModules(string VISCAInput, string IPAddress)
{
// Populate the VISCA command with the four zoom characters
string VISCA = $"810104470{VISCAInput[0]}0{VISCAInput[1]}0{VISCAInput[2]}0{VISCAInput[3]}FF";
Task<string> TS1 = APIHTTPVISCA(IPAddress, VISCA, true);
Task<string> TS2 = APIHTTPVISCA(IPAddress, VISCA, false);
await Task.WhenAll(TS1, TS2);
const string ExpReply = "9041FF9051FF";
if (TS1.Result == ExpReply && TS1.Result == ExpReply)
return true;
return false;
}
public static async Task SetTrim(string IPAddress, string LblTxt, int RetryCount = 0) // Sets trim by getting plate postion as metric
@@ -557,6 +541,12 @@ namespace AiQ_GUI
public int colourY { get; set; }
}
public class SysStatus
{
public int gpsState { get; set; } = 0;
public string gpsPresent { get; set; } = string.Empty;
}
public class NetworkConfig
{
public Property propDHCP { get; set; } = new Property();