From a4c51b0af048001090be879d32534514ce7650c6 Mon Sep 17 00:00:00 2001 From: Bradley Born Date: Wed, 14 Jan 2026 10:36:58 +0000 Subject: [PATCH] =?UTF-8?q?UI=20Components/Features=20=E2=80=A2=20Added=20?= =?UTF-8?q?BtnVlcPlay=20WHich=20toggles=20between=20Vlc.Play=20and=20VLC.S?= =?UTF-8?q?top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AiQ_GUI.Designer.cs | 21 ++++++++++++++++++++- AiQ_GUI.cs | 32 ++++++++++++++++++++++++++------ Mobile Tests/Mobile Tests.cs | 5 +++++ 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/AiQ_GUI.Designer.cs b/AiQ_GUI.Designer.cs index 6b5f27e..5bd8d9a 100644 --- a/AiQ_GUI.Designer.cs +++ b/AiQ_GUI.Designer.cs @@ -131,6 +131,7 @@ namespace AiQ_GUI BtnFirewall = new Button(); TabImages = new TabPage(); Video = new TabPage(); + BtnPlayVLC = new Button(); VLCVideo = new Label(); NightImgPcbx = new PictureBox(); NightImage = new Label(); @@ -1662,6 +1663,7 @@ namespace AiQ_GUI // Video // Video.BackColor = Color.FromArgb(39, 37, 55); + Video.Controls.Add(BtnPlayVLC); Video.Controls.Add(VidView); Video.Controls.Add(VLCVideo); Video.Controls.Add(NightImgPcbx); @@ -1675,13 +1677,29 @@ namespace AiQ_GUI Video.TabIndex = 5; Video.Text = "Video"; // + // BtnPlayVLC + // + BtnPlayVLC.BackColor = Color.FromArgb(70, 65, 80); + BtnPlayVLC.FlatAppearance.BorderSize = 0; + BtnPlayVLC.FlatStyle = FlatStyle.Flat; + BtnPlayVLC.Font = new Font("Segoe UI Semibold", 10F, FontStyle.Bold); + BtnPlayVLC.ForeColor = SystemColors.Control; + BtnPlayVLC.Location = new Point(286, 536); + BtnPlayVLC.Margin = new Padding(4, 3, 4, 3); + BtnPlayVLC.Name = "BtnPlayVLC"; + BtnPlayVLC.Size = new Size(113, 37); + BtnPlayVLC.TabIndex = 239; + BtnPlayVLC.Text = "Play Video"; + BtnPlayVLC.UseVisualStyleBackColor = false; + BtnPlayVLC.Click += BtnPlayVLC_Click; + // // VLCVideo // VLCVideo.AutoSize = true; VLCVideo.BackColor = Color.Transparent; VLCVideo.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold); VLCVideo.ForeColor = SystemColors.Control; - VLCVideo.Location = new Point(12, 545); + VLCVideo.Location = new Point(12, 555); VLCVideo.Margin = new Padding(4, 0, 4, 0); VLCVideo.Name = "VLCVideo"; VLCVideo.Size = new Size(86, 21); @@ -2129,5 +2147,6 @@ namespace AiQ_GUI public Label VLCVideo; public PictureBox NightImgPcbx; public PictureBox DayImgPcbx; + private Button BtnPlayVLC; } } diff --git a/AiQ_GUI.cs b/AiQ_GUI.cs index 4819958..1b7e594 100644 --- a/AiQ_GUI.cs +++ b/AiQ_GUI.cs @@ -1,7 +1,9 @@ using AiQ_GUI.AiQ_Tests; using AiQ_GUI.Mobile_Tests; +using DocumentFormat.OpenXml.Drawing.Diagrams; using LibVLCSharp.Shared; using LibVLCSharp.WinForms; +using MigraDoc.DocumentObjectModel; using Newtonsoft.Json; using System.ComponentModel; using System.Diagnostics; @@ -9,6 +11,7 @@ using System.Net.Http.Json; using System.Reflection; using System.Text.Json; using System.Windows.Forms; +using Color = System.Drawing.Color; namespace AiQ_GUI { @@ -211,7 +214,7 @@ namespace AiQ_GUI Logging.LogMessage("Pre Test Started"); if (CbBxCamType.Text == "AiQ") { - await AiQTests.AiQPreTest(); + await AiQTests.AiQPreTest(); } else if (CbBxCamType.Text == "Mobile") { @@ -1450,12 +1453,12 @@ namespace AiQ_GUI //StatsExcel excelExporter = new(); //excelExporter.ExportDatabaseToExcel(); //await MobilePreTest.CheckFirmwareAsync(); - - VLC.Play(VidView); - await Task.Delay(5000); + FlexiAPI.GetVersions(CamOnTest.IP).Wait(); + //VLC.Play(VidView); + //await Task.Delay(5000); //VLC.TakeSnapshot(VidView); - await MobileAPI.SetDayModeAsync(); + // await MobileAPI.SetDayModeAsync(); AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"), Level.LOG); } @@ -1463,7 +1466,7 @@ namespace AiQ_GUI { return new Label { - Location = new Point(5, yLoc), + Location = new System.Drawing.Point(5, yLoc), Height = 20, Width = 700, ForeColor = isRed ? Color.Red : Color.LightGreen, @@ -1483,6 +1486,23 @@ namespace AiQ_GUI PnlLbls.Controls.Add(lbl); } + private void BtnPlayVLC_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(CamOnTest.IP)) + { + AddToActionsList("No Camera Has Been Selected, Please Select A Camera.", Level.WARNING); + } + else if (VLC.IsPLaying(VidView)) + { + BtnPlayVLC.Text = "Play Video"; + VLC.Stop(VidView); + } + else + { + BtnPlayVLC.Text = "Stop Video"; + VLC.Play(VidView); + } + } } } diff --git a/Mobile Tests/Mobile Tests.cs b/Mobile Tests/Mobile Tests.cs index ad4d407..705bdc3 100644 --- a/Mobile Tests/Mobile Tests.cs +++ b/Mobile Tests/Mobile Tests.cs @@ -45,6 +45,11 @@ namespace AiQ_GUI.Mobile_Tests } } + public static async Task RunFinalTestAsync() + { + // Placeholder for any final tests if needed in the future + + } private static async Task TestDayNightMode() {