Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df790bb5b7 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,7 +3,7 @@
|
|||||||
# .NET编译生成文件
|
# .NET编译生成文件
|
||||||
[Bb]in
|
[Bb]in
|
||||||
[Oo]bj
|
[Oo]bj
|
||||||
[Dd]ebug*/
|
[Dd]ebug/
|
||||||
*.pdb
|
*.pdb
|
||||||
*.user
|
*.user
|
||||||
*.suo
|
*.suo
|
||||||
|
|||||||
@@ -53,9 +53,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\DLL\System.Data.SQLite.dll</HintPath>
|
||||||
<HintPath>..\packages\System.Data.SQLite.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Deployment" />
|
<Reference Include="System.Deployment" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
|
|||||||
@@ -94,9 +94,8 @@
|
|||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="TeeChart, Version=4.1.2017.2153, Culture=neutral, PublicKeyToken=9c8126276c77bdb7, processorArchitecture=MSIL">
|
<Reference Include="TeeChart">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\DLL\TeeChart.dll</HintPath>
|
||||||
<HintPath>bin\Debug\TeeChart.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -161,9 +160,9 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="My Project\Resources.resx">
|
<EmbeddedResource Include="My Project\Resources.resx">
|
||||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
|
||||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
2
AUTS_Repair/My Project/Resources.Designer.vb
generated
2
AUTS_Repair/My Project/Resources.Designer.vb
generated
@@ -22,7 +22,7 @@ Namespace My.Resources
|
|||||||
'''<summary>
|
'''<summary>
|
||||||
''' 一个强类型的资源类,用于查找本地化的字符串等。
|
''' 一个强类型的资源类,用于查找本地化的字符串等。
|
||||||
'''</summary>
|
'''</summary>
|
||||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
|
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||||
|
|||||||
@@ -119,6 +119,6 @@
|
|||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="NoImg40_30" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="NoImg40_30" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\bin\Debug\RepairImage\NoImg40_30.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\NoImg40_30.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
BIN
AUTS_Repair/Resources/NoImg40_30.png
Normal file
BIN
AUTS_Repair/Resources/NoImg40_30.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 459 B |
BIN
DLL/TeeChart.dll
Normal file
BIN
DLL/TeeChart.dll
Normal file
Binary file not shown.
@@ -79,9 +79,8 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\DLL\System.Data.SQLite.dll</HintPath>
|
||||||
<HintPath>..\packages\System.Data.SQLite.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Deployment" />
|
<Reference Include="System.Deployment" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
|
|||||||
207
UTS_Core/DebugLog/ApplicationLog.vb
Normal file
207
UTS_Core/DebugLog/ApplicationLog.vb
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports System.Text
|
||||||
|
Imports System.Windows.Forms
|
||||||
|
|
||||||
|
Namespace DebugLog
|
||||||
|
''' <summary>
|
||||||
|
''' 应用程序日志
|
||||||
|
''' </summary>
|
||||||
|
Public NotInheritable Class ApplicationLog
|
||||||
|
|
||||||
|
''' <summary>日志文件所在父文件夹路径</summary>
|
||||||
|
Private Shared _logPath As String = Application.StartupPath
|
||||||
|
|
||||||
|
''' <summary>日志文件名前缀</summary>
|
||||||
|
Private Shared _logFilePrefix As String = Application.ProductName
|
||||||
|
|
||||||
|
''' <summary>日志文件所在路径</summary>
|
||||||
|
Private Shared _logFilePath As String = $"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 保存日志的文件夹完整路径
|
||||||
|
''' </summary>
|
||||||
|
Public Shared Property LogDirPath As String
|
||||||
|
Get
|
||||||
|
If Equals(_logPath, String.Empty) Then
|
||||||
|
_logPath = Application.StartupPath
|
||||||
|
End If
|
||||||
|
Return _logPath
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
_logPath = value
|
||||||
|
|
||||||
|
_logFilePath = $"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log"
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 日志文件前缀
|
||||||
|
''' </summary>
|
||||||
|
Public Shared Property LogFilePrefix As String
|
||||||
|
Get
|
||||||
|
Return _logFilePrefix
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
_logFilePrefix = value
|
||||||
|
_logFilePath = $"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log"
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Shared ReadOnly Property LogFilePath() As String
|
||||||
|
Get
|
||||||
|
Return _logFilePath
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写入错误信息记录日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="ex"></param>
|
||||||
|
Public Shared Sub WriteErrorLog(ex As Exception)
|
||||||
|
Dim msg As New StringBuilder
|
||||||
|
|
||||||
|
msg.Append($"{ex.StackTrace} {ex.Message}")
|
||||||
|
|
||||||
|
WriteLog(LogTypes.Error, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写入流程信息记录日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="msg"></param>
|
||||||
|
Public Shared Sub WriteDebugLog1(msg As String)
|
||||||
|
WriteLog1(LogTypes.Debug.ToString, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
Public Shared Sub WriteDebugLog(msg As String)
|
||||||
|
WriteLog(LogTypes.Debug, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写入流程信息记录日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="msg"></param>
|
||||||
|
Public Shared Sub WriteInfoLog(msg As String)
|
||||||
|
WriteLog(LogTypes.Info, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写入警告信息记录日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="msg"></param>
|
||||||
|
Public Shared Sub WriteWarningLog(msg As String)
|
||||||
|
WriteLog(LogTypes.Warn, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写入错误信息记录日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="msg"></param>
|
||||||
|
Public Shared Sub WriteErrorLog(msg As String)
|
||||||
|
WriteLog(LogTypes.Error, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写入数据库信息记录日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="msg"></param>
|
||||||
|
Public Shared Sub WriteFatalLog(msg As String)
|
||||||
|
WriteLog(LogTypes.Fatal, msg.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Shared ReadOnly LogLock As New Object() '日志锁,防止多线程同时写日志导致冲突
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 将信息入到日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="logType">日志类型</param>
|
||||||
|
''' <param name="msg">日志内容</param>
|
||||||
|
Public Shared Sub WriteLog(logType As String, msg As String)
|
||||||
|
'写入记录入日志文件
|
||||||
|
SyncLock LogLock
|
||||||
|
Try
|
||||||
|
Dim logString As New StringBuilder
|
||||||
|
|
||||||
|
logString.Append($"[{Date.Now:yyyy-MM-dd HH:mm:ss:fff}]") '日志产生时间
|
||||||
|
|
||||||
|
logString.Append($"[{logType,-6}]") '日志类型
|
||||||
|
|
||||||
|
logString.Append($"[{Process.GetCurrentProcess.Id,-6}]") '日志的进程号
|
||||||
|
|
||||||
|
logString.Append($"[{Threading.Thread.CurrentThread.ManagedThreadId,-4}]") '日志的线程号
|
||||||
|
|
||||||
|
logString.Append(msg) '日志的消息主题
|
||||||
|
|
||||||
|
Using sw As StreamWriter = File.AppendText($"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log")
|
||||||
|
sw.WriteLine(logString.ToString())
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Console.WriteLine($"Uts WriteLog Error:{ex.Message}")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End SyncLock
|
||||||
|
End Sub
|
||||||
|
Public Shared Sub WriteLog1(logType As String, msg As String)
|
||||||
|
'写入记录入日志文件
|
||||||
|
SyncLock LogLock
|
||||||
|
Try
|
||||||
|
Dim logString As New StringBuilder
|
||||||
|
|
||||||
|
logString.Append($"[{Date.Now:yyyy-MM-dd HH:mm:ss:fff}]") '日志产生时间
|
||||||
|
|
||||||
|
logString.Append($"[{logType,-6}]") '日志类型
|
||||||
|
|
||||||
|
logString.Append($"[{Process.GetCurrentProcess.Id,-6}]") '日志的进程号
|
||||||
|
|
||||||
|
logString.Append($"[{Threading.Thread.CurrentThread.ManagedThreadId,-4}]") '日志的线程号
|
||||||
|
|
||||||
|
logString.Append(msg) '日志的消息主题
|
||||||
|
|
||||||
|
Using sw As StreamWriter = File.AppendText($"{LogDirPath}{Path.DirectorySeparatorChar}{logType}_{Date.Now:yyyyMMdd}.Log")
|
||||||
|
sw.WriteLine(logString.ToString())
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Console.WriteLine($"Uts WriteLog Error:{ex.Message}")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End SyncLock
|
||||||
|
End Sub
|
||||||
|
''' <summary>
|
||||||
|
''' 写日志
|
||||||
|
''' </summary>
|
||||||
|
Public Shared Sub WriteLog(type As LogTypes, ByVal msg As String)
|
||||||
|
WriteLog(type.ToString(), msg)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 日志类型
|
||||||
|
''' </summary>
|
||||||
|
Public Enum LogTypes
|
||||||
|
''' <summary>调试信息</summary>
|
||||||
|
Debug
|
||||||
|
|
||||||
|
''' <summary>系统运行信息</summary>
|
||||||
|
Info
|
||||||
|
|
||||||
|
''' <summary>警告信息</summary>
|
||||||
|
Warn
|
||||||
|
|
||||||
|
''' <summary>错误信息应该包含对象名、发生错误点所在的方法名称、具体错误信息</summary>
|
||||||
|
[Error]
|
||||||
|
|
||||||
|
''' <summary>致命信息</summary>
|
||||||
|
Fatal
|
||||||
|
End Enum
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
95
UTS_Core/DebugLog/ControlRecord.vb
Normal file
95
UTS_Core/DebugLog/ControlRecord.vb
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
Imports System.Windows.Forms
|
||||||
|
|
||||||
|
Namespace DebugLog
|
||||||
|
''' <summary>
|
||||||
|
''' 考虑修改为自定义控件
|
||||||
|
''' </summary>
|
||||||
|
Public Class ControlRecord
|
||||||
|
|
||||||
|
Sub New(recordControl As RichTextBox)
|
||||||
|
ShowRecord = True
|
||||||
|
SuspendLayout = False
|
||||||
|
MaxRecordCount = 512
|
||||||
|
RtxRecord = recordControl
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否在添加内容时先挂起布局
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Property SuspendLayout() As Boolean
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否添加记录到控件
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Property ShowRecord() As Boolean
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 控件记录最大行数
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Property MaxRecordCount() As Integer
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 需要被添加数据记录的控件句柄
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Property RtxRecord() As RichTextBox
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 清空内容
|
||||||
|
''' </summary>
|
||||||
|
Public Sub Clear()
|
||||||
|
If RtxRecord Is Nothing Then Return
|
||||||
|
RtxRecord.Clear()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub AppendRecord(logString As String)
|
||||||
|
If ShowRecord = False Then Return
|
||||||
|
If RtxRecord Is Nothing Then Return
|
||||||
|
|
||||||
|
If RtxRecord.InvokeRequired Then '判断是否需要开委托
|
||||||
|
RtxRecord.Invoke(New Action(Of String)(AddressOf AppendRecord), New Object() {logString})
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
With RtxRecord
|
||||||
|
If SuspendLayout Then
|
||||||
|
.SuspendLayout()
|
||||||
|
|
||||||
|
If .Lines.Length > MaxRecordCount Then '超过上限则移除最初行内容
|
||||||
|
.ReadOnly = False
|
||||||
|
.SelectionStart = 0
|
||||||
|
.SelectionLength = .GetFirstCharIndexFromLine(1)
|
||||||
|
.SelectedText = String.Empty
|
||||||
|
.ReadOnly = True
|
||||||
|
.SelectionStart = .TextLength
|
||||||
|
End If
|
||||||
|
|
||||||
|
.AppendText($"{Now:yyyy:MM:dd HH:mm:ss} - {logString}{vbNewLine}")
|
||||||
|
|
||||||
|
.ScrollToCaret()
|
||||||
|
|
||||||
|
.ResumeLayout(False)
|
||||||
|
Else
|
||||||
|
If .Lines.Length > MaxRecordCount Then '超过上限则移除最初行内容
|
||||||
|
.ReadOnly = False
|
||||||
|
.SelectionStart = 0
|
||||||
|
.SelectionLength = .GetFirstCharIndexFromLine(1)
|
||||||
|
.SelectedText = String.Empty
|
||||||
|
.ReadOnly = True
|
||||||
|
.SelectionStart = .TextLength
|
||||||
|
End If
|
||||||
|
|
||||||
|
.AppendText($"{Now:yyyy:MM:dd HH:mm:ss} - {logString}{vbNewLine}")
|
||||||
|
|
||||||
|
.ScrollToCaret()
|
||||||
|
|
||||||
|
End If
|
||||||
|
End With
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
94
UTS_Core/DebugLog/CsDataLog.vb
Normal file
94
UTS_Core/DebugLog/CsDataLog.vb
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
Imports System.IO
|
||||||
|
''' <summary>
|
||||||
|
''' 日志类
|
||||||
|
''' </summary>
|
||||||
|
Public NotInheritable Class CsDataLog
|
||||||
|
''' <summary>
|
||||||
|
''' 日志类型
|
||||||
|
''' </summary>
|
||||||
|
Public Enum LogType
|
||||||
|
''' <summary>堆栈跟踪信息</summary>
|
||||||
|
Trace
|
||||||
|
''' <summary>警告信息</summary>
|
||||||
|
Warning
|
||||||
|
''' <summary>错误信息应该包含对象名、发生错误点所在的方法名称、具体错误信息</summary>
|
||||||
|
[Error]
|
||||||
|
''' <summary>与数据库相关的信息</summary>
|
||||||
|
SQL
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>日志文件所在路径</summary>
|
||||||
|
Private Shared _logPath = String.Empty
|
||||||
|
|
||||||
|
''' <summary>日志前缀说明信息</summary>
|
||||||
|
Private Shared _logFilePrefix = String.Empty
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 保存日志的文件夹
|
||||||
|
''' </summary>
|
||||||
|
Public Shared Property LogPath As String
|
||||||
|
Get
|
||||||
|
|
||||||
|
If Equals(_logPath, String.Empty) Then
|
||||||
|
_logPath = Application.StartupPath
|
||||||
|
End If
|
||||||
|
Return _logPath
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As String)
|
||||||
|
_logPath = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 日志文件前缀
|
||||||
|
''' </summary>
|
||||||
|
Public Shared Property LogFilePrefix As String
|
||||||
|
Get
|
||||||
|
Return _logFilePrefix
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As String)
|
||||||
|
_logFilePrefix = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
'''
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="ex"></param>
|
||||||
|
Public Shared Sub WriteErrorLog(ex As Exception)
|
||||||
|
Dim msg As String = String.Empty
|
||||||
|
msg &= $"ErrorMessage:{ex.Message}{vbNewLine}"
|
||||||
|
msg &= $"ErrorTime:{Now}{vbNewLine}"
|
||||||
|
msg &= $"ErrorSource:{ex.Source}{vbNewLine}"
|
||||||
|
msg &= $"ErrorType:{ex.GetType}{vbNewLine}"
|
||||||
|
msg &= $"ErrorTargetSite:{ex.TargetSite}{vbNewLine}"
|
||||||
|
msg &= $"ErrorStackTrace:{ex.StackTrace}{vbNewLine}"
|
||||||
|
WriteLog(LogType.Error, msg)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 将信息入到日志
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="logType">日志类型</param>
|
||||||
|
''' <param name="msg">日志内容</param>
|
||||||
|
Public Shared Sub WriteLog(ByVal logType As String, ByVal msg As String)
|
||||||
|
Dim sw As StreamWriter = Nothing
|
||||||
|
Try
|
||||||
|
'同一天同一类日志以追加形式保存
|
||||||
|
sw = File.AppendText($"{LogPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log")
|
||||||
|
sw.WriteLine(logType & "#" & Date.Now.ToString("yyyy-MM-dd HH:mm:ss: ") & msg)
|
||||||
|
Catch
|
||||||
|
Finally
|
||||||
|
sw.Close()
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 写日志
|
||||||
|
''' </summary>
|
||||||
|
Public Shared Sub WriteLog(type As LogType, ByVal msg As String)
|
||||||
|
WriteLog(type.ToString(), msg)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
60
UTS_Core/DebugLog/CsDebugPrint.vb
Normal file
60
UTS_Core/DebugLog/CsDebugPrint.vb
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
Public NotInheritable Class CsDebugPrint
|
||||||
|
Enum EnDebugType
|
||||||
|
System
|
||||||
|
ComPort
|
||||||
|
Network
|
||||||
|
Ftp
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
''' <summary>是否需要打印调试信息</summary>
|
||||||
|
Public Shared Property IsDebug As Boolean = True
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="message">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(message As String)
|
||||||
|
If IsDebug Then
|
||||||
|
Console.WriteLine(message)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="type">打印信息类型</param>
|
||||||
|
''' <param name="msg">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(type As String, msg As String)
|
||||||
|
DebugPrint($"[{type}]{msg}")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="type">打印信息类型</param>
|
||||||
|
''' <param name="msg">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(type As EnDebugType, msg As String)
|
||||||
|
DebugPrint(type.ToString, msg)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="type">打印信息类型</param>
|
||||||
|
''' <param name="tip">需要打印信息的提示前缀</param>
|
||||||
|
''' <param name="msg">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(type As String, tip As String, msg As String)
|
||||||
|
DebugPrint(type, $"{tip}:{msg}")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="type">打印信息类型</param>
|
||||||
|
''' <param name="tip">需要打印信息的提示前缀</param>
|
||||||
|
''' <param name="msg">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(type As EnDebugType, tip As String, msg As String)
|
||||||
|
DebugPrint(type.ToString, $"{tip}:{msg}")
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
119
UTS_Core/DebugLog/DebugPrint.vb
Normal file
119
UTS_Core/DebugLog/DebugPrint.vb
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
Imports System.Text
|
||||||
|
|
||||||
|
Namespace DebugLog
|
||||||
|
Public Class DebugPrintClass
|
||||||
|
Enum DebugPrintType
|
||||||
|
System
|
||||||
|
Comport
|
||||||
|
Database
|
||||||
|
NetWork
|
||||||
|
Ftp
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 显示所有数据,优先度最高
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowAllData() As Boolean = True
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否显示系统信息
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowSystemData() As Byte = 1
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否显示串口信息
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowComportData() As Byte = 1
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否显示数据库信息
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowDatabaseData() As Byte = 1
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否显示网络信息
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowNetWorkData() As Byte = 1
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否显示Ftp信息
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowFtpData() As Byte = 1
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 显示信息的集合,对应数据位为1则打印,为0不打印
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowDataType() As Integer = ShowSystemData >> DebugPrintType.System Or
|
||||||
|
ShowComportData >> DebugPrintType.Comport Or
|
||||||
|
ShowDatabaseData >> DebugPrintType.Database Or
|
||||||
|
ShowNetWorkData >> DebugPrintType.NetWork Or
|
||||||
|
ShowFtpData >> DebugPrintType.Ftp
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否添加时间前缀
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowTime() As Boolean = True
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 是否显示与上包显示的间隔
|
||||||
|
''' </summary>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Shared Property ShowTimeSpan() As Boolean = True
|
||||||
|
|
||||||
|
|
||||||
|
Private Shared _lastShowTime As DateTime = Now
|
||||||
|
|
||||||
|
Private Shared _timeSpan As TimeSpan
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="printString">需要打印的信息</param>
|
||||||
|
Private Shared Sub DebugPrint(printString As String)
|
||||||
|
Console.WriteLine(printString)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="type">打印信息类型</param>
|
||||||
|
''' <param name="printString">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(type As DebugPrintType, printString As String)
|
||||||
|
If ShowAllData = False Then Return
|
||||||
|
If ((ShowDataType >> type) And 1) = 0 Then Return
|
||||||
|
|
||||||
|
_timeSpan = Now - _lastShowTime
|
||||||
|
_lastShowTime = Now
|
||||||
|
|
||||||
|
Dim msgBuilder As New StringBuilder
|
||||||
|
If ShowTime Then msgBuilder.Append($"{Now:yyyy-MM-dd HH:mm:ss} - ")
|
||||||
|
If ShowTimeSpan Then msgBuilder.Append($"{_timeSpan.TotalMilliseconds,8} - ")
|
||||||
|
msgBuilder.Append($"{type} - ")
|
||||||
|
msgBuilder.Append($"{printString}")
|
||||||
|
|
||||||
|
DebugPrint(msgBuilder.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 打印调试信息
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="type">打印信息类型</param>
|
||||||
|
''' <param name="tip">需要打印信息的提示前缀</param>
|
||||||
|
''' <param name="printString">需要打印的信息</param>
|
||||||
|
Public Shared Sub DebugPrint(type As DebugPrintType, tip As String, printString As String)
|
||||||
|
DebugPrint(type, $"{tip}:{printString}")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
Imports UTS_Core.UTSModule.Station
|
||||||
|
|
||||||
|
Public Class GridControlNodeAddCommand : Implements ICommand
|
||||||
|
Private ReadOnly grd As StationPlanGrid
|
||||||
|
Private ReadOnly startMoveRow As Integer
|
||||||
|
Private ReadOnly nodes As List(Of RowNode)
|
||||||
|
|
||||||
|
Sub New(grd As StationPlanGrid, startMoveRow As Integer, nodes As List(Of RowNode))
|
||||||
|
Me.grd = grd
|
||||||
|
Me.startMoveRow = startMoveRow
|
||||||
|
Me.nodes = nodes
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Redo() Implements ICommand.Redo
|
||||||
|
grd.NodeAddChildCommand(startMoveRow, nodes)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Undo() Implements ICommand.Undo
|
||||||
|
grd.NodeDeleteChildCommand(startMoveRow, nodes)
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
Imports UTS_Core.UTSModule.Station
|
||||||
|
|
||||||
|
Public Class GridControlNodeDeleteCommand : Implements ICommand
|
||||||
|
Private ReadOnly grd As StationPlanGrid
|
||||||
|
Private ReadOnly startMoveRow As Integer
|
||||||
|
Private ReadOnly nodes As List(Of RowNode)
|
||||||
|
|
||||||
|
Sub New(grd As StationPlanGrid, startMoveRow As Integer, nodes As List(Of RowNode))
|
||||||
|
Me.grd = grd
|
||||||
|
Me.startMoveRow = startMoveRow
|
||||||
|
Me.nodes = nodes
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Redo() Implements ICommand.Redo
|
||||||
|
grd.NodeDeleteChildCommand(startMoveRow, nodes)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Undo() Implements ICommand.Undo
|
||||||
|
grd.NodeAddChildCommand(startMoveRow, nodes)
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
Imports System.Drawing
|
Imports System.Drawing
|
||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports FlexCell
|
Imports FlexCell
|
||||||
|
Imports FluentFTP
|
||||||
|
Imports Mysqlx.XDevAPI.Relational
|
||||||
Imports UTS_Core.UTSModule.Production
|
Imports UTS_Core.UTSModule.Production
|
||||||
Imports UTS_Core.UTSModule.Test.Command
|
Imports UTS_Core.UTSModule.Test.Command
|
||||||
Imports UTS_Core.UTSModule.Test.StatusMonitor
|
Imports UTS_Core.UTSModule.Test.StatusMonitor
|
||||||
@@ -487,17 +489,20 @@ Namespace UTSModule.Station
|
|||||||
Dim tmpCurrRowIdx As Integer = startRowIdx
|
Dim tmpCurrRowIdx As Integer = startRowIdx
|
||||||
Dim tmpCurrRowNodeLevel As Integer = GetRowNodeLevel(grd, tmpCurrRowIdx)
|
Dim tmpCurrRowNodeLevel As Integer = GetRowNodeLevel(grd, tmpCurrRowIdx)
|
||||||
'判断当前行Row type = 1,记录下本行的NodeLevel = tempNodeLevel,记录NodeLstIndx
|
'判断当前行Row type = 1,记录下本行的NodeLevel = tempNodeLevel,记录NodeLstIndx
|
||||||
If rowType = RowNode.RowTypeEnum.Module Then
|
|
||||||
'从起始行开始往下遍历
|
Dim node As RowNode = _headNode.RowList(startRowIdx - _drawStartRow + 1)
|
||||||
Do
|
If rowType = RowNode.RowTypeEnum.Module OrElse rowType = RowNode.RowTypeEnum.Control Then
|
||||||
If tmpCurrRowIdx < Grid.Rows Then '遍历到最大行还未结束
|
''从起始行开始往下遍历
|
||||||
tmpCurrRowIdx = tmpCurrRowIdx + 1
|
'Do
|
||||||
tmpCurrRowNodeLevel = GetRowNodeLevel(grd, tmpCurrRowIdx)
|
' If tmpCurrRowIdx < Grid.Rows Then '遍历到最大行还未结束
|
||||||
Else
|
' tmpCurrRowIdx = tmpCurrRowIdx + 1
|
||||||
Return
|
' tmpCurrRowNodeLevel = GetRowNodeLevel(grd, tmpCurrRowIdx)
|
||||||
End If
|
' Else
|
||||||
Loop Until tmpCurrRowNodeLevel <= startRowNodeLevel Or tmpCurrRowIdx >= Grid.Rows '再次遍历到与起始行同级或更高级别的行,就算是该节点遍历结束
|
' Return
|
||||||
endRowNodeIdx = tmpCurrRowIdx - 1
|
' End If
|
||||||
|
'Loop Until tmpCurrRowNodeLevel <= startRowNodeLevel Or tmpCurrRowIdx >= Grid.Rows '再次遍历到与起始行同级或更高级别的行,就算是该节点遍历结束
|
||||||
|
'endRowNodeIdx = tmpCurrRowIdx - 1
|
||||||
|
endRowNodeIdx = startRowIdx + node.AllChildCount
|
||||||
|
|
||||||
'底色着色
|
'底色着色
|
||||||
LockGridAutoRedraw()
|
LockGridAutoRedraw()
|
||||||
@@ -681,6 +686,8 @@ Namespace UTSModule.Station
|
|||||||
_grd.Cell(gMouseOldRow, gMouseOldCol).FontBold = False
|
_grd.Cell(gMouseOldRow, gMouseOldCol).FontBold = False
|
||||||
If gOldRowType = RowNode.RowTypeEnum.Module Then '光标离开Module节点
|
If gOldRowType = RowNode.RowTypeEnum.Module Then '光标离开Module节点
|
||||||
Mouse_MoveOnNode_BackColorRepain(_grd, gOldRowType, gMouseOldRow, Color.White)
|
Mouse_MoveOnNode_BackColorRepain(_grd, gOldRowType, gMouseOldRow, Color.White)
|
||||||
|
ElseIf gOldRowType = RowNode.RowTypeEnum.Control Then '光标离开Module节点
|
||||||
|
Mouse_MoveOnNode_BackColorRepain(_grd, gOldRowType, gMouseOldRow, Color.White)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
gMouseOldRow = tmpMouseRow
|
gMouseOldRow = tmpMouseRow
|
||||||
@@ -691,6 +698,8 @@ Namespace UTSModule.Station
|
|||||||
_grd.Cell(tmpMouseRow, tmpMouseCol).FontBold = True
|
_grd.Cell(tmpMouseRow, tmpMouseCol).FontBold = True
|
||||||
If gRowType = RowNode.RowTypeEnum.Module Then '光标移动到module节点
|
If gRowType = RowNode.RowTypeEnum.Module Then '光标移动到module节点
|
||||||
Mouse_MoveOnNode_BackColorRepain(_grd, gRowType, tmpMouseRow, Color.FromArgb(40, Color.LemonChiffon))
|
Mouse_MoveOnNode_BackColorRepain(_grd, gRowType, tmpMouseRow, Color.FromArgb(40, Color.LemonChiffon))
|
||||||
|
ElseIf gRowType = RowNode.RowTypeEnum.Control Then
|
||||||
|
Mouse_MoveOnNode_BackColorRepain(_grd, gRowType, tmpMouseRow, Color.FromArgb(40, Color.LemonChiffon))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -701,6 +710,10 @@ Namespace UTSModule.Station
|
|||||||
gIsGri_MouseMove_EventReady = True
|
gIsGri_MouseMove_EventReady = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' 获取指定行的NodeIndex
|
''' 获取指定行的NodeIndex
|
||||||
''' </summary>
|
''' </summary>
|
||||||
@@ -845,7 +858,7 @@ Namespace UTSModule.Station
|
|||||||
.Column(ColNames.Pause).Width = 20
|
.Column(ColNames.Pause).Width = 20
|
||||||
.Column(ColNames.Action).Width = 20
|
.Column(ColNames.Action).Width = 20
|
||||||
.Column(ColNames.Description).Width = 200
|
.Column(ColNames.Description).Width = 200
|
||||||
.Column(ColNames.ControlType).Width = 50
|
.Column(ColNames.ControlType).Width = 80
|
||||||
.Column(ColNames.CommandType).Width = 80
|
.Column(ColNames.CommandType).Width = 80
|
||||||
.Column(ColNames.Command).Width = 120
|
.Column(ColNames.Command).Width = 120
|
||||||
.Column(ColNames.Parameters).Width = 340
|
.Column(ColNames.Parameters).Width = 340
|
||||||
@@ -1185,8 +1198,51 @@ Namespace UTSModule.Station
|
|||||||
node.ControlType = _grd.Cell(e.Row, e.Col).Text
|
node.ControlType = _grd.Cell(e.Row, e.Col).Text
|
||||||
If String.IsNullOrWhiteSpace(node.ControlType) Then
|
If String.IsNullOrWhiteSpace(node.ControlType) Then
|
||||||
node.RowType = RowNode.RowTypeEnum.Flow
|
node.RowType = RowNode.RowTypeEnum.Flow
|
||||||
|
|
||||||
|
Dim cmd As New GridControlNodeDeleteCommand(Me, e.Row, node.Children)
|
||||||
|
CommandManager.RunCommand(cmd) '添加到撤销堆栈执行
|
||||||
|
RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||||
|
'clear
|
||||||
Else
|
Else
|
||||||
node.RowType = RowNode.RowTypeEnum.Control
|
node.RowType = RowNode.RowTypeEnum.Control
|
||||||
|
Dim nodes As New List(Of RowNode)
|
||||||
|
Dim tmpNode As New RowNode
|
||||||
|
If node.ControlType = "If" Then
|
||||||
|
tmpNode.RowType = RowNode.RowTypeEnum.Control
|
||||||
|
tmpNode.ControlType = "Then"
|
||||||
|
tmpNode.AddNode(New RowNode)
|
||||||
|
tmpNode.AddNode(New RowNode)
|
||||||
|
nodes.Add(tmpNode)
|
||||||
|
nodes.Add(New RowNode) '添加空行
|
||||||
|
|
||||||
|
tmpNode = New RowNode
|
||||||
|
tmpNode.RowType = RowNode.RowTypeEnum.Control
|
||||||
|
tmpNode.ControlType = "ElseIf"
|
||||||
|
tmpNode.AddNode(New RowNode)
|
||||||
|
tmpNode.AddNode(New RowNode)
|
||||||
|
nodes.Add(tmpNode)
|
||||||
|
nodes.Add(New RowNode) '添加空行
|
||||||
|
|
||||||
|
tmpNode = New RowNode
|
||||||
|
tmpNode.RowType = RowNode.RowTypeEnum.Control
|
||||||
|
tmpNode.ControlType = "Else"
|
||||||
|
tmpNode.AddNode(New RowNode)
|
||||||
|
tmpNode.AddNode(New RowNode)
|
||||||
|
nodes.Add(tmpNode)
|
||||||
|
nodes.Add(New RowNode) '添加空行
|
||||||
|
|
||||||
|
Dim cmd As New GridControlNodeAddCommand(Me, e.Row, nodes)
|
||||||
|
CommandManager.RunCommand(cmd) '添加到撤销堆栈执行
|
||||||
|
RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||||
|
ElseIf node.ControlType = "ElseIf" Then
|
||||||
|
nodes.Add(New RowNode)
|
||||||
|
nodes.Add(New RowNode)
|
||||||
|
|
||||||
|
Dim cmd As New GridControlNodeAddCommand(Me, e.Row, nodes)
|
||||||
|
CommandManager.RunCommand(cmd) '添加到撤销堆栈执行
|
||||||
|
RaiseEvent PlanGridCommandChanged(Nothing, Nothing)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ControlType
|
changeType = RowNodeChangedEventArgs.RowNodeChangeType.ControlType
|
||||||
|
|
||||||
@@ -1567,7 +1623,70 @@ Namespace UTSModule.Station
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 子级节点添加
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="startMoveRow"></param>
|
||||||
|
''' <param name="nodes"></param>
|
||||||
|
Friend Sub NodeAddChildCommand(startMoveRow As Integer, nodes As List(Of RowNode))
|
||||||
|
Dim node As RowNode
|
||||||
|
Dim startNode As RowNode = _headNode.RowList(startMoveRow - _drawStartRow + 1)
|
||||||
|
Dim grdNode As FlexCell.Node = _grd.Tree.FindNode(startMoveRow)
|
||||||
|
LockGridAutoRedraw()
|
||||||
|
_uploading = True
|
||||||
|
|
||||||
|
For i As Integer = 0 To nodes.Count - 1
|
||||||
|
'更新内存
|
||||||
|
node = nodes(i)
|
||||||
|
|
||||||
|
'在当前节点插入节点
|
||||||
|
startNode.AddNode(node)
|
||||||
|
|
||||||
|
'更新控件
|
||||||
|
grdNode.Nodes.Add("", "")
|
||||||
|
UpdateGrid(_grd, node.RowListIndex, node)
|
||||||
|
|
||||||
|
Dim pNode As FlexCell.Node = _grd.Tree.FindNode(node.RowListIndex)
|
||||||
|
AddGridTreeNode(pNode, node)
|
||||||
|
Next
|
||||||
|
|
||||||
|
_uploading = False
|
||||||
|
UnLockGridAutoRedraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub NodeDeleteChildCommand(startMoveRow As Integer, nodes As List(Of RowNode))
|
||||||
|
LockGridAutoRedraw()
|
||||||
|
_uploading = True
|
||||||
|
|
||||||
|
Dim node As RowNode
|
||||||
|
Dim grdNode As FlexCell.Node
|
||||||
|
For i As Integer = 0 To nodes.Count - 1
|
||||||
|
node = nodes(i) '前面节点已删除,所以每次都是固定位置
|
||||||
|
If node Is Nothing Then Exit For
|
||||||
|
|
||||||
|
'更新控件
|
||||||
|
grdNode = _grd.Tree.FindNode(node.RowListIndex)
|
||||||
|
grdNode.Remove()
|
||||||
|
|
||||||
|
'更新内存
|
||||||
|
If node.CanDelete = False Then Exit For
|
||||||
|
node.Remove()
|
||||||
|
|
||||||
|
'其他操作
|
||||||
|
StationEditStatusMonitor.StationEditStatus = StationEditStatusMonitor.StationEditStatusEnum.Changed
|
||||||
|
Next
|
||||||
|
|
||||||
|
_uploading = False
|
||||||
|
UnLockGridAutoRedraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' 同级节点添加
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="startMoveRow"></param>
|
||||||
|
''' <param name="rows"></param>
|
||||||
|
''' <param name="nodes"></param>
|
||||||
Friend Sub NodeAddCommand(startMoveRow As Integer, rows As Integer, Optional nodes As List(Of RowNode) = Nothing)
|
Friend Sub NodeAddCommand(startMoveRow As Integer, rows As Integer, Optional nodes As List(Of RowNode) = Nothing)
|
||||||
Dim node As RowNode
|
Dim node As RowNode
|
||||||
Dim startNode As RowNode = _headNode.RowList(startMoveRow - _drawStartRow + 1)
|
Dim startNode As RowNode = _headNode.RowList(startMoveRow - _drawStartRow + 1)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="TeeChart">
|
<Reference Include="TeeChart">
|
||||||
<HintPath>..\AUTS_Repair\bin\Debug\TeeChart.dll</HintPath>
|
<HintPath>..\DLL\TeeChart.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.26\lib\net48\Ubiety.Dns.Core.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.8.0.26\lib\net48\Ubiety.Dns.Core.dll</HintPath>
|
||||||
@@ -200,6 +200,8 @@
|
|||||||
<Compile Include="Security\Aes128.vb" />
|
<Compile Include="Security\Aes128.vb" />
|
||||||
<Compile Include="Security\MD5.vb" />
|
<Compile Include="Security\MD5.vb" />
|
||||||
<Compile Include="Serialize\Serializer.vb" />
|
<Compile Include="Serialize\Serializer.vb" />
|
||||||
|
<Compile Include="UTSModule\Station\GridNodeCommands\GridControlNodeDeleteCommand.vb" />
|
||||||
|
<Compile Include="UTSModule\Station\GridNodeCommands\GridControlNodeAddCommand.vb" />
|
||||||
<Compile Include="UTSModule\Station\GridNodeCommands\GridNodeAddCommand.vb" />
|
<Compile Include="UTSModule\Station\GridNodeCommands\GridNodeAddCommand.vb" />
|
||||||
<Compile Include="UTSModule\Station\GridNodeCommands\GridNodeCopyPasteCommand.vb" />
|
<Compile Include="UTSModule\Station\GridNodeCommands\GridNodeCopyPasteCommand.vb" />
|
||||||
<Compile Include="UTSModule\Station\GridNodeCommands\GridNodeCutPasteCommand.vb" />
|
<Compile Include="UTSModule\Station\GridNodeCommands\GridNodeCutPasteCommand.vb" />
|
||||||
|
|||||||
Reference in New Issue
Block a user