public ApproachPredictionCmd(OrbitMGController omgController)
 {
     names = new string[] { "ap" };
     help  = "Project the path forward and determine closest approach to Moon\n" +
             "Use only after a transfer has been initiated";
     this.omgController = omgController;
 }
 public PatchedConicPreview(OrbitMGController omgController)
 {
     names = new string[] { "pcp" };
     help  = "PatchedConicPreview (pcp): pcp <angle> :closest approach info for moon trajectory with angle\n" +
             "Runs synchornously and will cause a frame rate stall.";
     this.omgController = omgController;
 }
 public PatchedConicPreviewAsync(OrbitMGController omgController)
 {
     names = new string[] { "pcpa" };
     help  = "PatchedConicPreview (pcpa): pcpa <angle> : closest approach info for moon trajectory with angle\n" +
             "Runs aynchronously. A callback will post the result to the console.";
     this.omgController = omgController;
 }
 public LunarCorrectionStartCmd(OrbitMGController omgController)
 {
     names = new string[] { "lunar_correction", "c" };
     help  = "OrbitMGController: calculate the course correction during lunar transfer.\n" +
             "  Must run pcp first to establish target distance.";
     this.omgController = omgController;
 }
 public MoonXfer(OrbitMGController omgController)
 {
     names = new string[] { "moonxfer", "m" };
     help  = "OrbitMGController: moonxfer <patch_conic_angle>\n" +
             " transfer to the moon with patched conic angle (adds the required maneuver to spaceship)\n";
     this.omgController = omgController;
 }
Esempio n. 6
0
    public GameObject GetInterceptWidget(TrajectoryData.Intercept intercept, OrbitMGController controller)
    {
        GameObject newWidget = Instantiate(interceptPrefab) as GameObject;

        if (newWidget != null)
        {
            OrbitXferUI orbitXferUI = newWidget.GetComponent <OrbitXferUI>();
            if (orbitXferUI != null)
            {
                orbitXferUI.SetController(controller);
                orbitXferUI.UpdateUI(intercept);
            }
            else
            {
                Debug.LogError("No OrbitXferUI component on " + newWidget.name);
            }
        }
        return(newWidget);
    }
Esempio n. 7
0
    /// <summary>
    /// Factory method to instantiate and initialize a UI widget to present an orbit transfer. The
    /// specific transfer widget will present its input attributes and allow then to be changed.
    ///
    /// Select calls back into the controller.
    ///
    /// </summary>
    /// <param name="transfer"></param>
    /// <param name="controller"></param>
    /// <returns></returns>
    public GameObject GetUIWidget(OrbitTransfer transfer, OrbitMGController controller)
    {
        GameObject newWidget = null;

        if (transfer.GetType() == typeof(HohmannXfer))
        {
            newWidget = Instantiate(hohmannUIPrefab) as GameObject;
        }
        else if (transfer.GetType() == typeof(PatchedConicXfer))
        {
            newWidget = Instantiate(patchedConicUIPrefab) as GameObject;
        }
        else if (transfer.GetType() == typeof(BiellipticXfer))
        {
            newWidget = Instantiate(biellipticUIPrefab) as GameObject;
        }
        else
        {
            Debug.LogError("Unsupported transfer type: " + transfer.GetType());
        }

        if (newWidget != null)
        {
            OrbitXferUI orbitXferUI = newWidget.GetComponent <OrbitXferUI>();
            if (orbitXferUI != null)
            {
                orbitXferUI.SetController(controller);
                orbitXferUI.UpdateUI(transfer);
            }
            else
            {
                Debug.LogError("No OrbitXferUI component on " + newWidget.name);
            }
        }

        return(newWidget);
    }
Esempio n. 8
0
 public void SetController(OrbitMGController controller)
 {
     this.gameController = controller;
 }