private StateFn StartCirc() { var maneuver = new Maneuver.Circularize(vessel, orbit, Planetarium.GetUniversalTime() + orbit.timeToAp); maneuver.PlaceManeuverNode(); ascent.UnRegister(this); node.Register(this); return(WaitNode); }
/* FIXME: NodeExecutor is only enabled for this state */ private StateFn LaunchTestCircularize(bool stateChanged) { if (stateChanged) { var maneuver = new Maneuver.Circularize(vessel, orbit, Planetarium.GetUniversalTime() + orbit.timeToAp); maneuver.PlaceManeuverNode(); ascent.Disable(); node.Enable(); } if (!node.enabled) { /* success */ if (vesselState.mass > LaunchTestState.Instance.best_mass) { Debug.Log("NEW BEST mass: " + vesselState.mass + "int: " + ascent.intermediate_altitude + " start_alt: " + ascent.start_altitude + " start_turn: " + ascent.start_turn + " maxQ: " + ascent.maxQlimit); LaunchTestState.Instance.best_intermediate_altitude = ascent.intermediate_altitude; LaunchTestState.Instance.best_start_turn = ascent.start_turn; LaunchTestState.Instance.best_maxQlimit = ascent.maxQlimit; LaunchTestState.Instance.best_mass = vesselState.mass; } else { Debug.Log("mass: " + vesselState.mass + "int: " + ascent.intermediate_altitude + " start_alt: " + ascent.start_altitude + " start_turn: " + ascent.start_turn + " maxQ: " + ascent.maxQlimit); } return(LaunchTestReset); } if (vesselState.thrustMaximum == 0) { /* ran out of gas */ return(LaunchTestReset); } if (vessel.situation == Vessel.Situations.LANDED || vessel.situation == Vessel.Situations.SPLASHED || vessel.state == Vessel.State.DEAD) { /* boom */ return(LaunchTestReset); } return(LaunchTestCircularize); }