This Commit contains all the changes for the new feature for S.L in regards to ExcelStats of the GUI
This commit is contained in:
260
AiQ_GUI.cs
260
AiQ_GUI.cs
@@ -1,6 +1,9 @@
|
|||||||
using Newtonsoft.Json;
|
using AiQ_GUI.Microsoft;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Data.OleDb;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Numerics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace AiQ_GUI
|
namespace AiQ_GUI
|
||||||
@@ -25,6 +28,8 @@ namespace AiQ_GUI
|
|||||||
|
|
||||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
public static MainForm? Instance { get; private set; }
|
public static MainForm? Instance { get; private set; }
|
||||||
|
// For Access Stats
|
||||||
|
const string connString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\Shared drives\MAV Production GUI's\AiQ\GUI's\AiQ_Final_Test.accdb;Persist Security Info=False;OLE DB Services=-1;";
|
||||||
|
|
||||||
public MainForm()
|
public MainForm()
|
||||||
{
|
{
|
||||||
@@ -37,7 +42,7 @@ namespace AiQ_GUI
|
|||||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
Stopwatch stopwatch = Stopwatch.StartNew();
|
||||||
|
|
||||||
Task? closeProcessesTask = Windows.CloseProcesses(); // Fire and forget closing other apps
|
Task? closeProcessesTask = Windows.CloseProcesses(); // Fire and forget closing other apps
|
||||||
Windows.UpdateFirewall();
|
//Windows.UpdateFirewall();
|
||||||
Task UniDataTask = Task.Run(() => Access.ReadUniData()); // Get universal data
|
Task UniDataTask = Task.Run(() => Access.ReadUniData()); // Get universal data
|
||||||
Task<LocalDataStore> LDSWAIT = Task.Run(() => LDS.GetLDS()); // Get and deserialise LDS.json
|
Task<LocalDataStore> LDSWAIT = Task.Run(() => LDS.GetLDS()); // Get and deserialise LDS.json
|
||||||
Task<string> guiVerTask = Task.Run(() => GUIUpdate.FindGUIVersion()); // Get GUI Version
|
Task<string> guiVerTask = Task.Run(() => GUIUpdate.FindGUIVersion()); // Get GUI Version
|
||||||
@@ -138,13 +143,16 @@ namespace AiQ_GUI
|
|||||||
AddToActionsList($"LED level could not be set: {LEDreply}");
|
AddToActionsList($"LED level could not be set: {LEDreply}");
|
||||||
}
|
}
|
||||||
else if (!await TestTube.CheckInTestTube(CamOnTest.IP)) // Sets LED's to medium power after checking it is in the test tube
|
else if (!await TestTube.CheckInTestTube(CamOnTest.IP)) // Sets LED's to medium power after checking it is in the test tube
|
||||||
|
{
|
||||||
await TestFailed(BtnStartTest, "Camera not in test tube");
|
await TestFailed(BtnStartTest, "Camera not in test tube");
|
||||||
|
}
|
||||||
|
|
||||||
Task VisCheck = Helper.VisualCheck(BtnStartTest);
|
Task VisCheck = Helper.VisualCheck(BtnStartTest);
|
||||||
|
|
||||||
if (!await FlexiAPI.ZoomModules("1F40", CamOnTest.IP)) // Zoom to 8000 (1F40h) at the same time.
|
if (!await FlexiAPI.ZoomModules("1F40", CamOnTest.IP)) // Zoom to 8000 (1F40h) at the same time.
|
||||||
await TestFailed(BtnStartTest, "Could not zoom modules to 8000");
|
await TestFailed(BtnStartTest, "Could not zoom modules to 8000");
|
||||||
|
|
||||||
|
|
||||||
if (!await FlexiAPI.SetZoomLockOn(CamOnTest.IP))
|
if (!await FlexiAPI.SetZoomLockOn(CamOnTest.IP))
|
||||||
Helper.RestartApp();
|
Helper.RestartApp();
|
||||||
|
|
||||||
@@ -186,7 +194,9 @@ namespace AiQ_GUI
|
|||||||
await FlexiAPI.SetTrim(CamOnTest.IP, LblTestTubePing.Text); // Auto trims the cameras, some plates should have been captured in the meantime
|
await FlexiAPI.SetTrim(CamOnTest.IP, LblTestTubePing.Text); // Auto trims the cameras, some plates should have been captured in the meantime
|
||||||
|
|
||||||
if (!await FlexiAPI.ZoomModules("0000", CamOnTest.IP)) // Zoom to full wide
|
if (!await FlexiAPI.ZoomModules("0000", CamOnTest.IP)) // Zoom to full wide
|
||||||
|
{
|
||||||
await TestFailed(BtnStartTest, "Could not zoom modules to full wide");
|
await TestFailed(BtnStartTest, "Could not zoom modules to full wide");
|
||||||
|
}
|
||||||
|
|
||||||
await Task.Delay(1000); // Wait to be sure cameras are zoomed out.
|
await Task.Delay(1000); // Wait to be sure cameras are zoomed out.
|
||||||
|
|
||||||
@@ -218,11 +228,82 @@ namespace AiQ_GUI
|
|||||||
// If there are any actions identified then fail the test.
|
// If there are any actions identified then fail the test.
|
||||||
// If any labels are red then fail. Only labels in panel so can foreach on labels not controls
|
// If any labels are red then fail. Only labels in panel so can foreach on labels not controls
|
||||||
if (RhTxBxActions.Text.Length > 2 || PnlLbls.Controls.OfType<Label>().Any(c => c.ForeColor == Color.Red) == true)
|
if (RhTxBxActions.Text.Length > 2 || PnlLbls.Controls.OfType<Label>().Any(c => c.ForeColor == Color.Red) == true)
|
||||||
await TestFailed(BtnStartTest);// If approved then pass otherwise GUI would have restarted before getting to TestPassed.
|
{
|
||||||
|
await TestFailed(BtnStartTest, "Diagnostic Failure");// If approved then pass otherwise GUI would have restarted before getting to TestPassed.
|
||||||
|
}
|
||||||
|
|
||||||
await TestPassed(PCTime);
|
await TestPassed(PCTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Stats(string TypeOfTest)
|
||||||
|
{
|
||||||
|
Stats([TypeOfTest]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stats(string[] TypeOfTest)
|
||||||
|
{
|
||||||
|
using OleDbConnection conn = new(connString); // Opens connection to Access database
|
||||||
|
try
|
||||||
|
{
|
||||||
|
conn.Open(); // Opens DB
|
||||||
|
string modelNumber = CbBxCameraType.Text.Substring(0, 6); // Get model number from combobox and make sure it is only 6 characters.
|
||||||
|
|
||||||
|
foreach (string type in TypeOfTest)
|
||||||
|
{
|
||||||
|
string query = $"UPDATE AiQ SET [{type}] = [{type}] + 1 WHERE [ModelNumber] = ?"; // Add one for every test ran of this type for this model number
|
||||||
|
using OleDbCommand cmd = new(query, conn); // Create command
|
||||||
|
cmd.Parameters.AddWithValue("?", modelNumber); // Add model number to prevent injection
|
||||||
|
|
||||||
|
int rowsAffected = cmd.ExecuteNonQuery();
|
||||||
|
// Execute the command and get the number of rows affected
|
||||||
|
//if (rowsAffected > 0) // If one or more rows were updated
|
||||||
|
// AddToActionsList($"Updated {TypeOfTest} for {modelNumber}");
|
||||||
|
//else
|
||||||
|
// AddToActionsList($"No rows found for {modelNumber}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
AddToActionsList("Could not access Access in Google Drive. Is it running?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StatsDiags(string redDiagLabels, string RhTxBxActionsText)
|
||||||
|
{
|
||||||
|
using OleDbConnection conn = new(connString);
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
// Null checks
|
||||||
|
string redVal = string.IsNullOrWhiteSpace(redDiagLabels) ? "-" : redDiagLabels;
|
||||||
|
string actVal = string.IsNullOrWhiteSpace(RhTxBxActionsText) ? "-" : RhTxBxActionsText;
|
||||||
|
string model = string.IsNullOrWhiteSpace(CamOnTest?.Model) ? "-" : CamOnTest.Model;
|
||||||
|
|
||||||
|
string sql = @"
|
||||||
|
INSERT INTO DiagsStats ([Date], [Model], [Red Diags Labels], [RhTxBxActions Contents])
|
||||||
|
VALUES (?, ?, ?, ?)";
|
||||||
|
|
||||||
|
using OleDbCommand cmd = new(sql, conn);
|
||||||
|
|
||||||
|
cmd.Parameters.Add(new OleDbParameter
|
||||||
|
{
|
||||||
|
OleDbType = OleDbType.Date,
|
||||||
|
Value = DateTime.Now
|
||||||
|
});
|
||||||
|
cmd.Parameters.AddWithValue("?", model);
|
||||||
|
cmd.Parameters.AddWithValue("?", redVal);
|
||||||
|
cmd.Parameters.AddWithValue("?", actVal);
|
||||||
|
|
||||||
|
int rows = cmd.ExecuteNonQuery();
|
||||||
|
|
||||||
|
//if (rows > 0)
|
||||||
|
// AddToActionsList($"DiagsStats inserted ({rows} row) for model '{model}' on {DateTime.Now:yyyy-MM-dd}");
|
||||||
|
//else
|
||||||
|
// AddToActionsList("No rows inserted into DiagsStats (unexpected).");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private async void BtnPreTest_Click(object sender, EventArgs e)
|
private async void BtnPreTest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// Show user test has started
|
// Show user test has started
|
||||||
@@ -278,7 +359,11 @@ namespace AiQ_GUI
|
|||||||
await PreTestPassed();
|
await PreTestPassed();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
await PreTestFailed();
|
{
|
||||||
|
await PreTestFailed("Diagnostic Failure");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***** Pass/Fails *****
|
// ***** Pass/Fails *****
|
||||||
@@ -293,7 +378,7 @@ namespace AiQ_GUI
|
|||||||
// Purge camera of all reads
|
// Purge camera of all reads
|
||||||
await FlexiAPI.APIHTTPRequest("/api/purge-all", CamOnTest.IP);
|
await FlexiAPI.APIHTTPRequest("/api/purge-all", CamOnTest.IP);
|
||||||
|
|
||||||
if (await DisplayQuestion("Do you want to set this camera to 211 and God mode?"))
|
if (await DisplayQuestion("Do you want to set this camera to 211 and God mode off?"))
|
||||||
{
|
{
|
||||||
// Turn off God mode
|
// Turn off God mode
|
||||||
string[,] GOD_JSON = { { "propGodMode", "false" } };
|
string[,] GOD_JSON = { { "propGodMode", "false" } };
|
||||||
@@ -322,25 +407,45 @@ namespace AiQ_GUI
|
|||||||
// TODO make sure serial number is in CamOnTest before making PDF
|
// TODO make sure serial number is in CamOnTest before making PDF
|
||||||
// Serial number is either what came out of the camera under RMA or updated above as new serial number from next empty row in spreadsheet
|
// Serial number is either what came out of the camera under RMA or updated above as new serial number from next empty row in spreadsheet
|
||||||
PDF.CreateFinalTestReport(CamOnTest, CbBxUserName.Text, fulltestvalues, PCTime);
|
PDF.CreateFinalTestReport(CamOnTest, CbBxUserName.Text, fulltestvalues, PCTime);
|
||||||
|
|
||||||
// Indicators to the user the test has passed
|
// Indicators to the user the test has passed
|
||||||
BtnStartTest.BackColor = Color.ForestGreen;
|
BtnStartTest.BackColor = Color.ForestGreen;
|
||||||
BtnStartTest.Text = "Test Passed";
|
BtnStartTest.Text = "Test Passed";
|
||||||
PnlQuestion.Visible = false; // just in case this came from an override
|
PnlQuestion.Visible = false; // just in case this came from an override
|
||||||
Logging.LogMessage("Final Test Passed");
|
Logging.LogMessage("Final Test Passed");
|
||||||
|
if (CamOnTest.RMANum == 0) // Yap to check if it is not a RMA
|
||||||
|
{
|
||||||
|
Stats("Final Tests Passed");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Stats("RMA Final Tests Passed");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task TestFailed(Button Btn, string ErrMssg)
|
public async Task TestFailed(Button Btn, string ErrMssg)
|
||||||
{
|
|
||||||
AddToActionsList(ErrMssg);
|
|
||||||
await TestFailed(Btn);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task TestFailed(Button Btn)
|
|
||||||
{
|
{
|
||||||
// Indicators to the user the test has failed
|
// Indicators to the user the test has failed
|
||||||
Btn.BackColor = Color.Maroon;
|
Btn.BackColor = Color.Maroon;
|
||||||
Btn.Text = "Test Failed";
|
Btn.Text = "Test Failed";
|
||||||
|
if (!(CamOnTest.RMANum != 0)) // Yap to check if it is not a RMA
|
||||||
|
{
|
||||||
|
Stats( ["Final Tests Failed", ErrMssg]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Stats("RMA Final Tests Failed");
|
||||||
|
}
|
||||||
|
AddToActionsList(ErrMssg);
|
||||||
|
|
||||||
|
string RedLbls = string.Join(Environment.NewLine, PnlLbls.Controls
|
||||||
|
.OfType<Label>()
|
||||||
|
.Where(lbl => lbl.ForeColor == Color.Red) // Only include red labels
|
||||||
|
.Select(lbl => lbl.Text)); // Extract text
|
||||||
|
string FullFailureValues = RhTxBxActions.Text + Environment.NewLine + RedLbls;
|
||||||
|
|
||||||
|
StatsDiags(RedLbls, RhTxBxActions.Text); // Log to Access database
|
||||||
|
|
||||||
|
|
||||||
if (await DisplayQuestion("Test failed, appeal?" + Environment.NewLine + "See Actions textbox for details."))
|
if (await DisplayQuestion("Test failed, appeal?" + Environment.NewLine + "See Actions textbox for details."))
|
||||||
{
|
{
|
||||||
@@ -356,14 +461,10 @@ namespace AiQ_GUI
|
|||||||
|
|
||||||
this.Refresh(); // To make sure all labels are up to date before reading them
|
this.Refresh(); // To make sure all labels are up to date before reading them
|
||||||
// Joins the actions box to any red labels to use as a full failed text
|
// Joins the actions box to any red labels to use as a full failed text
|
||||||
string FullFailureValues = RhTxBxActions.Text + Environment.NewLine +
|
|
||||||
string.Join(Environment.NewLine, PnlLbls.Controls
|
|
||||||
.OfType<Label>()
|
|
||||||
.Where(lbl => lbl.ForeColor == Color.Red) // Only include red labels
|
|
||||||
.Select(lbl => lbl.Text)); // Extract text
|
|
||||||
|
|
||||||
Logging.LogErrorMessage(FullFailureValues);
|
Logging.LogErrorMessage(FullFailureValues);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IList<IList<object>> values = GoogleAPI.service.Spreadsheets.Values.Get(GoogleAPI.spreadsheetId_ModelInfo, "'Approval'!A1:A").Execute().Values;
|
IList<IList<object>> values = GoogleAPI.service.Spreadsheets.Values.Get(GoogleAPI.spreadsheetId_ModelInfo, "'Approval'!A1:A").Execute().Values;
|
||||||
|
|
||||||
if (values?.Count > 0)
|
if (values?.Count > 0)
|
||||||
@@ -416,12 +517,20 @@ namespace AiQ_GUI
|
|||||||
PnlQuestion.Visible = true;
|
PnlQuestion.Visible = true;
|
||||||
BtnNo.Visible = false;
|
BtnNo.Visible = false;
|
||||||
Logging.LogMessage("Pre Test Passed");
|
Logging.LogMessage("Pre Test Passed");
|
||||||
|
if (CamOnTest.RMANum == 0) // Yap to check if it is not a RMA
|
||||||
|
{
|
||||||
|
Stats("Pre Tests Passed");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Stats("RMA Pre Tests Passed");
|
||||||
|
}
|
||||||
|
|
||||||
if (await DisplayQuestion("Test passed, restart?"))
|
if (await DisplayQuestion("Test passed, restart?"))
|
||||||
Helper.RestartApp();
|
Helper.RestartApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task PreTestFailed()
|
private async Task PreTestFailed(string ErrMssg)
|
||||||
{
|
{
|
||||||
BtnPreTest.BackColor = Color.Maroon; // Indicators to the user the test has failed
|
BtnPreTest.BackColor = Color.Maroon; // Indicators to the user the test has failed
|
||||||
BtnPreTest.Text = "Test Failed";
|
BtnPreTest.Text = "Test Failed";
|
||||||
@@ -429,6 +538,23 @@ namespace AiQ_GUI
|
|||||||
BtnNo.Visible = false;
|
BtnNo.Visible = false;
|
||||||
Logging.LogMessage("Pre Test Failed");
|
Logging.LogMessage("Pre Test Failed");
|
||||||
|
|
||||||
|
if (CamOnTest.RMANum == 0) // Yap to check if it is not a RMA
|
||||||
|
{
|
||||||
|
Stats(["Pre Tests Failed", ErrMssg]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Stats("RMA Pre Tests Failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
string RedLbls = string.Join(Environment.NewLine, PnlLbls.Controls
|
||||||
|
.OfType<Label>()
|
||||||
|
.Where(lbl => lbl.ForeColor == Color.Red) // Only include red labels
|
||||||
|
.Select(lbl => lbl.Text)); // Extract text
|
||||||
|
string FullFailureValues = RhTxBxActions.Text + Environment.NewLine + RedLbls;
|
||||||
|
|
||||||
|
StatsDiags(RedLbls, RhTxBxActions.Text); // Log to Access database
|
||||||
|
|
||||||
if (await DisplayQuestion("Test failed, restart?" + Environment.NewLine + "See Actions textbox for details."))
|
if (await DisplayQuestion("Test failed, restart?" + Environment.NewLine + "See Actions textbox for details."))
|
||||||
Helper.RestartApp();
|
Helper.RestartApp();
|
||||||
}
|
}
|
||||||
@@ -549,18 +675,22 @@ namespace AiQ_GUI
|
|||||||
CamOnTest.RMANum = Convert.ToInt32(await DisplayInput("What is the RMA number?"));
|
CamOnTest.RMANum = Convert.ToInt32(await DisplayInput("What is the RMA number?"));
|
||||||
|
|
||||||
if (CamOnTest.RMANum == -1) // Means they chose the 'I don't know' option
|
if (CamOnTest.RMANum == -1) // Means they chose the 'I don't know' option
|
||||||
|
{
|
||||||
await TestFailed(BtnStartTest, "Please get RMA number from operations team before continuing");
|
await TestFailed(BtnStartTest, "Please get RMA number from operations team before continuing");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Found RMA num and want to verify it with user
|
// Found RMA num and want to verify it with user
|
||||||
else if (!await DisplayQuestion($"Is {CamOnTest.RMANum} the RMA Number?")) // '!' because if its not the right RMA number let the user to it manually
|
else if (!await DisplayQuestion($"Is {CamOnTest.RMANum} the RMA Number?")) // '!' because if its not the right RMA number let the user to it manually
|
||||||
{
|
{
|
||||||
CamOnTest.RMANum = Convert.ToInt32(await DisplayInput("What is the RMA number?"));
|
CamOnTest.RMANum = Convert.ToInt32(await DisplayInput("What is the RMA number?"));
|
||||||
|
|
||||||
if (CamOnTest.RMANum == -1) // Means they chose the 'I don't know' option
|
if (CamOnTest.RMANum == -1) // Means they chose the 'I don't know' option
|
||||||
|
{
|
||||||
await TestFailed(BtnStartTest, "Please get RMA number from operations team before continuing");
|
await TestFailed(BtnStartTest, "Please get RMA number from operations team before continuing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddToActionsList("Camera has not been given a valid serial and model number, suggest you run through pre test again and check serial number register for any issues.");
|
AddToActionsList("Camera has not been given a valid serial and model number, suggest you run through pre test again and check serial number register for any issues.");
|
||||||
@@ -622,7 +752,11 @@ namespace AiQ_GUI
|
|||||||
string ProdcutKeyID = await DisplayInput("What is the Key ID?", false);
|
string ProdcutKeyID = await DisplayInput("What is the Key ID?", false);
|
||||||
|
|
||||||
if (RegexCache.VaxtorRegex().IsMatch(ProdcutKeyID)) // Means they chose the 'I don't know' option or isn't valid Key ID
|
if (RegexCache.VaxtorRegex().IsMatch(ProdcutKeyID)) // Means they chose the 'I don't know' option or isn't valid Key ID
|
||||||
|
{
|
||||||
|
Stats("Please Get A Valid Vaxtor Product Key Before Continuing");
|
||||||
await TestFailed(BtnStartTest, "Please get a valid Vaxtor Product Key before continuing");
|
await TestFailed(BtnStartTest, "Please get a valid Vaxtor Product Key before continuing");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DiagsAPI.licenses.raptorKeyID = TxBxProductKey.Text;
|
DiagsAPI.licenses.raptorKeyID = TxBxProductKey.Text;
|
||||||
lblVaxtor.Text += DiagsAPI.licenses.raptorKeyID;
|
lblVaxtor.Text += DiagsAPI.licenses.raptorKeyID;
|
||||||
@@ -671,7 +805,7 @@ namespace AiQ_GUI
|
|||||||
if (!JSONResponse.Contains(NewSerial) || !JSONResponse.Contains(CamOnTest.Model))
|
if (!JSONResponse.Contains(NewSerial) || !JSONResponse.Contains(CamOnTest.Model))
|
||||||
{
|
{
|
||||||
AddToActionsList("Could not set model or serial numbers into camera.");
|
AddToActionsList("Could not set model or serial numbers into camera.");
|
||||||
await PreTestFailed();
|
await PreTestFailed("Failed To Set Model Or Serial Number");
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagsAPI.modelNumber = CamOnTest.Model; // Update Diags and labels
|
DiagsAPI.modelNumber = CamOnTest.Model; // Update Diags and labels
|
||||||
@@ -1659,8 +1793,8 @@ namespace AiQ_GUI
|
|||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const double RealPlateWidthMeters = 0.52; // UK standard plate width
|
const double RealPlateWidthMeters = 0.52; // UK standard plate width
|
||||||
const double FocalLengthPixels = (50 * 1280) / 14.111224; // focal mm * pixel width / sensor width for IQ
|
// const double FocalLengthPixels = (50 * 1280) / 14.111224; // focal mm * pixel width / sensor width for IQ
|
||||||
// const double FocalLengthPixels = (50 * 1920) / 6.95; // focal mm * pixel width / sensor width for AiQ
|
const double FocalLengthPixels = (35 * 1920) / 6.95; // focal mm * pixel width / sensor width for AiQ
|
||||||
const double FrameRate = 25.0; // Frames per second
|
const double FrameRate = 25.0; // Frames per second
|
||||||
|
|
||||||
public class FrameData
|
public class FrameData
|
||||||
@@ -1689,38 +1823,72 @@ namespace AiQ_GUI
|
|||||||
return speedMph;
|
return speedMph;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***** Test & Debug *****
|
// ***** Test & Debug *****
|
||||||
private void BtnTest_Click(object sender, EventArgs e)
|
private async void BtnTest_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Stopwatch stopWatchTest = Stopwatch.StartNew();
|
Stopwatch stopWatchTest = Stopwatch.StartNew();
|
||||||
|
|
||||||
|
//string[,] GOD_JSON = { { "propURI", "rtsp://ADMIN:1234@192.168.0.49:554/live/main" } };
|
||||||
|
//string str = FlexiAPI.BuildJsonUpdate(GOD_JSON, "CameraA");
|
||||||
|
//AddToActionsList(str);
|
||||||
|
|
||||||
List<FrameData> frames = new List<FrameData>
|
// To estimate speed
|
||||||
{
|
//List<FrameData> frames = new List<FrameData>
|
||||||
new FrameData { FrameID = 60192555, PlatePosX = 1172, PlatePosY = 393, PlateWidthPixels = 108 },
|
//{
|
||||||
new FrameData { FrameID = 60192556, PlatePosX = 1103, PlatePosY = 361, PlateWidthPixels = 105 },
|
// new FrameData { FrameID = 60192555, PlatePosX = 1172, PlatePosY = 393, PlateWidthPixels = 108 },
|
||||||
new FrameData { FrameID = 60192558, PlatePosX = 983, PlatePosY = 331, PlateWidthPixels = 99 },
|
// new FrameData { FrameID = 60192556, PlatePosX = 1103, PlatePosY = 361, PlateWidthPixels = 105 },
|
||||||
new FrameData { FrameID = 60192559, PlatePosX = 930, PlatePosY = 301, PlateWidthPixels = 95 },
|
// new FrameData { FrameID = 60192558, PlatePosX = 983, PlatePosY = 331, PlateWidthPixels = 99 },
|
||||||
new FrameData { FrameID = 60192560, PlatePosX = 880, PlatePosY = 304, PlateWidthPixels = 93 },
|
// new FrameData { FrameID = 60192559, PlatePosX = 930, PlatePosY = 301, PlateWidthPixels = 95 },
|
||||||
new FrameData { FrameID = 60192561, PlatePosX = 834, PlatePosY = 278, PlateWidthPixels = 89 },
|
// new FrameData { FrameID = 60192560, PlatePosX = 880, PlatePosY = 304, PlateWidthPixels = 93 },
|
||||||
new FrameData { FrameID = 60192562, PlatePosX = 792, PlatePosY = 229, PlateWidthPixels = 87 },
|
// new FrameData { FrameID = 60192561, PlatePosX = 834, PlatePosY = 278, PlateWidthPixels = 89 },
|
||||||
new FrameData { FrameID = 60192563, PlatePosX = 752, PlatePosY = 208, PlateWidthPixels = 85 },
|
// new FrameData { FrameID = 60192562, PlatePosX = 792, PlatePosY = 229, PlateWidthPixels = 87 },
|
||||||
new FrameData { FrameID = 60192565, PlatePosX = 680, PlatePosY = 187, PlateWidthPixels = 81 },
|
// new FrameData { FrameID = 60192563, PlatePosX = 752, PlatePosY = 208, PlateWidthPixels = 85 },
|
||||||
new FrameData { FrameID = 60192566, PlatePosX = 648, PlatePosY = 167, PlateWidthPixels = 78 },
|
// new FrameData { FrameID = 60192565, PlatePosX = 680, PlatePosY = 187, PlateWidthPixels = 81 },
|
||||||
new FrameData { FrameID = 60192567, PlatePosX = 617, PlatePosY = 149, PlateWidthPixels = 76 },
|
// new FrameData { FrameID = 60192566, PlatePosX = 648, PlatePosY = 167, PlateWidthPixels = 78 },
|
||||||
new FrameData { FrameID = 60192568, PlatePosX = 588, PlatePosY = 132, PlateWidthPixels = 75 },
|
// new FrameData { FrameID = 60192567, PlatePosX = 617, PlatePosY = 149, PlateWidthPixels = 76 },
|
||||||
new FrameData { FrameID = 60192569, PlatePosX = 561, PlatePosY = 100, PlateWidthPixels = 70 },
|
// new FrameData { FrameID = 60192568, PlatePosX = 588, PlatePosY = 132, PlateWidthPixels = 75 },
|
||||||
new FrameData { FrameID = 60192570, PlatePosX = 535, PlatePosY = 85, PlateWidthPixels = 72 },
|
// new FrameData { FrameID = 60192569, PlatePosX = 561, PlatePosY = 100, PlateWidthPixels = 70 },
|
||||||
new FrameData { FrameID = 60192572, PlatePosX = 488, PlatePosY = 70, PlateWidthPixels = 69 },
|
// new FrameData { FrameID = 60192570, PlatePosX = 535, PlatePosY = 85, PlateWidthPixels = 72 },
|
||||||
new FrameData { FrameID = 60192573, PlatePosX = 466, PlatePosY = 55, PlateWidthPixels = 67 }
|
// new FrameData { FrameID = 60192572, PlatePosX = 488, PlatePosY = 70, PlateWidthPixels = 69 },
|
||||||
};
|
// new FrameData { FrameID = 60192573, PlatePosX = 466, PlatePosY = 55, PlateWidthPixels = 67 }
|
||||||
|
//};
|
||||||
|
|
||||||
|
//double Spd = EstimateSpeed(frames);
|
||||||
|
//AddToActionsList("Estimated Speed: " + Spd.ToString("F2") + " MPH");
|
||||||
|
|
||||||
|
|
||||||
|
StatsExcel excelExporter = new();
|
||||||
|
excelExporter.ExportDatabaseToExcel();
|
||||||
|
|
||||||
|
// FakeCamera fakeCamera = new FakeCamera(80); // Create an instance of FakeCamera
|
||||||
|
|
||||||
|
// //CamOnTest.IP = CbBxFoundCams.Text;
|
||||||
|
// _ = fakeCamera.StartAsync(CAMTYPE.BAD).ContinueWith(task =>
|
||||||
|
// {
|
||||||
|
// //Network.Initialize("developer", "Pass123");
|
||||||
|
|
||||||
|
// if (task.IsFaulted)
|
||||||
|
// {
|
||||||
|
// AddToActionsList("Error starting FakeCamera: " + task.Exception?.Message);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// AddToActionsList($"FakeCamera started successfully. IP: {fakeCamera}", false);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// await Task.Delay(3000); // Wait for server to start
|
||||||
|
// CbBxFoundCams.Text = "localhost"; // Should force update in creds an network reinit
|
||||||
|
// CmBoFoundCams_TextChanged(sender, e);
|
||||||
|
// CbBxCameraType.SelectedIndex = CbBxCameraType.Items.Count - 1; // Selects AB12CD as model number
|
||||||
|
|
||||||
|
// await Task.Delay(3000); // Wait for server to start
|
||||||
|
|
||||||
|
//BtnPreTest_Click(sender, e);
|
||||||
|
|
||||||
double Spd = EstimateSpeed(frames);
|
|
||||||
AddToActionsList("Estimated Speed: " + Spd.ToString("F2") + " MPH");
|
|
||||||
|
|
||||||
stopWatchTest.Stop();
|
stopWatchTest.Stop();
|
||||||
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"));
|
//AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,16 +42,17 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ClosedXML" Version="0.105.0" />
|
<PackageReference Include="ClosedXML" Version="0.105.0" />
|
||||||
|
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
|
||||||
<PackageReference Include="Emgu.CV" Version="4.12.0.5764" />
|
<PackageReference Include="Emgu.CV" Version="4.12.0.5764" />
|
||||||
<PackageReference Include="Emgu.CV.runtime.windows" Version="4.12.0.5764" />
|
<PackageReference Include="Emgu.CV.runtime.windows" Version="4.12.0.5764" />
|
||||||
<PackageReference Include="Google.Apis.Auth" Version="1.71.0" />
|
<PackageReference Include="Google.Apis.Auth" Version="1.72.0" />
|
||||||
<PackageReference Include="Google.Apis.Gmail.v1" Version="1.70.0.3833" />
|
<PackageReference Include="Google.Apis.Gmail.v1" Version="1.70.0.3833" />
|
||||||
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.70.0.3819" />
|
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.70.0.3819" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||||
<PackageReference Include="PDFsharp-MigraDoc-gdi" Version="6.2.1" />
|
<PackageReference Include="PDFsharp-MigraDoc-gdi" Version="6.2.2" />
|
||||||
<PackageReference Include="Selenium.Support" Version="4.35.0" />
|
<PackageReference Include="Selenium.Support" Version="4.36.0" />
|
||||||
<PackageReference Include="Selenium.WebDriver" Version="4.35.0" />
|
<PackageReference Include="Selenium.WebDriver" Version="4.36.0" />
|
||||||
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="140.0.7339.8200" />
|
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="141.0.7390.7600" />
|
||||||
<PackageReference Include="SSH.NET" Version="2025.0.0" />
|
<PackageReference Include="SSH.NET" Version="2025.0.0" />
|
||||||
<PackageReference Include="System.Data.OleDb" Version="9.0.9" />
|
<PackageReference Include="System.Data.OleDb" Version="9.0.9" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ namespace AiQ_GUI
|
|||||||
// Be aware this does bypass Flexi's watchdog so settings like zoom, focus, SIG wont keep forever
|
// Be aware this does bypass Flexi's watchdog so settings like zoom, focus, SIG wont keep forever
|
||||||
public static async Task<string> APIHTTPVISCA(string IPAddress, string VISCA, bool IR)
|
public static async Task<string> APIHTTPVISCA(string IPAddress, string VISCA, bool IR)
|
||||||
{
|
{
|
||||||
|
// http://localhost:8080/Infrared-camera-control?commandHex=8101044700000000FF
|
||||||
string suffix = $"-camera-control?commandHex={VISCA}";
|
string suffix = $"-camera-control?commandHex={VISCA}";
|
||||||
|
|
||||||
if (IR) // Add on which camera to control
|
if (IR) // Add on which camera to control
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace AiQ_GUI
|
|||||||
{
|
{
|
||||||
string requestUrl = $"http://{IPAddress}/{suffix}";
|
string requestUrl = $"http://{IPAddress}/{suffix}";
|
||||||
|
|
||||||
HttpClientHandler handler = new HttpClientHandler
|
HttpClientHandler handler = new()
|
||||||
{
|
{
|
||||||
Credentials = new NetworkCredential("developer", DevPass),
|
Credentials = new NetworkCredential("developer", DevPass),
|
||||||
PreAuthenticate = true
|
PreAuthenticate = true
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace AiQ_GUI
|
|||||||
|
|
||||||
public class FakeCamera
|
public class FakeCamera
|
||||||
{
|
{
|
||||||
public const string JSONLoc = "C:\\Users\\BradleyBorn\\OneDrive - MAV Systems Ltd\\Desktop\\AIQ_GUI_TEST\\FakeCameraGood\\";
|
public const string JSONLoc = "C:\\Users\\BradleyBorn\\OneDrive - MAV Systems Ltd\\Desktop\\AiQ_GUI\\AiQ_GUI\\FakeCamera\\";
|
||||||
|
|
||||||
public static bool Snapshot = false;
|
public static bool Snapshot = false;
|
||||||
private HttpListener listener;
|
private HttpListener listener;
|
||||||
@@ -227,8 +227,8 @@ namespace AiQ_GUI
|
|||||||
else if (path.Equals("/Infrared-camera-control") || path.Equals("/Colour-camera-control")) // Fixed
|
else if (path.Equals("/Infrared-camera-control") || path.Equals("/Colour-camera-control")) // Fixed
|
||||||
{
|
{
|
||||||
string viscaReply = "9041FF9051FF";
|
string viscaReply = "9041FF9051FF";
|
||||||
|
//MainForm.Instance.AddToActionsList($"VISCA Command Received: {context.Request.QueryString["commandHex"]}");
|
||||||
if (!RegexCache.VISCARegex().IsMatch(context.Request.QueryString["commandHex"]))
|
if (!RegexCache.VISCAAPIRegex().IsMatch(context.Request.QueryString["commandHex"]))
|
||||||
viscaReply = "9060FF";
|
viscaReply = "9060FF";
|
||||||
|
|
||||||
await HTTPReplySetup(context, viscaReply, 200, "text/plain");
|
await HTTPReplySetup(context, viscaReply, 200, "text/plain");
|
||||||
|
|||||||
21
Helper.cs
21
Helper.cs
@@ -77,23 +77,33 @@ namespace AiQ_GUI
|
|||||||
{
|
{
|
||||||
foreach (int ShuffleOrder in Shuffle())
|
foreach (int ShuffleOrder in Shuffle())
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (ShuffleOrder)
|
switch (ShuffleOrder)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (!await MainForm.Instance.DisplayQuestion("Is the sleeve aligned correctly?"))
|
if (!await MainForm.Instance.DisplayQuestion("Is the sleeve aligned correctly?"))
|
||||||
|
{
|
||||||
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Sleeve not aligned");
|
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Sleeve not aligned");
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!await MainForm.Instance.DisplayQuestion("Are all the screws fitted in the front?"))
|
if (!await MainForm.Instance.DisplayQuestion("Are all the screws fitted in the front?"))
|
||||||
|
{
|
||||||
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Not all front screws fitted");
|
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Not all front screws fitted");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (!await MainForm.Instance.DisplayQuestion("Are all the screws fitted in the rear?"))
|
if (!await MainForm.Instance.DisplayQuestion("Are all the screws fitted in the rear?"))
|
||||||
|
{
|
||||||
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Not all rear screws fitted");
|
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Not all rear screws fitted");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (await MainForm.Instance.DisplayQuestion("Shake unit, does it rattle?"))
|
if (await MainForm.Instance.DisplayQuestion("Shake unit, does it rattle?"))
|
||||||
|
{
|
||||||
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Unit rattles");
|
await MainForm.Instance.TestFailed(Btn, "Visual Test Fail - Unit rattles");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MainForm.Instance.AddToActionsList("Numbering problem in visual test");
|
MainForm.Instance.AddToActionsList("Numbering problem in visual test");
|
||||||
@@ -151,16 +161,12 @@ namespace AiQ_GUI
|
|||||||
double Exp_PSU_V = Convert.ToDouble(CameraAccessInfo.PowerType.Remove(CameraAccessInfo.PowerType.IndexOf('V')));
|
double Exp_PSU_V = Convert.ToDouble(CameraAccessInfo.PowerType.Remove(CameraAccessInfo.PowerType.IndexOf('V')));
|
||||||
double Exp_PSU_I = Math.Round(UniversalData.PowerConsumption / Exp_PSU_V, 2); // 32W device if AiQ Mk2 on medium LED power
|
double Exp_PSU_I = Math.Round(UniversalData.PowerConsumption / Exp_PSU_V, 2); // 32W device if AiQ Mk2 on medium LED power
|
||||||
|
|
||||||
if (PSU_V > Exp_PSU_V + 1 || PSU_V < Exp_PSU_V - 1)
|
if (Math.Abs(PSU_V - Exp_PSU_V) > 1)
|
||||||
{
|
|
||||||
MainForm.Instance.AddToActionsList($"PSU Voltage out of range: {PSUVoltage}V. Expected {Exp_PSU_V}V ± 1V.");
|
MainForm.Instance.AddToActionsList($"PSU Voltage out of range: {PSUVoltage}V. Expected {Exp_PSU_V}V ± 1V.");
|
||||||
}
|
|
||||||
|
|
||||||
if (PSU_I < Exp_PSU_I * 0.8 || PSU_I > Exp_PSU_I * 1.2)
|
if (Math.Abs(PSU_I - Exp_PSU_I) > 0.2 * Math.Abs(Exp_PSU_I))
|
||||||
{
|
|
||||||
MainForm.Instance.AddToActionsList($"PSU Current out of range: {PSUCurrent}A. Expected {Exp_PSU_I}A ± 20%.");
|
MainForm.Instance.AddToActionsList($"PSU Current out of range: {PSUCurrent}A. Expected {Exp_PSU_I}A ± 20%.");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
MainForm.Instance.AddToActionsList("PSU did not reply as expected.");
|
MainForm.Instance.AddToActionsList("PSU did not reply as expected.");
|
||||||
@@ -223,6 +229,9 @@ namespace AiQ_GUI
|
|||||||
[GeneratedRegex(@"^81(( [0-9A-Fa-f]{2})+)? FF$", RegexOptions.Compiled | RegexOptions.IgnoreCase)]
|
[GeneratedRegex(@"^81(( [0-9A-Fa-f]{2})+)? FF$", RegexOptions.Compiled | RegexOptions.IgnoreCase)]
|
||||||
internal static partial Regex VISCARegex();
|
internal static partial Regex VISCARegex();
|
||||||
|
|
||||||
|
[GeneratedRegex(@"^81(([0-9A-Fa-f]{2})+)?FF$", RegexOptions.Compiled | RegexOptions.IgnoreCase)]
|
||||||
|
internal static partial Regex VISCAAPIRegex();
|
||||||
|
|
||||||
[GeneratedRegex(@"^\d{15,19}$", RegexOptions.Compiled | RegexOptions.IgnoreCase)]
|
[GeneratedRegex(@"^\d{15,19}$", RegexOptions.Compiled | RegexOptions.IgnoreCase)]
|
||||||
internal static partial Regex VaxtorRegex();
|
internal static partial Regex VaxtorRegex();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace AiQ_GUI
|
|||||||
// Reads camera model numbers and descriptions from the database, sorts them alphabetically by model number (except "AB12CD", which appears last), and formats each entry as "ModelNumber - Description".
|
// Reads camera model numbers and descriptions from the database, sorts them alphabetically by model number (except "AB12CD", which appears last), and formats each entry as "ModelNumber - Description".
|
||||||
public static string[] ReadCamTypes()
|
public static string[] ReadCamTypes()
|
||||||
{
|
{
|
||||||
List<Tuple<string, string>> modelTuples = new List<Tuple<string, string>>(30); // Preallocate list with estimated capacity to reduce internal resizing
|
List<Tuple<string, string>> modelTuples = new(30); // Preallocate list with estimated capacity to reduce internal resizing
|
||||||
using OleDbConnection conn = new(connString);
|
using OleDbConnection conn = new(connString);
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -100,6 +100,9 @@ namespace AiQ_GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Expected universal data for the GUI, read from the database
|
// Expected universal data for the GUI, read from the database
|
||||||
public class UniversalData
|
public class UniversalData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -66,28 +66,22 @@ namespace AiQ_GUI
|
|||||||
return "Spreadsheet not found";
|
return "Spreadsheet not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(FilePath);
|
using XLWorkbook workbook = new(FilePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
// Start from row 1 and check downwards to find next empty row in column B
|
// Start from row 1 and check downwards to find next empty row in column B
|
||||||
int row = 1;
|
int row = 1;
|
||||||
while (!worksheet.Cell(row, 2).IsEmpty()) // Column B = Serial numbers
|
while (!worksheet.Cell(row, 2).IsEmpty()) // Column B = Serial numbers
|
||||||
{
|
|
||||||
row++;
|
row++;
|
||||||
}
|
|
||||||
|
|
||||||
// Safety check to avoid invalid index
|
// Safety check to avoid invalid index
|
||||||
if (row <= 1)
|
if (row <= 1)
|
||||||
{
|
|
||||||
return "Last serial number not found";
|
return "Last serial number not found";
|
||||||
}
|
|
||||||
|
|
||||||
// Generate new serial number from previous
|
// Generate new serial number from previous
|
||||||
string lastSerialNumber = worksheet.Cell(row - 1, 2).GetString(); // Column B
|
string lastSerialNumber = worksheet.Cell(row - 1, 2).GetString(); // Column B
|
||||||
if (string.IsNullOrWhiteSpace(lastSerialNumber) || !lastSerialNumber.StartsWith("K"))
|
if (string.IsNullOrWhiteSpace(lastSerialNumber) || !lastSerialNumber.StartsWith("K"))
|
||||||
{
|
|
||||||
return "Invalid last serial number format";
|
return "Invalid last serial number format";
|
||||||
}
|
|
||||||
|
|
||||||
int NewSerialNumberInt = Convert.ToInt32(lastSerialNumber.Substring(1)) + 1;
|
int NewSerialNumberInt = Convert.ToInt32(lastSerialNumber.Substring(1)) + 1;
|
||||||
string newSerialNumber = "K" + NewSerialNumberInt;
|
string newSerialNumber = "K" + NewSerialNumberInt;
|
||||||
@@ -124,7 +118,7 @@ namespace AiQ_GUI
|
|||||||
return "Spreadsheet not found";
|
return "Spreadsheet not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(filePath);
|
using XLWorkbook workbook = new(filePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
// Find the row with the matching serial number in column B
|
// Find the row with the matching serial number in column B
|
||||||
@@ -136,8 +130,7 @@ namespace AiQ_GUI
|
|||||||
{
|
{
|
||||||
// Update columns D-E
|
// Update columns D-E
|
||||||
worksheet.Cell(row, 4).Value = "Pre Test: " + DateTime.Now.ToString("dd/MM/yyyy");
|
worksheet.Cell(row, 4).Value = "Pre Test: " + DateTime.Now.ToString("dd/MM/yyyy");
|
||||||
worksheet.Cell(row, 5).Value = Vers.version + " - " + Vers.revision + Environment.NewLine +
|
worksheet.Cell(row, 5).Value = $"{Vers.version} - {Vers.revision}" + Environment.NewLine + Vers.buildtime + Environment.NewLine + Vers.proquint;
|
||||||
Vers.buildtime + Environment.NewLine + Vers.proquint;
|
|
||||||
// Update MAC to column H
|
// Update MAC to column H
|
||||||
worksheet.Cell(row, 8).Value = Vers.MAC;
|
worksheet.Cell(row, 8).Value = Vers.MAC;
|
||||||
|
|
||||||
@@ -172,7 +165,7 @@ namespace AiQ_GUI
|
|||||||
return "Spreadsheet not found";
|
return "Spreadsheet not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(FilePath);
|
using XLWorkbook workbook = new(FilePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
// Find the row with the matching serial number in column B
|
// Find the row with the matching serial number in column B
|
||||||
@@ -224,15 +217,13 @@ namespace AiQ_GUI
|
|||||||
return "Spreadsheet not found";
|
return "Spreadsheet not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(FilePath);
|
using XLWorkbook workbook = new(FilePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
// Find next free row by checking column C
|
// Find next free row by checking column C
|
||||||
int row = 2;
|
int row = 2;
|
||||||
while (!worksheet.Cell(row, 3).IsEmpty()) // Column C
|
while (!worksheet.Cell(row, 3).IsEmpty()) // Column C
|
||||||
{
|
|
||||||
row++;
|
row++;
|
||||||
}
|
|
||||||
|
|
||||||
// Write model, serial, date, and protectionKeyId to columns C–F
|
// Write model, serial, date, and protectionKeyId to columns C–F
|
||||||
worksheet.Cell(row, 3).Value = model; // Column C
|
worksheet.Cell(row, 3).Value = model; // Column C
|
||||||
@@ -263,7 +254,7 @@ namespace AiQ_GUI
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(filePath);
|
using XLWorkbook workbook = new(filePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
int row = 2; // Start from row 2
|
int row = 2; // Start from row 2
|
||||||
@@ -277,12 +268,11 @@ namespace AiQ_GUI
|
|||||||
if (sheetSerial.Contains(serial) && sheetModel.Contains(model))
|
if (sheetSerial.Contains(serial) && sheetModel.Contains(model))
|
||||||
{
|
{
|
||||||
string rmaStr = worksheet.Cell(row, 1).GetString(); // Column A
|
string rmaStr = worksheet.Cell(row, 1).GetString(); // Column A
|
||||||
|
|
||||||
if (int.TryParse(rmaStr, out int rmaNumber))
|
if (int.TryParse(rmaStr, out int rmaNumber))
|
||||||
{
|
|
||||||
return rmaNumber;
|
return rmaNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch { /* Safe to ignore bad row */ }
|
catch { /* Safe to ignore bad row */ }
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
@@ -306,7 +296,7 @@ namespace AiQ_GUI
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(filePath);
|
using XLWorkbook workbook = new(filePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
int row = 1;
|
int row = 1;
|
||||||
@@ -315,11 +305,10 @@ namespace AiQ_GUI
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string cellSerial = worksheet.Cell(row, 2).GetString();
|
string cellSerial = worksheet.Cell(row, 2).GetString();
|
||||||
|
|
||||||
if (cellSerial.Contains(serial))
|
if (cellSerial.Contains(serial))
|
||||||
{
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch { /* Ignore malformed rows */ }
|
catch { /* Ignore malformed rows */ }
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
@@ -343,14 +332,12 @@ namespace AiQ_GUI
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
using XLWorkbook workbook = new XLWorkbook(filePath);
|
using XLWorkbook workbook = new(filePath);
|
||||||
IXLWorksheet worksheet = workbook.Worksheets.First();
|
IXLWorksheet worksheet = workbook.Worksheets.First();
|
||||||
|
|
||||||
int row = 2; // Start from C2
|
int row = 2; // Start from C2
|
||||||
while (!worksheet.Cell(row, 3).IsEmpty()) // Column C = 3
|
while (!worksheet.Cell(row, 3).IsEmpty()) // Column C = 3
|
||||||
{
|
|
||||||
row++;
|
row++;
|
||||||
}
|
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
@@ -368,7 +355,7 @@ namespace AiQ_GUI
|
|||||||
// 1. Ensure spreadsheet exists and has valid starting data
|
// 1. Ensure spreadsheet exists and has valid starting data
|
||||||
if (!File.Exists(filePath))
|
if (!File.Exists(filePath))
|
||||||
{
|
{
|
||||||
XLWorkbook workbook = new XLWorkbook();
|
XLWorkbook workbook = new();
|
||||||
IXLWorksheet ws = workbook.Worksheets.Add("Sheet1");
|
IXLWorksheet ws = workbook.Worksheets.Add("Sheet1");
|
||||||
|
|
||||||
// Pre-fill first row with dummy data for serial
|
// Pre-fill first row with dummy data for serial
|
||||||
@@ -379,7 +366,7 @@ namespace AiQ_GUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Run Pre-Test update
|
// 2. Run Pre-Test update
|
||||||
Versions fakeVersion = new Versions
|
Versions fakeVersion = new()
|
||||||
{
|
{
|
||||||
version = "1.6.4",
|
version = "1.6.4",
|
||||||
revision = "bf16134",
|
revision = "bf16134",
|
||||||
@@ -388,11 +375,11 @@ namespace AiQ_GUI
|
|||||||
MAC = "00:1A:2B:3C:4D:5E"
|
MAC = "00:1A:2B:3C:4D:5E"
|
||||||
};
|
};
|
||||||
|
|
||||||
string preTestResult = Excel.UpdateSpreadSheetPreTest(filePath, fakeVersion, "Fake Cam", "TestModel");
|
string preTestResult = UpdateSpreadSheetPreTest(filePath, fakeVersion, "Fake Cam", "TestModel");
|
||||||
Debug.WriteLine("Pre-Test Result: " + preTestResult);
|
Debug.WriteLine("Pre-Test Result: " + preTestResult);
|
||||||
|
|
||||||
// 3. Run Final Test update
|
// 3. Run Final Test update
|
||||||
Diags fakeDiags = new Diags
|
Diags fakeDiags = new()
|
||||||
{
|
{
|
||||||
serialNumber = preTestResult, // Newly generated serial
|
serialNumber = preTestResult, // Newly generated serial
|
||||||
licenses = new Licenses
|
licenses = new Licenses
|
||||||
@@ -404,13 +391,13 @@ namespace AiQ_GUI
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SSHData fakeSSH = new SSHData
|
SSHData fakeSSH = new()
|
||||||
{
|
{
|
||||||
packages = "\r\nlibvaxtorocr10 - 8.4.20-1\r\nvaxtorocrdatacpu3 - 8.4.20-1",
|
packages = "\r\nlibvaxtorocr10 - 8.4.20-1\r\nvaxtorocrdatacpu3 - 8.4.20-1",
|
||||||
tailscale = true
|
tailscale = true
|
||||||
};
|
};
|
||||||
|
|
||||||
string finalTestResult = Excel.UpdateSpreadSheetFinalTest(filePath, fakeDiags, fakeSSH, 0);
|
string finalTestResult = UpdateSpreadSheetFinalTest(filePath, fakeDiags, fakeSSH, 0);
|
||||||
Debug.WriteLine("Final-Test Result: " + finalTestResult);
|
Debug.WriteLine("Final-Test Result: " + finalTestResult);
|
||||||
|
|
||||||
// // 4. Run Vaxtor update
|
// // 4. Run Vaxtor update
|
||||||
|
|||||||
247
Microsoft/StatsExcel.cs
Normal file
247
Microsoft/StatsExcel.cs
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.OleDb;
|
||||||
|
using ClosedXML.Excel;
|
||||||
|
|
||||||
|
namespace AiQ_GUI.Microsoft
|
||||||
|
{
|
||||||
|
internal class StatsExcel
|
||||||
|
{
|
||||||
|
private const string connString =
|
||||||
|
@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\Shared drives\MAV Production GUI's\AiQ\GUI's\AiQ_Final_Test.accdb;Persist Security Info=False;OLE DB Services=-1;";
|
||||||
|
|
||||||
|
private readonly string exportPath =
|
||||||
|
@"C:\Users\BradleyBorn\OneDrive - MAV Systems Ltd\Desktop\AiQ_Test_Stats.xlsx";
|
||||||
|
|
||||||
|
public void ExportDatabaseToExcel()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList("=== ExportDatabaseToExcel START ===");
|
||||||
|
|
||||||
|
using (OleDbConnection conn = new(connString))
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
MainForm.Instance.AddToActionsList("Connected to Access database.");
|
||||||
|
|
||||||
|
DateTime now = DateTime.Now;
|
||||||
|
|
||||||
|
// ==================== MAIN STATS EXPORT ====================
|
||||||
|
string selectColumns = @"
|
||||||
|
ModelNumber,
|
||||||
|
[Total Tests Run],
|
||||||
|
[Pre Tests Passed],
|
||||||
|
[Pre Tests Failed],
|
||||||
|
[Final Tests Passed],
|
||||||
|
[Final Tests Failed],
|
||||||
|
[RMA Total Tests Run],
|
||||||
|
[RMA Pre Tests Passed],
|
||||||
|
[RMA Pre Tests Failed],
|
||||||
|
[RMA Final Tests Passed],
|
||||||
|
[RMA Final Tests Failed],
|
||||||
|
[Diagnostic Failure],
|
||||||
|
[Failed To Set Model Or Serial Number],
|
||||||
|
[Camera Not In Test Tube],
|
||||||
|
[Could Not Zoom Modules To 8000],
|
||||||
|
[Could Not Zoom Modules To Full Wide],
|
||||||
|
[Please Get RMA Number From Operations Team Before Continuing],
|
||||||
|
[Please Get A Valid Vaxtor Product Key Before Continuing],
|
||||||
|
[Visual Test Fail - Sleeve Not Aligned],
|
||||||
|
[Visual Test Fail - Not All Front Screws Fitted],
|
||||||
|
[Visual Test Fail - Not All Rear Screws Fitted],
|
||||||
|
[Visual Test Fail - Unit rattles]";
|
||||||
|
|
||||||
|
string query = $@"
|
||||||
|
SELECT
|
||||||
|
{selectColumns}
|
||||||
|
FROM AiQ";
|
||||||
|
|
||||||
|
OleDbDataAdapter adapter = new(query, conn);
|
||||||
|
DataTable dataTable = new();
|
||||||
|
adapter.Fill(dataTable);
|
||||||
|
|
||||||
|
if (dataTable.Rows.Count == 0)
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList("No data found in AiQ table.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string monthName = now.ToString("MMMM");
|
||||||
|
string sheetName = $"{monthName} Stats";
|
||||||
|
|
||||||
|
MainForm.Instance.AddToActionsList($"Adding sheet: {sheetName}");
|
||||||
|
|
||||||
|
XLWorkbook workbook;
|
||||||
|
if (System.IO.File.Exists(exportPath))
|
||||||
|
{
|
||||||
|
workbook = new XLWorkbook(exportPath);
|
||||||
|
MainForm.Instance.AddToActionsList("Opened existing workbook.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
workbook = new XLWorkbook();
|
||||||
|
MainForm.Instance.AddToActionsList("Created new workbook (file not found).");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (workbook.Worksheets.Contains(sheetName))
|
||||||
|
{
|
||||||
|
workbook.Worksheet(sheetName).Delete();
|
||||||
|
MainForm.Instance.AddToActionsList($"Deleted old sheet: {sheetName}");
|
||||||
|
}
|
||||||
|
|
||||||
|
var ws = workbook.Worksheets.Add(sheetName);
|
||||||
|
ws.Cell(1, 1).InsertTable(dataTable, "AiQ_Stats", true);
|
||||||
|
ws.Columns().AdjustToContents();
|
||||||
|
|
||||||
|
ws.Cell(1, dataTable.Columns.Count + 2).Value = "Exported:";
|
||||||
|
ws.Cell(2, dataTable.Columns.Count + 2).Value = now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
// ==================== DIAGS STATS EXPORT (CURRENT MONTH ONLY) ====================
|
||||||
|
MainForm.Instance.AddToActionsList("Exporting DiagsStats for current month...");
|
||||||
|
|
||||||
|
DateTime monthStart = new DateTime(now.Year, now.Month, 1);
|
||||||
|
DateTime nextMonth = monthStart.AddMonths(1);
|
||||||
|
|
||||||
|
string diagsQuery = @"
|
||||||
|
SELECT
|
||||||
|
[Date],
|
||||||
|
[Model],
|
||||||
|
[Red Diags Labels],
|
||||||
|
[RhTxBxActions Contents]
|
||||||
|
FROM DiagsStats
|
||||||
|
WHERE [Date] >= ? AND [Date] < ?";
|
||||||
|
|
||||||
|
OleDbDataAdapter diagsAdapter = new(diagsQuery, conn);
|
||||||
|
diagsAdapter.SelectCommand.Parameters.Add(new OleDbParameter { OleDbType = OleDbType.Date, Value = monthStart });
|
||||||
|
diagsAdapter.SelectCommand.Parameters.Add(new OleDbParameter { OleDbType = OleDbType.Date, Value = nextMonth });
|
||||||
|
|
||||||
|
DataTable diagsTable = new();
|
||||||
|
diagsAdapter.Fill(diagsTable);
|
||||||
|
|
||||||
|
if (diagsTable.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
int startRow = ws.LastRowUsed().RowNumber() + 3;
|
||||||
|
|
||||||
|
ws.Cell(startRow, 1).Value = "Diags Stats (Current Month)";
|
||||||
|
ws.Cell(startRow, 1).Style.Font.Bold = true;
|
||||||
|
ws.Cell(startRow, 1).Style.Font.FontSize = 12;
|
||||||
|
|
||||||
|
ws.Cell(startRow + 1, 1).InsertTable(diagsTable, "Diags_Stats", true);
|
||||||
|
ws.Columns().AdjustToContents();
|
||||||
|
|
||||||
|
MainForm.Instance.AddToActionsList($"Added DiagsStats ({diagsTable.Rows.Count} rows) starting at row {startRow}.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList("No DiagsStats data found for current month.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== SAVE MAIN SHEET ====================
|
||||||
|
workbook.SaveAs(exportPath);
|
||||||
|
MainForm.Instance.AddToActionsList($"Added {sheetName} to workbook: {exportPath}");
|
||||||
|
|
||||||
|
workbook.Dispose();
|
||||||
|
|
||||||
|
// ==================== BACKUP TABLE (ALWAYS, BEFORE RESET) ====================
|
||||||
|
string ts = now.ToString("yyyyMMdd_HHmmss");
|
||||||
|
string backupTableName = $"Ztats_{ts}";
|
||||||
|
|
||||||
|
if (backupTableName.Length > 64)
|
||||||
|
backupTableName = backupTableName.Substring(0, 64);
|
||||||
|
|
||||||
|
string backupSql = $@"
|
||||||
|
SELECT
|
||||||
|
{selectColumns}
|
||||||
|
INTO [{backupTableName}]
|
||||||
|
FROM AiQ";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var cmdBackup = new OleDbCommand(backupSql, conn))
|
||||||
|
{
|
||||||
|
cmdBackup.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
MainForm.Instance.AddToActionsList($"Created backup table: [{backupTableName}]");
|
||||||
|
}
|
||||||
|
catch (Exception backupEx)
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList($"ERROR creating backup table [{backupTableName}]. Aborting reset to protect data. Details: {backupEx.Message}");
|
||||||
|
MainForm.Instance.AddToActionsList("=== ExportDatabaseToExcel END (backup failed, no reset) ===");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var tx = conn.BeginTransaction())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string resetSql = @"
|
||||||
|
UPDATE AiQ SET
|
||||||
|
[Total Tests Run] = 0,
|
||||||
|
[Pre Tests Passed] = 0,
|
||||||
|
[Pre Tests Failed] = 0,
|
||||||
|
[Final Tests Passed] = 0,
|
||||||
|
[Final Tests Failed] = 0,
|
||||||
|
[RMA Total Tests Run] = 0,
|
||||||
|
[RMA Pre Tests Passed] = 0,
|
||||||
|
[RMA Pre Tests Failed] = 0,
|
||||||
|
[RMA Final Tests Passed] = 0,
|
||||||
|
[RMA Final Tests Failed] = 0,
|
||||||
|
[Diagnostic Failure] = 0,
|
||||||
|
[Failed To Set Model Or Serial Number] = 0,
|
||||||
|
[Camera Not In Test Tube] = 0,
|
||||||
|
[Could Not Zoom Modules To 8000] = 0,
|
||||||
|
[Could Not Zoom Modules To Full Wide] = 0,
|
||||||
|
[Please Get RMA Number From Operations Team Before Continuing] = 0,
|
||||||
|
[Please Get A Valid Vaxtor Product Key Before Continuing] = 0,
|
||||||
|
[Visual Test Fail - Sleeve Not Aligned] = 0,
|
||||||
|
[Visual Test Fail - Not All Front Screws Fitted] = 0,
|
||||||
|
[Visual Test Fail - Not All Rear Screws Fitted] = 0,
|
||||||
|
[Visual Test Fail - Unit rattles] = 0;";
|
||||||
|
|
||||||
|
using (var cmdReset = new OleDbCommand(resetSql, conn, tx))
|
||||||
|
{
|
||||||
|
int affected = cmdReset.ExecuteNonQuery();
|
||||||
|
MainForm.Instance.AddToActionsList($"Zeroed counters on AiQ rows: {affected} row(s).");
|
||||||
|
}
|
||||||
|
|
||||||
|
int updatedRows;
|
||||||
|
using (var cmdUpd = new OleDbCommand("UPDATE UniversalData SET LastStatsRun = ?", conn, tx))
|
||||||
|
{
|
||||||
|
cmdUpd.Parameters.Add(new OleDbParameter { OleDbType = OleDbType.Date, Value = now });
|
||||||
|
updatedRows = cmdUpd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updatedRows == 0)
|
||||||
|
{
|
||||||
|
using (var cmdIns = new OleDbCommand("INSERT INTO UniversalData (LastStatsRun) VALUES (?)", conn, tx))
|
||||||
|
{
|
||||||
|
cmdIns.Parameters.Add(new OleDbParameter { OleDbType = OleDbType.Date, Value = now });
|
||||||
|
cmdIns.ExecuteNonQuery();
|
||||||
|
MainForm.Instance.AddToActionsList("Inserted LastStatsRun row.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList("Updated LastStatsRun successfully.");
|
||||||
|
}
|
||||||
|
|
||||||
|
tx.Commit();
|
||||||
|
MainForm.Instance.AddToActionsList("Reset committed.");
|
||||||
|
}
|
||||||
|
catch (Exception resetEx)
|
||||||
|
{
|
||||||
|
tx.Rollback();
|
||||||
|
MainForm.Instance.AddToActionsList($"ERROR during reset, rolled back. Details: {resetEx.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MainForm.Instance.AddToActionsList("=== ExportDatabaseToExcel END ===");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList($"ERROR exporting stats: {ex.Message}");
|
||||||
|
MainForm.Instance.AddToActionsList($"Stack Trace: {ex.StackTrace}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -86,6 +86,8 @@ namespace AiQ_GUI
|
|||||||
|
|
||||||
Properties.Settings.Default.FirstRun = false;
|
Properties.Settings.Default.FirstRun = false;
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
|
|
||||||
|
Application.Restart(); // Restart to not be in admin mode
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user