コード例 #1
0
 public FlightComputer(ISignalProcessor s)
 {
     mSignalProcessor = s;
     mPreviousCtrl.CopyFrom(s.Vessel.ctrlState);
     mAttachedVessel = s.Vessel;
     mLegacyComputer = new Legacy.FlightComputer();
     mRoverComputer  = new RoverComputer(s.Vessel);
     Bifrost         = new BifrostUnit(s);
 }
コード例 #2
0
        private void Parse(String s)
        {
            BifrostUnit bu = mFlightComputer.Bifrost;

            if (String.IsNullOrEmpty(s))
            {
                return;
            }
            bu.Log("> " + s);
            String[] split = s.Split(' ');
            switch (split[0])
            {
            default:
                bu.Log("Parsing error.");
                break;

            case "upload":
                if (split.Length < 2)
                {
                    bu.Log("Missing argument.");
                }
                else
                {
                    bu.Upload(split[1]);
                }
                break;

            case "run":
                bu.Run();
                bu.Log("Running...");
                break;

            case "pause":
                bu.Pause();
                bu.Log("Stopping...");
                break;

            case "resume":
                bu.Log("Resuming...");
                bu.Resume();
                break;

            case "reset":
                bu.Log("Resetting...");
                bu.Reset();
                break;
            }
        }