public SimulationOfTrip(PO.CurrentStation current)
        {
            MycurrentStation             = current;
            worker                       = new BackgroundWorker();
            worker.WorkerReportsProgress = true;

            worker.DoWork                    += Worker_DoWork;
            worker.ProgressChanged           += Worker_ProgressChanged;
            worker.RunWorkerCompleted        += Complate;
            worker.WorkerSupportsCancellation = true;
        }
예제 #2
0
 /// <summary>
 /// starts the simulation
 /// </summary>
 public void GoToTrip(BO.BusOnTrip b, BO.Line l)
 {
     PO.CurrentStation current;
     if (l.StationsRoute != null && l.StationsRoute.Count() > 0)
     {
         current = new PO.CurrentStation {
             TripStartTime = b.ActualTakeOff, EndStationName = l.StationsRoute.ToList().Last().Station.Address, UplineStations = l.StationsRoute, LineID = l.ID, LineNum = l.LineCode
         };
         PO.CurrentStation.LineTimings.Add(current);
         if (current.simulation == null)
         {
             current.simulation = new SimulationOfTrip(current);
         }
         current.simulation.Starting();
     }
 }