Selenium is wired to the settings page and has been modified to allow screenshot to be taken at any time

This commit is contained in:
2023-04-26 14:04:39 +02:00
parent d935a07076
commit e0d5f82467
7 changed files with 336 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ namespace Test_Merge
private int _grandPrixYear = 2000;
private List<string> _driverList = new List<string>();
private F1TVEmulator Emulator = null;
private bool CreatingZone = false;
private Point ZoneP1;
private Point ZoneP2;
@@ -256,5 +258,29 @@ namespace Test_Merge
}
return new Rectangle(newP1.X, newP1.Y,newP2.X-newP1.X,newP2.Y -newP2.Y);
}
private async void btnRefresh_Click(object sender, EventArgs e)
{
if (Emulator == null)
{
Emulator = new F1TVEmulator(tbxGpUrl.Text);
}
if (!Emulator.Ready)
{
if (await Emulator.Start() != 0)
{
MessageBox.Show("Could not start the emulator");
}
else
{
pbxMain.Image = Emulator.Screenshot();
}
}
else
{
pbxMain.Image = Emulator.Screenshot();
}
}
}
}