- Timestamp:
- 11/23/10 15:03:01 (14 years ago)
- Location:
- branches/HeuristicLab.DebugEngine
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DebugEngine/DebugEngine.cs
r4904 r4909 162 162 } 163 163 164 public virtual void Step( ) {164 public virtual void Step(bool skipStackOperations) { 165 165 OnStarted(); 166 166 lastUpdateTime = DateTime.Now; … … 168 168 timer.Start(); 169 169 ProcessNextOperation(); 170 while (skipStackOperations && !(CurrentOperation is IAtomicOperation) && CanContinue) 171 ProcessNextOperation(); 170 172 timer.Stop(); 171 173 ExecutionTime += DateTime.Now - lastUpdateTime; -
branches/HeuristicLab.DebugEngine/DebugEngineView.Designer.cs
r4904 r4909 47 47 this.components = new System.ComponentModel.Container(); 48 48 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugEngineView)); 49 this.label1 = new System.Windows.Forms.Label(); 50 this.executionTimeTextBox = new System.Windows.Forms.TextBox(); 51 this.operationContentView = new OperationContentView(); 52 this.logView = new HeuristicLab.Core.Views.LogView(); 53 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 49 this.operationContentView = new HeuristicLab.DebugEngine.OperationContentView(); 50 this.executionStackView = new HeuristicLab.DebugEngine.ExecutionStackView(); 54 51 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 52 this.refreshButton = new System.Windows.Forms.Button(); 53 this.skipStackOpsCheckBox = new System.Windows.Forms.CheckBox(); 55 54 this.stepButton = new System.Windows.Forms.Button(); 56 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 57 this.refreshButton = new System.Windows.Forms.Button();58 this.skipStackOpsCheckBox = new System.Windows.Forms.CheckBox();59 56 this.splitContainer3 = new System.Windows.Forms.SplitContainer(); 60 this.executionStackView = new HeuristicLab.DebugEngine.ExecutionStackView(); 61 this.operatorTraceView = new OperatorTraceView(); 62 this.splitContainer1.Panel1.SuspendLayout(); 63 this.splitContainer1.Panel2.SuspendLayout(); 64 this.splitContainer1.SuspendLayout(); 57 this.operatorTraceView = new HeuristicLab.DebugEngine.OperatorTraceView(); 65 58 this.splitContainer2.Panel1.SuspendLayout(); 66 59 this.splitContainer2.Panel2.SuspendLayout(); 67 60 this.splitContainer2.SuspendLayout(); 68 61 this.splitContainer3.Panel1.SuspendLayout(); 62 this.splitContainer3.Panel2.SuspendLayout(); 69 63 this.splitContainer3.SuspendLayout(); 70 64 this.SuspendLayout(); 71 65 // 72 // label1 73 // 74 this.label1.AutoSize = true; 75 this.label1.Location = new System.Drawing.Point(3, 9); 76 this.label1.Name = "label1"; 77 this.label1.Size = new System.Drawing.Size(83, 13); 78 this.label1.TabIndex = 0; 79 this.label1.Text = "Execution Time:"; 80 // 81 // executionTimeTextBox 82 // 83 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 66 // operationContentView 67 // 68 this.operationContentView.Caption = "Operation Content View"; 69 this.operationContentView.Content = null; 70 this.operationContentView.Dock = System.Windows.Forms.DockStyle.Fill; 71 this.operationContentView.Location = new System.Drawing.Point(0, 0); 72 this.operationContentView.Name = "operationContentView"; 73 this.operationContentView.ReadOnly = false; 74 this.operationContentView.Size = new System.Drawing.Size(484, 538); 75 this.operationContentView.TabIndex = 0; 76 // 77 // executionStackView 78 // 79 this.executionStackView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 80 | System.Windows.Forms.AnchorStyles.Left) 84 81 | System.Windows.Forms.AnchorStyles.Right))); 85 this.executionTimeTextBox.Location = new System.Drawing.Point(92, 6); 86 this.executionTimeTextBox.Name = "executionTimeTextBox"; 87 this.executionTimeTextBox.ReadOnly = true; 88 this.executionTimeTextBox.Size = new System.Drawing.Size(611, 20); 89 this.executionTimeTextBox.TabIndex = 1; 90 // 91 // logView 92 // 93 this.logView.Caption = "Log View"; 94 this.logView.Content = null; 95 this.logView.Dock = System.Windows.Forms.DockStyle.Fill; 96 this.logView.Location = new System.Drawing.Point(0, 0); 97 this.logView.Name = "logView"; 98 this.logView.ReadOnly = false; 99 this.logView.Size = new System.Drawing.Size(198, 237); 100 this.logView.TabIndex = 2; 101 // 102 // splitContainer1 103 // 104 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 105 this.splitContainer1.Location = new System.Drawing.Point(0, 0); 106 this.splitContainer1.Name = "splitContainer1"; 107 this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; 108 // 109 // splitContainer1.Panel1 110 // 111 this.splitContainer1.Panel1.Controls.Add(this.executionStackView); 112 // 113 // splitContainer1.Panel2 114 // 115 this.splitContainer1.Panel2.Controls.Add(this.logView); 116 this.splitContainer1.Size = new System.Drawing.Size(198, 502); 117 this.splitContainer1.SplitterDistance = 261; 118 this.splitContainer1.TabIndex = 3; 82 this.executionStackView.Caption = "Execution Stack View"; 83 this.executionStackView.Content = null; 84 this.executionStackView.Location = new System.Drawing.Point(0, 0); 85 this.executionStackView.Name = "executionStackView"; 86 this.executionStackView.ReadOnly = false; 87 this.executionStackView.Size = new System.Drawing.Size(197, 505); 88 this.executionStackView.TabIndex = 0; 119 89 // 120 90 // splitContainer2 … … 126 96 // splitContainer2.Panel1 127 97 // 128 this.splitContainer2.Panel1.Controls.Add(this.splitContainer1); 98 this.splitContainer2.Panel1.Controls.Add(this.executionStackView); 99 this.splitContainer2.Panel1.Controls.Add(this.refreshButton); 100 this.splitContainer2.Panel1.Controls.Add(this.skipStackOpsCheckBox); 101 this.splitContainer2.Panel1.Controls.Add(this.stepButton); 129 102 // 130 103 // splitContainer2.Panel2 131 104 // 132 105 this.splitContainer2.Panel2.Controls.Add(this.operationContentView); 133 this.splitContainer2.Size = new System.Drawing.Size(68 3, 502);134 this.splitContainer2.SplitterDistance = 19 8;106 this.splitContainer2.Size = new System.Drawing.Size(687, 538); 107 this.splitContainer2.SplitterDistance = 199; 135 108 this.splitContainer2.TabIndex = 0; 136 109 // 110 // refreshButton 111 // 112 this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 113 this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image"))); 114 this.refreshButton.Location = new System.Drawing.Point(3, 511); 115 this.refreshButton.Name = "refreshButton"; 116 this.refreshButton.Size = new System.Drawing.Size(24, 24); 117 this.refreshButton.TabIndex = 5; 118 this.toolTip.SetToolTip(this.refreshButton, "Refresh View"); 119 this.refreshButton.UseVisualStyleBackColor = true; 120 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 121 // 122 // skipStackOpsCheckBox 123 // 124 this.skipStackOpsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 125 this.skipStackOpsCheckBox.AutoSize = true; 126 this.skipStackOpsCheckBox.Location = new System.Drawing.Point(63, 516); 127 this.skipStackOpsCheckBox.Name = "skipStackOpsCheckBox"; 128 this.skipStackOpsCheckBox.Size = new System.Drawing.Size(78, 17); 129 this.skipStackOpsCheckBox.TabIndex = 6; 130 this.skipStackOpsCheckBox.Text = "Skip Stack"; 131 this.toolTip.SetToolTip(this.skipStackOpsCheckBox, "Automatically step over steps that manipulate only the execution stack"); 132 this.skipStackOpsCheckBox.UseVisualStyleBackColor = true; 133 // 137 134 // stepButton 138 135 // 139 this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles. Top | System.Windows.Forms.AnchorStyles.Right)));136 this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 140 137 this.stepButton.Image = ((System.Drawing.Image)(resources.GetObject("stepButton.Image"))); 141 this.stepButton.Location = new System.Drawing.Point( 815, 3);138 this.stepButton.Location = new System.Drawing.Point(33, 511); 142 139 this.stepButton.Name = "stepButton"; 143 140 this.stepButton.Size = new System.Drawing.Size(24, 24); … … 147 144 this.stepButton.Click += new System.EventHandler(this.stepButton_Click); 148 145 // 149 // refreshButton150 //151 this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));152 this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image")));153 this.refreshButton.Location = new System.Drawing.Point(845, 3);154 this.refreshButton.Name = "refreshButton";155 this.refreshButton.Size = new System.Drawing.Size(24, 24);156 this.refreshButton.TabIndex = 5;157 this.refreshButton.UseVisualStyleBackColor = true;158 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);159 //160 // skipStackOpsCheckBox161 //162 this.skipStackOpsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));163 this.skipStackOpsCheckBox.AutoSize = true;164 this.skipStackOpsCheckBox.Location = new System.Drawing.Point(709, 8);165 this.skipStackOpsCheckBox.Name = "skipStackOpsCheckBox";166 this.skipStackOpsCheckBox.Size = new System.Drawing.Size(100, 17);167 this.skipStackOpsCheckBox.TabIndex = 6;168 this.skipStackOpsCheckBox.Text = "Skip Stack Ops";169 this.skipStackOpsCheckBox.UseVisualStyleBackColor = true;170 //171 146 // splitContainer3 172 147 // … … 174 149 | System.Windows.Forms.AnchorStyles.Left) 175 150 | System.Windows.Forms.AnchorStyles.Right))); 176 this.splitContainer3.Location = new System.Drawing.Point( 3, 33);151 this.splitContainer3.Location = new System.Drawing.Point(0, 0); 177 152 this.splitContainer3.Name = "splitContainer3"; 178 153 // … … 180 155 // 181 156 this.splitContainer3.Panel1.Controls.Add(this.splitContainer2); 157 // 158 // splitContainer3.Panel2 159 // 182 160 this.splitContainer3.Panel2.Controls.Add(this.operatorTraceView); 183 this.splitContainer3.Size = new System.Drawing.Size(8 66, 502);184 this.splitContainer3.SplitterDistance = 68 3;161 this.splitContainer3.Size = new System.Drawing.Size(872, 538); 162 this.splitContainer3.SplitterDistance = 687; 185 163 this.splitContainer3.TabIndex = 7; 164 // 165 // operatorTraceView 166 // 167 this.operatorTraceView.Caption = "Operator Trace View"; 168 this.operatorTraceView.Content = null; 186 169 this.operatorTraceView.Dock = System.Windows.Forms.DockStyle.Fill; 187 // 188 // executionStackView 189 // 190 this.executionStackView.Caption = "Execution Stack View"; 191 this.executionStackView.Content = null; 192 this.executionStackView.Dock = System.Windows.Forms.DockStyle.Fill; 193 this.executionStackView.Location = new System.Drawing.Point(0, 0); 194 this.executionStackView.Name = "executionStackView"; 195 this.executionStackView.ReadOnly = false; 196 this.executionStackView.Size = new System.Drawing.Size(198, 261); 197 this.executionStackView.TabIndex = 0; 198 // 199 // operationContentView 200 // 201 this.operationContentView.Caption = "Operation Content View"; 202 this.operationContentView.Content = null; 203 this.operationContentView.Dock = System.Windows.Forms.DockStyle.Fill; 204 this.operationContentView.Location = new System.Drawing.Point(0, 0); 205 this.operationContentView.Name = "operationContentView"; 206 this.operationContentView.ReadOnly = false; 207 this.operationContentView.Size = new System.Drawing.Size(481, 502); 208 this.operationContentView.TabIndex = 0; 170 this.operatorTraceView.Location = new System.Drawing.Point(0, 0); 171 this.operatorTraceView.Name = "operatorTraceView"; 172 this.operatorTraceView.ReadOnly = false; 173 this.operatorTraceView.Size = new System.Drawing.Size(181, 538); 174 this.operatorTraceView.TabIndex = 0; 209 175 // 210 176 // DebugEngineView … … 212 178 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 213 179 this.Controls.Add(this.splitContainer3); 214 this.Controls.Add(this.skipStackOpsCheckBox);215 this.Controls.Add(this.refreshButton);216 this.Controls.Add(this.stepButton);217 this.Controls.Add(this.executionTimeTextBox);218 this.Controls.Add(this.label1);219 180 this.Name = "DebugEngineView"; 220 181 this.Size = new System.Drawing.Size(872, 538); 221 this.splitContainer1.Panel1.ResumeLayout(false);222 this.splitContainer1.Panel2.ResumeLayout(false);223 this.splitContainer1.ResumeLayout(false);224 182 this.splitContainer2.Panel1.ResumeLayout(false); 183 this.splitContainer2.Panel1.PerformLayout(); 225 184 this.splitContainer2.Panel2.ResumeLayout(false); 226 185 this.splitContainer2.ResumeLayout(false); 227 186 this.splitContainer3.Panel1.ResumeLayout(false); 187 this.splitContainer3.Panel2.ResumeLayout(false); 228 188 this.splitContainer3.ResumeLayout(false); 229 189 this.ResumeLayout(false); 230 this.PerformLayout();231 190 232 191 } … … 234 193 #endregion 235 194 236 private System.Windows.Forms.Label label1;237 private System.Windows.Forms.TextBox executionTimeTextBox;238 private Core.Views.LogView logView;239 private System.Windows.Forms.SplitContainer splitContainer1;240 195 private System.Windows.Forms.SplitContainer splitContainer2; 241 196 private System.Windows.Forms.Button stepButton; -
branches/HeuristicLab.DebugEngine/DebugEngineView.cs
r4904 r4909 58 58 protected override void DeregisterContentEvents() { 59 59 Content.CurrentOperationChanged -= new EventHandler<OperationChangedEventArgs>(Content_CurrentOperationChanged); 60 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);61 60 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 62 61 base.DeregisterContentEvents(); … … 69 68 protected override void RegisterContentEvents() { 70 69 base.RegisterContentEvents(); 71 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);72 70 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 73 71 Content.CurrentOperationChanged += new EventHandler<OperationChangedEventArgs>(Content_CurrentOperationChanged); … … 81 79 base.OnContentChanged(); 82 80 if (Content == null) { 83 logView.Content = null;84 executionTimeTextBox.Text = "-";85 81 executionStackView.Content = null; 82 operatorTraceView.Content = null; 86 83 operationContentView.Content = null; 87 84 } else { 88 logView.Content = Content.Log;89 executionTimeTextBox.Text = Content.ExecutionTime.ToString();90 85 executionStackView.Content = Content.ExecutionStack; 86 operatorTraceView.Content = Content.OperatorTrace; 91 87 operationContentView.Content = new OperationContent(Content.CurrentOperation); 92 88 } … … 96 92 base.SetEnabledStateOfControls(); 97 93 if (Content == null) { 98 logView.Enabled = false;99 executionTimeTextBox.Enabled = false;100 94 stepButton.Enabled = false; 95 refreshButton.Enabled = false; 101 96 } else { 102 logView.Enabled = true;103 executionTimeTextBox.Enabled = true;104 97 stepButton.Enabled = Content.CanContinue; 98 refreshButton.Enabled = Content.CurrentAtomicOperation != null; 105 99 } 106 100 } … … 108 102 #endregion 109 103 110 protected virtual void Content_ExecutionTimeChanged(object sender, EventArgs e) {111 if (InvokeRequired)112 Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);113 else114 executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();115 }116 117 104 void Content_ExecutionStateChanged(object sender, EventArgs e) { 118 if (InvokeRequired) 105 if (InvokeRequired) { 119 106 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 120 else {107 } else { 121 108 switch (Content.ExecutionState) { 122 109 case ExecutionState.Started: 123 110 executionStackView.SuspendUpdate(); 124 logView.Content = null; 125 operatorTraceView.Content = null; 111 operatorTraceView.SuspendUpdate(); 126 112 break; 127 113 default: 128 logView.Content = Content.Log;129 114 executionStackView.ResumeUpdate(); 130 115 operationContentView.Content = new OperationContent(Content.CurrentOperation); 131 operatorTraceView. Content = Content.OperatorTrace;116 operatorTraceView.ResumeUpdate(); 132 117 break; 133 118 } … … 140 125 Invoke(new EventHandler<OperationChangedEventArgs>(Content_CurrentOperationChanged), sender, e); 141 126 } else { 127 142 128 } 143 129 } 144 130 145 131 private void stepButton_Click(object sender, EventArgs e) { 146 Content.Step(); 147 while (skipStackOpsCheckBox.Checked && !(Content.CurrentOperation is IAtomicOperation) && Content.CanContinue) 148 Content.Step(); 132 Content.Step(skipStackOpsCheckBox.Checked); 149 133 } 150 134 -
branches/HeuristicLab.DebugEngine/DebugEngineView.resx
r4904 r4909 119 119 </resheader> 120 120 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 121 <data name="stepButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">122 <value>123 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/gAA125 Cv4B5iV4ZgAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV126 gNyZz/4ndN/7HzfhtQYh72A1IGPK0//z9v/+H9Rw8zXQAFt8huAKg/+z9/3637n173+30sv/gQbY4zIE127 qwGRXY/+T9n263/J0r//E6b//W+TexanIVgNCGx++L917XuwZuOSL/+lo6/9N45c9t+h6Gw8ukuwGuBR128 df9/ydx3cM2KLj3/pX1WBxKdDuxL7/4PbHkGthmieaUXrjSB1QUWeXf+2xRcgWm2wZegsBpgmHUbrFnK129 a7krodSI1QCdtBtAZ6/xJaQZJI/VACnvtX7S3iuIylBYDSDGZpgaig0AAOHY1PSKOymCAAAAAElFTkSu130 QmCC131 </value>132 </data>133 <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">134 <value>17, 17</value>135 </metadata>136 121 <data name="refreshButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 137 122 <value> 138 123 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 139 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAL BAAA140 Cw QBG8oqrQAAAmFJREFUOE+dk21IU1EYx3cVVzkhaLCy+UaY0xwlZkYRmiGR7oMEUlAGfRGKvkRFVOQ0124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAgAA 125 CwIBm8luNgAAAmFJREFUOE+dk21IU1EYx3cVVzkhaLCy+UaY0xwlZkYRmiGR7oMEUlAGfRGKvkRFVOQ0 141 126 DddsVmtbvpQWhCFBSvaCUcRAk0gGm8SGM7JtrU1nzYFvu3P33znDRcLpSxceDvdefr/zv+d5Lidaufjg 142 127 QKKIWwNSUo4Tz4u4RAl5xYsgJIuEcADCYlS8oQKLvvvKdam1n+PcqjUyN5ox7PyIVrMB1U9PoKxThZI7 … … 151 136 </value> 152 137 </data> 138 <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 139 <value>17, 17</value> 140 </metadata> 141 <data name="stepButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 142 <value> 143 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 144 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/AAA 145 CvwBmdu77wAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV 146 gNyZz/4ndN/7HzfhtQYh72A1IGPK0//z9v/+H9Rw8zXQAFt8huAKg/+z9/3637n173+30sv/gQbY4zIE 147 qwGRXY/+T9n263/J0r//E6b//W+TexanIVgNCGx++L917XuwZuOSL/+lo6/9N45c9t+h6Gw8ukuwGuBR 148 df9/ydx3cM2KLj3/pX1WBxKdDuxL7/4PbHkGthmieaUXrjSB1QUWeXf+2xRcgWm2wZegsBpgmHUbrFnK 149 a7krodSI1QCdtBtAZ6/xJaQZJI/VACnvtX7S3iuIylBYDSDGZpgaig0AAOHY1PSKOymCAAAAAElFTkSu 150 QmCC 151 </value> 152 </data> 153 153 </root> -
branches/HeuristicLab.DebugEngine/ExecutionStackView.Designer.cs
r4904 r4909 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 this.treeView = new System.Windows.Forms.TreeView(); 27 28 this.groupBox = new System.Windows.Forms.GroupBox(); 29 this.imageList = new System.Windows.Forms.ImageList(this.components); 28 30 this.groupBox.SuspendLayout(); 29 31 this.SuspendLayout(); … … 32 34 // 33 35 this.treeView.Dock = System.Windows.Forms.DockStyle.Fill; 36 this.treeView.ImageIndex = 0; 37 this.treeView.ImageList = this.imageList; 34 38 this.treeView.Location = new System.Drawing.Point(3, 16); 35 39 this.treeView.Name = "treeView"; 40 this.treeView.SelectedImageIndex = 0; 41 this.treeView.ShowNodeToolTips = true; 36 42 this.treeView.Size = new System.Drawing.Size(303, 261); 37 43 this.treeView.TabIndex = 0; … … 48 54 this.groupBox.TabStop = false; 49 55 this.groupBox.Text = "Execution Stack"; 56 // 57 // imageList 58 // 59 this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 60 this.imageList.ImageSize = new System.Drawing.Size(16, 16); 61 this.imageList.TransparentColor = System.Drawing.Color.Transparent; 50 62 // 51 63 // ExecutionStackView … … 65 77 private System.Windows.Forms.TreeView treeView; 66 78 private System.Windows.Forms.GroupBox groupBox; 79 private System.Windows.Forms.ImageList imageList; 67 80 68 81 } -
branches/HeuristicLab.DebugEngine/ExecutionStackView.cs
r4903 r4909 5 5 using System.Windows.Forms; 6 6 using HeuristicLab.Collections; 7 using HeuristicLab.Common.Resources; 7 8 using HeuristicLab.Core; 8 9 using HeuristicLab.MainForm; … … 51 52 52 53 private void UpdateExecutionStack() { 53 if (!suspended) { 54 if (suspended) { 55 groupBox.Text = string.Format("Execution Stack ({0})", CountOperations(Content)); 56 } else { 54 57 treeView.BeginUpdate(); 55 58 treeView.Nodes.Clear(); 59 treeView.ImageList.Images.Clear(); 60 treeView.ImageList.Images.Add(VS2008ImageLibrary.Method); 61 treeView.ImageList.Images.Add(VS2008ImageLibrary.Module); 56 62 int totalNodes = AddStackOperations(treeView.Nodes, ((IEnumerable<IOperation>)Content).Reverse()); 57 63 if (treeView.Nodes.Count > 0) … … 60 66 treeView.EndUpdate(); 61 67 groupBox.Text = string.Format("Execution Stack ({0})", totalNodes); 62 } else {63 groupBox.Text = string.Format("Execution Stack ({0})", CountOperations(Content));64 68 } 65 69 } … … 81 85 if (op is IAtomicOperation) { 82 86 IAtomicOperation atom = op as IAtomicOperation; 83 TreeNode node = nodes.Add(atom.Operator.Name );87 TreeNode node = nodes.Add(atom.Operator.Name ?? atom.Operator.ItemName); 84 88 node.Tag = atom; 85 node.ToolTipText = Utils.TypeName(atom.Operator); 86 node.ImageKey = "AtomicOperation"; 89 node.ToolTipText = string.Format("{0}{1}{1}{2}", 90 Utils.TypeName(atom.Operator), Environment.NewLine, 91 Utils.Wrap(atom.Operator.Description ?? atom.Operator.ItemDescription, 60)); 92 node.ImageIndex = 0; 93 node.SelectedImageIndex = 0; 87 94 if (atom.Operator.Breakpoint) 88 95 node.ForeColor = Color.Red; … … 94 101 node.Tag = op; 95 102 node.ToolTipText = Utils.TypeName(ops); 96 node.ImageKey = "OperationCollection"; 103 node.ImageIndex = 1; 104 node.SelectedImageIndex = 1; 97 105 count += AddStackOperations(node.Nodes, ops); 98 106 } … … 116 124 } 117 125 118 119 120 126 #region Event Handlers (child controls) 121 127 private void treeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { … … 137 143 public virtual void ResumeUpdate() { 138 144 suspended = false; 139 UpdateExecutionStack(); 145 if (Content != null) 146 UpdateExecutionStack(); 140 147 } 141 148 #endregion -
branches/HeuristicLab.DebugEngine/ExecutionStackView.resx
r4871 r4909 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>17, 17</value> 122 </metadata> 120 123 </root> -
branches/HeuristicLab.DebugEngine/HeuristicLab.DebugEngine.csproj
r4904 r4909 102 102 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 103 103 </Reference> 104 <Reference Include="HeuristicLab.Operators-3.3"> 105 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath> 106 </Reference> 104 107 <Reference Include="HeuristicLab.Persistence-3.3"> 105 108 <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath> … … 166 169 <EmbeddedResource Include="OperatorTraceView.resx"> 167 170 <DependentUpon>OperatorTraceView.cs</DependentUpon> 171 <SubType>Designer</SubType> 168 172 </EmbeddedResource> 169 173 <EmbeddedResource Include="Properties\Resources.resx"> -
branches/HeuristicLab.DebugEngine/OperationContentView.Designer.cs
r4903 r4909 39 39 this.collectionLabel = new System.Windows.Forms.Label(); 40 40 this.timer = new System.Windows.Forms.Timer(this.components); 41 this.executionContextImageList = new System.Windows.Forms.ImageList(this.components); 42 this.parametersImageList = new System.Windows.Forms.ImageList(this.components); 43 this.scopeImageList = new System.Windows.Forms.ImageList(this.components); 44 this.parameterColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 41 45 this.groupBox.SuspendLayout(); 42 46 this.splitContainer1.Panel1.SuspendLayout(); … … 117 121 // 118 122 this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 123 this.executionContextTreeView.ImageIndex = 0; 124 this.executionContextTreeView.ImageList = this.executionContextImageList; 119 125 this.executionContextTreeView.Location = new System.Drawing.Point(3, 16); 120 126 this.executionContextTreeView.Name = "executionContextTreeView"; 127 this.executionContextTreeView.SelectedImageIndex = 0; 128 this.executionContextTreeView.ShowNodeToolTips = true; 121 129 this.executionContextTreeView.Size = new System.Drawing.Size(236, 161); 122 130 this.executionContextTreeView.TabIndex = 0; … … 137 145 // parameterListView 138 146 // 147 this.parameterListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 148 this.parameterColumn}); 139 149 this.parameterListView.Dock = System.Windows.Forms.DockStyle.Fill; 140 this.parameterListView.FullRowSelect = true; 150 this.parameterListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; 151 this.parameterListView.HideSelection = false; 141 152 this.parameterListView.Location = new System.Drawing.Point(3, 16); 142 153 this.parameterListView.Name = "parameterListView"; 154 this.parameterListView.ShowItemToolTips = true; 143 155 this.parameterListView.Size = new System.Drawing.Size(236, 158); 156 this.parameterListView.SmallImageList = this.parametersImageList; 144 157 this.parameterListView.TabIndex = 0; 145 158 this.parameterListView.UseCompatibleStateImageBehavior = false; 146 this.parameterListView.View = System.Windows.Forms.View. List;159 this.parameterListView.View = System.Windows.Forms.View.Details; 147 160 this.parameterListView.ItemActivate += new System.EventHandler(this.parameterListView_ItemActivate); 148 161 // … … 161 174 // 162 175 this.scopeTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 176 this.scopeTreeView.ImageIndex = 0; 177 this.scopeTreeView.ImageList = this.scopeImageList; 163 178 this.scopeTreeView.Location = new System.Drawing.Point(3, 16); 164 179 this.scopeTreeView.Name = "scopeTreeView"; 180 this.scopeTreeView.SelectedImageIndex = 0; 181 this.scopeTreeView.ShowNodeToolTips = true; 165 182 this.scopeTreeView.Size = new System.Drawing.Size(299, 342); 166 183 this.scopeTreeView.TabIndex = 0; 184 this.scopeTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.scopeTreeView_NodeMouseDoubleClick); 167 185 // 168 186 // nameTextBox … … 215 233 this.timer.Interval = 500; 216 234 this.timer.Tick += new System.EventHandler(this.timer_Tick); 235 // 236 // executionContextImageList 237 // 238 this.executionContextImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 239 this.executionContextImageList.ImageSize = new System.Drawing.Size(16, 16); 240 this.executionContextImageList.TransparentColor = System.Drawing.Color.Transparent; 241 // 242 // parametersImageList 243 // 244 this.parametersImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 245 this.parametersImageList.ImageSize = new System.Drawing.Size(16, 16); 246 this.parametersImageList.TransparentColor = System.Drawing.Color.Transparent; 247 // 248 // scopeImageList 249 // 250 this.scopeImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 251 this.scopeImageList.ImageSize = new System.Drawing.Size(16, 16); 252 this.scopeImageList.TransparentColor = System.Drawing.Color.Transparent; 217 253 // 218 254 // OperationContentView … … 254 290 private System.Windows.Forms.GroupBox scopeGroupBox; 255 291 private System.Windows.Forms.Timer timer; 292 private System.Windows.Forms.ImageList executionContextImageList; 293 private System.Windows.Forms.ImageList parametersImageList; 294 private System.Windows.Forms.ImageList scopeImageList; 295 private System.Windows.Forms.ColumnHeader parameterColumn; 256 296 } 257 297 } -
branches/HeuristicLab.DebugEngine/OperationContentView.cs
r4904 r4909 5 5 using System.Windows.Forms; 6 6 using HeuristicLab.Common; 7 using HeuristicLab.Common.Resources; 7 8 using HeuristicLab.Core; 8 9 using HeuristicLab.MainForm; … … 47 48 parameterListView.BeginUpdate(); 48 49 parameterListView.Items.Clear(); 50 parameterListView.SmallImageList.Images.Clear(); 49 51 if (Content.IsAtomic) { 50 52 foreach (var param in Content.AtomicOperation.Operator.Parameters) { … … 52 54 string.Format("{0} = {1}", param.Name, GetParameterValue(param, Content.ExecutionContext))); 53 55 item.Tag = param; 54 } 56 parameterListView.SmallImageList.Images.Add(param.ItemImage ?? VS2008ImageLibrary.Nothing); 57 item.ImageIndex = parameterListView.SmallImageList.Images.Count - 1; 58 item.ToolTipText = string.Format("{0}{1}{1}{2}", 59 Utils.TypeName(param), Environment.NewLine, 60 Utils.Wrap(param.Description ?? param.ItemDescription, 60)); 61 } 62 } 63 if (parameterListView.Items.Count > 0) { 64 for (int i = 0; i < parameterListView.Columns.Count; i++) 65 parameterListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 55 66 } 56 67 parameterListView.EndUpdate(); … … 72 83 scopeTreeView.BeginUpdate(); 73 84 scopeTreeView.Nodes.Clear(); 85 scopeTreeView.ImageList.Images.Clear(); 86 scopeTreeView.ImageList.Images.Add(VS2008ImageLibrary.Namespace); 87 scopeTreeView.ImageList.Images.Add(VS2008ImageLibrary.Field); 74 88 if (Content.IsContext) { 75 89 var scope = Content.ExecutionContext.Scope; … … 88 102 89 103 private void AddScope(TreeNodeCollection nodes, IScope scope) { 90 TreeNode node = nodes.Add(string.Format("{0} ({1}+{2})", scope.Name, scope.Variables.Count, scope.SubScopes.Count)); 104 TreeNode node = nodes.Add(string.Format("{0} ({1}+{2})", 105 scope.Name, scope.Variables.Count, scope.SubScopes.Count)); 91 106 node.Tag = scope; 107 node.ImageIndex = 0; 108 node.SelectedImageIndex = 0; 92 109 if (Content.IsAtomic && Content.AtomicOperation.Scope == scope) { 93 110 node.ForeColor = Color.Red; … … 97 114 TreeNode varNode = node.Nodes.Add(string.Format("{0}={1}", var.Name, var.Value)); 98 115 varNode.Tag = var.Value; 99 varNode.ToolTipText = Utils.TypeName(var.Value); 116 varNode.ToolTipText = string.Format("{0}{1}{1}{2}", 117 Utils.TypeName(var.Value), Environment.NewLine, 118 Utils.Wrap(var.Description ?? var.ItemDescription, 60)); 119 varNode.ImageIndex = 1; 120 varNode.SelectedImageIndex = 1; 100 121 } 101 122 foreach (var subScope in scope.SubScopes) { … … 107 128 executionContextTreeView.BeginUpdate(); 108 129 executionContextTreeView.Nodes.Clear(); 130 executionContextTreeView.ImageList.Images.Clear(); 131 executionContextTreeView.ImageList.Images.Add(VS2008ImageLibrary.Namespace); 109 132 if (Content.IsContext) { 110 133 AddExecutionContext(Content.ExecutionContext, executionContextTreeView.Nodes); … … 120 143 StringBuilder name = new StringBuilder(); 121 144 if (context != null && context.Operator != null) 122 name.Append( "Op ").Append(context.Operator.Name);145 name.Append(context.Operator.Name); 123 146 else 124 147 name.Append("<Context>"); … … 126 149 TreeNode node = nodes.Add(name.ToString()); 127 150 node.Tag = executionContext; 151 node.ImageIndex = 0; 152 node.SelectedImageIndex = 0; 128 153 foreach (var param in executionContext.Parameters) { 129 TreeNode paramNode = node.Nodes.Add(string.Format("Param {0}={1}", param.Name, GetParameterValue(param, executionContext))); 154 TreeNode paramNode = node.Nodes.Add(string.Format("{0}={1}", 155 param.Name, GetParameterValue(param, executionContext))); 130 156 paramNode.Tag = param; 157 executionContextTreeView.ImageList.Images.Add(param.ItemImage ?? VS2008ImageLibrary.Nothing); 158 paramNode.ImageIndex = executionContextTreeView.ImageList.Images.Count - 1; 159 paramNode.SelectedImageIndex = paramNode.ImageIndex; 160 paramNode.ToolTipText = string.Format("{0}{1}{1}{2}", 161 Utils.TypeName(param), Environment.NewLine, 162 Utils.Wrap(param.Description ?? param.ItemDescription, 60)); 131 163 } 132 164 if (executionContext.Parent != null) … … 150 182 if (param != null) 151 183 MainFormManager.MainForm.ShowContent(param); 184 } 185 } 186 187 private void scopeTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { 188 if (e.Node != null) { 189 IItem item = e.Node.Tag as IItem; 190 if (item != null) 191 MainFormManager.MainForm.ShowContent(item); 152 192 } 153 193 } -
branches/HeuristicLab.DebugEngine/OperationContentView.resx
r4876 r4909 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="executionContextImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>97, 17</value> 122 </metadata> 123 <metadata name="parametersImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 124 <value>296, 17</value> 125 </metadata> 126 <metadata name="scopeImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 <value>461, 17</value> 128 </metadata> 120 129 <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 130 <value>17, 17</value> -
branches/HeuristicLab.DebugEngine/OperatorTraceView.Designer.cs
r4904 r4909 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 this.operatorTraceGroupBox = new System.Windows.Forms.GroupBox(); 27 28 this.listView = new System.Windows.Forms.ListView(); 29 this.listViewColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 30 this.imageList = new System.Windows.Forms.ImageList(this.components); 28 31 this.operatorTraceGroupBox.SuspendLayout(); 29 32 this.SuspendLayout(); … … 35 38 this.operatorTraceGroupBox.Location = new System.Drawing.Point(0, 0); 36 39 this.operatorTraceGroupBox.Name = "operatorTraceGroupBox"; 37 this.operatorTraceGroupBox.Size = new System.Drawing.Size( 515, 405);40 this.operatorTraceGroupBox.Size = new System.Drawing.Size(152, 489); 38 41 this.operatorTraceGroupBox.TabIndex = 0; 39 42 this.operatorTraceGroupBox.TabStop = false; … … 42 45 // listView 43 46 // 47 this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 48 this.listViewColumnHeader}); 44 49 this.listView.Dock = System.Windows.Forms.DockStyle.Fill; 45 this.listView.FullRowSelect = true; 50 this.listView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; 51 this.listView.HideSelection = false; 46 52 this.listView.Location = new System.Drawing.Point(3, 16); 47 53 this.listView.Name = "listView"; 48 this.listView.Size = new System.Drawing.Size(509, 386); 54 this.listView.ShowItemToolTips = true; 55 this.listView.Size = new System.Drawing.Size(146, 470); 56 this.listView.SmallImageList = this.imageList; 49 57 this.listView.TabIndex = 0; 50 58 this.listView.UseCompatibleStateImageBehavior = false; 51 this.listView.View = System.Windows.Forms.View. List;59 this.listView.View = System.Windows.Forms.View.Details; 52 60 this.listView.ItemActivate += new System.EventHandler(this.listView_ItemActivate); 61 // 62 // imageList 63 // 64 this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 65 this.imageList.ImageSize = new System.Drawing.Size(16, 16); 66 this.imageList.TransparentColor = System.Drawing.Color.Transparent; 53 67 // 54 68 // OperatorTraceView … … 58 72 this.Controls.Add(this.operatorTraceGroupBox); 59 73 this.Name = "OperatorTraceView"; 60 this.Size = new System.Drawing.Size( 515, 405);74 this.Size = new System.Drawing.Size(152, 489); 61 75 this.operatorTraceGroupBox.ResumeLayout(false); 62 76 this.ResumeLayout(false); … … 68 82 private System.Windows.Forms.GroupBox operatorTraceGroupBox; 69 83 private System.Windows.Forms.ListView listView; 84 private System.Windows.Forms.ImageList imageList; 85 private System.Windows.Forms.ColumnHeader listViewColumnHeader; 70 86 } 71 87 } -
branches/HeuristicLab.DebugEngine/OperatorTraceView.cs
r4904 r4909 2 2 using System.Windows.Forms; 3 3 using HeuristicLab.Collections; 4 using HeuristicLab.Common.Resources; 4 5 using HeuristicLab.Core; 5 6 using HeuristicLab.Core.Views; 6 7 using HeuristicLab.MainForm; 8 using HeuristicLab.Operators; 7 9 8 10 namespace HeuristicLab.DebugEngine { … … 49 51 50 52 private void UpdateOperatorTrace() { 53 if (suspended) 54 return; 51 55 listView.BeginUpdate(); 52 56 listView.Items.Clear(); 57 listView.SmallImageList.Images.Clear(); 58 listView.SmallImageList.Images.Add(VS2008ImageLibrary.Method); 59 listView.SmallImageList.Images.Add(VS2008ImageLibrary.Module); 53 60 foreach (var item in Content) { 54 61 var viewItem = listView.Items.Add(item.Name ?? item.ItemName); 62 viewItem.ToolTipText = string.Format("{0}{1}{1}{2}", 63 Utils.TypeName(item), Environment.NewLine, 64 Utils.Wrap(item.Description, 60)); 55 65 viewItem.Tag = item; 66 viewItem.ImageIndex = item is CombinedOperator ? 1 : 0; 67 } 68 if (listView.Items.Count > 0) { 69 for (int i = 0; i < listView.Columns.Count; i++) 70 listView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 56 71 } 57 72 listView.EndUpdate(); … … 77 92 } 78 93 #endregion 94 95 private bool suspended = false; 96 public void SuspendUpdate() { 97 suspended = true; 98 } 99 public void ResumeUpdate() { 100 suspended = false; 101 UpdateOperatorTrace(); 102 } 79 103 } 80 104 -
branches/HeuristicLab.DebugEngine/OperatorTraceView.resx
r4904 r4909 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>17, 17</value> 122 </metadata> 120 123 </root> -
branches/HeuristicLab.DebugEngine/Utils.cs
r4871 r4909 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 2 using System.Text; 3 using System.Text.RegularExpressions; 5 4 using HeuristicLab.Persistence.Auxiliary; 6 5 … … 12 11 return TypeNameParser.Parse(obj.GetType().ToString()).GetTypeNameInCode(true); 13 12 } 13 public static string Wrap(string text, int columns) { 14 StringBuilder sb = new StringBuilder(); 15 Regex whitespace = new Regex("\\s"); 16 int lineLength = 0; 17 foreach (var word in whitespace.Split(text)) { 18 if (lineLength + word.Length < columns) { 19 if (lineLength > 0) { 20 sb.Append(' '); 21 lineLength++; 22 } 23 sb.Append(word); 24 lineLength += word.Length; 25 } else { 26 sb.Append(Environment.NewLine).Append(word); 27 lineLength = word.Length; 28 } 29 } 30 return sb.ToString(); 31 } 14 32 } 15 33 }
Note: See TracChangeset
for help on using the changeset viewer.