Added a lot to the doc and modified the pdf generation

This commit is contained in:
2023-06-02 13:41:12 +02:00
parent bef8b9d635
commit a368e02453
113 changed files with 54217 additions and 17276 deletions
+21 -5
View File
@@ -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));