Example #1
0
        private void UpdateEditor()
        {
            UpdatePanels();

            if (!_updateSimulator)
            {
                return;
            }

            _updateSimulator = false;

            try
            {
                SimManager.Gravity = _currentBody.GeeASL * GRAVITY;

                if (Atmosphere)
                {
                    SimManager.Atmosphere = _currentBody.GetPressure(_atmosphereDepth) * PhysicsGlobals.KpaToAtmospheres;
                }
                else
                {
                    SimManager.Atmosphere = 0;
                }

                SimManager.Mach = _mach;

                SimManager.RequestSimulation();
                SimManager.TryStartSimulation();
            }
            catch (Exception e)
            {
                BasicLogger.Exception(e, "BasicDeltaV.Update()");
            }
        }
Example #2
0
 public void Flush()
 {
     if (this.buf.Length > 0)
     {
         BasicLogger.Log(this.buf);
     }
     this.buf.Length = 0;
 }
Example #3
0
        private void UpdateFlight()
        {
            try
            {
                SimManager.RequestSimulation();
                SimManager.TryStartSimulation();

                if (SimManager.ResultsReady())
                {
                    if (FlightGlobals.ActiveVessel != null)
                    {
                        SimManager.Gravity = FlightGlobals.ActiveVessel.mainBody.gravParameter / Math.Pow(FlightGlobals.ActiveVessel.mainBody.Radius + FlightGlobals.ActiveVessel.mainBody.GetAltitude(FlightGlobals.ActiveVessel.CoM), 2);

                        SimManager.Mach = FlightGlobals.ActiveVessel.mach;
                    }
                }
            }
            catch (Exception e)
            {
                BasicLogger.Exception(e, "BasicDeltaV.Update()");
            }

            UpdatePanels();
        }