Dynamic labels & Changed color to light green

- Filesystem size
- Flexi version
- Flexi Revision
- MAC
- Timestamp
- Temperature
- ZoomLock
- Serial and model Number
- Licenses
- CPU usage
This commit is contained in:
2025-12-23 13:01:15 +00:00
parent 872be2e105
commit 36f9639baa
7 changed files with 182 additions and 419 deletions

View File

@@ -178,11 +178,12 @@ namespace AiQ_GUI
BtnPreTest.Enabled = BtnStartTest.Enabled = false; // Disable buttons to stop user rnning multiple tests at the same time.
Logging.LogMessage("Final Test Started");
if (CbBxCameraModel.Text == "AiQ")
if (CbBxCamType.Text == "AiQ")
{
AiQTests.AiQFinalTest();
await AiQTests.AiQFinalTest();
}
else if (CbBxCameraModel.Text == "Mobile")
else if (CbBxCamType.Text == "Mobile")
{
await PreTestPassed();
}
@@ -197,7 +198,7 @@ namespace AiQ_GUI
Logging.LogMessage("Pre Test Started");
if (CbBxCamType.Text == "AiQ")
{
AiQTests.AiQPreTest();
await AiQTests.AiQPreTest();
}
else if (CbBxCamType.Text == "Mobile")
{
@@ -596,11 +597,6 @@ namespace AiQ_GUI
TestStartConditions();
}
private void CbBxCameraModel_SelectedIndexChanged(object sender, EventArgs e)
{
TestStartConditions();
}
private void btnPsuOn_Click(object sender, EventArgs e)
{
@@ -675,6 +671,12 @@ namespace AiQ_GUI
RhTxBxActions.ScrollToCaret();
}
private void CbBxCamTypSelectedIndexChanged(object sender, EventArgs e)
{
TestStartConditions();
}
private async void TestStartConditions()
{
if (Flags.Start)
@@ -1433,11 +1435,62 @@ namespace AiQ_GUI
Stopwatch stopWatchTest = Stopwatch.StartNew();
await MobilePreTest.CheckFirmwareAsync();
//await MobilePreTest.CheckFirmwareAsync();
//AddLabelToPanel("Test Complete", false);
FakeCamera fakeCamera = new FakeCamera(80); // Create an instance of FakeCamera
//CamOnTest.IP = CbBxFoundCams.Text;
_ = fakeCamera.StartAsync(CAMTYPE.GOOD).ContinueWith(task =>
{
//Network.Initialize("developer", "Pass123");
if (task.IsFaulted)
{
AddToActionsList("Error starting FakeCamera: " + task.Exception?.Message);
}
else
{
AddToActionsList($"FakeCamera started successfully. IP: {fakeCamera}");
}
});
await Task.Delay(3000); // Wait for server to start
CbBxFoundCams.Text = "localhost"; // Should force update in creds an network reinit
CmBoFoundCams_TextChanged(sender, e);
CbBxCameraModel.SelectedIndex = CbBxCameraModel.Items.Count - 1; // Selects AB12CD as model number
await Task.Delay(3000); // Wait for server to start
BtnStartTest_Click(sender, e);
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"), Level.LOG);
}
public static Label MakeNewLabel(string text, bool isRed, int yLoc)
{
return new Label
{
Location = new Point(5, yLoc),
Height = 20,
Width = 220,
ForeColor = isRed ? Color.Red : Color.LightGreen,
Text = text,
Name = "Lbl_" + Guid.NewGuid(),
AutoSize = false
};
}
public void AddLabelToPanel(string text, bool isRed)
{
int yLoc = PnlLbls.Controls
.OfType<Label>()
.Count() * 22; // 20 height + 2px spacing
Label lbl = MakeNewLabel(text, isRed, yLoc);
PnlLbls.Controls.Add(lbl);
}
}
}