Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4903


Ignore:
Timestamp:
11/22/10 14:08:18 (14 years ago)
Author:
epitzer
Message:

Many small improvements to DebugEngine (#47)

  • suppress logging during execution
  • add refresh button
  • optionally skip over execution stack operators
  • expand all tree views and scroll to top node
  • show operator on click on atomic operation
  • add build.cmd
Location:
branches/HeuristicLab.DebugEngine
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DebugEngine/DebugEngine.cs

    r4871 r4903  
    2222using System;
    2323using System.Linq;
    24 using System.Collections.Generic;
     24using System.Threading;
    2525using HeuristicLab.Common;
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Collections;
    29 using System.Threading;
    3028
    3129namespace HeuristicLab.DebugEngine {
     
    3533  public class DebugEngine : Executable, IEngine {
    3634
    37 
    3835    #region Construction and Cloning
    39    
     36
    4037    [StorableConstructor]
    41     protected DebugEngine(bool deserializing) : base(deserializing) {
     38    protected DebugEngine(bool deserializing)
     39      : base(deserializing) {
    4240      pausePending = stopPending = false;
    4341      timer = new System.Timers.Timer(100);
     
    4543      timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
    4644    }
    47     protected DebugEngine(DebugEngine original, Cloner cloner) : base(original, cloner) {
     45    protected DebugEngine(DebugEngine original, Cloner cloner)
     46      : base(original, cloner) {
    4847      if (original.ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState));
    4948      Log = cloner.Clone(original.Log);
     
    8483    private DateTime lastUpdateTime;
    8584    private System.Timers.Timer timer;
    86      
     85
    8786    [Storable]
    8887    private IOperator currentOperator;
     
    108107
    109108    public virtual IExecutionContext CurrentExecutionContext {
    110       get { return CurrentOperation as IExecutionContext;  }
     109      get { return CurrentOperation as IExecutionContext; }
    111110    }
    112111
     
    153152      ignoreNextBreakpoint = true;
    154153      timer.Start();
    155       ProcessNextOperation();     
     154      ProcessNextOperation();
    156155      timer.Stop();
    157156      ExecutionTime += DateTime.Now - lastUpdateTime;
     
    165164      ThreadPool.QueueUserWorkItem(new WaitCallback(Run), null);
    166165    }
    167    
     166
    168167    protected override void OnStarted() {
    169168      Log.LogMessage("Engine started");
     
    190189      if (ExecutionState == ExecutionState.Paused) OnStopped();
    191190    }
    192    
     191
    193192    protected override void OnStopped() {
    194193      Log.LogMessage("Engine stopped");
  • branches/HeuristicLab.DebugEngine/DebugEngineView.Designer.cs

    r4876 r4903  
    5656      this.stepButton = new System.Windows.Forms.Button();
    5757      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     58      this.refreshButton = new System.Windows.Forms.Button();
     59      this.skipStackOpsCheckBox = new System.Windows.Forms.CheckBox();
    5860      this.splitContainer1.Panel1.SuspendLayout();
    5961      this.splitContainer1.Panel2.SuspendLayout();
     
    8082      this.executionTimeTextBox.Name = "executionTimeTextBox";
    8183      this.executionTimeTextBox.ReadOnly = true;
    82       this.executionTimeTextBox.Size = new System.Drawing.Size(747, 20);
     84      this.executionTimeTextBox.Size = new System.Drawing.Size(611, 20);
    8385      this.executionTimeTextBox.TabIndex = 1;
    8486      //
     
    157159      this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    158160      this.stepButton.Image = ((System.Drawing.Image)(resources.GetObject("stepButton.Image")));
    159       this.stepButton.Location = new System.Drawing.Point(845, 3);
     161      this.stepButton.Location = new System.Drawing.Point(815, 3);
    160162      this.stepButton.Name = "stepButton";
    161163      this.stepButton.Size = new System.Drawing.Size(24, 24);
     
    165167      this.stepButton.Click += new System.EventHandler(this.stepButton_Click);
    166168      //
     169      // refreshButton
     170      //
     171      this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     172      this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image")));
     173      this.refreshButton.Location = new System.Drawing.Point(845, 3);
     174      this.refreshButton.Name = "refreshButton";
     175      this.refreshButton.Size = new System.Drawing.Size(24, 24);
     176      this.refreshButton.TabIndex = 5;
     177      this.refreshButton.UseVisualStyleBackColor = true;
     178      this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
     179      //
     180      // skipStackOpsCheckBox
     181      //
     182      this.skipStackOpsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     183      this.skipStackOpsCheckBox.AutoSize = true;
     184      this.skipStackOpsCheckBox.Location = new System.Drawing.Point(709, 8);
     185      this.skipStackOpsCheckBox.Name = "skipStackOpsCheckBox";
     186      this.skipStackOpsCheckBox.Size = new System.Drawing.Size(100, 17);
     187      this.skipStackOpsCheckBox.TabIndex = 6;
     188      this.skipStackOpsCheckBox.Text = "Skip Stack Ops";
     189      this.skipStackOpsCheckBox.UseVisualStyleBackColor = true;
     190      //
    167191      // DebugEngineView
    168192      //
    169193      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     194      this.Controls.Add(this.skipStackOpsCheckBox);
     195      this.Controls.Add(this.refreshButton);
    170196      this.Controls.Add(this.splitContainer2);
    171197      this.Controls.Add(this.stepButton);
     
    196222    private HeuristicLab.DebugEngine.ExecutionStackView executionStackView;
    197223    private HeuristicLab.DebugEngine.OperationContentView operationContentView;
     224    private System.Windows.Forms.Button refreshButton;
     225    private System.Windows.Forms.CheckBox skipStackOpsCheckBox;
    198226
    199227  }
  • branches/HeuristicLab.DebugEngine/DebugEngineView.cs

    r4876 r4903  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Drawing;
    2523using System.Windows.Forms;
    26 using HeuristicLab.Common.Resources;
    2724using HeuristicLab.Core;
    2825using HeuristicLab.Core.Views;
    2926using HeuristicLab.MainForm;
    30 using HeuristicLab.Persistence.Auxiliary;
    3127namespace HeuristicLab.DebugEngine {
    3228
     
    124120      else {
    125121        switch (Content.ExecutionState) {
    126           case ExecutionState.Started: executionStackView.SuspendUpdate(); break;
     122          case ExecutionState.Started:
     123            executionStackView.SuspendUpdate();
     124            logView.Content = null;
     125            break;
    127126          default:
     127            logView.Content = Content.Log;
    128128            executionStackView.ResumeUpdate();
    129129            operationContentView.Content = new OperationContent(Content.CurrentOperation);
     
    145145    private void stepButton_Click(object sender, EventArgs e) {
    146146      Content.Step();
     147      while (skipStackOpsCheckBox.Checked && !(Content.CurrentOperation is IAtomicOperation) && Content.CanContinue)
     148        Content.Step();
     149    }
     150
     151    private void refreshButton_Click(object sender, EventArgs e) {
     152      var content = Content;
     153      Content = null;
     154      Content = content;
    147155    }
    148156
  • branches/HeuristicLab.DebugEngine/DebugEngineView.resx

    r4876 r4903  
    122122    <value>
    123123        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    124         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALDAAA
    125         CwwBP0AiyAAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV
     124        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCwAA
     125        CwsBbQSEtwAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV
    126126        gNyZz/4ndN/7HzfhtQYh72A1IGPK0//z9v/+H9Rw8zXQAFt8huAKg/+z9/3637n173+30sv/gQbY4zIE
    127127        qwGRXY/+T9n263/J0r//E6b//W+TexanIVgNCGx++L917XuwZuOSL/+lo6/9N45c9t+h6Gw8ukuwGuBR
     
    134134    <value>17, 17</value>
    135135  </metadata>
     136  <data name="refreshButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     137    <value>
     138        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
     139        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEQAA
     140        CxEBf2RfkQAAAmFJREFUOE+dk21IU1EYx3cVVzkhaLCy+UaY0xwlZkYRmiGR7oMEUlAGfRGKvkRFVOQ0
     141        DddsVmtbvpQWhCFBSvaCUcRAk0gGm8SGM7JtrU1nzYFvu3P33znDRcLpSxceDvdefr/zv+d5Lidaufjg
     142        QKKIWwNSUo4Tz4u4RAl5xYsgJIuEcADCYlS8oQKLvvvKdam1n+PcqjUyN5ox7PyIVrMB1U9PoKxThZI7
     143        h3C1vwk2l2OWD40c15nbwITD/h5p/9hrVL2sgXpSA43bgGsOHeodLTj16QJK71XCOmlH3u1dbIHDOxGk
     144        8PXJW1D1HYWsfgs2NW3FSfOZmKjBcTMmydLmswWXnjegZvg0dusPoHXQiDH3OJw+F9IaFbFU8UptymYL
     145        DncdQ0lHBfosrxBZFvL5ZUEyFfgFm2d8lURal8kWFHeU4eIzNYULSHF8ROB6LQPI1CiRrskF3ZnC6y/L
     146        2YIdxr0Y/WqDf/pnEj1lry+Q5vkxlfTdN73W6w+IyX2Cy+PfOP7FxRaQHbFSB8maGOaFfR7vFLcYjiYs
     147        LEW5eVJzC1GJekjLFhR2lWJ72x7k3i0KZrUoQ/JmBdpHHmOJj0ppIiIpbx96iDzjP9q4s6sEWrcp1rJs
     148        XQEsLjv9HJAE6TSF1eVE5ZNqbK7LYSfYZir+I6AShb4Ilm92MoET6BzuiU0lbWXto7NsAYmNnBuFq3pO
     149        oThIYblagQfve9mCjOZ8vLC+hZwMzt9QfIAorHljQGA2sp/5L7S96wY5KHxwWHCltxEq0xGknJch5ZwM
     150        5foqGAe7MROKJHtn+ASm4H8f/gZt6J11yfCrBQAAAABJRU5ErkJggg==
     151</value>
     152  </data>
    136153</root>
  • branches/HeuristicLab.DebugEngine/ExecutionStackView.cs

    r4871 r4903  
    11using System;
    22using System.Collections.Generic;
    3 using System.ComponentModel;
    43using System.Drawing;
    5 using System.Data;
    64using System.Linq;
    7 using System.Text;
    85using System.Windows.Forms;
    96using HeuristicLab.Collections;
    107using HeuristicLab.Core;
     8using HeuristicLab.MainForm;
    119using HeuristicLab.MainForm.WindowsForms;
    12 using HeuristicLab.MainForm;
    1310
    1411namespace HeuristicLab.DebugEngine {
     
    5148        UpdateExecutionStack();
    5249    }
    53    
     50
    5451
    5552    private void UpdateExecutionStack() {
     
    6057        if (treeView.Nodes.Count > 0)
    6158          treeView.TopNode = treeView.Nodes[0];
     59        treeView.ExpandAll();
    6260        treeView.EndUpdate();
    6361        groupBox.Text = string.Format("Execution Stack ({0})", totalNodes);
     
    118116    }
    119117
    120    
     118
    121119
    122120    #region Event Handlers (child controls)
  • branches/HeuristicLab.DebugEngine/OperationContentView.Designer.cs

    r4876 r4903  
    2727      this.groupBox = new System.Windows.Forms.GroupBox();
    2828      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     29      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     30      this.executionContextGroupBox = new System.Windows.Forms.GroupBox();
     31      this.executionContextTreeView = new System.Windows.Forms.TreeView();
     32      this.parametersGroupBox = new System.Windows.Forms.GroupBox();
    2933      this.parameterListView = new System.Windows.Forms.ListView();
     34      this.scopeGroupBox = new System.Windows.Forms.GroupBox();
    3035      this.scopeTreeView = new System.Windows.Forms.TreeView();
    3136      this.nameTextBox = new System.Windows.Forms.TextBox();
     
    3338      this.atomicLabel = new System.Windows.Forms.Label();
    3439      this.collectionLabel = new System.Windows.Forms.Label();
    35       this.splitContainer2 = new System.Windows.Forms.SplitContainer();
    36       this.parametersGroupBox = new System.Windows.Forms.GroupBox();
    37       this.executionContextGroupBox = new System.Windows.Forms.GroupBox();
    38       this.scopeGroupBox = new System.Windows.Forms.GroupBox();
    39       this.executionContextTreeView = new System.Windows.Forms.TreeView();
    4040      this.timer = new System.Windows.Forms.Timer(this.components);
    4141      this.groupBox.SuspendLayout();
     
    4646      this.splitContainer2.Panel2.SuspendLayout();
    4747      this.splitContainer2.SuspendLayout();
     48      this.executionContextGroupBox.SuspendLayout();
    4849      this.parametersGroupBox.SuspendLayout();
    49       this.executionContextGroupBox.SuspendLayout();
    5050      this.scopeGroupBox.SuspendLayout();
    5151      this.SuspendLayout();
     
    8585      this.splitContainer1.TabIndex = 4;
    8686      //
     87      // splitContainer2
     88      //
     89      this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
     90      this.splitContainer2.Location = new System.Drawing.Point(0, 0);
     91      this.splitContainer2.Name = "splitContainer2";
     92      this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
     93      //
     94      // splitContainer2.Panel1
     95      //
     96      this.splitContainer2.Panel1.Controls.Add(this.executionContextGroupBox);
     97      //
     98      // splitContainer2.Panel2
     99      //
     100      this.splitContainer2.Panel2.Controls.Add(this.parametersGroupBox);
     101      this.splitContainer2.Size = new System.Drawing.Size(242, 361);
     102      this.splitContainer2.SplitterDistance = 180;
     103      this.splitContainer2.TabIndex = 1;
     104      //
     105      // executionContextGroupBox
     106      //
     107      this.executionContextGroupBox.Controls.Add(this.executionContextTreeView);
     108      this.executionContextGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     109      this.executionContextGroupBox.Location = new System.Drawing.Point(0, 0);
     110      this.executionContextGroupBox.Name = "executionContextGroupBox";
     111      this.executionContextGroupBox.Size = new System.Drawing.Size(242, 180);
     112      this.executionContextGroupBox.TabIndex = 0;
     113      this.executionContextGroupBox.TabStop = false;
     114      this.executionContextGroupBox.Text = "Execution Context";
     115      //
     116      // executionContextTreeView
     117      //
     118      this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     119      this.executionContextTreeView.Location = new System.Drawing.Point(3, 16);
     120      this.executionContextTreeView.Name = "executionContextTreeView";
     121      this.executionContextTreeView.Size = new System.Drawing.Size(236, 161);
     122      this.executionContextTreeView.TabIndex = 0;
     123      this.executionContextTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseClick);
     124      this.executionContextTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseDoubleClick);
     125      //
     126      // parametersGroupBox
     127      //
     128      this.parametersGroupBox.Controls.Add(this.parameterListView);
     129      this.parametersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     130      this.parametersGroupBox.Location = new System.Drawing.Point(0, 0);
     131      this.parametersGroupBox.Name = "parametersGroupBox";
     132      this.parametersGroupBox.Size = new System.Drawing.Size(242, 177);
     133      this.parametersGroupBox.TabIndex = 0;
     134      this.parametersGroupBox.TabStop = false;
     135      this.parametersGroupBox.Text = "Parameters";
     136      //
    87137      // parameterListView
    88138      //
     
    97147      this.parameterListView.ItemActivate += new System.EventHandler(this.parameterListView_ItemActivate);
    98148      //
     149      // scopeGroupBox
     150      //
     151      this.scopeGroupBox.Controls.Add(this.scopeTreeView);
     152      this.scopeGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     153      this.scopeGroupBox.Location = new System.Drawing.Point(0, 0);
     154      this.scopeGroupBox.Name = "scopeGroupBox";
     155      this.scopeGroupBox.Size = new System.Drawing.Size(305, 361);
     156      this.scopeGroupBox.TabIndex = 1;
     157      this.scopeGroupBox.TabStop = false;
     158      this.scopeGroupBox.Text = "Scope";
     159      //
    99160      // scopeTreeView
    100161      //
     
    109170      this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    110171                  | System.Windows.Forms.AnchorStyles.Right)));
     172      this.nameTextBox.Cursor = System.Windows.Forms.Cursors.Default;
    111173      this.nameTextBox.Location = new System.Drawing.Point(6, 19);
    112174      this.nameTextBox.Name = "nameTextBox";
     
    114176      this.nameTextBox.Size = new System.Drawing.Size(395, 20);
    115177      this.nameTextBox.TabIndex = 3;
     178      this.nameTextBox.DoubleClick += new System.EventHandler(this.nameTextBox_DoubleClick);
    116179      //
    117180      // contextLabel
     
    147210      this.collectionLabel.TabIndex = 0;
    148211      this.collectionLabel.Text = "Collection";
    149       //
    150       // splitContainer2
    151       //
    152       this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
    153       this.splitContainer2.Location = new System.Drawing.Point(0, 0);
    154       this.splitContainer2.Name = "splitContainer2";
    155       this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
    156       //
    157       // splitContainer2.Panel1
    158       //
    159       this.splitContainer2.Panel1.Controls.Add(this.executionContextGroupBox);
    160       //
    161       // splitContainer2.Panel2
    162       //
    163       this.splitContainer2.Panel2.Controls.Add(this.parametersGroupBox);
    164       this.splitContainer2.Size = new System.Drawing.Size(242, 361);
    165       this.splitContainer2.SplitterDistance = 180;
    166       this.splitContainer2.TabIndex = 1;
    167       //
    168       // parametersGroupBox
    169       //
    170       this.parametersGroupBox.Controls.Add(this.parameterListView);
    171       this.parametersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    172       this.parametersGroupBox.Location = new System.Drawing.Point(0, 0);
    173       this.parametersGroupBox.Name = "parametersGroupBox";
    174       this.parametersGroupBox.Size = new System.Drawing.Size(242, 177);
    175       this.parametersGroupBox.TabIndex = 0;
    176       this.parametersGroupBox.TabStop = false;
    177       this.parametersGroupBox.Text = "Parameters";
    178       //
    179       // executionContextGroupBox
    180       //
    181       this.executionContextGroupBox.Controls.Add(this.executionContextTreeView);
    182       this.executionContextGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    183       this.executionContextGroupBox.Location = new System.Drawing.Point(0, 0);
    184       this.executionContextGroupBox.Name = "executionContextGroupBox";
    185       this.executionContextGroupBox.Size = new System.Drawing.Size(242, 180);
    186       this.executionContextGroupBox.TabIndex = 0;
    187       this.executionContextGroupBox.TabStop = false;
    188       this.executionContextGroupBox.Text = "Execution Context";
    189       //
    190       // scopeGroupBox
    191       //
    192       this.scopeGroupBox.Controls.Add(this.scopeTreeView);
    193       this.scopeGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    194       this.scopeGroupBox.Location = new System.Drawing.Point(0, 0);
    195       this.scopeGroupBox.Name = "scopeGroupBox";
    196       this.scopeGroupBox.Size = new System.Drawing.Size(305, 361);
    197       this.scopeGroupBox.TabIndex = 1;
    198       this.scopeGroupBox.TabStop = false;
    199       this.scopeGroupBox.Text = "Scope";
    200       //
    201       // executionContextTreeView
    202       //
    203       this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
    204       this.executionContextTreeView.Location = new System.Drawing.Point(3, 16);
    205       this.executionContextTreeView.Name = "executionContextTreeView";
    206       this.executionContextTreeView.Size = new System.Drawing.Size(236, 161);
    207       this.executionContextTreeView.TabIndex = 0;
    208       this.executionContextTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseClick);
    209       this.executionContextTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseDoubleClick);
    210212      //
    211213      // timer
     
    229231      this.splitContainer2.Panel2.ResumeLayout(false);
    230232      this.splitContainer2.ResumeLayout(false);
     233      this.executionContextGroupBox.ResumeLayout(false);
    231234      this.parametersGroupBox.ResumeLayout(false);
    232       this.executionContextGroupBox.ResumeLayout(false);
    233235      this.scopeGroupBox.ResumeLayout(false);
    234236      this.ResumeLayout(false);
  • branches/HeuristicLab.DebugEngine/OperationContentView.cs

    r4876 r4903  
    11using System;
    22using System.Collections.Generic;
    3 using System.ComponentModel;
    43using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    74using System.Text;
    85using System.Windows.Forms;
     6using HeuristicLab.Common;
     7using HeuristicLab.Core;
     8using HeuristicLab.MainForm;
    99using HeuristicLab.MainForm.WindowsForms;
    10 using HeuristicLab.MainForm;
    11 using HeuristicLab.Core;
    12 using HeuristicLab.Common;
    1310
    1411namespace HeuristicLab.DebugEngine {
     
    6158
    6259    private object GetParameterValue(IParameter param, IExecutionContext context) {
    63       var originalContext = param.ExecutionContext;
     60      param = (IParameter)param.Clone();
    6461      param.ExecutionContext = context;
    6562      object value = null;
    6663      try {
    67         try {
    68           value = param.ActualValue;
    69         } catch (Exception x) {
    70           value = x;
    71         }
    72       } finally {
    73         param.ExecutionContext = originalContext;
     64        value = param.ActualValue;
     65      } catch (Exception x) {
     66        value = x.Message;
    7467      }
    7568      return value;
     
    8376        while (scope != null && scope.Parent != null)
    8477          scope = scope.Parent;
    85         UpdateScope(scope);
    86       }
    87       scopeTreeView.EndUpdate();
    88     }
    89 
    90     private void UpdateScope(IScope scope) {
    91       if (scope != null) {
    92         AddScope(scopeTreeView.Nodes, scope);
     78        if (scope != null)
     79          AddScope(scopeTreeView.Nodes, scope);
     80        if (scopeTreeView.Nodes.Count > 0)
     81          scopeTreeView.TopNode = scopeTreeView.Nodes[0];
    9382      }
    9483      scopeTreeView.ExpandAll();
     
    9988
    10089    private void AddScope(TreeNodeCollection nodes, IScope scope) {
    101       TreeNode node = nodes.Add(scope.Name);
     90      TreeNode node = nodes.Add(string.Format("{0} ({1}+{2})", scope.Name, scope.Variables.Count, scope.SubScopes.Count));
    10291      node.Tag = scope;
    10392      if (Content.IsAtomic && Content.AtomicOperation.Scope == scope) {
     
    121110        AddExecutionContext(Content.ExecutionContext, executionContextTreeView.Nodes);
    122111      }
     112      executionContextTreeView.ExpandAll();
     113      if (executionContextTreeView.Nodes.Count > 0)
     114        executionContextTreeView.TopNode = executionContextTreeView.Nodes[0];
    123115      executionContextTreeView.EndUpdate();
    124116    }
     
    206198
    207199    #endregion
     200
     201    private void nameTextBox_DoubleClick(object sender, EventArgs e) {
     202      if (Content != null && Content.IsAtomic && Content.AtomicOperation.Operator != null)
     203        MainFormManager.MainForm.ShowContent(Content.AtomicOperation.Operator);
     204    }
     205
    208206  }
    209207}
Note: See TracChangeset for help on using the changeset viewer.