• Camera/LED.cs
• Added null-checks so labels are created dynamically when lblVorI is null (uses MainForm.Instance.AddLabelToPanel). • Camera/CameraModules.cs • Added null-label handling to create dynamic module labels with the correct content (OK or the error message). • AiQ_GUI.cs • Increased dynamic label width in MakeNewLabel from 220 → 700 to avoid truncated messages. • Succesfully ran through a pre-test with dynamic labels
This commit is contained in:
45
AiQ_GUI.cs
45
AiQ_GUI.cs
@@ -1435,33 +1435,33 @@ 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
|
||||
//FakeCamera fakeCamera = new FakeCamera(80); // Create an instance of FakeCamera
|
||||
|
||||
//CamOnTest.IP = CbBxFoundCams.Text;
|
||||
_ = fakeCamera.StartAsync(CAMTYPE.GOOD).ContinueWith(task =>
|
||||
{
|
||||
//Network.Initialize("developer", "Pass123");
|
||||
//_ = 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}");
|
||||
}
|
||||
});
|
||||
// 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
|
||||
//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
|
||||
//await Task.Delay(3000); // Wait for server to start
|
||||
|
||||
BtnStartTest_Click(sender, e);
|
||||
//BtnStartTest_Click(sender, e);
|
||||
|
||||
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"), Level.LOG);
|
||||
}
|
||||
@@ -1471,7 +1471,7 @@ namespace AiQ_GUI
|
||||
{
|
||||
Location = new Point(5, yLoc),
|
||||
Height = 20,
|
||||
Width = 220,
|
||||
Width = 700,
|
||||
ForeColor = isRed ? Color.Red : Color.LightGreen,
|
||||
Text = text,
|
||||
Name = "Lbl_" + Guid.NewGuid(),
|
||||
@@ -1489,8 +1489,5 @@ namespace AiQ_GUI
|
||||
PnlLbls.Controls.Add(lbl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user