Exemplo n.º 1
0
        internal object GetTotalEvasTime()
        {
            long        totalTime    = 0;
            FlightEvent currentStart = null;

            for (int i = 0; i < subsequentEvents.Count; i++)
            {
                FlightEvent flightEvent = subsequentEvents[i];
                if (flightEvent is EvaCrewEvent)
                {
                    currentStart = flightEvent;
                }
                else if (currentStart != null && (flightEvent is EndFlightCrewEvent || flightEvent is EvaCrewEndEvent))
                {
                    totalTime   += flightEvent.time - currentStart.time;
                    currentStart = null;
                }
            }
            if (currentStart != null)
            {
                totalTime += EventProcessor.GetTimeInTicks() - currentStart.time;
            }

            return(totalTime);
        }
Exemplo n.º 2
0
        public long GetTotalFlightTime()
        {
            long        totalTime    = 0;
            FlightEvent currentStart = this;

            for (int i = 0; i < subsequentEvents.Count; i++)
            {
                FlightEvent flightEvent = subsequentEvents[i];
                if (flightEvent is LaunchCrewEvent)
                {
                    currentStart = flightEvent;
                }
                else if (flightEvent is EndFlightCrewEvent)
                {
                    totalTime   += flightEvent.time - currentStart.time;
                    currentStart = null;
                }
            }
            if (currentStart != null)
            {
                totalTime += EventProcessor.GetTimeInTicks() - currentStart.time;
            }

            return(totalTime);
        }
Exemplo n.º 3
0
        internal IEnumerable <string> GetShips()
        {
            List <string> ships = new List <string>();
            //ships.Add(vesselName);
            LaunchCrewEvent     lauEv = this;
            List <EvaCrewEvent> evas  = new List <EvaCrewEvent>();

            foreach (var flightEvent in subsequentEvents)
            {
                if (flightEvent is LaunchCrewEvent)
                {
                    evas  = new List <EvaCrewEvent>();
                    lauEv = flightEvent as LaunchCrewEvent;
                }
                else if (flightEvent is EvaCrewEvent)
                {
                    evas.Add(flightEvent as EvaCrewEvent);
                }
                else if (flightEvent is EndFlightCrewEvent)
                {
                    ships.Add(lauEv.vesselName + "(" + TicksToShortTime(flightEvent.time - lauEv.time) + ", EVA - " + evas.Count.ToString() + ")");
                    lauEv = null;
                    evas  = new List <EvaCrewEvent>();
                }
            }

            if (lauEv != null)
            {
                ships.Add(lauEv.vesselName + "(" + TicksToShortTime(EventProcessor.GetTimeInTicks() - lauEv.time) + ", EVA - " + evas.Count.ToString() + ")");
            }

            return(ships);
        }
Exemplo n.º 4
0
        public long GetTotalMissionTime()
        {
            long        totalTime    = 0;
            FlightEvent currentStart = this;
            FlightEvent lastStart    = null;

            for (int i = 0; i < subsequentEvents.Count; i++)
            {
                FlightEvent flightEvent = subsequentEvents[i];
                if (flightEvent is LaunchEvent)
                {
                    currentStart = flightEvent;
                }
                else if (flightEvent is EndFlightEvent || flightEvent is FinishMissionEvent)
                {
                    if (currentStart == null)
                    {
                        currentStart = lastStart;
                    }
                    totalTime   += flightEvent.time - currentStart.time;
                    lastStart    = currentStart;
                    currentStart = null;
                }
            }
            if (currentStart != null)
            {
                totalTime += EventProcessor.GetTimeInTicks() - currentStart.time;
            }

            return(totalTime);
        }
Exemplo n.º 5
0
        internal object GetIdleTime()
        {
            long        totalTime  = 0;
            FlightEvent currentEnd = null;

            for (int i = 0; i < subsequentEvents.Count; i++)
            {
                FlightEvent flightEvent = subsequentEvents[i];
                if (flightEvent is EndFlightCrewEvent)
                {
                    currentEnd = flightEvent;
                }
                else if (currentEnd != null && flightEvent is LaunchCrewEvent)
                {
                    currentEnd = null;
                }
            }
            if (currentEnd != null)
            {
                totalTime += EventProcessor.GetTimeInTicks() - currentEnd.time;
            }

            return(totalTime);
        }
Exemplo n.º 6
0
 public FlightEvent()
 {
     time = EventProcessor.GetTimeInTicks();
 }