Changes to SSH including new password
This commit is contained in:
77
AiQ_GUI.cs
77
AiQ_GUI.cs
@@ -635,8 +635,8 @@ namespace AiQ_GUI
|
||||
lblTrim.Text += "H: " + DiagsAPI.trim[0] + " V: " + DiagsAPI.trim[1];
|
||||
|
||||
// Offset accounted for in the SetTrim function, so value should be close to 0,0.
|
||||
int HMax = 96; // 5% of 1920 each way = ±96
|
||||
int VMax = 54; // 5% of 1080 each way = ±54
|
||||
const int HMax = 96; // 5% of 1920 each way = ±96
|
||||
const int VMax = 54; // 5% of 1080 each way = ±54
|
||||
|
||||
if (Math.Abs(DiagsAPI.trim[0]) <= HMax && Math.Abs(DiagsAPI.trim[1]) <= VMax)
|
||||
lblTrim.ForeColor = Color.LightGreen;
|
||||
@@ -1000,9 +1000,8 @@ namespace AiQ_GUI
|
||||
PnlInputValue.Visible = true;
|
||||
|
||||
while (Flags.Done == false) // Waiting for user input in RMA Num panel
|
||||
{
|
||||
await Task.Delay(100); // Check every 100ms
|
||||
}
|
||||
|
||||
Flags.Done = false; // Reset flag
|
||||
|
||||
PnlInputValue.Visible = false;
|
||||
@@ -1654,78 +1653,14 @@ namespace AiQ_GUI
|
||||
BtnFactoryDefault.BackColor = Color.Green;
|
||||
}
|
||||
|
||||
// Constants
|
||||
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 = (35 * 1920) / 6.95; // focal mm * pixel width / sensor width for AiQ
|
||||
const double FrameRate = 25.0; // Frames per second
|
||||
|
||||
public class FrameData
|
||||
{
|
||||
public long FrameID;
|
||||
public int PlatePosX;
|
||||
public int PlatePosY;
|
||||
public int PlateWidthPixels;
|
||||
}
|
||||
|
||||
public double EstimateSpeed(List<FrameData> frames)
|
||||
{
|
||||
double TimeElapsed = 0;
|
||||
int frameCount = frames.Count;
|
||||
|
||||
for (int i = 1; i < frameCount; i++)
|
||||
{
|
||||
double time = (frames[i].FrameID - frames[i - 1].FrameID) / FrameRate;
|
||||
TimeElapsed += time;
|
||||
}
|
||||
|
||||
double FarDist = (FocalLengthPixels * RealPlateWidthMeters) / frames[0].PlateWidthPixels;
|
||||
double CloseDist = (FocalLengthPixels * RealPlateWidthMeters) / frames[frameCount - 1].PlateWidthPixels;
|
||||
|
||||
double speedMph = (Math.Abs(FarDist - CloseDist) / TimeElapsed) * 2.237;
|
||||
return speedMph;
|
||||
}
|
||||
|
||||
// ***** Test & Debug *****
|
||||
private async void BtnTest_Click(object sender, EventArgs e)
|
||||
{
|
||||
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");
|
||||
//string OUT = await FlexiAPI.HTTP_Update("CameraA", "100.118.196.113:8080", GOD_JSON);
|
||||
//AddToActionsList(OUT);
|
||||
|
||||
string[,] TEST_JSON = { { "propSerialNumber", "1234567" }, { "propMavModelNumber", "XA45HF" } };
|
||||
string JSONResponse = await FlexiAPI.HTTP_Update("Internal Config", "100.118.196.113", TEST_JSON);
|
||||
AddToActionsList(JSONResponse);
|
||||
|
||||
//string OUT = await FlexiAPI.HTTP_Fetch("InternalConfig", "100.118.196.113");
|
||||
//AddToActionsList(OUT);
|
||||
|
||||
// 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 = 60192558, PlatePosX = 983, PlatePosY = 331, PlateWidthPixels = 99 },
|
||||
// new FrameData { FrameID = 60192559, PlatePosX = 930, PlatePosY = 301, PlateWidthPixels = 95 },
|
||||
// new FrameData { FrameID = 60192560, PlatePosX = 880, PlatePosY = 304, PlateWidthPixels = 93 },
|
||||
// new FrameData { FrameID = 60192561, PlatePosX = 834, PlatePosY = 278, PlateWidthPixels = 89 },
|
||||
// new FrameData { FrameID = 60192562, PlatePosX = 792, PlatePosY = 229, PlateWidthPixels = 87 },
|
||||
// new FrameData { FrameID = 60192563, PlatePosX = 752, PlatePosY = 208, PlateWidthPixels = 85 },
|
||||
// new FrameData { FrameID = 60192565, PlatePosX = 680, PlatePosY = 187, PlateWidthPixels = 81 },
|
||||
// new FrameData { FrameID = 60192566, PlatePosX = 648, PlatePosY = 167, PlateWidthPixels = 78 },
|
||||
// new FrameData { FrameID = 60192567, PlatePosX = 617, PlatePosY = 149, PlateWidthPixels = 76 },
|
||||
// new FrameData { FrameID = 60192568, PlatePosX = 588, PlatePosY = 132, PlateWidthPixels = 75 },
|
||||
// new FrameData { FrameID = 60192569, PlatePosX = 561, PlatePosY = 100, PlateWidthPixels = 70 },
|
||||
// new FrameData { FrameID = 60192570, PlatePosX = 535, PlatePosY = 85, PlateWidthPixels = 72 },
|
||||
// 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");
|
||||
string[,] Vaxtor_JSON = { { "propMinCharHeight", "14" }, { "propMinGlobalConfidence", "30" } };
|
||||
string response = await FlexiAPI.HTTP_Update("RaptorOCR", "192.168.0.100", Vaxtor_JSON);
|
||||
AddToActionsList(response);
|
||||
|
||||
stopWatchTest.Stop();
|
||||
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"));
|
||||
|
||||
Reference in New Issue
Block a user