Example #1
0
        private void UpdateDisplay()
        {
            if (entrySensor.IsCarOnSensor())
            {
                lblEntrySensor.Text = "True";      //entry sensor
            }

            else
            {
                lblEntrySensor.Text = "False";
            }

            if (entryBarrier.IsLifted())
            {
                lblEntryBarrier.Text = "True";     //entry barrier
            }
            else
            {
                lblEntryBarrier.Text = "False";
            }

            if (exitSensor.IsCarOnSensor())
            {
                lblExitSensor.Text = "True";       //exit sensor
            }
            else
            {
                lblExitSensor.Text = "False";
            }

            if (exitBarrier.IsLifted())
            {
                lblExitBarrier.Text = "True";          //exit barrier
            }

            else
            {
                lblExitBarrier.Text = "False";
            }

            if (fullSign.IsLit())
            {
                lblFullSign.Text = "True";             //fullsign
            }

            else
            {
                lblFullSign.Text = "False";
            }

            int spaces = carPark.GetCurrentSpaces();

            lblSpaces.Text = spaces.ToString();          //spaces

            if (carPark.IsFull())
            {
                btnCarArrivesAtEntrance.Visible = false;
            }
        }
Example #2
0
 private void UpdateDisplay()
 {
     lblEntrySensor.Text     = "" + entrySensor.IsCarOnSensor();
     lblExitSensor.Text      = "" + exitSensor.IsCarOnSensor();
     lblEntryBarrier.Text    = "" + entryBarrier.IsLifted();
     lblExitBarrier.Text     = "" + exitBarrier.IsLifted();
     lblSpaces.Text          = "" + carPark.GetCurrentSpaces();
     lblFullSign.Text        = "" + fullSign.IsLit();
     lblTicketMachine.Text   = "" + ticketMachine.GetMessage();
     lblTicketValidator.Text = "" + ticketValidator.GetMessage();
 }
Example #3
0
        public void CarEnteredCarPark()
        {
            ticketMachine.ClearMessage();
            entryBarrier.Lower();
            currentSpaces = currentSpaces + 1;
            GetCurrentSpaces();

            if (currentSpaces == 5)
            {
                fullSign.SetLit(true);
                fullSign.IsLit();
            }
        }
        private void UpdateDisplay()

        {
            lblPaystation.Text      = Convert.ToString(PayForTicket.GetMessage());
            lblSpaces.Text          = Convert.ToString(carPark.GetCurrentSpaces());
            lblEntryBarrier.Text    = Convert.ToString(entryBarrier.IsLifted());
            lblEntrySensor.Text     = Convert.ToString(entrySensor.IsCarOnSensor());
            lblExitBarrier.Text     = Convert.ToString(exitBarrier.IsLifted());
            lblExitSensor.Text      = Convert.ToString(exitSensor.IsCarOnSensor());
            lblFullSign.Text        = Convert.ToString(fullSign.IsLit());
            lblTicketMachine.Text   = ticketMachine.GetMessage();
            lblTicketValidator.Text = ticketValidator.GetMessage();
            lstActiveTickets.Items.Clear();
            // used to loop over every ticket item in ticketList
            foreach (Ticket ticket in activeTickets.ticketList)
            {
                // add a random hashcode for the ticket while displaying its paid status
                lstActiveTickets.Items.Add("#" + ticket.GetHashCode() + ": " + ticket.IsPaid());
            }
        }
Example #5
0
        private void UpdateDisplay(bool updateTicketList)
        {
            lblTicketMachine.Text   = ticketMachine.GetMessage();
            lblTicketValidator.Text = ticketValidator.GetMessage();
            lblEntrySensor.Text     = entrySensor.IsCarOnSensor().ToString();
            lblEntryBarrier.Text    = entryBarrier.IsLifted().ToString();
            lblExitSensor.Text      = exitSensor.IsCarOnSensor().ToString();
            lblExitBarrier.Text     = exitBarrier.IsLifted().ToString();
            lblFullSign.Text        = fullSign.IsLit().ToString();
            lblSpaces.Text          = carPark.GetCurrentSpaces().ToString();

            if (updateTicketList)
            {
                lstActiveTickets.Items.Clear();

                foreach (Ticket t in activeTickets.GetTickets())
                {
                    lstActiveTickets.Items.Add("#" + t.getID() + " : " + t.IsPaid());
                }
            }

            if (lstActiveTickets.SelectedItem != null)
            {
                btnInsertTicket.Visible = true;
            }

            if (btnDriverPressesForTicket.Visible == true)
            {
                btnCarArrivesAtEntrance.Visible = false;
                btnCarEntersCarPark.Visible     = false;
            }

            if (btnCarEntersCarPark.Visible == true)
            {
                btnCarArrivesAtEntrance.Visible   = false;
                btnDriverPressesForTicket.Visible = false;
            }

            if (btnInsertCoins.Visible == true)
            {
                btnInsertTicket.Visible = false;
            }

            if (panelPayment.Visible == true)
            {
                btnInsertCoins.Visible = false;
            }

            if (btnDriverEntersTicket.Visible == true)
            {
                btnCarArrivesAtExit.Visible = false;
                btnCarExitsCarPark.Visible  = false;
            }

            if (btnCarExitsCarPark.Visible == true)
            {
                btnCarArrivesAtExit.Visible   = false;
                btnDriverEntersTicket.Visible = false;
            }

            if (carPark.GetCurrentSpaces() == 0)
            {
                btnCarArrivesAtEntrance.Visible = false;
            }
        }