Changeset 4759
- Timestamp:
- 11/09/10 15:58:12 (14 years ago)
- Location:
- branches/HeuristicLab.DebugEngine
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DebugEngine/DebugEngineView.Designer.cs
r4753 r4759 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugEngineView)); 48 49 this.label1 = new System.Windows.Forms.Label(); … … 50 51 this.logView = new HeuristicLab.Core.Views.LogView(); 51 52 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 52 this.splitContainer2 = new System.Windows.Forms.SplitContainer();53 53 this.executionStackTreeView = new System.Windows.Forms.TreeView(); 54 54 this.label2 = new System.Windows.Forms.Label(); 55 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 55 56 this.label3 = new System.Windows.Forms.Label(); 56 57 this.scopeTreeView = new System.Windows.Forms.TreeView(); 57 58 this.stepButton = new System.Windows.Forms.Button(); 58 59 this.updateButton = new System.Windows.Forms.Button(); 60 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 61 this.parentButton = new System.Windows.Forms.Button(); 62 this.operationTextBox = new System.Windows.Forms.TextBox(); 63 this.label4 = new System.Windows.Forms.Label(); 59 64 this.splitContainer1.Panel1.SuspendLayout(); 60 65 this.splitContainer1.Panel2.SuspendLayout(); … … 81 86 this.executionTimeTextBox.Name = "executionTimeTextBox"; 82 87 this.executionTimeTextBox.ReadOnly = true; 83 this.executionTimeTextBox.Size = new System.Drawing.Size( 366, 20);88 this.executionTimeTextBox.Size = new System.Drawing.Size(496, 20); 84 89 this.executionTimeTextBox.TabIndex = 1; 85 90 // … … 92 97 this.logView.Name = "logView"; 93 98 this.logView.ReadOnly = false; 94 this.logView.Size = new System.Drawing.Size( 515, 175);99 this.logView.Size = new System.Drawing.Size(339, 255); 95 100 this.logView.TabIndex = 2; 96 101 // 97 102 // splitContainer1 98 103 // 99 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 100 | System.Windows.Forms.AnchorStyles.Left) 101 | System.Windows.Forms.AnchorStyles.Right))); 102 this.splitContainer1.Location = new System.Drawing.Point(3, 32); 104 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 105 this.splitContainer1.Location = new System.Drawing.Point(0, 0); 103 106 this.splitContainer1.Name = "splitContainer1"; 104 107 this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; … … 106 109 // splitContainer1.Panel1 107 110 // 108 this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); 111 this.splitContainer1.Panel1.Controls.Add(this.executionStackTreeView); 112 this.splitContainer1.Panel1.Controls.Add(this.label2); 109 113 // 110 114 // splitContainer1.Panel2 111 115 // 112 116 this.splitContainer1.Panel2.Controls.Add(this.logView); 113 this.splitContainer1.Size = new System.Drawing.Size( 515, 341);114 this.splitContainer1.SplitterDistance = 162;117 this.splitContainer1.Size = new System.Drawing.Size(339, 492); 118 this.splitContainer1.SplitterDistance = 233; 115 119 this.splitContainer1.TabIndex = 3; 116 //117 // splitContainer2118 //119 this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;120 this.splitContainer2.Location = new System.Drawing.Point(0, 0);121 this.splitContainer2.Name = "splitContainer2";122 //123 // splitContainer2.Panel1124 //125 this.splitContainer2.Panel1.Controls.Add(this.executionStackTreeView);126 this.splitContainer2.Panel1.Controls.Add(this.label2);127 //128 // splitContainer2.Panel2129 //130 this.splitContainer2.Panel2.Controls.Add(this.label3);131 this.splitContainer2.Panel2.Controls.Add(this.scopeTreeView);132 this.splitContainer2.Size = new System.Drawing.Size(515, 162);133 this.splitContainer2.SplitterDistance = 258;134 this.splitContainer2.TabIndex = 0;135 120 // 136 121 // executionStackTreeView … … 142 127 this.executionStackTreeView.Name = "executionStackTreeView"; 143 128 this.executionStackTreeView.ShowNodeToolTips = true; 144 this.executionStackTreeView.Size = new System.Drawing.Size( 252, 143);129 this.executionStackTreeView.Size = new System.Drawing.Size(333, 214); 145 130 this.executionStackTreeView.TabIndex = 2; 146 131 this.executionStackTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionStackTreeView_NodeMouseDoubleClick); … … 155 140 this.label2.Text = "Execution Stack"; 156 141 // 142 // splitContainer2 143 // 144 this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 145 | System.Windows.Forms.AnchorStyles.Left) 146 | System.Windows.Forms.AnchorStyles.Right))); 147 this.splitContainer2.Location = new System.Drawing.Point(3, 32); 148 this.splitContainer2.Name = "splitContainer2"; 149 // 150 // splitContainer2.Panel1 151 // 152 this.splitContainer2.Panel1.Controls.Add(this.splitContainer1); 153 // 154 // splitContainer2.Panel2 155 // 156 this.splitContainer2.Panel2.Controls.Add(this.label4); 157 this.splitContainer2.Panel2.Controls.Add(this.operationTextBox); 158 this.splitContainer2.Panel2.Controls.Add(this.label3); 159 this.splitContainer2.Panel2.Controls.Add(this.scopeTreeView); 160 this.splitContainer2.Size = new System.Drawing.Size(678, 492); 161 this.splitContainer2.SplitterDistance = 339; 162 this.splitContainer2.TabIndex = 0; 163 // 157 164 // label3 158 165 // 159 166 this.label3.AutoSize = true; 160 this.label3.Location = new System.Drawing.Point(3, 0);167 this.label3.Location = new System.Drawing.Point(3, 26); 161 168 this.label3.Name = "label3"; 162 169 this.label3.Size = new System.Drawing.Size(63, 13); … … 169 176 | System.Windows.Forms.AnchorStyles.Left) 170 177 | System.Windows.Forms.AnchorStyles.Right))); 171 this.scopeTreeView.Location = new System.Drawing.Point(3, 16);178 this.scopeTreeView.Location = new System.Drawing.Point(3, 42); 172 179 this.scopeTreeView.Name = "scopeTreeView"; 173 180 this.scopeTreeView.ShowNodeToolTips = true; 174 this.scopeTreeView.Size = new System.Drawing.Size( 247, 143);181 this.scopeTreeView.Size = new System.Drawing.Size(329, 447); 175 182 this.scopeTreeView.TabIndex = 0; 176 183 this.scopeTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.scopeTreeView_NodeMouseDoubleClick); … … 180 187 this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 181 188 this.stepButton.Image = ((System.Drawing.Image)(resources.GetObject("stepButton.Image"))); 182 this.stepButton.Location = new System.Drawing.Point( 494, 3);189 this.stepButton.Location = new System.Drawing.Point(624, 3); 183 190 this.stepButton.Name = "stepButton"; 184 191 this.stepButton.Size = new System.Drawing.Size(24, 24); 185 192 this.stepButton.TabIndex = 4; 193 this.toolTip.SetToolTip(this.stepButton, "Step"); 186 194 this.stepButton.UseVisualStyleBackColor = true; 187 195 this.stepButton.Click += new System.EventHandler(this.stepButton_Click); … … 191 199 this.updateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 192 200 this.updateButton.Image = ((System.Drawing.Image)(resources.GetObject("updateButton.Image"))); 193 this.updateButton.Location = new System.Drawing.Point( 464, 3);201 this.updateButton.Location = new System.Drawing.Point(654, 3); 194 202 this.updateButton.Name = "updateButton"; 195 203 this.updateButton.Size = new System.Drawing.Size(24, 24); 196 204 this.updateButton.TabIndex = 5; 205 this.toolTip.SetToolTip(this.updateButton, "Refresh/Reset View"); 197 206 this.updateButton.UseVisualStyleBackColor = true; 198 207 this.updateButton.Click += new System.EventHandler(this.updateButton_Click); 199 208 // 209 // parentButton 210 // 211 this.parentButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 212 this.parentButton.Image = ((System.Drawing.Image)(resources.GetObject("parentButton.Image"))); 213 this.parentButton.Location = new System.Drawing.Point(594, 3); 214 this.parentButton.Name = "parentButton"; 215 this.parentButton.Size = new System.Drawing.Size(24, 24); 216 this.parentButton.TabIndex = 6; 217 this.toolTip.SetToolTip(this.parentButton, "Go to parent ExecutionContext"); 218 this.parentButton.UseVisualStyleBackColor = true; 219 this.parentButton.Click += new System.EventHandler(this.parentButton_Click); 220 // 221 // operationTextBox 222 // 223 this.operationTextBox.Location = new System.Drawing.Point(65, 3); 224 this.operationTextBox.Name = "operationTextBox"; 225 this.operationTextBox.ReadOnly = true; 226 this.operationTextBox.Size = new System.Drawing.Size(267, 20); 227 this.operationTextBox.TabIndex = 2; 228 // 229 // label4 230 // 231 this.label4.AutoSize = true; 232 this.label4.Location = new System.Drawing.Point(3, 6); 233 this.label4.Name = "label4"; 234 this.label4.Size = new System.Drawing.Size(56, 13); 235 this.label4.TabIndex = 3; 236 this.label4.Text = "Operation:"; 237 // 200 238 // DebugEngineView 201 239 // 202 240 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 241 this.Controls.Add(this.parentButton); 242 this.Controls.Add(this.splitContainer2); 203 243 this.Controls.Add(this.updateButton); 204 244 this.Controls.Add(this.stepButton); 205 this.Controls.Add(this.splitContainer1);206 245 this.Controls.Add(this.executionTimeTextBox); 207 246 this.Controls.Add(this.label1); 208 247 this.Name = "DebugEngineView"; 209 this.Size = new System.Drawing.Size( 521, 376);248 this.Size = new System.Drawing.Size(684, 527); 210 249 this.splitContainer1.Panel1.ResumeLayout(false); 250 this.splitContainer1.Panel1.PerformLayout(); 211 251 this.splitContainer1.Panel2.ResumeLayout(false); 212 252 this.splitContainer1.ResumeLayout(false); 213 253 this.splitContainer2.Panel1.ResumeLayout(false); 214 this.splitContainer2.Panel1.PerformLayout();215 254 this.splitContainer2.Panel2.ResumeLayout(false); 216 255 this.splitContainer2.Panel2.PerformLayout(); … … 234 273 private System.Windows.Forms.Button stepButton; 235 274 private System.Windows.Forms.Button updateButton; 275 private System.Windows.Forms.ToolTip toolTip; 276 private System.Windows.Forms.Button parentButton; 277 private System.Windows.Forms.Label label4; 278 private System.Windows.Forms.TextBox operationTextBox; 236 279 237 280 } -
branches/HeuristicLab.DebugEngine/DebugEngineView.cs
r4753 r4759 24 24 using System.Drawing; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Common.Resources; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Core.Views; … … 49 50 public DebugEngineView() { 50 51 InitializeComponent(); 52 updateButton.Image = VS2008ImageLibrary.Refresh; 53 stepButton.Image = VS2008ImageLibrary.MoveNext; 54 parentButton.Image = VS2008ImageLibrary.ArrowUp; 51 55 } 52 56 … … 117 121 Invoke(new Action(UpdateView)); 118 122 } else { 119 executionStackTreeView.BeginUpdate(); 120 executionStackTreeView.Nodes.Clear(); 121 AddOperations(executionStackTreeView.Nodes, Content.ExecutionStack.ToArray()); 122 executionStackTreeView.ExpandAll(); 123 if (executionStackTreeView.Nodes.Count > 0) 124 executionStackTreeView.TopNode = executionStackTreeView.Nodes[0]; 125 executionStackTreeView.EndUpdate(); 126 127 128 scopeTreeView.BeginUpdate(); 129 scopeTreeView.Nodes.Clear(); 130 if (Content.CurrentOperation != null) { 131 AddScope(scopeTreeView.Nodes, Content.CurrentOperation.Scope); 132 } 133 scopeTreeView.ExpandAll(); 134 if (scopeTreeView.Nodes.Count > 0) 135 scopeTreeView.TopNode = scopeTreeView.Nodes[0]; 136 scopeTreeView.EndUpdate(); 137 } 123 UpdateExecutionStack(); 124 SetOperation(Content.CurrentOperation); 125 } 126 } 127 128 private void SetOperation(IOperation operation) { 129 IAtomicOperation atomicOperation = operation as IAtomicOperation; 130 operationTextBox.Text = "<none>"; 131 toolTip.SetToolTip(operationTextBox, null); 132 if (atomicOperation != null && atomicOperation.Operator != null) { 133 operationTextBox.Text = string.Format("Atomic {0}", atomicOperation.Operator.Name); 134 toolTip.SetToolTip(operationTextBox, TypeName(atomicOperation.Operator)); 135 } 136 OperationCollection operationCollection = operation as OperationCollection; 137 if (operationCollection != null) 138 operationTextBox.Text = string.Format("Collection {0}", operationCollection.Count); 139 IExecutionContext context = operation as IExecutionContext; 140 IScope scope = null; 141 if (context != null) { 142 scope = context.Scope; 143 while (scope != null && scope.Parent != null) 144 scope = scope.Parent; 145 } 146 UpdateScope(scope); 147 if (context != null) 148 parentButton.Enabled = context.Parent != null; 149 scopeTreeView.Tag = context; 150 } 151 152 private void UpdateExecutionStack() { 153 executionStackTreeView.BeginUpdate(); 154 executionStackTreeView.Nodes.Clear(); 155 AddOperations(executionStackTreeView.Nodes, Content.ExecutionStack.ToArray()); 156 executionStackTreeView.ExpandAll(); 157 if (executionStackTreeView.Nodes.Count > 0) 158 executionStackTreeView.TopNode = executionStackTreeView.Nodes[0]; 159 executionStackTreeView.EndUpdate(); 160 } 161 162 private void UpdateScope(IScope scope) { 163 scopeTreeView.BeginUpdate(); 164 scopeTreeView.Nodes.Clear(); 165 if (scope != null) { 166 AddScope(scopeTreeView.Nodes, scope); 167 } 168 scopeTreeView.ExpandAll(); 169 if (scopeTreeView.Nodes.Count > 0) 170 scopeTreeView.TopNode = scopeTreeView.Nodes[0]; 171 scopeTreeView.EndUpdate(); 138 172 } 139 173 … … 151 185 node.Tag = atom; 152 186 node.ToolTipText = TypeName(atom); 187 node.ImageKey = "AtomicOperation"; 153 188 if (atom.Operator.Breakpoint) 154 189 node.ForeColor = Color.Red; … … 158 193 paramNode.Tag = param; 159 194 paramNode.ToolTipText = string.Format("{0} = {1}", TypeName(param), typeName); 195 paramNode.ImageKey = "Parameter"; 160 196 } 161 197 } else if (op is OperationCollection) { … … 164 200 node.Tag = op; 165 201 node.ToolTipText = TypeName(ops); 202 node.ImageKey = "OperationCollection"; 166 203 AddOperations(node.Nodes, ops); 167 204 } … … 170 207 171 208 private string GetApproximateValue(IParameter param, ref string typeName) { 172 string value = "<none>"; 209 string valueString = "<none>"; 210 IExecutionContext context = Content.CurrentOperation as IExecutionContext; 211 IExecutionContext originalContext = param.ExecutionContext; 212 object value = null; 173 213 try { 174 IExecutionContext context = Content.CurrentOperation as IExecutionContext; 175 IExecutionContext oldContext = param.ExecutionContext; 176 if (context != null) { 214 try { 177 215 param.ExecutionContext = context; 178 } 179 value = param.ActualValue.ToString(); 180 typeName = TypeName(param.ActualValue); 181 if (context != oldContext) { 182 param.ExecutionContext = oldContext; 183 value = string.Format("~ {0}", value); 216 value = param.ActualValue; 217 } finally { 218 param.ExecutionContext = originalContext; 184 219 } 185 220 } catch (Exception) { } 186 return value; 221 if (value != null) { 222 valueString = value.ToString(); 223 if (context != originalContext) 224 valueString = " ~ " + valueString; 225 typeName = TypeName(value); 226 } 227 return valueString; 187 228 } 188 229 189 230 private void AddScope(TreeNodeCollection nodes, IScope scope) { 190 231 TreeNode node = nodes.Add(scope.Name); 232 if (Content.CurrentOperation != null && Content.CurrentOperation.Scope == scope) { 233 node.ForeColor = Color.Red; 234 node.BackColor = Color.LightGray; 235 } 191 236 foreach (var var in scope.Variables) { 192 237 TreeNode varNode = node.Nodes.Add(string.Format("{0}={1}", var.Name, var.Value.ToString())); … … 230 275 MainFormManager.MainForm.ShowContent((IItem)e.Node.Tag); 231 276 } 277 278 private void parentButton_Click(object sender, EventArgs e) { 279 IExecutionContext context = scopeTreeView.Tag as IExecutionContext; 280 if (context != null) { 281 SetOperation(context.Parent as IOperation); 282 } 283 } 232 284 } 233 285 } -
branches/HeuristicLab.DebugEngine/HeuristicLab.DebugEngine.csproj
r4744 r4759 114 114 <Reference Include="System.Xml.Linq" /> 115 115 <Reference Include="System.Data.DataSetExtensions" /> 116 <Reference Include="Microsoft.CSharp" />117 116 <Reference Include="System.Data" /> 118 117 <Reference Include="System.Xml" />
Note: See TracChangeset
for help on using the changeset viewer.