Exemple #1
0
        public static ManeuverCommand WithNode(ManeuverNode node, FlightComputer f)
        {
            double thrust  = FlightCore.GetTotalThrust(f.Vessel);
            double advance = f.Delay;

            if (thrust > 0)
            {
                advance += (node.DeltaV.magnitude / (thrust / f.Vessel.GetTotalMass())) / 2;
            }

            var newNode = new ManeuverCommand()
            {
                Node = new ManeuverNode()
                {
                    DeltaV            = node.DeltaV,
                    patch             = node.patch,
                    solver            = node.solver,
                    scaledSpaceTarget = node.scaledSpaceTarget,
                    nextPatch         = node.nextPatch,
                    UT           = node.UT,
                    nodeRotation = node.nodeRotation,
                },
                TimeStamp = node.UT - advance,
            };

            return(newNode);
        }
        private void OnExecClick()
        {
            if (mFlightComputer.Vessel.patchedConicSolver == null || mFlightComputer.Vessel.patchedConicSolver.maneuverNodes.Count == 0)
            {
                return;
            }
            var cmd = ManeuverCommand.WithNode(mFlightComputer.Vessel.patchedConicSolver.maneuverNodes[0], mFlightComputer);

            if (cmd.TimeStamp < RTUtil.GameTime + mFlightComputer.Delay)
            {
                RTUtil.ScreenMessage("[Flight Computer]: Signal delay is too high to execute this maneuver at the proper time.");
            }
            else
            {
                mFlightComputer.Enqueue(cmd, false, false, true);
            }
        }
 public static ManeuverCommand WithNode(ManeuverNode node)
 {
     var newNode = new ManeuverCommand()
     {
         Node = new ManeuverNode()
         {
             DeltaV = node.DeltaV,
             patch = node.patch,
             solver = node.solver,
             scaledSpaceTarget = node.scaledSpaceTarget,
             nextPatch = node.nextPatch,
             UT = node.UT,
             nodeRotation = node.nodeRotation,
         },
         TimeStamp = node.UT,
     };
     return newNode;
 }
        public static ManeuverCommand WithNode(ManeuverNode node)
        {
            var newNode = new ManeuverCommand()
            {
                Node = new ManeuverNode()
                {
                    DeltaV            = node.DeltaV,
                    patch             = node.patch,
                    solver            = node.solver,
                    scaledSpaceTarget = node.scaledSpaceTarget,
                    nextPatch         = node.nextPatch,
                    UT           = node.UT,
                    nodeRotation = node.nodeRotation,
                },
                TimeStamp = node.UT,
            };

            return(newNode);
        }
        public static ManeuverCommand WithNode(ManeuverNode node, FlightComputer f)
        {
            double thrust = FlightCore.GetTotalThrust(f.Vessel);
            double advance = f.Delay;

            if (thrust > 0) {
                advance += (node.DeltaV.magnitude / (thrust / f.Vessel.GetTotalMass())) / 2;
            }

            var newNode = new ManeuverCommand()
            {
                Node = new ManeuverNode()
                {
                    DeltaV = node.DeltaV,
                    patch = node.patch,
                    solver = node.solver,
                    scaledSpaceTarget = node.scaledSpaceTarget,
                    nextPatch = node.nextPatch,
                    UT = node.UT,
                    nodeRotation = node.nodeRotation,
                },
                TimeStamp = node.UT - advance,
            };
            return newNode;
        }