Fixed the waiting time calculation and added graphical representation on the checkouts fill

This commit is contained in:
2023-01-11 13:23:56 +01:00
parent 1ba25e36da
commit 435193b59f
5 changed files with 56 additions and 42 deletions
+3 -19
View File
@@ -22,32 +22,16 @@ namespace Caisses
Clients = new List<Client>();
Open = false;
}
public void Tick(int averageWaitingTime, int CrossoverTime)
public void Tick(int averageWaitingTime, int CrossoverTime, int openedCheckoutsCount)
{
if (!Open && averageWaitingTime > CrossoverTime)
if (!Open && averageWaitingTime > CrossoverTime || openedCheckoutsCount == 0)
{
Open = true;
}
if (Open && averageWaitingTime < CrossoverTime && Clients.Count == 0)
if (Open && averageWaitingTime < 1 && Clients.Count == 0 && openedCheckoutsCount > 1)
{
Open = false;
}
/*
if (Clients.Count != 0)
{
//This is the first client inline
Client client = Clients[0];
if (client.State == Client.ClientState.Inline)
client.State = Client.ClientState.Checkout;
if (client.CheckoutTime <= 0)
{
I think we need to do this processing in the store
}
}
*/
}
}
}