批量粘贴与批量撤销功能上线
This commit is contained in:
78
.gitignore
vendored
78
.gitignore
vendored
@@ -1,41 +1,47 @@
|
||||
#
|
||||
#ignore thumbnails created by windows
|
||||
Thumbs.db
|
||||
#Ignore files build by Visual Studio
|
||||
*.obj
|
||||
*.exe
|
||||
*.pdb
|
||||
*.user
|
||||
*.aps
|
||||
*.pch
|
||||
*.vspscc
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ncb
|
||||
*.suo
|
||||
*.tlb
|
||||
*.tlh
|
||||
*.bak
|
||||
*.cache
|
||||
*.ilk
|
||||
*.log
|
||||
[Bb]in/
|
||||
[Dd]ebug*/
|
||||
*.sbr
|
||||
obj/
|
||||
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
[Tt]est[Rr]esult*
|
||||
packages
|
||||
|
||||
|
||||
log.txt
|
||||
/.vs
|
||||
.vs/
|
||||
|
||||
node_modules/
|
||||
# .NET编译生成文件
|
||||
[Bb]in
|
||||
[Oo]bj
|
||||
[Dd]ebug*/
|
||||
*.pdb
|
||||
*.user
|
||||
*.suo
|
||||
*.cache
|
||||
*.ilk
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.vsp
|
||||
*.vspscc
|
||||
|
||||
# 发布输出
|
||||
publish/
|
||||
*.pubxml
|
||||
|
||||
# NuGet包
|
||||
packages/
|
||||
*.nupkg
|
||||
|
||||
# Visual Studio临时文件
|
||||
_ReSharper.*
|
||||
*.resharper
|
||||
[Tt]emp/
|
||||
|
||||
# MSTest测试结果
|
||||
TestResults/
|
||||
*.trx
|
||||
|
||||
# Rider IDE
|
||||
.idea/
|
||||
.DS_Store
|
||||
*.sln.iml
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
||||
*.code-workspace
|
||||
|
||||
# 用户特定文件
|
||||
*.userprefs
|
||||
|
||||
# 构建日志
|
||||
msbuild.log
|
||||
|
||||
@@ -118,6 +118,24 @@ Namespace UTSModule.Station
|
||||
Public Sub PlanGridSelectChanged(sender As Object, ByVal e As PlanNodeSelectChangedEventArgs)
|
||||
TsBtnBackward.Enabled = _planGrid.CanBackward
|
||||
TsBtnForward.Enabled = _planGrid.CanForward
|
||||
|
||||
'表格移动
|
||||
If GrdStationPlan Is Nothing OrElse GrdStationPlan.Tree.SelectedNode Is Nothing Then Return
|
||||
Dim canMove As Boolean = True
|
||||
Dim startMoveRow As Integer = GrdStationPlan.Selection.FirstRow
|
||||
Dim moveRows As Integer = GrdStationPlan.Selection.LastRow - GrdStationPlan.Selection.FirstRow + 1
|
||||
Dim startLever As Integer = GrdStationPlan.Tree.FindNode(startMoveRow).Level
|
||||
For i As Integer = startMoveRow To startMoveRow + moveRows - 1
|
||||
If startLever <> GrdStationPlan.Tree.FindNode(startMoveRow).Level Then
|
||||
canMove = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
TsBtnMoveDown.Enabled = canMove
|
||||
TsBtnMoveLeft.Enabled = canMove
|
||||
TsBtnMoveRight.Enabled = canMove
|
||||
TsBtnMoveUp.Enabled = canMove
|
||||
End Sub
|
||||
|
||||
Public Sub PlanGridCommandChanged(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
Public Class GridNodeTextChangedCommand : Implements ICommand
|
||||
Imports UTS_Core.UTSModule.Station
|
||||
|
||||
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
|
||||
Public Class GridNodeTextChangedCommand : Implements ICommand
|
||||
|
||||
Sub New(grd As FlexCell.Grid, row As Integer, col As Integer, beforeText As String, afterText As String)
|
||||
Private ReadOnly grd As StationPlanGrid
|
||||
Private ReadOnly dic As Dictionary(Of Integer, TextChangedRowNode)
|
||||
|
||||
Sub New(grd As StationPlanGrid, dic As Dictionary(Of Integer, TextChangedRowNode))
|
||||
Me.grd = grd
|
||||
Me.row = row
|
||||
Me.col = col
|
||||
Me.beforeText = beforeText
|
||||
Me.afterText = afterText
|
||||
Me.dic = dic
|
||||
End Sub
|
||||
|
||||
Public Sub Redo() Implements ICommand.Redo
|
||||
grd.Cell(row, col).Text = afterText
|
||||
For Each row As Integer In dic.Keys
|
||||
grd.UpdateGrid2(dic(row).AfterRowNode)
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Undo() Implements ICommand.Undo
|
||||
grd.Cell(row, col).Text = beforeText
|
||||
|
||||
For Each row As Integer In dic.Keys
|
||||
grd.UpdateGrid2(dic(row).BeforeRowNode)
|
||||
Next
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class TextChangedRowNode
|
||||
|
||||
Public Property BeforeRowNode As RowNode
|
||||
|
||||
Public Property AfterRowNode As RowNode
|
||||
|
||||
End Class
|
||||
|
||||
@@ -26,6 +26,18 @@
|
||||
''' <returns></returns>
|
||||
Public Property Node() As RowNode
|
||||
|
||||
''' <summary>
|
||||
''' 修改前的节点
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property BeforeNode() As RowNode
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 修改类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
|
||||
Public Property ChangeType() As RowNodeChangeType
|
||||
End Class
|
||||
|
||||
|
||||
@@ -406,6 +406,12 @@ Namespace UTSModule.Station
|
||||
Dim cpNode As New RowNode
|
||||
|
||||
With cpNode
|
||||
.RowListIndex = RowListIndex
|
||||
|
||||
.Pause = Pause
|
||||
.ControlType = ControlType
|
||||
.SaveToDb = SaveToDb
|
||||
|
||||
.RowType = RowType
|
||||
|
||||
.Action = Action
|
||||
@@ -428,19 +434,44 @@ Namespace UTSModule.Station
|
||||
.Parameters.Add(param.Clone())
|
||||
Next
|
||||
|
||||
.RowNodes = New RowNodeCollection(cpNode)
|
||||
.Children = New List(Of RowNode)()
|
||||
'.RowNodes = New RowNodeCollection(cpNode)
|
||||
'.Children = New List(Of RowNode)()
|
||||
|
||||
'todo:克隆功能待重写
|
||||
''todo:克隆功能待重写
|
||||
|
||||
For Each child As RowNode In Children
|
||||
.RowNodes.Add(child.Clone())
|
||||
Next
|
||||
'For Each child As RowNode In Children
|
||||
' .RowNodes.Add(child.Clone())
|
||||
'Next
|
||||
End With
|
||||
|
||||
Return cpNode
|
||||
End Function
|
||||
|
||||
Public Sub CopyFrom(node As RowNode)
|
||||
With node
|
||||
.RowListIndex = RowListIndex
|
||||
|
||||
Pause = .Pause
|
||||
ControlType = .ControlType
|
||||
SaveToDb = .SaveToDb
|
||||
|
||||
RowType = .RowType
|
||||
Action = .Action
|
||||
RecordName = .RecordName
|
||||
Retry = .Retry
|
||||
RetryInterval = .RetryInterval
|
||||
[Label] = String.Copy(.Label)
|
||||
Description = String.Copy(.Description)
|
||||
ErrorCode = String.Copy(.ErrorCode)
|
||||
ErrorMessage = String.Copy(.ErrorMessage)
|
||||
CommandType = String.Copy(.CommandType)
|
||||
Command = String.Copy(.Command)
|
||||
Parameters.Clear()
|
||||
For Each param As TestCmdParam In .Parameters
|
||||
Parameters.Add(param.Clone())
|
||||
Next
|
||||
End With
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "节点样式"
|
||||
|
||||
@@ -140,15 +140,20 @@ Namespace UTSModule.Station
|
||||
|
||||
|
||||
#Region "表格事件处理"
|
||||
Private _isUpload As Boolean
|
||||
Private _beforeNode As RowNode
|
||||
|
||||
Private Sub Grid_CellChange(sender As Object, e As CellChangeEventArgs)
|
||||
If ActiveRowNode Is Nothing Then Return
|
||||
|
||||
If _cellChanged = GridCellChangedEnum.None Then _cellChanged = GridCellChangedEnum.RowNodeInfo
|
||||
If _cellChanged <> GridCellChangedEnum.RowNodeInfo Then Return
|
||||
|
||||
If Not _isUpload Then _beforeNode = ActiveRowNode.Clone
|
||||
_isUpload = True
|
||||
|
||||
If e.Col = ColNames.ColValue Then
|
||||
Dim value As String = _grd.Cell(e.Row, e.Col).Text
|
||||
Dim changeType As RowNodeChangedEventArgs.RowNodeChangeType
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.None
|
||||
Dim changeType As RowNodeChangedEventArgs.RowNodeChangeType = RowNodeChangedEventArgs.RowNodeChangeType.None
|
||||
Select Case e.Row
|
||||
Case RowNames.Action
|
||||
ActiveRowNode.Action = _grd.Cell(e.Row, e.Col).BooleanValue
|
||||
@@ -157,8 +162,55 @@ Namespace UTSModule.Station
|
||||
ActiveRowNode.Label = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Label
|
||||
Case RowNames.CommandType
|
||||
Dim cmdType As String = _grd.Cell(RowNames.CommandType, ColNames.ColValue).Text
|
||||
If String.Compare(ActiveRowNode.CommandType, cmdType) <> 0 Then
|
||||
ActiveRowNode.CommandType = cmdType
|
||||
ActiveRowNode.Command = ""
|
||||
ActiveRowNode.Parameters.Clear()
|
||||
ActiveRowNode.Action = Not String.IsNullOrWhiteSpace(ActiveRowNode.Command)
|
||||
CommandTypeChanged(ActiveRowNode)
|
||||
End If
|
||||
ActiveRowNode.CommandType = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.CommandType
|
||||
Case RowNames.ControlType
|
||||
ActiveRowNode.ControlType = _grd.Cell(RowNames.ControlType, ColNames.ColValue).Text
|
||||
Case RowNames.Command
|
||||
Dim cmdName As String = _grd.Cell(RowNames.Command, ColNames.ColValue).Text
|
||||
If String.Compare(ActiveRowNode.Command, cmdName) <> 0 Then
|
||||
ActiveRowNode.Command = cmdName
|
||||
ActiveRowNode.Parameters.Clear()
|
||||
ActiveRowNode.Action = Not String.IsNullOrWhiteSpace(ActiveRowNode.Command)
|
||||
|
||||
'拷贝所有参数到当前节点信息中
|
||||
Dim planCommand As TestCmd = _testCmdManager.GetCommand(ActiveRowNode.CommandType, ActiveRowNode.Command)
|
||||
If planCommand Is Nothing Then Return
|
||||
For Each cmdParam As TestCmdParam In planCommand.Params
|
||||
ActiveRowNode.Parameters.Add(cmdParam.Clone())
|
||||
Next
|
||||
|
||||
'更新行节点信息表格内容
|
||||
CommandChanged(ActiveRowNode)
|
||||
End If
|
||||
|
||||
ActiveRowNode.Command = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Command
|
||||
Case RowNames.ErrorCode
|
||||
Dim codeMsg As String = _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).Text
|
||||
Dim errCode As String = ErrCodeManager.CodeMsgToCode(codeMsg)
|
||||
If String.Compare(ActiveRowNode.ErrorCode, errCode) <> 0 Then
|
||||
ActiveRowNode.ErrorCode = errCode
|
||||
ActiveRowNode.ErrorMessage = _errCodeManager(ActiveRowNode.ErrorCode).Msg
|
||||
_grd.Cell(RowNames.ErrorCode, ColNames.ColValue).Text = errCode
|
||||
_grd.Cell(RowNames.ErrorCode, ColNames.ColValue).BackColor = _errCodeManager(ActiveRowNode.ErrorCode).Color
|
||||
_grd.Cell(RowNames.ErrorMessage, ColNames.ColValue).BackColor = _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).BackColor
|
||||
ErrCodeChanged(ActiveRowNode)
|
||||
End If
|
||||
ActiveRowNode.ErrorCode = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorCode
|
||||
Case RowNames.ErrorMessage
|
||||
ActiveRowNode.ErrorMessage = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorMessage
|
||||
|
||||
Case RowNames.RowType
|
||||
ActiveRowNode.RowType = CType([Enum].Parse(GetType(RowNode.RowTypeEnum), value), RowNode.RowTypeEnum)
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.RowType
|
||||
@@ -177,18 +229,7 @@ Namespace UTSModule.Station
|
||||
Case RowNames.RetryInterval
|
||||
ActiveRowNode.RetryInterval = CInt(value)
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.RetryInterval
|
||||
Case RowNames.ErrorCode
|
||||
ActiveRowNode.ErrorCode = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorCode
|
||||
Case RowNames.ErrorMessage
|
||||
ActiveRowNode.ErrorMessage = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorMessage
|
||||
Case RowNames.CommandType
|
||||
ActiveRowNode.CommandType = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.CommandType
|
||||
Case RowNames.Command
|
||||
ActiveRowNode.Command = value
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Command
|
||||
|
||||
Case >= RowNames.Parameters
|
||||
If e.Row - RowNames.Parameters > ActiveRowNode.Parameters.Count - 1 Then Return
|
||||
ActiveRowNode.Parameters(e.Row - RowNames.Parameters).Value = value
|
||||
@@ -197,13 +238,16 @@ Namespace UTSModule.Station
|
||||
|
||||
If changeType = RowNodeChangedEventArgs.RowNodeChangeType.None Then Return
|
||||
|
||||
Dim args As New RowNodeChangedEventArgs With {
|
||||
.Node = ActiveRowNode,
|
||||
.ChangeType = changeType
|
||||
}
|
||||
RaiseEvent RowNodeTextChanged(sender, args)
|
||||
If _beforeNode IsNot Nothing Then
|
||||
Dim args As New RowNodeChangedEventArgs With {
|
||||
.Node = ActiveRowNode,
|
||||
.BeforeNode = _beforeNode,
|
||||
.ChangeType = changeType
|
||||
}
|
||||
RaiseEvent RowNodeTextChanged(sender, args)
|
||||
End If
|
||||
End If
|
||||
|
||||
_isUpload = False
|
||||
_cellChanged = GridCellChangedEnum.None
|
||||
End Sub
|
||||
|
||||
@@ -218,6 +262,9 @@ Namespace UTSModule.Station
|
||||
_grd.Cell(row, ColNames.ColName).Text = node.Parameters(idx).Desc
|
||||
_grd.Cell(row, ColNames.ColValue).Text = node.Parameters(idx).Value
|
||||
Next
|
||||
|
||||
_grd.Range(RowNames.LineNumber, ColNames.ColName, _grd.Rows - 1, ColNames.ColName).BackColor = Color.LightGray
|
||||
_grd.Range(RowNames.LineNumber, ColNames.ColName, _grd.Rows - 1, ColNames.ColName).Alignment = AlignmentEnum.RightCenter
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -227,6 +274,9 @@ Namespace UTSModule.Station
|
||||
_grd.Cell(RowNames.Command, ColNames.ColValue).Text = node.Command
|
||||
_grd.Cell(RowNames.Parameters, ColNames.ColName).Text = RowNames.Parameters.ToString()
|
||||
_grd.Cell(RowNames.Parameters, ColNames.ColValue).Text = ""
|
||||
|
||||
_grd.Range(RowNames.LineNumber, ColNames.ColName, _grd.Rows - 1, ColNames.ColName).BackColor = Color.LightGray
|
||||
_grd.Range(RowNames.LineNumber, ColNames.ColName, _grd.Rows - 1, ColNames.ColName).Alignment = AlignmentEnum.RightCenter
|
||||
End Sub
|
||||
|
||||
Private Sub ErrCodeChanged(node As RowNode)
|
||||
@@ -239,47 +289,62 @@ Namespace UTSModule.Station
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
Private Sub Grid_ComboClick(sender As Object, e As ComboClickEventArgs)
|
||||
If ActiveRowNode Is Nothing Then Return
|
||||
Select Case _grdSingleRowDropRow
|
||||
Case RowNames.ControlType
|
||||
ActiveRowNode.ControlType = _grd.Cell(RowNames.ControlType, ColNames.ColValue).Text
|
||||
Case RowNames.CommandType
|
||||
'如果命令类型变化则,清空命令
|
||||
Dim cmdType As String = _grd.Cell(RowNames.CommandType, ColNames.ColValue).Text
|
||||
If String.Compare(ActiveRowNode.CommandType, cmdType) <> 0 Then
|
||||
ActiveRowNode.CommandType = cmdType
|
||||
ActiveRowNode.Command = ""
|
||||
ActiveRowNode.Parameters.Clear()
|
||||
CommandTypeChanged(ActiveRowNode)
|
||||
End If
|
||||
Case RowNames.Command
|
||||
Dim cmdName As String = _grd.Cell(RowNames.Command, ColNames.ColValue).Text
|
||||
If String.Compare(ActiveRowNode.Command, cmdName) <> 0 Then
|
||||
ActiveRowNode.Command = cmdName
|
||||
ActiveRowNode.Parameters.Clear()
|
||||
'If ActiveRowNode Is Nothing Then Return
|
||||
'Dim changeType As RowNodeChangedEventArgs.RowNodeChangeType = RowNodeChangedEventArgs.RowNodeChangeType.None
|
||||
'Dim beforeNode As RowNode = ActiveRowNode.Clone
|
||||
'Select Case _grdSingleRowDropRow
|
||||
' Case RowNames.ControlType
|
||||
' ActiveRowNode.ControlType = _grd.Cell(RowNames.ControlType, ColNames.ColValue).Text
|
||||
' changeType = RowNodeChangedEventArgs.RowNodeChangeType.ControlType
|
||||
' Case RowNames.CommandType
|
||||
' '如果命令类型变化则,清空命令
|
||||
' Dim cmdType As String = _grd.Cell(RowNames.CommandType, ColNames.ColValue).Text
|
||||
' If String.Compare(ActiveRowNode.CommandType, cmdType) <> 0 Then
|
||||
' ActiveRowNode.CommandType = cmdType
|
||||
' ActiveRowNode.Command = ""
|
||||
' ActiveRowNode.Parameters.Clear()
|
||||
' CommandTypeChanged(ActiveRowNode)
|
||||
' changeType = RowNodeChangedEventArgs.RowNodeChangeType.CommandType
|
||||
' End If
|
||||
' Case RowNames.Command
|
||||
' Dim cmdName As String = _grd.Cell(RowNames.Command, ColNames.ColValue).Text
|
||||
' If String.Compare(ActiveRowNode.Command, cmdName) <> 0 Then
|
||||
' ActiveRowNode.Command = cmdName
|
||||
' ActiveRowNode.Parameters.Clear()
|
||||
|
||||
'拷贝所有参数到当前节点信息中
|
||||
Dim planCommand As TestCmd = _testCmdManager.GetCommand(ActiveRowNode.CommandType, ActiveRowNode.Command)
|
||||
If planCommand Is Nothing Then Return
|
||||
For Each cmdParam As TestCmdParam In planCommand.Params
|
||||
ActiveRowNode.Parameters.Add(cmdParam.Clone())
|
||||
Next
|
||||
' '拷贝所有参数到当前节点信息中
|
||||
' Dim planCommand As TestCmd = _testCmdManager.GetCommand(ActiveRowNode.CommandType, ActiveRowNode.Command)
|
||||
' If planCommand Is Nothing Then Return
|
||||
' For Each cmdParam As TestCmdParam In planCommand.Params
|
||||
' ActiveRowNode.Parameters.Add(cmdParam.Clone())
|
||||
' Next
|
||||
|
||||
'更新行节点信息表格内容
|
||||
CommandChanged(ActiveRowNode)
|
||||
End If
|
||||
Case RowNames.ErrorCode
|
||||
Dim codeMsg As String = _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).Text
|
||||
Dim errCode As String = ErrCodeManager.CodeMsgToCode(codeMsg)
|
||||
If String.Compare(ActiveRowNode.ErrorCode, errCode) <> 0 Then
|
||||
ActiveRowNode.ErrorCode = errCode
|
||||
ActiveRowNode.ErrorMessage = _errCodeManager(ActiveRowNode.ErrorCode).Msg
|
||||
_grd.Cell(RowNames.ErrorCode, ColNames.ColValue).Text = errCode
|
||||
_grd.Cell(RowNames.ErrorCode, ColNames.ColValue).BackColor = _errCodeManager(ActiveRowNode.ErrorCode).Color
|
||||
_grd.Cell(RowNames.ErrorMessage, ColNames.ColValue).BackColor = _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).BackColor
|
||||
ErrCodeChanged(ActiveRowNode)
|
||||
End If
|
||||
End Select
|
||||
' '更新行节点信息表格内容
|
||||
' CommandChanged(ActiveRowNode)
|
||||
' changeType = RowNodeChangedEventArgs.RowNodeChangeType.Command
|
||||
' End If
|
||||
' Case RowNames.ErrorCode
|
||||
' Dim codeMsg As String = _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).Text
|
||||
' Dim errCode As String = ErrCodeManager.CodeMsgToCode(codeMsg)
|
||||
' If String.Compare(ActiveRowNode.ErrorCode, errCode) <> 0 Then
|
||||
' ActiveRowNode.ErrorCode = errCode
|
||||
' ActiveRowNode.ErrorMessage = _errCodeManager(ActiveRowNode.ErrorCode).Msg
|
||||
' _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).Text = errCode
|
||||
' _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).BackColor = _errCodeManager(ActiveRowNode.ErrorCode).Color
|
||||
' _grd.Cell(RowNames.ErrorMessage, ColNames.ColValue).BackColor = _grd.Cell(RowNames.ErrorCode, ColNames.ColValue).BackColor
|
||||
' ErrCodeChanged(ActiveRowNode)
|
||||
' changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorCode
|
||||
' End If
|
||||
'End Select
|
||||
|
||||
'If changeType = RowNodeChangedEventArgs.RowNodeChangeType.None Then Return
|
||||
|
||||
'Dim args As New RowNodeChangedEventArgs With {
|
||||
' .Node = ActiveRowNode,
|
||||
' .BeforeNode = beforeNode,
|
||||
' .ChangeType = changeType
|
||||
'}
|
||||
'RaiseEvent RowNodeTextChanged(sender, args)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@@ -316,9 +381,9 @@ Namespace UTSModule.Station
|
||||
_grd.ComboBox(0).Items.Add(RowNode.RowTypeEnum.Control)
|
||||
_grd.ComboBox(0).Items.Add(RowNode.RowTypeEnum.Flow)
|
||||
_grd.ComboBox(0).Items.Add(RowNode.RowTypeEnum.Module)
|
||||
Case RowNames.Parameters'特殊处理Call命令
|
||||
_grd.ComboBox(0).Items.Clear()
|
||||
_grd.ComboBox(0).Items.Addrange(UTS_Core.UTSModule.Test.UtsTester.CreateTester.GetCustomModuleName())
|
||||
Case RowNames.Parameters '特殊处理Call命令
|
||||
_grd.ComboBox(0).Items.Clear()
|
||||
_grd.ComboBox(0).Items.AddRange(UTS_Core.UTSModule.Test.UtsTester.CreateTester.GetCustomModuleName())
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -64,7 +64,19 @@ Namespace UTSModule.Station
|
||||
''' <summary>节点执行可撤销事件</summary>
|
||||
Public Event PlanGridCommandChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
|
||||
''' <summary>粘贴操作计时器</summary>
|
||||
Private WithEvents _userActionTimer As New Timer()
|
||||
|
||||
''' <summary>计时器超时时间</summary>
|
||||
Private Const UserActionTimeout As Integer = 300 ' ms
|
||||
|
||||
Private _dicTextChangedRowNode As New Dictionary(Of Integer, TextChangedRowNode) '记录文本修改的行号和节点对象
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 构造函数
|
||||
''' </summary>
|
||||
|
||||
Sub New()
|
||||
NodeStartRow = 1
|
||||
@@ -77,8 +89,58 @@ Namespace UTSModule.Station
|
||||
|
||||
_testCmdManager = TestCmdManager.CreateManager()
|
||||
_errCodeManager = ErrCodeManager.CreateManager()
|
||||
|
||||
_userActionTimer.Interval = UserActionTimeout
|
||||
_userActionTimer.Stop()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 表格内容改变处理事件
|
||||
''' </summary>
|
||||
Private Sub OnUserAction(node As RowNode)
|
||||
If CommandManager.IsRuning Then Return
|
||||
|
||||
' 每次用户操作都重置计时器
|
||||
_userActionTimer.Stop()
|
||||
_userActionTimer.Start()
|
||||
|
||||
'记录当前活动节点
|
||||
If Not _dicTextChangedRowNode.ContainsKey(node.RowListIndex) Then
|
||||
_dicTextChangedRowNode.Add(node.RowListIndex, New TextChangedRowNode With {.BeforeRowNode = node.Clone})
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnUserActionEnd(node As RowNode)
|
||||
If CommandManager.IsRuning Then Return
|
||||
|
||||
'记录当前活动节点
|
||||
If _dicTextChangedRowNode.ContainsKey(node.RowListIndex) Then
|
||||
_dicTextChangedRowNode(node.RowListIndex).AfterRowNode = node.Clone
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 粘贴操作计时器超时处理事件
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
Private Sub _userActionTimer_Tick(sender As Object, e As EventArgs) Handles _userActionTimer.Tick
|
||||
_userActionTimer.Stop()
|
||||
|
||||
OnUserActionTimeout()
|
||||
End Sub
|
||||
|
||||
Private Sub OnUserActionTimeout()
|
||||
If CommandManager.IsRuning = False Then
|
||||
CommandManager.AddUndoCommand(New GridNodeTextChangedCommand(Me, _dicTextChangedRowNode))
|
||||
|
||||
RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
_dicTextChangedRowNode = New Dictionary(Of Integer, TextChangedRowNode)
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 屏蔽表格引发自定义事件,避免行节点内容修改,todo:暂未完成
|
||||
''' </summary>
|
||||
@@ -474,7 +536,7 @@ Namespace UTSModule.Station
|
||||
Return Color.DarkSlateGray
|
||||
End If
|
||||
Case "ComPort"
|
||||
Return Color.DarkCyan
|
||||
Return Color.Olive
|
||||
Case "UtsComPort"
|
||||
Return Color.SeaGreen
|
||||
Case "Converter"
|
||||
@@ -852,21 +914,26 @@ Namespace UTSModule.Station
|
||||
|
||||
Private Function ParamsToString(params As List(Of TestCmdParam)) As String
|
||||
Return String.Join($" {_paramChar} ", params.Select(Function(p) p.Value))
|
||||
|
||||
'Dim result As New StringBuilder
|
||||
|
||||
'For i As Integer = 0 To params.Count - 1
|
||||
' If i = 0 Then
|
||||
' result.Append(params(i).Value)
|
||||
' Else
|
||||
' result.Append($" {_paramChar} {params(i).Value}")
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'Return result.ToString()
|
||||
End Function
|
||||
|
||||
Public Sub UpdateGrid2(node As RowNode)
|
||||
Dim row As Integer = node.RowListIndex
|
||||
Dim rowNode As RowNode = _headNode.RowList(row)
|
||||
rowNode.CopyFrom(node)
|
||||
|
||||
_uploading = True
|
||||
UpdateGrid(_grd, row, rowNode)
|
||||
_uploading = False
|
||||
|
||||
'触发事件
|
||||
If SkipEvent Then Return
|
||||
Dim event2 As New PlanNodeSelectChangedEventArgs With {.Node = node,
|
||||
.LineNumber = row,
|
||||
.LineActionEn = node.Action
|
||||
}
|
||||
|
||||
RaiseEvent PlanNodeSelectChanged(_grd, event2)
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateGrid(grd As Grid, row As Integer, node As RowNode)
|
||||
Dim rowCmdType As String
|
||||
@@ -1012,13 +1079,13 @@ Namespace UTSModule.Station
|
||||
|
||||
|
||||
Private Sub CommandChanged(node As RowNode)
|
||||
_grd.Cell(node.RowListIndex, ColNames.Parameters).Text = ParamsToString(node.Parameters)
|
||||
_grd.Cell(node.RowListIndex, ColNames.Action).Text = IIf(node.Action, "1", "0").ToString
|
||||
|
||||
_grd.Cell(node.RowListIndex, ColNames.Parameters).Text = ParamsToString(node.Parameters)
|
||||
End Sub
|
||||
|
||||
Private Sub CommandTypeChanged(node As RowNode)
|
||||
_grd.Cell(node.RowListIndex, ColNames.Command).Text = " "
|
||||
_grd.Cell(node.RowListIndex, ColNames.Action).Text = IIf(node.Action, "1", "0").ToString
|
||||
_grd.Cell(node.RowListIndex, ColNames.Command).Text = node.Command
|
||||
_grd.Cell(node.RowListIndex, ColNames.Parameters).Text = ParamsToString(node.Parameters)
|
||||
End Sub
|
||||
|
||||
@@ -1055,12 +1122,11 @@ Namespace UTSModule.Station
|
||||
Dim changeType As RowNodeChangedEventArgs.RowNodeChangeType
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.None
|
||||
|
||||
Dim cmd As ICommand
|
||||
Dim beforeNode As RowNode = node.Clone()
|
||||
OnUserAction(beforeNode)
|
||||
|
||||
Select Case e.Col
|
||||
Case ColNames.[Pause]
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.Pause.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.[Pause] = _grd.Cell(e.Row, e.Col).BooleanValue
|
||||
If node.[Pause] Then
|
||||
_grd.Cell(e.Row, e.Col).BackColor = Color.Red
|
||||
@@ -1068,8 +1134,6 @@ Namespace UTSModule.Station
|
||||
_grd.Cell(e.Row, e.Col).BackColor = Color.White
|
||||
End If
|
||||
Case ColNames.Action
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.Action.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.Action = _grd.Cell(e.Row, e.Col).BooleanValue
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Action
|
||||
If node.RowType = RowNode.RowTypeEnum.FixedModule Then
|
||||
@@ -1079,8 +1143,6 @@ Namespace UTSModule.Station
|
||||
|
||||
NodeActionChanged(node)
|
||||
Case ColNames.Description
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.Description.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.Description = _grd.Cell(e.Row, e.Col).Text
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Description
|
||||
Case ColNames.[Label]
|
||||
@@ -1093,7 +1155,6 @@ Namespace UTSModule.Station
|
||||
_uploading = False
|
||||
Return
|
||||
Else
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.Label.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
If Not String.IsNullOrEmpty(node.Label) Then RemoveLabelName(node.Label) '移出之前记录标签名称
|
||||
|
||||
node.Label = labelName
|
||||
@@ -1107,8 +1168,6 @@ Namespace UTSModule.Station
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Label
|
||||
End If
|
||||
Case ColNames.ControlType
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.ControlType.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.ControlType = _grd.Cell(e.Row, e.Col).Text
|
||||
If String.IsNullOrWhiteSpace(node.ControlType) Then
|
||||
node.RowType = RowNode.RowTypeEnum.Flow
|
||||
@@ -1119,11 +1178,11 @@ Namespace UTSModule.Station
|
||||
|
||||
Case ColNames.CommandType
|
||||
If String.Compare(node.CommandType, _grd.Cell(e.Row, e.Col).Text) <> 0 Then
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.CommandType.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.CommandType = _grd.Cell(e.Row, e.Col).Text
|
||||
node.Command = ""
|
||||
node.Parameters.Clear()
|
||||
node.Action = Not String.IsNullOrWhiteSpace(node.Command)
|
||||
CommandTypeChanged(node)
|
||||
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.CommandType
|
||||
@@ -1132,17 +1191,9 @@ Namespace UTSModule.Station
|
||||
NodeActionChanged(node)
|
||||
Case ColNames.Command
|
||||
If node.Command <> _grd.Cell(e.Row, e.Col).Text Then
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.Command.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.Command = _grd.Cell(e.Row, e.Col).Text
|
||||
|
||||
If String.IsNullOrWhiteSpace(node.Command) Then
|
||||
node.Action = False
|
||||
Else
|
||||
node.Action = True
|
||||
End If
|
||||
|
||||
node.Parameters.Clear()
|
||||
node.Action = Not String.IsNullOrWhiteSpace(node.Command)
|
||||
|
||||
'拷贝所有参数到当前节点信息中
|
||||
Dim planCommand As TestCmd = _testCmdManager.GetCommand(node.CommandType, node.Command)
|
||||
@@ -1155,9 +1206,6 @@ Namespace UTSModule.Station
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Command
|
||||
End If
|
||||
Case ColNames.Parameters
|
||||
Dim pStr As String = ParamsToString(node.Parameters)
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, pStr, _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
Dim str() As String = _grd.Cell(e.Row, e.Col).Text.Split(New Char() {_paramChar})
|
||||
|
||||
For i As Integer = 0 To node.Parameters.Count - 1
|
||||
@@ -1169,8 +1217,6 @@ Namespace UTSModule.Station
|
||||
Next
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Parameters
|
||||
Case ColNames.SaveToDb
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.SaveToDb.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.SaveToDb = _grd.Cell(e.Row, e.Col).BooleanValue
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.SaveToDb
|
||||
If node.RowType = RowNode.RowTypeEnum.FixedModule Then
|
||||
@@ -1189,7 +1235,6 @@ Namespace UTSModule.Station
|
||||
_uploading = False
|
||||
Return
|
||||
Else
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.RecordName.ToString(), recordName)
|
||||
If IsExistRecordName(node.RecordName) Then RemoveRecordName(node.RecordName) '移出之前记录名称
|
||||
|
||||
node.RecordName = recordName
|
||||
@@ -1199,31 +1244,21 @@ Namespace UTSModule.Station
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.RecordName
|
||||
End If
|
||||
Case ColNames.Retry
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.Retry.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.Retry = _grd.Cell(e.Row, e.Col).IntegerValue
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.Retry
|
||||
Case ColNames.RetryInterval
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.RetryInterval.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.RetryInterval = _grd.Cell(e.Row, e.Col).IntegerValue
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.RetryInterval
|
||||
Case ColNames.ErrorCode
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.ErrorCode.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.ErrorCode = _grd.Cell(e.Row, e.Col).Text
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorCode
|
||||
Case ColNames.ErrorMessage
|
||||
cmd = New GridNodeTextChangedCommand(_grd, e.Row, e.Col, node.ErrorMessage.ToString(), _grd.Cell(e.Row, e.Col).Text)
|
||||
|
||||
node.ErrorMessage = _grd.Cell(e.Row, e.Col).Text
|
||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ErrorMessage
|
||||
End Select
|
||||
|
||||
If CommandManager.IsRuning = False AndAlso cmd IsNot Nothing Then
|
||||
CommandManager.RunCommand(cmd)
|
||||
RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||
End If
|
||||
OnUserActionEnd(node)
|
||||
|
||||
|
||||
'触发事件
|
||||
If SkipEvent Then Return
|
||||
@@ -1236,6 +1271,7 @@ Namespace UTSModule.Station
|
||||
|
||||
Dim args As New RowNodeChangedEventArgs With {
|
||||
.Node = node,
|
||||
.BeforeNode = beforeNode,
|
||||
.ChangeType = changeType
|
||||
}
|
||||
RaiseEvent RowNodeTextChanged(sender, args)
|
||||
@@ -1533,8 +1569,10 @@ Namespace UTSModule.Station
|
||||
Dim startNode As RowNode = _headNode.RowList(startMoveRow - _drawStartRow + 1)
|
||||
For i As Integer = 1 To rows
|
||||
node = _headNode.RowList(startMoveRow - _drawStartRow + i)
|
||||
If node.RowLever > startNode.RowLever Then Continue For
|
||||
If node.RowLever < startNode.RowLever Then Exit For
|
||||
If startNode.RowLever <> node.RowLever Then
|
||||
MsgBox("请选择同一级别节点再尝试此操作") '非同级别节点不移动
|
||||
Return
|
||||
End If
|
||||
nodes.Add(node)
|
||||
Next
|
||||
|
||||
@@ -1599,9 +1637,18 @@ Namespace UTSModule.Station
|
||||
|
||||
Dim startNode As RowNode = _headNode.RowList(startMoveRow - _drawStartRow + 1)
|
||||
Dim prevNode As RowNode = startNode.PrevNode
|
||||
|
||||
If prevNode Is Nothing Then Return
|
||||
|
||||
Dim node As RowNode
|
||||
For i As Integer = 2 To moveRows
|
||||
node = _headNode.RowList(startMoveRow - _drawStartRow + i)
|
||||
If startNode.RowLever <> node.RowLever Then
|
||||
MsgBox("请选择同一级别节点再尝试此操作") '非同级别节点不移动
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Dim moveEndRow As Integer = prevNode.RowListIndex
|
||||
Dim cmd As New GridNodeMoveUpCommand(Me, startMoveRow, moveRows, moveEndRow)
|
||||
CommandManager.RunCommand(cmd) '添加到撤销堆栈执行
|
||||
@@ -1612,10 +1659,20 @@ Namespace UTSModule.Station
|
||||
Public Sub NodeMoveDown(startMoveRow As Integer, moveRows As Integer)
|
||||
If _headNode Is Nothing Then Return
|
||||
|
||||
Dim startNode As RowNode = _headNode.RowList(startMoveRow - _drawStartRow + 1)
|
||||
Dim endNode As RowNode = _headNode.RowList(startMoveRow + moveRows - _drawStartRow)
|
||||
Dim nextNode As RowNode = endNode.NextNode
|
||||
If nextNode Is Nothing Then Return
|
||||
|
||||
Dim node As RowNode
|
||||
For i As Integer = 2 To moveRows
|
||||
node = _headNode.RowList(startMoveRow - _drawStartRow + i)
|
||||
If startNode.RowLever <> node.RowLever Then
|
||||
MsgBox("请选择同一级别节点再尝试此操作") '非同级别节点不移动
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim moveEndRow As Integer = startMoveRow + nextNode.AllChildCount + 1
|
||||
Dim cmd As New GridNodeMoveDownCommand(Me, startMoveRow, moveRows, moveEndRow)
|
||||
CommandManager.RunCommand(cmd) '添加到撤销堆栈执行
|
||||
@@ -1782,8 +1839,10 @@ Namespace UTSModule.Station
|
||||
Dim moveEndRow As Integer = startNode.ParentNode.RowListIndex + startNode.ParentNode.AllChildCount + 1
|
||||
For i As Integer = 1 To moveRows
|
||||
node = _headNode.RowList(startMoveRow - _drawStartRow + i)
|
||||
If node.RowLever < startNode.RowLever Then Exit For '高于起始节点级别不移动
|
||||
If node.RowLever > startNode.RowLever Then Continue For
|
||||
If startNode.RowLever <> node.RowLever Then
|
||||
MsgBox("请选择同一级别节点再尝试此操作") '非同级别节点不移动
|
||||
Return
|
||||
End If
|
||||
|
||||
moveEndRow -= (node.AllChildCount + 1)
|
||||
Next
|
||||
@@ -1840,6 +1899,15 @@ Namespace UTSModule.Station
|
||||
If startNode.RowLever < 1 Then Return '固定节点不移动
|
||||
If startNode.PrevNode Is Nothing Then Return '没有上一级节点
|
||||
|
||||
Dim node As RowNode
|
||||
For i As Integer = 2 To moveRows
|
||||
node = _headNode.RowList(startMoveRow - _drawStartRow + i)
|
||||
If startNode.RowLever <> node.RowLever Then
|
||||
MsgBox("请选择同一级别节点再尝试此操作") '非同级别节点不移动
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim moveRightNodeIndex As Integer = startNode.PrevNode.Children.Count
|
||||
Dim moveEndRow As Integer = startNode.PrevNode.RowListIndex + startNode.PrevNode.AllChildCount + 1
|
||||
|
||||
@@ -1900,53 +1968,25 @@ Namespace UTSModule.Station
|
||||
With _grd
|
||||
Select Case e.ChangeType
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.Action
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.Action, .Cell(row, ColNames.Action).Text, node.Action.ToString())
|
||||
|
||||
.Cell(row, ColNames.Action).Text = IIf(node.Action, "1", "0").ToString()
|
||||
NodeActionChanged(node)
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.RowType
|
||||
'If node.RowType = RowNode.RowTypeEnum.FixedModule Then
|
||||
' .Cell(row, ColNames.Label).FontSize = 10
|
||||
' .Cell(row, ColNames.Label).FontBold = True
|
||||
'ElseIf node.RowType = RowNode.RowTypeEnum.Module Then
|
||||
' .Cell(row, ColNames.Label).FontSize = 8
|
||||
' .Cell(row, ColNames.Label).FontBold = True
|
||||
'ElseIf node.RowType = RowNode.RowTypeEnum.Flow Then
|
||||
' .Cell(row, ColNames.Label).FontSize = 8
|
||||
' .Cell(row, ColNames.Label).FontBold = False
|
||||
'End If
|
||||
'NodeActionChanged(node)
|
||||
NodeRowTypeChanged(node)
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.Label
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.Label, .Cell(row, ColNames.Label).Text, node.Label.ToString())
|
||||
|
||||
.Cell(row, ColNames.Label).Text = $"{node.Label}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.ControlType
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.ControlType, .Cell(row, ColNames.ControlType).Text, node.ControlType.ToString())
|
||||
|
||||
.Cell(row, ColNames.ControlType).Text = $"{node.ControlType}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.Description
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.Description, .Cell(row, ColNames.Description).Text, node.Description.ToString())
|
||||
|
||||
.Cell(row, ColNames.Description).Text = $"{node.Description}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.SaveToDb
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.SaveToDb, .Cell(row, ColNames.SaveToDb).Text, node.SaveToDb.ToString())
|
||||
|
||||
.Cell(row, ColNames.SaveToDb).Text = IIf(node.SaveToDb, "1", "0").ToString()
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.RecordName
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.RecordName, .Cell(row, ColNames.RecordName).Text, node.RecordName.ToString())
|
||||
|
||||
.Cell(row, ColNames.RecordName).Text = $"{node.RecordName}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.Retry
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.Retry, .Cell(row, ColNames.Retry).Text, node.Retry.ToString())
|
||||
|
||||
.Cell(row, ColNames.Retry).Text = $"{node.Retry}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.RetryInterval
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.RetryInterval, .Cell(row, ColNames.RetryInterval).Text, node.RetryInterval.ToString())
|
||||
|
||||
.Cell(row, ColNames.RetryInterval).Text = $"{node.RetryInterval}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.ErrorCode
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.ErrorCode, .Cell(row, ColNames.ErrorCode).Text, node.ErrorCode.ToString())
|
||||
|
||||
.Cell(row, ColNames.ErrorCode).Text = $"{node.ErrorCode}"
|
||||
If String.IsNullOrWhiteSpace(node.ErrorCode) = False Then
|
||||
.Cell(row, ColNames.ErrorCode).BackColor = _errCodeManager(node.ErrorCode).Color
|
||||
@@ -1956,35 +1996,34 @@ Namespace UTSModule.Station
|
||||
.Cell(row, ColNames.ErrorMessage).BackColor = Color.White
|
||||
End If
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.ErrorMessage
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.ErrorMessage, .Cell(row, ColNames.ErrorMessage).Text, node.ErrorMessage.ToString())
|
||||
|
||||
.Cell(row, ColNames.ErrorMessage).Text = $"{node.ErrorMessage}"
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.CommandType
|
||||
If String.Compare(.Cell(row, ColNames.CommandType).Text, node.CommandType) <> 0 Then
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.CommandType, .Cell(row, ColNames.CommandType).Text, node.CommandType.ToString())
|
||||
|
||||
.Cell(row, ColNames.CommandType).Text = $"{node.CommandType}"
|
||||
CommandTypeChanged(node)
|
||||
NodeActionChanged(node)
|
||||
End If
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.Command
|
||||
If String.Compare(.Cell(row, ColNames.Command).Text, node.Command) <> 0 Then
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.Command, .Cell(row, ColNames.Command).Text, node.Command.ToString())
|
||||
|
||||
.Cell(row, ColNames.Command).Text = $"{node.Command}"
|
||||
CommandChanged(node)
|
||||
NodeActionChanged(node)
|
||||
End If
|
||||
Case RowNodeChangedEventArgs.RowNodeChangeType.Parameters
|
||||
cmd = New GridNodeTextChangedCommand(_grd, row, ColNames.Parameters, .Cell(row, ColNames.Parameters).Text, ParamsToString(node.Parameters))
|
||||
|
||||
.Cell(row, ColNames.Parameters).Text = $"{ParamsToString(node.Parameters)}"
|
||||
End Select
|
||||
End With
|
||||
OnUserAction(e.BeforeNode)
|
||||
OnUserActionEnd(e.Node)
|
||||
'If CommandManager.IsRuning = False Then
|
||||
|
||||
If CommandManager.IsRuning = False AndAlso cmd IsNot Nothing Then
|
||||
CommandManager.RunCommand(cmd)
|
||||
RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||
|
||||
End If
|
||||
' Dim dic As New Dictionary(Of Integer, TextChangedRowNode) From {
|
||||
' {row, New TextChangedRowNode With {.BeforeRowNode = e.BeforeNode.Clone, .AfterRowNode = e.Node.Clone}}
|
||||
' }
|
||||
' CommandManager.AddUndoCommand(New GridNodeTextChangedCommand(Me, dic))
|
||||
' RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||
'End If
|
||||
|
||||
StationEditStatusMonitor.StationEditStatus = StationEditStatusMonitor.StationEditStatusEnum.Changed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user