添加撤销,导航Call命令,节点类型根据子节点数量变化,标签和记录名去重等功能

This commit is contained in:
2025-04-14 20:19:36 +08:00
parent 9da8e6fecd
commit e82bfaaf20
38 changed files with 1484 additions and 1242 deletions

View File

@@ -35,12 +35,15 @@ Namespace UTSModule.Station
Me.TsBtnLoad = New System.Windows.Forms.ToolStripButton()
Me.TsBtnSaveAs = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
Me.tsBtnInsertRow = New System.Windows.Forms.ToolStripButton()
Me.tsBtnRemoveRow = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator13 = New System.Windows.Forms.ToolStripSeparator()
Me.TsBtnBackward = New System.Windows.Forms.ToolStripButton()
Me.TsBtnForward = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator14 = New System.Windows.Forms.ToolStripSeparator()
Me.TsBtnBackward = New System.Windows.Forms.ToolStripButton()
Me.TsBtnForward = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
Me.TsBtnUndo = New System.Windows.Forms.ToolStripButton()
Me.TsBtnRedo = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator13 = New System.Windows.Forms.ToolStripSeparator()
Me.tsBtnInsertRow = New System.Windows.Forms.ToolStripButton()
Me.tsBtnRemoveRow = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator14 = New System.Windows.Forms.ToolStripSeparator()
Me.TsBtnMoveUp = New System.Windows.Forms.ToolStripButton()
Me.TsBtnMoveDown = New System.Windows.Forms.ToolStripButton()
Me.TsBtnMoveLeft = New System.Windows.Forms.ToolStripButton()
@@ -76,8 +79,8 @@ Namespace UTSModule.Station
Me.ToolStripSeparator11 = New System.Windows.Forms.ToolStripSeparator()
Me.TsmiDebugStart = New System.Windows.Forms.ToolStripMenuItem()
Me.TsmiDebugEnd = New System.Windows.Forms.ToolStripMenuItem()
Me.TsmiDebugStep = New System.Windows.Forms.ToolStripMenuItem()
Me.TsmiDebugContinue = New System.Windows.Forms.ToolStripMenuItem()
Me.TsmiDebugStep = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator8 = New System.Windows.Forms.ToolStripSeparator()
Me.TsmiDebugSetup = New System.Windows.Forms.ToolStripMenuItem()
Me.TsmiDebugMain = New System.Windows.Forms.ToolStripMenuItem()
@@ -95,6 +98,7 @@ Namespace UTSModule.Station
Me.TabControl1 = New System.Windows.Forms.TabControl()
Me.TpOutputInfo = New System.Windows.Forms.TabPage()
Me.RtxOutputInfo = New System.Windows.Forms.RichTextBox()
Me.TsmiJumpCall = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStrip1.SuspendLayout()
Me.StuMain.SuspendLayout()
CType(Me.SplStationPlan, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -119,7 +123,7 @@ Namespace UTSModule.Station
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsBtnOpen, Me.TsBtnSave, Me.ToolStripSeparator4, Me.TsBtnLoad, Me.TsBtnSaveAs, Me.ToolStripSeparator3, Me.TsBtnBackward, Me.TsBtnForward, Me.ToolStripSeparator13, Me.tsBtnInsertRow, Me.tsBtnRemoveRow, Me.ToolStripSeparator14, Me.TsBtnMoveUp, Me.TsBtnMoveDown, Me.TsBtnMoveLeft, Me.TsBtnMoveRight, Me.ToolStripSeparator2, Me.TsBtnDebugMode, Me.TsBtnDebugStart, Me.TsBtnFailMode, Me.ToolStripSeparator10, Me.tslBtn_ActionOnly, Me.TsBtn_Record, Me.TsBtn_ExpandNode})
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TsBtnOpen, Me.TsBtnSave, Me.ToolStripSeparator4, Me.TsBtnLoad, Me.TsBtnSaveAs, Me.ToolStripSeparator3, Me.TsBtnBackward, Me.TsBtnForward, Me.ToolStripSeparator1, Me.TsBtnUndo, Me.TsBtnRedo, Me.ToolStripSeparator13, Me.tsBtnInsertRow, Me.tsBtnRemoveRow, Me.ToolStripSeparator14, Me.TsBtnMoveUp, Me.TsBtnMoveDown, Me.TsBtnMoveLeft, Me.TsBtnMoveRight, Me.ToolStripSeparator2, Me.TsBtnDebugMode, Me.TsBtnDebugStart, Me.TsBtnFailMode, Me.ToolStripSeparator10, Me.tslBtn_ActionOnly, Me.TsBtn_Record, Me.TsBtn_ExpandNode})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(977, 40)
@@ -176,6 +180,58 @@ Namespace UTSModule.Station
Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
Me.ToolStripSeparator3.Size = New System.Drawing.Size(6, 40)
'
'TsBtnBackward
'
Me.TsBtnBackward.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TsBtnBackward.Image = CType(resources.GetObject("TsBtnBackward.Image"), System.Drawing.Image)
Me.TsBtnBackward.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TsBtnBackward.Name = "TsBtnBackward"
Me.TsBtnBackward.Size = New System.Drawing.Size(47, 37)
Me.TsBtnBackward.Text = "上一步"
Me.TsBtnBackward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'
'TsBtnForward
'
Me.TsBtnForward.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TsBtnForward.Image = CType(resources.GetObject("TsBtnForward.Image"), System.Drawing.Image)
Me.TsBtnForward.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TsBtnForward.Name = "TsBtnForward"
Me.TsBtnForward.Size = New System.Drawing.Size(47, 37)
Me.TsBtnForward.Text = "下一步"
Me.TsBtnForward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
Me.TsBtnForward.ToolTipText = "下一步"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 40)
'
'TsBtnUndo
'
Me.TsBtnUndo.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TsBtnUndo.Image = CType(resources.GetObject("TsBtnUndo.Image"), System.Drawing.Image)
Me.TsBtnUndo.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TsBtnUndo.Name = "TsBtnUndo"
Me.TsBtnUndo.Size = New System.Drawing.Size(35, 37)
Me.TsBtnUndo.Text = "撤销"
Me.TsBtnUndo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'
'TsBtnRedo
'
Me.TsBtnRedo.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TsBtnRedo.Image = CType(resources.GetObject("TsBtnRedo.Image"), System.Drawing.Image)
Me.TsBtnRedo.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TsBtnRedo.Name = "TsBtnRedo"
Me.TsBtnRedo.Size = New System.Drawing.Size(35, 37)
Me.TsBtnRedo.Text = "重做"
Me.TsBtnRedo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
Me.TsBtnRedo.ToolTipText = "撤销"
'
'ToolStripSeparator13
'
Me.ToolStripSeparator13.Name = "ToolStripSeparator13"
Me.ToolStripSeparator13.Size = New System.Drawing.Size(6, 40)
'
'tsBtnInsertRow
'
Me.tsBtnInsertRow.Image = CType(resources.GetObject("tsBtnInsertRow.Image"), System.Drawing.Image)
@@ -194,32 +250,6 @@ Namespace UTSModule.Station
Me.tsBtnRemoveRow.Text = "移除行"
Me.tsBtnRemoveRow.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'
'ToolStripSeparator13
'
Me.ToolStripSeparator13.Name = "ToolStripSeparator13"
Me.ToolStripSeparator13.Size = New System.Drawing.Size(6, 40)
'
'TsBtnBackward
'
Me.TsBtnBackward.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TsBtnBackward.Image = CType(resources.GetObject("TsBtnBackward.Image"), System.Drawing.Image)
Me.TsBtnBackward.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TsBtnBackward.Name = "TsBtnBackward"
Me.TsBtnBackward.Size = New System.Drawing.Size(59, 37)
Me.TsBtnBackward.Text = "向后导航"
Me.TsBtnBackward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'
'TsBtnForward
'
Me.TsBtnForward.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TsBtnForward.Image = CType(resources.GetObject("TsBtnForward.Image"), System.Drawing.Image)
Me.TsBtnForward.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TsBtnForward.Name = "TsBtnForward"
Me.TsBtnForward.Size = New System.Drawing.Size(59, 37)
Me.TsBtnForward.Text = "向前导航"
Me.TsBtnForward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
Me.TsBtnForward.ToolTipText = "向前导航"
'
'ToolStripSeparator14
'
Me.ToolStripSeparator14.Name = "ToolStripSeparator14"
@@ -421,9 +451,9 @@ Namespace UTSModule.Station
'
'CmsPlanGrid
'
Me.CmsPlanGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MsiGridRowBlockInsert, Me.MsiGridRowBlockDelete, Me.ToolStripSeparator7, Me.tsBtn_CheckAction, Me.tsBtn_UncheckAction, Me.ToolStripSeparator15, Me.MsiUndo, Me.MsiRedo, Me.ToolStripSeparator6, Me.MsiSaveNodeFile, Me.MsiLoadNodeFile, Me.ToolStripSeparator11, Me.TsmiDebugStart, Me.TsmiDebugEnd, Me.TsmiDebugContinue, Me.TsmiDebugStep, Me.ToolStripSeparator8, Me.TsmiDebugSetup, Me.TsmiDebugMain, Me.TsmiDebugPass, Me.TsmiDebugFail, Me.TsmiDebugCleanup, Me.ToolStripSeparator9, Me.TsmiDebugNode, Me.TsmiDebugNodeBegin})
Me.CmsPlanGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MsiGridRowBlockInsert, Me.MsiGridRowBlockDelete, Me.ToolStripSeparator7, Me.tsBtn_CheckAction, Me.tsBtn_UncheckAction, Me.ToolStripSeparator15, Me.MsiUndo, Me.MsiRedo, Me.ToolStripSeparator6, Me.MsiSaveNodeFile, Me.MsiLoadNodeFile, Me.ToolStripSeparator11, Me.TsmiDebugStart, Me.TsmiDebugEnd, Me.TsmiDebugContinue, Me.TsmiDebugStep, Me.ToolStripSeparator8, Me.TsmiDebugSetup, Me.TsmiDebugMain, Me.TsmiDebugPass, Me.TsmiDebugFail, Me.TsmiDebugCleanup, Me.ToolStripSeparator9, Me.TsmiDebugNode, Me.TsmiDebugNodeBegin, Me.TsmiJumpCall})
Me.CmsPlanGrid.Name = "CmsMain"
Me.CmsPlanGrid.Size = New System.Drawing.Size(222, 458)
Me.CmsPlanGrid.Size = New System.Drawing.Size(222, 502)
'
'MsiGridRowBlockInsert
'
@@ -431,7 +461,7 @@ Namespace UTSModule.Station
Me.MsiGridRowBlockInsert.Name = "MsiGridRowBlockInsert"
Me.MsiGridRowBlockInsert.ShortcutKeyDisplayString = "Ctr+I"
Me.MsiGridRowBlockInsert.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.I), System.Windows.Forms.Keys)
Me.MsiGridRowBlockInsert.Size = New System.Drawing.Size(192, 22)
Me.MsiGridRowBlockInsert.Size = New System.Drawing.Size(221, 22)
Me.MsiGridRowBlockInsert.Text = "插入"
'
'MsiGridRowBlockDelete
@@ -440,75 +470,75 @@ Namespace UTSModule.Station
Me.MsiGridRowBlockDelete.Name = "MsiGridRowBlockDelete"
Me.MsiGridRowBlockDelete.ShortcutKeyDisplayString = "Ctr+D"
Me.MsiGridRowBlockDelete.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.D), System.Windows.Forms.Keys)
Me.MsiGridRowBlockDelete.Size = New System.Drawing.Size(192, 22)
Me.MsiGridRowBlockDelete.Size = New System.Drawing.Size(221, 22)
Me.MsiGridRowBlockDelete.Text = "删除"
'
'ToolStripSeparator7
'
Me.ToolStripSeparator7.Name = "ToolStripSeparator7"
Me.ToolStripSeparator7.Size = New System.Drawing.Size(189, 6)
Me.ToolStripSeparator7.Size = New System.Drawing.Size(218, 6)
'
'tsBtn_CheckAction
'
Me.tsBtn_CheckAction.Image = CType(resources.GetObject("tsBtn_CheckAction.Image"), System.Drawing.Image)
Me.tsBtn_CheckAction.Name = "tsBtn_CheckAction"
Me.tsBtn_CheckAction.Size = New System.Drawing.Size(192, 22)
Me.tsBtn_CheckAction.Size = New System.Drawing.Size(221, 22)
Me.tsBtn_CheckAction.Text = "勾选测试"
'
'tsBtn_UncheckAction
'
Me.tsBtn_UncheckAction.Image = CType(resources.GetObject("tsBtn_UncheckAction.Image"), System.Drawing.Image)
Me.tsBtn_UncheckAction.Name = "tsBtn_UncheckAction"
Me.tsBtn_UncheckAction.Size = New System.Drawing.Size(192, 22)
Me.tsBtn_UncheckAction.Size = New System.Drawing.Size(221, 22)
Me.tsBtn_UncheckAction.Text = "取消勾选测试"
'
'ToolStripSeparator15
'
Me.ToolStripSeparator15.Name = "ToolStripSeparator15"
Me.ToolStripSeparator15.Size = New System.Drawing.Size(189, 6)
Me.ToolStripSeparator15.Size = New System.Drawing.Size(218, 6)
'
'MsiUndo
'
Me.MsiUndo.Enabled = False
Me.MsiUndo.Name = "MsiUndo"
Me.MsiUndo.Size = New System.Drawing.Size(192, 22)
Me.MsiUndo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Z), System.Windows.Forms.Keys)
Me.MsiUndo.Size = New System.Drawing.Size(221, 22)
Me.MsiUndo.Text = "撤销"
'
'MsiRedo
'
Me.MsiRedo.Enabled = False
Me.MsiRedo.Name = "MsiRedo"
Me.MsiRedo.Size = New System.Drawing.Size(192, 22)
Me.MsiRedo.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Y), System.Windows.Forms.Keys)
Me.MsiRedo.Size = New System.Drawing.Size(221, 22)
Me.MsiRedo.Text = "重做"
'
'ToolStripSeparator6
'
Me.ToolStripSeparator6.Name = "ToolStripSeparator6"
Me.ToolStripSeparator6.Size = New System.Drawing.Size(189, 6)
Me.ToolStripSeparator6.Size = New System.Drawing.Size(218, 6)
'
'MsiSaveNodeFile
'
Me.MsiSaveNodeFile.Name = "MsiSaveNodeFile"
Me.MsiSaveNodeFile.Size = New System.Drawing.Size(192, 22)
Me.MsiSaveNodeFile.Size = New System.Drawing.Size(221, 22)
Me.MsiSaveNodeFile.Text = "另存为节点文件"
'
'MsiLoadNodeFile
'
Me.MsiLoadNodeFile.Name = "MsiLoadNodeFile"
Me.MsiLoadNodeFile.Size = New System.Drawing.Size(192, 22)
Me.MsiLoadNodeFile.Size = New System.Drawing.Size(221, 22)
Me.MsiLoadNodeFile.Text = "加载节点文件"
'
'ToolStripSeparator11
'
Me.ToolStripSeparator11.Name = "ToolStripSeparator11"
Me.ToolStripSeparator11.Size = New System.Drawing.Size(189, 6)
Me.ToolStripSeparator11.Size = New System.Drawing.Size(218, 6)
'
'TsmiDebugStart
'
Me.TsmiDebugStart.Image = CType(resources.GetObject("TsmiDebugStart.Image"), System.Drawing.Image)
Me.TsmiDebugStart.Name = "TsmiDebugStart"
Me.TsmiDebugStart.ShortcutKeys = System.Windows.Forms.Keys.F5
Me.TsmiDebugStart.Size = New System.Drawing.Size(207, 22)
Me.TsmiDebugStart.Size = New System.Drawing.Size(221, 22)
Me.TsmiDebugStart.Text = "开始执行"
'
'TsmiDebugEnd
@@ -516,42 +546,42 @@ Namespace UTSModule.Station
Me.TsmiDebugEnd.Image = CType(resources.GetObject("TsmiDebugEnd.Image"), System.Drawing.Image)
Me.TsmiDebugEnd.Name = "TsmiDebugEnd"
Me.TsmiDebugEnd.ShortcutKeys = CType((System.Windows.Forms.Keys.Shift Or System.Windows.Forms.Keys.F5), System.Windows.Forms.Keys)
Me.TsmiDebugEnd.Size = New System.Drawing.Size(207, 22)
Me.TsmiDebugEnd.Size = New System.Drawing.Size(221, 22)
Me.TsmiDebugEnd.Text = "退出执行"
'
'TsmiDebugStep
'
Me.TsmiDebugStep.Image = CType(resources.GetObject("TsmiDebugStep.Image"), System.Drawing.Image)
Me.TsmiDebugStep.Name = "TsmiDebugStep"
Me.TsmiDebugStep.ShortcutKeys = System.Windows.Forms.Keys.F11
Me.TsmiDebugStep.Size = New System.Drawing.Size(207, 22)
Me.TsmiDebugStep.Text = "单步执行"
'
'TsmiDebugContinue
'
Me.TsmiDebugContinue.Image = CType(resources.GetObject("TsmiDebugContinue.Image"), System.Drawing.Image)
Me.TsmiDebugContinue.Name = "TsmiDebugContinue"
Me.TsmiDebugContinue.ShortcutKeys = CType((System.Windows.Forms.Keys.Alt Or System.Windows.Forms.Keys.F5), System.Windows.Forms.Keys)
Me.TsmiDebugContinue.Size = New System.Drawing.Size(207, 22)
Me.TsmiDebugContinue.Size = New System.Drawing.Size(221, 22)
Me.TsmiDebugContinue.Text = "继续执行"
'
'TsmiDebugStep
'
Me.TsmiDebugStep.Image = CType(resources.GetObject("TsmiDebugStep.Image"), System.Drawing.Image)
Me.TsmiDebugStep.Name = "TsmiDebugStep"
Me.TsmiDebugStep.ShortcutKeys = System.Windows.Forms.Keys.F11
Me.TsmiDebugStep.Size = New System.Drawing.Size(221, 22)
Me.TsmiDebugStep.Text = "单步执行"
'
'ToolStripSeparator8
'
Me.ToolStripSeparator8.Name = "ToolStripSeparator8"
Me.ToolStripSeparator8.Size = New System.Drawing.Size(189, 6)
Me.ToolStripSeparator8.Size = New System.Drawing.Size(218, 6)
'
'TsmiDebugSetup
'
Me.TsmiDebugSetup.Name = "TsmiDebugSetup"
Me.TsmiDebugSetup.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.F1), System.Windows.Forms.Keys)
Me.TsmiDebugSetup.Size = New System.Drawing.Size(207, 22)
Me.TsmiDebugSetup.Size = New System.Drawing.Size(221, 22)
Me.TsmiDebugSetup.Text = "Setup模块执行"
'
'TsmiDebugMain
'
Me.TsmiDebugMain.Name = "TsmiDebugMain"
Me.TsmiDebugMain.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.F2), System.Windows.Forms.Keys)
Me.TsmiDebugMain.Size = New System.Drawing.Size(207, 22)
Me.TsmiDebugMain.Size = New System.Drawing.Size(221, 22)
Me.TsmiDebugMain.Text = "Main模块执行"
'
'TsmiDebugPass
@@ -578,7 +608,7 @@ Namespace UTSModule.Station
'ToolStripSeparator9
'
Me.ToolStripSeparator9.Name = "ToolStripSeparator9"
Me.ToolStripSeparator9.Size = New System.Drawing.Size(189, 6)
Me.ToolStripSeparator9.Size = New System.Drawing.Size(218, 6)
'
'TsmiDebugNode
'
@@ -646,59 +676,67 @@ Namespace UTSModule.Station
Me.RtxColTip.Size = New System.Drawing.Size(296, 78)
Me.RtxColTip.TabIndex = 0
Me.RtxColTip.Text = ""
'
'GrpOutputInfo
'
Me.GrpOutputInfo.Controls.Add(Me.TabControl1)
Me.GrpOutputInfo.Dock = System.Windows.Forms.DockStyle.Fill
Me.GrpOutputInfo.Location = New System.Drawing.Point(0, 0)
Me.GrpOutputInfo.Name = "GrpOutputInfo"
Me.GrpOutputInfo.Size = New System.Drawing.Size(977, 166)
Me.GrpOutputInfo.TabIndex = 0
Me.GrpOutputInfo.TabStop = false
Me.GrpOutputInfo.Text = "输出内容"
'
'TabControl1
'
Me.TabControl1.Controls.Add(Me.TpOutputInfo)
Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TabControl1.Location = New System.Drawing.Point(3, 17)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size(971, 146)
Me.TabControl1.TabIndex = 1
'
'TpOutputInfo
'
Me.TpOutputInfo.Controls.Add(Me.RtxOutputInfo)
Me.TpOutputInfo.Location = New System.Drawing.Point(4, 22)
Me.TpOutputInfo.Name = "TpOutputInfo"
Me.TpOutputInfo.Padding = New System.Windows.Forms.Padding(3)
Me.TpOutputInfo.Size = New System.Drawing.Size(963, 120)
Me.TpOutputInfo.TabIndex = 0
Me.TpOutputInfo.Text = "输出信息"
Me.TpOutputInfo.UseVisualStyleBackColor = true
'
'RtxOutputInfo
'
Me.RtxOutputInfo.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RtxOutputInfo.Dock = System.Windows.Forms.DockStyle.Fill
Me.RtxOutputInfo.Location = New System.Drawing.Point(3, 3)
Me.RtxOutputInfo.Name = "RtxOutputInfo"
Me.RtxOutputInfo.Size = New System.Drawing.Size(957, 114)
Me.RtxOutputInfo.TabIndex = 0
Me.RtxOutputInfo.Text = ""
'
'FrmStationPlan
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 12!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(977, 580)
Me.Controls.Add(Me.SplStationPlan)
Me.Controls.Add(Me.StuMain)
Me.Controls.Add(Me.ToolStrip1)
Me.KeyPreview = true
Me.Name = "FrmStationPlan"
'
'GrpOutputInfo
'
Me.GrpOutputInfo.Controls.Add(Me.TabControl1)
Me.GrpOutputInfo.Dock = System.Windows.Forms.DockStyle.Fill
Me.GrpOutputInfo.Location = New System.Drawing.Point(0, 0)
Me.GrpOutputInfo.Name = "GrpOutputInfo"
Me.GrpOutputInfo.Size = New System.Drawing.Size(977, 166)
Me.GrpOutputInfo.TabIndex = 0
Me.GrpOutputInfo.TabStop = False
Me.GrpOutputInfo.Text = "输出内容"
'
'TabControl1
'
Me.TabControl1.Controls.Add(Me.TpOutputInfo)
Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TabControl1.Location = New System.Drawing.Point(3, 17)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size(971, 146)
Me.TabControl1.TabIndex = 1
'
'TpOutputInfo
'
Me.TpOutputInfo.Controls.Add(Me.RtxOutputInfo)
Me.TpOutputInfo.Location = New System.Drawing.Point(4, 22)
Me.TpOutputInfo.Name = "TpOutputInfo"
Me.TpOutputInfo.Padding = New System.Windows.Forms.Padding(3)
Me.TpOutputInfo.Size = New System.Drawing.Size(963, 120)
Me.TpOutputInfo.TabIndex = 0
Me.TpOutputInfo.Text = "输出信息"
Me.TpOutputInfo.UseVisualStyleBackColor = True
'
'RtxOutputInfo
'
Me.RtxOutputInfo.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RtxOutputInfo.Dock = System.Windows.Forms.DockStyle.Fill
Me.RtxOutputInfo.Location = New System.Drawing.Point(3, 3)
Me.RtxOutputInfo.Name = "RtxOutputInfo"
Me.RtxOutputInfo.Size = New System.Drawing.Size(957, 114)
Me.RtxOutputInfo.TabIndex = 0
Me.RtxOutputInfo.Text = ""
'
'TsmiJumpCall
'
Me.TsmiJumpCall.Name = "TsmiJumpCall"
Me.TsmiJumpCall.ShortcutKeys = System.Windows.Forms.Keys.F12
Me.TsmiJumpCall.Size = New System.Drawing.Size(221, 22)
Me.TsmiJumpCall.Text = "函数跳转"
Me.TsmiJumpCall.Visible = False
'
'FrmStationPlan
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(977, 580)
Me.Controls.Add(Me.SplStationPlan)
Me.Controls.Add(Me.StuMain)
Me.Controls.Add(Me.ToolStrip1)
Me.KeyPreview = True
Me.Name = "FrmStationPlan"
Me.Text = "Form1"
Me.ToolStrip1.ResumeLayout(false)
Me.ToolStrip1.PerformLayout
@@ -794,5 +832,9 @@ End Sub
Friend WithEvents tsBtn_CheckAction As ToolStripMenuItem
Friend WithEvents tsBtn_UncheckAction As ToolStripMenuItem
Friend WithEvents ToolStripSeparator15 As ToolStripSeparator
Friend WithEvents ToolStripSeparator1 As ToolStripSeparator
Friend WithEvents TsBtnUndo As ToolStripButton
Friend WithEvents TsBtnRedo As ToolStripButton
Friend WithEvents TsmiJumpCall As ToolStripMenuItem
End Class
End Namespace

View File

@@ -170,26 +170,6 @@
UQwy2qIWr4A5OaxVi0fATrsJPfFVQR7m/pGA42eBmARc8yrgpMxj38aewhjuEbNg/LgMLUEfVe01jGmu
4CpO4hz7JfYUxrgFGzER09jXsacwxi34/WdggZgE7MwCMQk8aYbA8tHPYe5Hgfe35R2spYRwB61XwcSY
NxMjAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsBtnInsertRow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADTSURBVDhPvVKrDoNAEOSX+gt1tfxBg6psUNjmFJKcQjY5
gyQ5gyXBVDbBVFYgKitWVEzZ43qpoDwC6SSjZmc2uxlvMXRRQ+UVVNZRnjVEomHlceAL9OooEjUzwBrp
CTQtw0hOD/hsZaPhA/APYnrAZhegj1ZeDzLVYPJ/RCwRHIWhlX/CDbCZz6vvQHUD9IWgChoMYNGRNxvj
FVAlQWSEIBkOYLiB8CSNUeaEMCX4MWEbNaMBDnxv77N1WUMXbQttG7smzi2SxWpNDBY3cf+3JnreG12r
GpgvtOAmAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsBtnRemoveRow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADdSURBVDhPY6AK2Hbwwv+1O0/9X7zh0P+Zy3b9nzBv8//e
2ev/Q6UJg3W7Tv8HgS/f//1//PbP/0uPfv039Uwm3oD5a/ajaD5+6+d/p7B84g2YMG8j2EYQBmmcsXA1
HE+es/x/19SF/5t6ZqEYyMLEgtsCkMbDN/7833bu5/+lB7/9n7T5E9hwkCZ0DNWCCkA2rjvx43/7sgf/
S2fe/Z/ScwcjTFA0o8dCZesUsFdg3oJhqHJMgC0WIrKbcGtAB9hiAa+N6ABkALpzSTKAJgmJJAOQExIy
hkoPasDAAACBjwD6rwhXUgAAAABJRU5ErkJggg==
</value>
</data>
<data name="TsBtnBackward.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -213,6 +193,49 @@
MMZLXiK1d5zSLwohxBwZ+9IGEBc6sd6JjYXBNO8XOOfG9Kx3xF4GJIOF3hP7M6BGM6CXrgCi0aUzYIiW
MOcgUa2BJcy3bb1DWg34RkafGwF2A+hlg/vnJThAGkAI0WDRU9HAV/6tHp9FdAB/QLi4qrG0hAAAAABJ
RU5ErkJggg==
</value>
</data>
<data name="TsBtnUndo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHJSURBVDhPvZHdK4NhGMb3pzAt4dgfIPmMosgBB8pHjnbA
kSMhijSa2pgJ89U23jEJExpmvhq2+ZoMxVZD78vYxjsue5+NMTVK+dV18jxdv7v7eXh/Rrt8BC7UkpVE
OWvCoHYdoeuf4cqRKCaNqGwY/p1Es2gN1YL4X14hGZmHzmBFcXX7zxLl3A4p6mwAtQuY7Qw6FTOgVhmo
l2mo9DT652iIJ25JQrUwg1ojEXA8PfvB3PvgcLmJIJKm0WskVxi+SuRqPbnsMzxDNMugnrpCzYAdIws3
5Pwz1TIXtBsMkoomwxJpYF9u70cPi2vag3PHHQ7sN5BPO0mplfKTmE/uUCpyIrFoCgkFY4jPGwpKuH29
PvZjslBuQ5V0Hx2qcyJ4h3lgcXLphcFyDxm1DUFub1jAuH04PHNh59gBo/kCS1unaOgLfm/dqBtCqRMl
bTbkN+6RyKhNCLK7woLkrLJvqRHvEQEbWM9Fs7DYH7FoYqBZuUX3mBFxGeKvjxlJedMGEXye/J4u9Rr4
aaLogsJaPTxPL5BPmNCj2YZsfJNM5spS5SpiU1uiCzKEusBrq0ji8xQQ5PQgLlMCfnp7oNyKmJTm6IJ/
gsd7A8Wc0VfbPf1MAAAAAElFTkSuQmCC
</value>
</data>
<data name="TsBtnRedo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACMSURBVDhPtZDRDYAgDET7wazu5AIOY/x2BX/dAHO2KNQW
MMZLXiK1d5zSLwohxBwZ+9IGEBc6sd6JjYXBNO8XOOfG9Kx3xF4GJIOF3hP7M6BGM6CXrgCi0aUzYIiW
MOcgUa2BJcy3bb1DWg34RkafGwF2A+hlg/vnJThAGkAI0WDRU9HAV/6tHp9FdAB/QLi4qrG0hAAAAABJ
RU5ErkJggg==
</value>
</data>
<data name="tsBtnInsertRow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADTSURBVDhPvVKrDoNAEOSX+gt1tfxBg6psUNjmFJKcQjY5
gyQ5gyXBVDbBVFYgKitWVEzZ43qpoDwC6SSjZmc2uxlvMXRRQ+UVVNZRnjVEomHlceAL9OooEjUzwBrp
CTQtw0hOD/hsZaPhA/APYnrAZhegj1ZeDzLVYPJ/RCwRHIWhlX/CDbCZz6vvQHUD9IWgChoMYNGRNxvj
FVAlQWSEIBkOYLiB8CSNUeaEMCX4MWEbNaMBDnxv77N1WUMXbQttG7smzi2SxWpNDBY3cf+3JnreG12r
GpgvtOAmAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsBtnRemoveRow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADdSURBVDhPY6AK2Hbwwv+1O0/9X7zh0P+Zy3b9nzBv8//e
2ev/Q6UJg3W7Tv8HgS/f//1//PbP/0uPfv039Uwm3oD5a/ajaD5+6+d/p7B84g2YMG8j2EYQBmmcsXA1
HE+es/x/19SF/5t6ZqEYyMLEgtsCkMbDN/7833bu5/+lB7/9n7T5E9hwkCZ0DNWCCkA2rjvx43/7sgf/
S2fe/Z/ScwcjTFA0o8dCZesUsFdg3oJhqHJMgC0WIrKbcGtAB9hiAa+N6ABkALpzSTKAJgmJJAOQExIy
hkoPasDAAACBjwD6rwhXUgAAAABJRU5ErkJggg==
</value>
</data>
<data name="TsBtnMoveUp.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@@ -60,7 +60,7 @@ Namespace UTSModule.Station
If StationPlan IsNot Nothing Then
_planGrid.HeadNode = StationPlan.HeadNode
_planGrid.UpdateGrid()
_planGrid.GridUpdateEventTrigger(GrdStationPlan) '笨方法,开始就触发一次刷新
StationEditStatusMonitor.StationEditStatus = StationEditStatusMonitor.StationEditStatusEnum.None
_tester.ProcessStation = _utsApp.ProcessStation
@@ -94,6 +94,9 @@ Namespace UTSModule.Station
.RtxColTip = RtxColTip}
AddHandler _planGrid.PlanNodeSelectChanged, AddressOf PlanGridSelectChanged
AddHandler _planGrid.PlanGridCommandChanged, AddressOf PlanGridCommandChanged
'todo:检测撤销队列的变化
AddHandler _planGrid.PlanNodeSelectChanged, AddressOf _nodeGrid.Grid_PlanNodeSelectChanged
AddHandler _planGrid.RowNodeTextChanged, AddressOf _nodeGrid.Grid_RowNodeTextChanged
@@ -117,6 +120,15 @@ Namespace UTSModule.Station
TsBtnForward.Enabled = _planGrid.CanForward
End Sub
Public Sub PlanGridCommandChanged(sender As Object, e As EventArgs)
TsBtnUndo.Enabled = _planGrid.CanUndo
TsBtnRedo.Enabled = _planGrid.CanRedo
MsiUndo.Enabled = _planGrid.CanUndo
MsiRedo.Enabled = _planGrid.CanRedo
End Sub
Private Function InitializeUtsApp() As Boolean
_utsApp = UtsAppForm.CreateSingleton()
_utsApp.AddStatisticsObserver(Me)
@@ -206,7 +218,7 @@ Namespace UTSModule.Station
Try
StationPlan.LoadFile(revStationPlanPath)
_planGrid.UpdateGrid()
_planGrid.GridUpdateEventTrigger(GrdStationPlan) '笨方法,开始就触发一次刷新
' _planGrid.GridUpdateEventTrigger(GrdStationPlan) '笨方法,开始就触发一次刷新
StationEditStatusMonitor.StationEditStatus = StationEditStatusMonitor.StationEditStatusEnum.None
If StationEditStatusMonitor.StationEditStatus <> StationEditStatusMonitor.StationEditStatusEnum.Saved Then
@@ -226,7 +238,7 @@ Namespace UTSModule.Station
Try
StationPlan.LoadFile(revStationPlanPath)
_planGrid.UpdateGrid()
_planGrid.GridUpdateEventTrigger(GrdStationPlan) '笨方法,开始就触发一次刷新
StationEditStatusMonitor.StationEditStatus = StationEditStatusMonitor.StationEditStatusEnum.None
If StationEditStatusMonitor.StationEditStatus <> StationEditStatusMonitor.StationEditStatusEnum.Saved Then
@@ -300,8 +312,10 @@ Namespace UTSModule.Station
End Using
_planGrid.ClearNavigation()
TsBtnBackward.Enabled = _planGrid.CanBackward
TsBtnForward.Enabled = _planGrid.CanForward
_planGrid.ClearCommand()
PlanGridSelectChanged(Nothing, Nothing)
PlanGridCommandChanged(Nothing, Nothing)
End Sub
Private Sub TsBtnLoad_Click(sender As Object, e As EventArgs) Handles TsBtnLoad.Click
@@ -309,8 +323,10 @@ Namespace UTSModule.Station
ApplicationLog.WriteInfoLog($"编辑页面执行流程重载中。")
LoadTreeViewFormXml()
_planGrid.ClearNavigation()
TsBtnBackward.Enabled = _planGrid.CanBackward
TsBtnForward.Enabled = _planGrid.CanForward
_planGrid.ClearCommand()
PlanGridSelectChanged(Nothing, Nothing)
PlanGridCommandChanged(Nothing, Nothing)
ApplicationLog.WriteInfoLog($"编辑页面执行流程重载完成。")
End If
End Sub
@@ -802,6 +818,18 @@ Namespace UTSModule.Station
_planGrid.Check_Uncheck_Action(GrdStationPlan, tmpFrisRow, tmpLastRow, False)
End Sub
Private Sub MsiUndo_Click(sender As Object, e As EventArgs) Handles MsiUndo.Click, TsBtnUndo.Click
_planGrid.UndoCommand()
End Sub
Private Sub MsiRedo_Click(sender As Object, e As EventArgs) Handles MsiRedo.Click, TsBtnRedo.Click
_planGrid.RedoCommand()
End Sub
Private Sub TsmiJumpCall_Click(sender As Object, e As EventArgs) Handles TsmiJumpCall.Click
_planGrid.JumpCall()
End Sub
#End Region

View File

@@ -0,0 +1,94 @@
Public Module CommandManager
Private Property UndoCommands As New Stack(Of ICommand)
Private Property RedoCommands As New Stack(Of ICommand)
Private _isRunning As Boolean = False
''' <summary>
''' 运行命令,并将命令添加至撤销堆栈
''' </summary>
''' <param name="command"></param>
Public Sub RunCommand(command As ICommand)
command.Redo()
AddUndoCommand(command)
End Sub
Public ReadOnly Property IsRuning() As Boolean
Get
Return _isRunning
End Get
End Property
Public Function CanUndo() As Boolean
Return UndoCommands.Count > 0
End Function
Public Function CanRedo() As Boolean
Return RedoCommands.Count > 0
End Function
''' <summary>
''' 将命令添加至撤销堆栈
''' </summary>
Public Sub AddUndoCommand(command As ICommand)
UndoCommands.Push(command)
If RedoCommands.Count > 0 Then
ClearRedoCommands()
End If
End Sub
''' <summary>
''' 清空撤销命令堆栈
''' </summary>
Public Sub ClearUndoCommands()
UndoCommands.Clear()
End Sub
''' <summary>
''' 清空重做命令堆栈
''' </summary>
Public Sub ClearRedoCommands()
RedoCommands.Clear()
End Sub
''' <summary>
''' 清空撤销与重做命令堆栈
''' </summary>
Public Sub ClearCommands()
ClearUndoCommands()
ClearRedoCommands()
End Sub
''' <summary>
''' 执行撤销命令
''' </summary>
Public Sub Undo()
If UndoCommands.Count <= 0 Then Return
_isRunning = True
Dim command As ICommand = UndoCommands.Pop()
command.Undo()
RedoCommands.Push(command)
_isRunning = False
End Sub
''' <summary>
''' 执行重做命令
''' </summary>
Public Sub Redo()
If RedoCommands.Count <= 0 Then Return
_isRunning = True
Dim command As ICommand = RedoCommands.Pop()
command.Redo()
UndoCommands.Push(command)
_isRunning = False
End Sub
End Module

View File

@@ -0,0 +1,22 @@
Imports UTS_Core.UTSModule.Station
Public Class GridNodeAddCommand : Implements ICommand
Private ReadOnly grd As StationPlanGrid
Private ReadOnly startMoveRow As Integer
Private ReadOnly moveRows As Integer
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer)
Me.grd = grd
Me.startMoveRow = startMoveRow
Me.moveRows = moveRows
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.NodeAddCommand(startMoveRow, moveRows)
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.NodeDeleteCommand(startMoveRow, moveRows)
End Sub
End Class

View File

@@ -0,0 +1,12 @@
Public Class GridNodeCopyPasteCommand : Implements ICommand
Public Sub New()
End Sub
Public Sub Redo() Implements ICommand.Redo
Throw New NotImplementedException()
End Sub
Public Sub Undo() Implements ICommand.Undo
Throw New NotImplementedException()
End Sub
End Class

View File

@@ -0,0 +1,10 @@
Public Class GridNodeCutPasteCommand : Implements ICommand
Public Sub Redo() Implements ICommand.Redo
Throw New NotImplementedException()
End Sub
Public Sub Undo() Implements ICommand.Undo
Throw New NotImplementedException()
End Sub
End Class

View File

@@ -0,0 +1,23 @@
Imports UTS_Core.UTSModule.Station
Public Class GridNodeDeleteCommand : Implements ICommand
Private ReadOnly grd As StationPlanGrid
Private ReadOnly startMoveRow As Integer
Private ReadOnly moveRows As Integer
Private ReadOnly nodes As List(Of RowNode)
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer, nodes As List(Of RowNode))
Me.grd = grd
Me.startMoveRow = startMoveRow
Me.moveRows = moveRows
Me.nodes = nodes
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.NodeDeleteCommand(startMoveRow, moveRows)
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.NodeAddCommand(startMoveRow, moveRows, nodes)
End Sub
End Class

View File

@@ -0,0 +1,23 @@
Imports UTS_Core.UTSModule.Station
Public Class GridNodeMoveDownCommand : Implements ICommand
Private ReadOnly grd As StationPlanGrid
Private ReadOnly startMoveRow As Integer
Private ReadOnly moveRows As Integer
Private ReadOnly moveEndRow As Integer
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer, moveEndRow As Integer)
Me.grd = grd
Me.startMoveRow = startMoveRow
Me.moveRows = moveRows
Me.moveEndRow = moveEndRow
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.NodeMoveDownCommand(startMoveRow, moveRows)
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.NodeMoveUpCommand(moveEndRow, moveRows)
End Sub
End Class

View File

@@ -0,0 +1,25 @@
Imports UTS_Core.UTSModule.Station
Public Class GridNodeMoveLeftCommand : Implements ICommand
Private ReadOnly grd As StationPlanGrid
Private ReadOnly startMoveRow As Integer
Private ReadOnly moveRows As Integer
Private ReadOnly moveEndRow As Integer
Private ReadOnly moveRightNodeIndex As Integer
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer, moveEndRow As Integer, moveRightNodeIndex As Integer)
Me.grd = grd
Me.startMoveRow = startMoveRow
Me.moveRows = moveRows
Me.moveEndRow = moveEndRow
Me.moveRightNodeIndex = moveRightNodeIndex
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.NodeMoveLeftCommand(startMoveRow, moveRows)
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.NodeMoveRightCommand(moveEndRow, moveRows, moveRightNodeIndex)
End Sub
End Class

View File

@@ -0,0 +1,25 @@
Imports UTS_Core.UTSModule.Station
Public Class GridNodeMoveRightCommand : Implements ICommand
Private ReadOnly grd As StationPlanGrid
Private ReadOnly startMoveRow As Integer
Private ReadOnly moveRows As Integer
Private ReadOnly moveEndRow As Integer
Private ReadOnly moveRightNodeIndex As Integer
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer, moveEndRow As Integer, moveRightNodeIndex As Integer)
Me.grd = grd
Me.startMoveRow = startMoveRow
Me.moveRows = moveRows
Me.moveEndRow = moveEndRow
Me.moveRightNodeIndex = moveRightNodeIndex
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.NodeMoveRightCommand(startMoveRow, moveRows, moveRightNodeIndex)
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.NodeMoveLeftCommand(moveEndRow, moveRows)
End Sub
End Class

View File

@@ -1,28 +1,25 @@
Imports UTS_Core.Undo
Imports UTS_Core.UTSModule.Station
Imports UTS_Core.UTSModule.Station
Public Class GridNodeMoveUpCommand : Implements ICommand
Private ReadOnly grd As StationPlanGrid
Private ReadOnly startMoveRow As Integer
Private ReadOnly moveRows As Integer
Private ReadOnly moveEndRow As Integer
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer)
Sub New(grd As StationPlanGrid, startMoveRow As Integer, moveRows As Integer, moveEndRow As Integer)
Me.grd = grd
Me.startMoveRow = startMoveRow
Me.moveRows = moveRows
End Sub
Public Sub Execute() Implements ICommand.Execute
grd.NodeMoveUp(startMoveRow, moveRows)
Me.moveEndRow = moveEndRow
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.NodeMoveUp(startMoveRow, moveRows)
grd.NodeMoveUpCommand(startMoveRow, moveRows)
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.NodeMoveDown(startMoveRow, moveRows)
grd.NodeMoveDownCommand(moveEndRow, moveRows)
End Sub
End Class

View File

@@ -0,0 +1,24 @@
Public Class GridNodeTextChangedCommand : Implements ICommand
Private ReadOnly grd As FlexCell.Grid
Private ReadOnly row As Integer
Private ReadOnly col As Integer
Private ReadOnly beforeText As String
Private ReadOnly afterText As String
Sub New(grd As FlexCell.Grid, row As Integer, col As Integer, beforeText As String, afterText As String)
Me.grd = grd
Me.row = row
Me.col = col
Me.beforeText = beforeText
Me.afterText = afterText
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.Cell(row, col).Text = afterText
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.Cell(row, col).Text = beforeText
End Sub
End Class

View File

@@ -0,0 +1,11 @@
Public Interface ICommand
''' <summary>
''' 重做命令
''' </summary>
Sub Redo()
''' <summary>
''' 撤销命令
''' </summary>
Sub Undo()
End Interface

View File

@@ -1,136 +0,0 @@
Imports UTS_Core.Undo
Namespace UTSModule.Station
Public Class RowNodeCommand
Implements ICommand
Private ReadOnly _row As Integer
Private ReadOnly _rowNode As RowNode
Sub New(rowNode As RowNode, row As Integer, redoString As String)
_row = row
_rowNode = rowNode
End Sub
Public Sub Redo() Implements ICommand.Redo
End Sub
Public Sub Undo() Implements ICommand.Undo
End Sub
Public Sub Execute() Implements ICommand.Execute
Redo()
End Sub
End Class
Public Class RowNodeCommand2
Implements ICommand
Enum ChangeType
Add
Remove
Insert
RemoveChildAt
RemoveChildNode
MoveUp
MoveDown
MoveLeft
MoveRight
TextChanged
End Enum
Private _parentNode As RowNode
Private _rowNode As RowNode
Private _index As Integer '增加节点的位置
Private _type As ChangeType '当前操作的类型
Sub New(parentNode As RowNode, rowNode As RowNode, type As ChangeType, Optional index As Integer = 0)
_parentNode = parentNode
_rowNode = rowNode
_index = index
_type = type
End Sub
Public Sub Execute() Implements ICommand.Execute
Redo()
End Sub
Public Sub Redo() Implements ICommand.Redo
Select Case _type
Case ChangeType.Add
_parentNode.AddNode(_rowNode)
_index = _rowNode.RowIndex
Case ChangeType.Insert
_parentNode.InsertNode(_index, _rowNode)
Case ChangeType.Remove
_index = _rowNode.RowIndex
_parentNode.RemoveChildNode(_rowNode)
Case ChangeType.RemoveChildAt
_index = _rowNode.RowIndex
_parentNode.RemoveChildAt(_index)
Case ChangeType.RemoveChildNode
_index = _rowNode.RowIndex
_parentNode.RemoveChildNode(_rowNode)
Case ChangeType.MoveUp
_rowNode.MoveUp()
Case ChangeType.MoveDown
_rowNode.MoveDown()
Case ChangeType.MoveLeft
_rowNode.MoveLeft()
Case ChangeType.MoveRight
_rowNode.MoveRight()
Case ChangeType.TextChanged
End Select
End Sub
Public Sub Undo() Implements ICommand.Undo
Select Case _type
Case ChangeType.Add
_parentNode.RemoveChildNode(_rowNode)
Case ChangeType.Insert
_parentNode.RemoveChildAt(_index)
Case ChangeType.Remove
_parentNode.InsertNode(_index, _rowNode)
Case ChangeType.RemoveChildAt
_parentNode.InsertNode(_index, _rowNode)
Case ChangeType.RemoveChildNode
_parentNode.InsertNode(_index, _rowNode)
Case ChangeType.MoveUp
_rowNode.MoveDown()
Case ChangeType.MoveDown
_rowNode.MoveUp()
Case ChangeType.MoveLeft
_rowNode.MoveRight()
Case ChangeType.MoveRight
_rowNode.MoveLeft()
Case ChangeType.TextChanged
End Select
End Sub
End Class
End Namespace

View File

@@ -38,6 +38,7 @@ Namespace UTSModule.Station
Public Event RowNodeTextChanged(ByVal sender As Object, ByVal e As RowNodeChangedEventArgs) '自定义事件
Public Sub New()
_errCodeManager = ErrCodeManager.CreateManager()
_testCmdManager = TestCmdManager.CreateManager()

File diff suppressed because it is too large Load Diff