コード例 #1
0
ファイル: ConsoleDock.cs プロジェクト: KeyleXiao/behaviac
        public ConsoleDock()
        {
            if (_consoleDock == null)
                _consoleDock = this;

            InitializeComponent();

            this.TabText = Resources.Output;
        }
コード例 #2
0
ファイル: ConsoleDock.cs プロジェクト: 675492062/behaviac
        internal static void Inspect() {
            if (_consoleDock == null) {
                _consoleDock = new ConsoleDock();
                _consoleDock.Show(MainWindow.Instance.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);

            } else {
                _consoleDock.Show();
            }
        }
コード例 #3
0
ファイル: ConsoleDock.cs プロジェクト: chkob/behaviac-old
        public ConsoleDock()
        {
            if (_consoleDock == null)
            {
                _consoleDock = this;
            }

            InitializeComponent();

            this.TabText = Resources.Output;
        }
コード例 #4
0
ファイル: ConsoleDock.cs プロジェクト: raptoravis/behaviac1
 internal static void Inspect()
 {
     if (_consoleDock == null)
     {
         _consoleDock = new ConsoleDock();
         _consoleDock.Show(MainWindow.Instance.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);
     }
     else
     {
         _consoleDock.Show();
     }
 }
コード例 #5
0
ファイル: TimelineDock.cs プロジェクト: zsfdyxf/behaviac
        //return true if breaked
        private bool update(int frame)
        {
            int _agenttype_index     = 0;
            int _agentinstance_index = 0;

            ConsoleDock.SetMesssages(frame);

            if (Plugin.EditMode == EditModes.Connect)
            {
                if (Plugin.UpdateMode == UpdateModes.Continue)
                {
                    SetTotalFrame(frame);
                    AgentDataPool.CurrentFrame = AgentDataPool.TotalFrames;
                }

                updateUI(frame);
            }

            lock (_lockObject) {
                if (_agenttype_index != -1 && _agentinstance_index != -1)
                {
                    //update could be entered multiple times for a 'frame' if there are multiple breakpoints in 'frame'
                    if (_agenttype_index == 0 && _agentinstance_index == 0)
                    {
                        AgentDataPool.CurrentFrame = frame;

                        // Global
                        //foreach (Plugin.InstanceName_t agentType in Plugin.InstanceNames)
                        //{
                        //    updateParameters(agentType.agentType_, agentType.agentType_.AgentTypeName, frame);
                        //}
                    }

                    this._break_prompt = "";

                    // Agent
                    while (_agenttype_index < Plugin.AgentTypes.Count)
                    {
                        AgentType agentType = Plugin.AgentTypes[_agenttype_index];

                        if (!agentType.IsInherited)
                        {
                            List <string> instances = AgentInstancePool.GetInstances(agentType.ToString());

                            while (_agentinstance_index < instances.Count)
                            {
                                string instance = instances[_agentinstance_index];
                                _agentinstance_index++;

                                // Parameters
                                updateParameters(agentType, instance, frame);

                                if (Plugin.EditMode == EditModes.Analyze)
                                {
                                    string agentName        = string.Format("{0}#{1}", agentType, instance);
                                    string behaviorFilename = FrameStatePool.GetBehaviorFilename(agentName, frame);

                                    if (_lastBreakFrame != frame)
                                    {
                                        _lastBreakPointIndex = 0;
                                    }

                                    // Breakpoint
                                    List <FrameStatePool.FrameState.Action> actions = FrameStatePool.GetActions(agentName, frame, behaviorFilename);
                                    HighlightBreakPoint.Instance = checkBreakpoint(behaviorFilename, actions, ref _lastBreakPointIndex);

                                    if (HighlightBreakPoint.Instance != null || agentName == Plugin.DebugAgentInstance)
                                    {
                                        // Highlights
                                        List <string> transitionIds    = FrameStatePool.GetHighlightTransitionIds(agentName, frame, behaviorFilename);
                                        List <string> highlightNodeIds = FrameStatePool.GetHighlightNodeIds(agentName, frame, behaviorFilename);
                                        List <string> updatedNodeIds   = FrameStatePool.GetUpdatedNodeIds(agentName, frame, behaviorFilename);
                                        Dictionary <string, FrameStatePool.NodeProfileInfos.ProfileInfo> profileInfos = FrameStatePool.GetProfileInfos(frame, behaviorFilename);

                                        updateHighlights(agentName, frame, transitionIds, highlightNodeIds, updatedNodeIds, HighlightBreakPoint.Instance, profileInfos);
                                    }

                                    // Return if there is breakpoint breaked.
                                    if (HighlightBreakPoint.Instance != null)
                                    {
                                        _lastBreakFrame = frame;
                                        return(true);
                                    }
                                }
                            }
                        }

                        _agenttype_index++;
                        _agentinstance_index = 0;
                    }

                    _agenttype_index     = -1;
                    _agentinstance_index = -1;

                    //after checking breakpoints, to check applog
                    _log_index = 0;
                }
            }

            lock (_lockObject) {
                if (_log_index != -1)
                {
                    if (Plugin.EditMode == EditModes.Analyze)
                    {
                        bool bCheckLog = (this.comboBoxLogFilter.Text != "");

                        if (bCheckLog)
                        {
                            if (Plugin.EditMode == EditModes.Analyze)
                            {
                                Debug.Check(true);
                            }
                            else if (MessageQueue.IsConnected)
                            {
                                Debug.Check(true);
                            }
                            else
                            {
                                bCheckLog = false;
                            }
                        }

                        if (bCheckLog)
                        {
                            List <string> logs = FrameStatePool.GetAppLog(frame, this.comboBoxLogFilter.Text);

                            if (logs != null && _log_index < logs.Count)
                            {
                                this._break_prompt = logs[_log_index++];
                                return(true);
                            }
                        }
                    }

                    _log_index = -1;
                }
            }

            return(false);
        }
コード例 #6
0
ファイル: ConsoleDock.cs プロジェクト: raptoravis/behaviac1
        protected override void OnClosed(EventArgs e)
        {
            _consoleDock = null;

            base.OnClosed(e);
        }
コード例 #7
0
ファイル: ConsoleDock.cs プロジェクト: KeyleXiao/behaviac
        protected override void OnClosed(EventArgs e)
        {
            _consoleDock = null;

            base.OnClosed(e);
        }