Exemple #1
0
        private void Init()
        {
            List <Tap> taps = new List <Tap> {
                new Tap(false, 50, GasolineType.Petrol, 1.54),
                new Tap(false, 50, GasolineType.Diesel, 1.5),
                new Tap(false, 50, GasolineType.Unleaded95, 1.39),
            };

            PetrolPumps = new List <PetrolPump>();


            PetrolPump petrolPump1 = new PetrolPump("1", taps);
            PetrolPump petrolPump2 = new PetrolPump("2", taps);
            PetrolPump petrolPump3 = new PetrolPump("3", taps);

            PetrolPumps.Add(petrolPump1);
            PetrolPumps.Add(petrolPump2);
            PetrolPumps.Add(petrolPump3);


            Checkouts = new List <Checkout>();

            Checkout checkout1 = new Checkout(1, 30, 30, 30, 30, 30, 30, 30, 30, 30, 20, 15, 15);
            Checkout checkout2 = new Checkout(2, 30, 30, 30, 30, 30, 30, 30, 30, 30, 20, 15, 15);
            Checkout checkout3 = new Checkout(3, 30, 30, 30, 30, 30, 30, 30, 30, 30, 20, 15, 15);

            Checkouts.Add(checkout1);
            Checkouts.Add(checkout2);
            Checkouts.Add(checkout3);
        }
Exemple #2
0
        /// <summary>
        /// After pumping the pump is blocked and several parameters are recorded
        /// </summary>
        /// <param name="usedPump"></param>
        /// <param name="usedGasolineType"></param>
        /// <param name="litersPumped"></param>
        /// <param name="amountOwed"></param>
        public void FinishedPumping(PetrolPump usedPump, GasolineType usedGasolineType, double litersPumped, double amountOwed)
        {
            usedPump.WasUsed     = true;
            usedPump.AmountOwned = amountOwed;
            Tap usedTap = Taps.Where(x => x.GasolineType == usedGasolineType).FirstOrDefault();

            usedTap.LiterPerTank -= litersPumped;
            OnPumpWasUsed(EventArgs.Empty);
        }
Exemple #3
0
 /// <summary>
 /// After payment was received the open is reset and reopened
 /// </summary>
 /// <param name="usedPump"></param>
 public void OpenPump(PetrolPump usedPump)
 {
     usedPump.WasUsed     = false;
     usedPump.AmountOwned = 0;
     OnPumpIsPayed(EventArgs.Empty);
 }