private void CorrectionCalcCompleted(LunarCourseCorrection lcc)
    {
        // Update the GE Console
        string s = LunarCorrectionApply();

        GEConsole.Instance().AddToHistory(s);
    }
    //============================================================================================
    // Console commands: If there is a GEConsole in the scene, these commands will be available
    //============================================================================================

    private void AddConsoleCommands()
    {
        GEConsole.RegisterCommandIfConsole(new MoonXfer(this));
        GEConsole.RegisterCommandIfConsole(new LunarCorrectionStartCmd(this));
        GEConsole.RegisterCommandIfConsole(new PatchedConicPreview(this));
        GEConsole.RegisterCommandIfConsole(new PatchedConicPreviewAsync(this));
        GEConsole.RegisterCommandIfConsole(new ApproachPredictionCmd(this));
    }
    /// <summary>
    /// Callback for MoonPreview when run in async mode.
    /// </summary>
    /// <param name="lcc"></param>
    private void MoonPreviewCompleted(LunarCourseCorrection lcc)
    {
        // Update the GE Console with the result stored in calcData
        string s = string.Format("Closest approach of {0} at t={1}\n",
                                 courseCorrectionData.distance, courseCorrectionData.timeAtApproach);

        GEConsole.Instance().AddToHistory(s);
    }
Example #4
0
    public static void RegisterCommandIfConsole(GEConsoleCommand cmd)
    {
        GEConsole gec = Instance();

        if (gec != null)
        {
            gec.RegisterCommand(cmd);
        }
    }
Example #5
0
 public static GEConsole Instance()
 {
     if (instance == null)
     {
         GEConsole[] consoles = (GEConsole[])Object.FindObjectsOfType(typeof(GEConsole));
         if (consoles.Length > 0)
         {
             instance = consoles[0];
         }
     }
     return(instance);
 }
 private void NotifyListeners(float distance)
 {
     foreach (GameObject go in listeners)
     {
         IClosestApproach iClosest = go.GetComponent <IClosestApproach>();
         if (iClosest != null)
         {
             iClosest.OnClosestApproachTrigger(body1, body2, distance);
         }
     }
     // If there is a GE console, log there
     if (GEConsole.Instance() != null)
     {
         GEConsole.Instance().AddToHistory(string.Format("Closest approach={0}", distance));
     }
     triggered = true;
 }
Example #7
0
 private void AddConsoleCommands()
 {
     GEConsole.RegisterCommandIfConsole(new LambertUniversalCommand(this));
 }
    //******************************************************
    //Console commands
    //******************************************************

    private void InitCommands()
    {
        GEConsole.RegisterCommandIfConsole(new ShowForceCommand(this));
    }