Changeset 4753
- Timestamp:
- 11/09/10 11:09:37 (14 years ago)
- Location:
- branches/HeuristicLab.DebugEngine
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DebugEngine/DebugEngine.cs
r4747 r4753 62 62 OperationCollection coll = next as OperationCollection; 63 63 while (coll != null) { 64 Log.LogMessage("Expanding OperationCollection"); 64 65 for (int i = coll.Count - 1; i >= 0; i--) { 65 66 ExecutionStack.Push(coll[i]); … … 70 71 IAtomicOperation operation = next as IAtomicOperation; 71 72 if (operation != null) { 73 Log.LogMessage("Preparing IAtomicOperation"); 72 74 try { 73 75 currentOperator = operation.Operator; … … 77 79 Pause(); 78 80 } 81 Log.LogMessage("Executing IAtomicOperation"); 79 82 ExecutionStack.Push(operation.Operator.Execute((IExecutionContext)operation)); 80 83 } catch (Exception ex) { … … 83 86 } 84 87 } else { 88 Log.LogMessage("Nothing to do"); 85 89 CurrentOperation = null; 86 90 } … … 99 103 OnStarted(); 100 104 var lastUpdateTime = DateTime.Now; 101 if (ExecutionStack.Count > 0) 105 if (ExecutionStack.Count > 0) { 106 while (ExecutionStack.Count > 0 && ExecutionStack.Peek() == null) 107 ExecutionStack.Pop(); 102 108 ProcessNextOperation(); 109 } 103 110 ExecutionTime += DateTime.Now - lastUpdateTime; 104 111 OnPaused(); -
branches/HeuristicLab.DebugEngine/DebugEngineView.Designer.cs
r4747 r4753 141 141 this.executionStackTreeView.Location = new System.Drawing.Point(3, 16); 142 142 this.executionStackTreeView.Name = "executionStackTreeView"; 143 this.executionStackTreeView.ShowNodeToolTips = true; 143 144 this.executionStackTreeView.Size = new System.Drawing.Size(252, 143); 144 145 this.executionStackTreeView.TabIndex = 2; … … 170 171 this.scopeTreeView.Location = new System.Drawing.Point(3, 16); 171 172 this.scopeTreeView.Name = "scopeTreeView"; 173 this.scopeTreeView.ShowNodeToolTips = true; 172 174 this.scopeTreeView.Size = new System.Drawing.Size(247, 143); 173 175 this.scopeTreeView.TabIndex = 0; -
branches/HeuristicLab.DebugEngine/DebugEngineView.cs
r4747 r4753 27 27 using HeuristicLab.Core.Views; 28 28 using HeuristicLab.MainForm; 29 using HeuristicLab.Persistence.Auxiliary; 29 30 namespace HeuristicLab.DebugEngine { 30 31 /// <summary> … … 116 117 Invoke(new Action(UpdateView)); 117 118 } else { 119 executionStackTreeView.BeginUpdate(); 118 120 executionStackTreeView.Nodes.Clear(); 119 121 AddOperations(executionStackTreeView.Nodes, Content.ExecutionStack.ToArray()); 120 122 executionStackTreeView.ExpandAll(); 121 123 if (executionStackTreeView.Nodes.Count > 0) 124 executionStackTreeView.TopNode = executionStackTreeView.Nodes[0]; 125 executionStackTreeView.EndUpdate(); 126 127 128 scopeTreeView.BeginUpdate(); 122 129 scopeTreeView.Nodes.Clear(); 123 130 if (Content.CurrentOperation != null) { … … 125 132 } 126 133 scopeTreeView.ExpandAll(); 127 } 134 if (scopeTreeView.Nodes.Count > 0) 135 scopeTreeView.TopNode = scopeTreeView.Nodes[0]; 136 scopeTreeView.EndUpdate(); 137 } 138 } 139 140 private string TypeName(object obj) { 141 if (obj == null) 142 return "null"; 143 return TypeNameParser.Parse(obj.GetType().ToString()).GetTypeNameInCode(true); 128 144 } 129 145 … … 134 150 TreeNode node = nodes.Add(atom.Operator.Name); 135 151 node.Tag = atom; 152 node.ToolTipText = TypeName(atom); 136 153 if (atom.Operator.Breakpoint) 137 154 node.ForeColor = Color.Red; 138 155 foreach (var param in atom.Operator.Parameters) { 139 IItem value = null; 140 try { 141 value = param.ActualValue; 142 } catch (Exception) { } 143 TreeNode paramNode = node.Nodes.Add(string.Format("Param {0}={1}", param.Name, value)); 156 string typeName = "null"; 157 TreeNode paramNode = node.Nodes.Add(string.Format("Param {0} = {1}", param.Name, GetApproximateValue(param, ref typeName))); 144 158 paramNode.Tag = param; 159 paramNode.ToolTipText = string.Format("{0} = {1}", TypeName(param), typeName); 145 160 } 146 161 } else if (op is OperationCollection) { … … 148 163 TreeNode node = executionStackTreeView.Nodes.Add(string.Format("{0} Operations", ops.Count)); 149 164 node.Tag = op; 165 node.ToolTipText = TypeName(ops); 150 166 AddOperations(node.Nodes, ops); 151 167 } 152 168 } 169 } 170 171 private string GetApproximateValue(IParameter param, ref string typeName) { 172 string value = "<none>"; 173 try { 174 IExecutionContext context = Content.CurrentOperation as IExecutionContext; 175 IExecutionContext oldContext = param.ExecutionContext; 176 if (context != null) { 177 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); 184 } 185 } catch (Exception) { } 186 return value; 153 187 } 154 188 … … 158 192 TreeNode varNode = node.Nodes.Add(string.Format("{0}={1}", var.Name, var.Value.ToString())); 159 193 varNode.Tag = var.Value; 194 varNode.ToolTipText = TypeName(var.Value); 160 195 } 161 196 foreach (var subScope in scope.SubScopes) { -
branches/HeuristicLab.DebugEngine/DebugEngineView.resx
r4746 r4753 122 122 <value> 123 123 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAL DAAA125 Cw wBP0AiyAAAAXxJREFUOE9j+P//PwM6Tuh5woZNHJsYhmaQIqABpkDMQowhWA0onPX8f/zkt/bohoDE124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCwAA 125 CwsBbQSEtwAAAXxJREFUOE9j+P//PwM6Tuh5woZNHJsYhmaQIqABpkDMQowhWA0onPX8f/zkt/bohoDE 126 126 G+Y9/xXb8fANzHCsBuTOfPY/ofve/7gJr72QvQMSX3Xk/f/w9gdA/RCvYzUgY8rT//P2//4f1HDzL9CA 127 127 bJghIPGF+z78D264ht8AoIb/s/f9+t+59e9/t9LL/4H8PJAhIPFpW97/96++gN+AyK5H/6ds+/W/ZOnf … … 135 135 <value> 136 136 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 137 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALD wAA138 Cw 8BkvkDpQAAAkNJREFUOE+d0l1IU2EYB/AZXSR0GV10bRclXWRdRB8kk5TIMV3iFgWC1FhgZbNlBNY2137 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALDgAA 138 Cw4BQL7hQQAAAkNJREFUOE+d0l1IU2EYB/AZXSR0GV10bRclXWRdRB8kk5TIMV3iFgWC1FhgZbNlBNY2 139 139 KqEwzbkMwpVzKyoWeswuXNOWy8yZ8zPXyMlcbbbvj+NZ24x/74JC7BjSgQfOxfv+zv95zpMFgKN60LW+ 140 140 KH9X0ez8At/1xb8tGqc3B4KRjRuysz/lbM1rquBtpzirPRmg941Nrm6nxrpMQwmj9SOMU07cowZwsUkP
Note: See TracChangeset
for help on using the changeset viewer.