Updated other uses of Internal Config to GLOBAL--FlexiApplication
This commit is contained in:
34
AiQ_GUI.cs
34
AiQ_GUI.cs
@@ -304,7 +304,7 @@ namespace AiQ_GUI
|
||||
{
|
||||
// Turn off God mode
|
||||
string[,] GOD_JSON = { { "propGodMode", "false" } };
|
||||
string IntConf = await FlexiAPI.HTTP_Update("Internal Config", CamOnTest.IP, GOD_JSON);
|
||||
string IntConf = await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", CamOnTest.IP, GOD_JSON);
|
||||
if (!IntConf.Contains("\"propGodMode\": {\"value\": \"false\", \"datatype\": \"boolean\"},"))
|
||||
AddToActionsList("Could not turn off God mode");
|
||||
|
||||
@@ -397,15 +397,14 @@ namespace AiQ_GUI
|
||||
List<object> oblistCD = [CamOnTest.Model, FullFailureValues];
|
||||
GoogleAPI.WriteToSS(oblistCD, "'Approval'!C" + nextRow + ":D" + nextRow, GoogleAPI.spreadsheetId_ModelInfo);
|
||||
|
||||
//await Teams.SendMssg(Convert.ToString(nextRow), CbBxUserName.Text);
|
||||
GoogleAPI.EmailApproval(Convert.ToString(nextRow), CbBxUserName.Text);
|
||||
await Teams.SendMssg(Convert.ToString(nextRow), CbBxUserName.Text);
|
||||
//GoogleAPI.EmailApproval(Convert.ToString(nextRow), CbBxUserName.Text);
|
||||
|
||||
string Approved = "";
|
||||
|
||||
while (Approved != "TRUE")
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
|
||||
values = GoogleAPI.service.Spreadsheets.Values.Get(GoogleAPI.spreadsheetId_ModelInfo, "'Approval'!B" + nextRow).Execute().Values;
|
||||
|
||||
if (values?.Count > 0)
|
||||
@@ -925,7 +924,7 @@ namespace AiQ_GUI
|
||||
|
||||
try
|
||||
{
|
||||
await FlexiAPI.HTTP_Update("Internal Config", CamOnTest.IP, GOD_JSON);
|
||||
await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", CamOnTest.IP, GOD_JSON);
|
||||
BtnSetGodMode.Text = newGodModeValue == "true" ? "Set God Mode Off" : "Set God Mode On";
|
||||
BtnSetGodMode.BackColor = Color.Green;
|
||||
}
|
||||
@@ -1171,7 +1170,7 @@ namespace AiQ_GUI
|
||||
try
|
||||
{
|
||||
Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera
|
||||
string RESP = await FlexiAPI.HTTP_Update("Internal Config", SCL.IP, GOD_JSON);
|
||||
string RESP = await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, GOD_JSON);
|
||||
Instance.AddToActionsList($"Setting God mode for camera {SCL.IP} to {newGodModeValue}", false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1580,9 +1579,24 @@ namespace AiQ_GUI
|
||||
{
|
||||
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.
|
||||
await CameraModules.FactoryResetModules(SCL.IP); // Reset camera modules
|
||||
|
||||
Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera, cannot be done in soak test finally becuase of this.
|
||||
await CameraModules.FactoryResetModules(SCL.IP);
|
||||
string[,] godJson = { { "propGodMode", "false" } }; // Set God mode explicitly off
|
||||
string GOD = await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, godJson);
|
||||
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");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
AddToActionsList("Failed to set God mode, reset camera modules or 211 for camera " + SCL.IP + ". Reason: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1702,13 +1716,15 @@ namespace AiQ_GUI
|
||||
}
|
||||
|
||||
// ***** Test & Debug *****
|
||||
private async void BtnTest_Click(object sender, EventArgs e)
|
||||
private void BtnTest_Click(object sender, EventArgs e)
|
||||
{
|
||||
Stopwatch stopWatchTest = Stopwatch.StartNew();
|
||||
|
||||
StatsExcel excelExporter = new();
|
||||
excelExporter.ExportDatabaseToExcel();
|
||||
|
||||
// /api/config-ids - For getting all available config IDs
|
||||
|
||||
stopWatchTest.Stop();
|
||||
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user