public void CreateTrackSegment(int number)
        {
            TrackSegment temporaryTrackSegment = new TrackSegment();

            temporaryTrackSegment.SetNumber(number);

            trackSegments.Add(number, temporaryTrackSegment);
        }
Esempio n. 2
0
        private void OpenCloseButton_Click(object sender, EventArgs e)
        {
            if (listViewTrack.SelectedItems.Count > 0)
            {
                TrackSegment segment    = central.GetTrackSegment(Int32.Parse(listViewTrack.SelectedItems[0].Text));
                string       openClosed = segment.GetOpenClosed();

                if (openClosed.Equals("Open"))
                {
                    testingForm.updateSegment(segment.GetNumber(), "Closed");
                }
                else
                {
                    testingForm.updateSegment(segment.GetNumber(), "Open");
                }
            }
        }
        public void UpdateSegmentOpenClosed(int number, string open)
        {
            TrackSegment temporaryTrackSegment = trackSegments[number];

            temporaryTrackSegment.SetOpenClosed(open);
        }
        public void UpdateSegmentLine(int number, string line)
        {
            TrackSegment temporaryTrackSegment = trackSegments[number];

            temporaryTrackSegment.SetLine(line);
        }
        public void UpdateSegmentSpeedLimit(int number, int speedLimit)
        {
            TrackSegment temporaryTrackSegment = trackSegments[number];

            temporaryTrackSegment.SetSpeedLimit(speedLimit);
        }
        public void UpdateSegmentSwitchDirection(int number, string switchDirection)
        {
            TrackSegment temporaryTrackSegment = trackSegments[number];

            temporaryTrackSegment.SetSwitchDirection(switchDirection);
        }
        public void UpdateSegmentFailure(int number, string failure)
        {
            TrackSegment temporaryTrackSegment = trackSegments[number];

            temporaryTrackSegment.SetFailure(failure);
        }