Exemple #1
0
        private void CarArrivesAtExit(object sender, EventArgs e)
        {
            exitSensor.CarDetected(carPark);

            if (exitSensor.IsCarOnSensor())
            {
                lblTicketValidator.Text = ticketValidator.GetMessage("Please insert your ticket.");
            }

            btnCarArrivesAtExit.Visible   = false;
            btnDriverEntersTicket.Visible = true;
            UpdateDisplay();
        }
Exemple #2
0
        private void UpdateDisplay()
        {
            if (entryBarrier.isLifted() == true)
            {
                lblEntryBarrier.Text = "True";
            }
            else
            {
                lblEntryBarrier.Text = "False";
            }

            if (entrySensor.IsCarOnSensor() == true)
            {
                lblEntrySensor.Text = "True";
            }
            else
            {
                lblEntrySensor.Text = "False";
            }

            if (exitBarrier.isLifted() == true)
            {
                lblExitBarrier.Text = "True";
            }
            else
            {
                lblExitBarrier.Text = "False";
            }

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

            if (fullSign.isLit() == true)
            {
                lblFullSign.Text = "True";
            }
            else
            {
                lblFullSign.Text = "False";
            }
            lblSpaces.Text = Convert.ToString(carPark.GetCurrentSpaces());

            lblTicketMachine.Text   = ticketMachine.GetMessage();
            lblTicketValidator.Text = ticketValidator.GetMessage();


            lstActiveTickets.Items.Clear();
            List <Ticket> tickets = activeTickets.GetTickets();

            foreach (Ticket ticket in tickets)
            {
                lstActiveTickets.Items.Add(Convert.ToString("#" + ticket.ticketNumber() + ":" + ticket.IsPaid()));
            }
        }
        private void CarEntersCarPark(object sender, EventArgs e)
        {
            entrySensor.CarLeftSensor();
            btnCarArrivesAtEntrance.Visible = true;
            btnCarArrivesAtExit.Visible     = true;
            btnCarEntersCarPark.Visible     = false;

            if (carPark.GetCurrentSpaces() == 0)
            {
                btnCarArrivesAtEntrance.Visible = false;
            }
            if (exitSensor.IsCarOnSensor() == true || exitBarrier.IsLifted() == true)

            {
                btnCarArrivesAtExit.Visible = false;
            }
            UpdateDisplay();
        }
Exemple #4
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();
 }
        private void UpdateDisplay()
        {
            lblEntrySensor.Text   = entrySensor.IsCarOnSensor().ToString();
            lblTicketMachine.Text = ticketMachine.Message;
            lblEntryBarrier.Text  = entryBarrier.IsLifted().ToString();

            lblExitSensor.Text      = exitSensor.IsCarOnSensor().ToString();
            lblTicketValidator.Text = ticketValidator.Message;
            lblExitBarrier.Text     = exitBarrier.IsLifted().ToString();

            lblFullSign.Text = fullSign.Lit.ToString();
            lblSpaces.Text   = carPark.CurrentSpaces.ToString();

            lstActiveTickets.Items.Clear();
            lstActiveTickets.Items.AddRange(activeTickets.GetTickets());
        }
        private void UpdateDisplay()
        {
            if (entryBarrier.isLifted() == true)
            {
                lblEntryBarrier.Text = "True";
            }
            else
            {
                lblEntryBarrier.Text = "False";
            }
            if (entrySensor.IsCarOnSensor() == true)
            {
                lblEntrySensor.Text = "True";
            }
            else
            {
                lblEntrySensor.Text = "False";
            }

            if (exitBarrier.isLifted() == true)
            {
                lblExitBarrier.Text = "True";
            }
            else
            {
                lblExitBarrier.Text = "False";
            }

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

            if (fullSign.isLit() == true)
            {
                lblFullSign.Text = "True";
            }
            else
            {
                lblFullSign.Text = "False";
            }
            lblSpaces.Text = Convert.ToString(carPark.GetCurrentSpaces());
        }
Exemple #7
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;
            }
        }