Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            SetupConstants();
            Initializer();

            GlobalClock.GetInstance().Start(1, noOfStations);

            Console.Read();
        }
Ejemplo n.º 2
0
 private void btnStartSimulator_Click(object sender, EventArgs e)
 {
     try
     {
         if (btnSaveSetting.Enabled)
         {
             btnSaveSetting.Enabled = false;
             StartSimulator();
         }
         GlobalClock.GetInstance().Start(_timer, _noOfStations);
         btnStartSimulator.Enabled = false;
     }
     catch (Exception exp)
     {
         MessageBox.Show(exp.Message);
     }
 }
Ejemplo n.º 3
0
 private void CleanUp()
 {
     try
     {
         StationShipmentHandler.ShipmentQueuedAtStation  -= UpdateShipmentQueuingAtStation;
         TrainSystemSimulator.TrainProgressEvent         -= UpdateTrackIdWithTrainProgress;
         TrainSystemSimulator.TrainShipmentLoadEvent     -= UpdateShipmentLoadedIntoTrainProgress;
         TrainSystemSimulator.TrainShipmentUnloadEvent   -= UpdateShipmentUnloadedFromTrainProgress;
         TrainSystemSimulator.TrainArrivedAtStationEvent -= UpdateTrainArrivalAtUI;
         TrainSystemSimulator.TrainOtherEvent            -= UpdateTrainOtherEventsAtUI;
         Station.ShipmentDequeuedFromStation             -= UpdateShipmentDequeueFromStation;
         TrainSystemSimulator.GetInstance().CleanUp();
         StationShipmentHandler.GetInstance().CleanUp();
         GlobalClock.GetInstance().Cleanup();
     }
     catch (Exception exp)
     {
         MessageBox.Show(exp.Message);
     }
 }