UI Components/Features

• Added BtnVlcPlay WHich toggles between Vlc.Play and VLC.Stop
This commit is contained in:
2026-01-14 10:36:58 +00:00
parent d1d90f17fc
commit a4c51b0af0
3 changed files with 51 additions and 7 deletions

21
AiQ_GUI.Designer.cs generated
View File

@@ -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;
}
}

View File

@@ -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);
}
}
}
}

View File

@@ -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()
{