Exemplo n.º 1
0
        //Method to load station
        private void Station_Load(object sender, EventArgs e)
        {
            //Loop to create pumps
            for (int i = 1; i <= 9; i++)
            {
                Pump pump = new Pump();
                pump.isFree = true;
                pump.Id     = i;
                pump.name   = "pump" + i.ToString();
                pumps.Add(pump);
                foreach (Control cnt in Controls)
                {
                    if (cnt is Label)
                    {
                        if (cnt.Name == pump.name)
                        {
                            cnt.Text += "";
                        }
                    }
                }
            }

            GetNewVehicle.Start(); //Get a vehicle with random attributes in random time interval.
            CheckPump.Start();     //Check pumps and assign free pump for the first vehicle in the queue
            SecondCounter.Start(); //Starts timer for fuelling
        }
Exemplo n.º 2
0
 /// <summary>
 /// Nollaa ajastimen tilan.
 /// Myös suorituskerrat nollataan.
 /// </summary>
 public void Reset()
 {
     SecondCounter.Reset();
     Times.Reset();
     timeToTrigger = trigInterval;
 }