Added all the files needed for calibration and detection but it now needs to be wired up

This commit is contained in:
2023-04-26 15:55:00 +02:00
parent e0d5f82467
commit 0080104072
17 changed files with 1819 additions and 12 deletions

View File

@@ -261,6 +261,7 @@ namespace Test_Merge
private async void btnRefresh_Click(object sender, EventArgs e)
{
btnRefresh.Enabled = false;
if (Emulator == null)
{
Emulator = new F1TVEmulator(tbxGpUrl.Text);
@@ -268,9 +269,30 @@ namespace Test_Merge
if (!Emulator.Ready)
{
if (await Emulator.Start() != 0)
Task<int> start = Task.Run(() => Emulator.Start());
int errorCode = await start;
if (errorCode != 0)
{
MessageBox.Show("Could not start the emulator");
string message;
switch (errorCode)
{
case 101:
message = "Error " + errorCode + " Could not start the driver. It could be because an other instance is runnin make sure you closed them all before trying again";
break;
case 102:
message = "Error " + errorCode + " Could not navigate on the F1TV site. Make sure the correct URL has been given and that you logged from chrome. It can take a few minutes to update";
break;
case 103:
message = "Error "+errorCode+" The url is not a valid url";
break;
case 104:
message = "Error "+errorCode+" The url is not a valid url";
break;
default:
message = "Could not start the emulator Error " + errorCode;
break;
}
MessageBox.Show(message);
}
else
{
@@ -281,6 +303,7 @@ namespace Test_Merge
{
pbxMain.Image = Emulator.Screenshot();
}
btnRefresh.Enabled = true;
}
}
}