Пример #1
0
        public void StartGooeyProgramming()
        {
            Log.DebugLog("entered");

            using (MainLock.AcquireSharedUsing())
            {
                m_currentCommand = null;
                m_listCommands   = true;
                m_commandList.Clear();
                m_syntaxErrors.Clear();

                MyTerminalControls.Static.CustomControlGetter += CustomControlGetter;
                m_block.AppendingCustomInfo += m_block_AppendingCustomInfo;

                Commands = AutopilotTerminal.GetAutopilotCommands(m_block).ToString();
                foreach (ACommand comm in ParseCommands(Commands))
                {
                    m_commandList.Add(comm);
                }
                if (m_syntaxErrors.Length != 0)
                {
                    m_block.UpdateCustomInfo();
                }
                m_block.RebuildControls();
            }
        }
Пример #2
0
        private void Finished(bool save)
        {
            Log.DebugLog("entered");

            if (save)
            {
                Commands = string.Join(" ; ", m_commandList.Select(cmd => cmd.DisplayString));
                AutopilotTerminal.SetAutopilotCommands(m_block, new StringBuilder(Commands));
                m_actionList.Clear();
                GetActions(Commands, m_actionList);
            }

            MyTerminalControls.Static.CustomControlGetter -= CustomControlGetter;
            m_block.AppendingCustomInfo -= m_block_AppendingCustomInfo;

            m_block.UpdateCustomInfo();
            m_block.RebuildControls();

            Cleanup();
        }
Пример #3
0
        public AutopilotActionList GetActions()
        {
            using (MainLock.AcquireSharedUsing())
            {
                if (!m_actionList.IsEmpty)
                {
                    m_actionList.Reset();
                    return(m_actionList);
                }
                m_syntaxErrors.Clear();

                Commands = AutopilotTerminal.GetAutopilotCommands(m_block).ToString();
                List <ACommand> commands = new List <ACommand>();
                GetActions(Commands, m_actionList);
                if (m_syntaxErrors.Length != 0)
                {
                    m_block.UpdateCustomInfo();
                }
                return(m_actionList);
            }
        }
Пример #4
0
 public SortableAutopilot(AutopilotTerminal autopilot, Vector3D mypos)
 {
     this.distance        = null;
     this.Autopilot       = autopilot;
     this.DistanceSquared = (float)Vector3D.DistanceSquared(autopilot.m_block.GetPosition(), mypos);
 }