Added a lot to the doc and modified the pdf generation
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/// Author : Maxime Rohmer
|
||||
/// Date : 08/05/2023
|
||||
/// Date : 30/05/2023
|
||||
/// File : DriverDrsWindow.cs
|
||||
/// Brief : Window containing DRS related method and infos
|
||||
/// Version : 0.1
|
||||
/// Version : Alpha 1.0
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,9 +13,9 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Tesseract;
|
||||
|
||||
namespace Test_Merge
|
||||
namespace TrackTrends
|
||||
{
|
||||
internal class DriverDrsWindow:Window
|
||||
public class DriverDrsWindow:Window
|
||||
{
|
||||
private static int EmptyDrsGreenValue = -1;
|
||||
private static Random rnd = new Random();
|
||||
@@ -23,9 +23,17 @@ namespace Test_Merge
|
||||
{
|
||||
Name = "DRS";
|
||||
}
|
||||
public override async Task<object> DecodePng()
|
||||
/// <summary>
|
||||
/// Method that will decode the content of the window
|
||||
/// </summary>
|
||||
/// <returns>returns a boolean (true = DRS OPEN, false = DRS CLOSED)</returns>
|
||||
public override object DecodePng()
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
//DEBUG
|
||||
//WindowImage.Save("./DRS/"+rnd.Next(0,99999)+".png");
|
||||
|
||||
int greenValue = GetGreenPixels();
|
||||
if (EmptyDrsGreenValue == -1)
|
||||
EmptyDrsGreenValue = greenValue;
|
||||
@@ -35,6 +43,10 @@ namespace Test_Merge
|
||||
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// Method that will get the green pixel proportion in the image, this can be used to determin if the DRS has been actuated
|
||||
/// </summary>
|
||||
/// <returns>The number of clearely green pixels</returns>
|
||||
private unsafe int GetGreenPixels()
|
||||
{
|
||||
int tot = 0;
|
||||
@@ -69,6 +81,10 @@ namespace Test_Merge
|
||||
|
||||
return tot;
|
||||
}
|
||||
/// <summary>
|
||||
/// This method is used to lock on where exactly the DRS window is
|
||||
/// </summary>
|
||||
/// <returns>Returns a rectangle containing the DRS</returns>
|
||||
public Rectangle GetBox()
|
||||
{
|
||||
var tessImage = Pix.LoadFromMemory(ImageToByte(WindowImage));
|
||||
|
||||
Reference in New Issue
Block a user