V4.6
This commit is contained in:
@@ -28,10 +28,10 @@ namespace AiQ_GUI
|
||||
MainForm.Instance.AddToActionsList($"{CamMod.firmwareVer} or {UniversalData.WonwooFirmware} could not be converted to a double");
|
||||
}
|
||||
|
||||
if (CamOnTest.RMANum > 0 && LessTanOrEqualTo)
|
||||
if (CamOnTest.RMANum > 0 && !LessTanOrEqualTo)
|
||||
errMssg += $"Firmware: {CamMod.firmwareVer} should be less than or equal to {UniversalData.WonwooFirmware} for RMA {CamOnTest.RMANum}";
|
||||
|
||||
else if ((CamOnTest.RMANum == 0 || CamOnTest.RMANum == -1) && CamMod.firmwareVer != UniversalData.WonwooFirmware)
|
||||
else if (CamOnTest.RMANum < 1 && CamMod.firmwareVer != UniversalData.WonwooFirmware)
|
||||
errMssg += $"Firmware: {CamMod.firmwareVer} should be {UniversalData.WonwooFirmware} ";
|
||||
|
||||
if (CamMod.expMode != 0) // Auto 0=0x00
|
||||
@@ -107,5 +107,33 @@ namespace AiQ_GUI
|
||||
// Build the final VISCA command string using the input characters split as p and q
|
||||
return $"8101044{command}00000{hex[0]}0{hex[1]}FF";
|
||||
}
|
||||
|
||||
public static async Task<bool> SetZoomLockOn(string IP)
|
||||
{
|
||||
// Set Zoomlock on and if it fails ask user to set it manually
|
||||
if (!(await FlexiAPI.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."))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
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 = FlexiAPI.APIHTTPVISCA(IPAddress, VISCA, true);
|
||||
Task<string> TS2 = FlexiAPI.APIHTTPVISCA(IPAddress, VISCA, false);
|
||||
await Task.WhenAll(TS1, TS2);
|
||||
|
||||
const string ExpReply = "9041FF9051FF";
|
||||
if (TS1.Result == ExpReply && TS1.Result == ExpReply)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user