From 3d56954029cc249f0544dd531162f304e3daf740 Mon Sep 17 00:00:00 2001 From: Wen Momo Date: Thu, 3 Jul 2025 22:55:57 +0800 Subject: [PATCH] =?UTF-8?q?1,=20ServiceController=20=E4=B8=ADdbHost?= =?UTF-8?q?=E5=92=8CftpHost=E5=86=99=E5=85=A5=E6=B3=A8=E5=86=8C=E5=B9=B6?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E5=89=8D=E7=BD=AE=E5=88=B0lic=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E4=B9=8B=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2,Testplan隐藏行改为对高度设置来实现 --- AUTS_ServiceControler/FrmUpdateConfig.vb | 18 ++++-- AUTS_Studio/AUTS_Studio.vbproj | 7 ++- .../Station/FrmStationPlan.Designer.vb | 11 ++-- UTS_Core/UTSModule/Station/StationPlanGrid.vb | 61 +++++++++++++------ UTS_Core/UTSModule/UtsDb.vb | 2 +- 5 files changed, 68 insertions(+), 31 deletions(-) diff --git a/AUTS_ServiceControler/FrmUpdateConfig.vb b/AUTS_ServiceControler/FrmUpdateConfig.vb index 49f8446..cd14be9 100644 --- a/AUTS_ServiceControler/FrmUpdateConfig.vb +++ b/AUTS_ServiceControler/FrmUpdateConfig.vb @@ -2,6 +2,7 @@ Imports System.Net Imports System.Net.Sockets Imports System.Text +Imports FluentFTP Imports UTS_Core.Database Imports UTS_Core.Security Imports UTS_Core.UTSModule @@ -370,14 +371,15 @@ Public Class FrmUpdateConfig ''' 获取更新服务的最新信息 ''' Private Function GetUpdateServiceInfo(serviceName As String) As UpdatePackageInfo - + MsgBox("DbConnector.CanConnectToRemote = " & DbConnector.CanConnectToRemote) If DbConnector.CanConnectToRemote = False Then '判断网络连接状态 Throw New Exception($"无法连接到数据库!") End If Using db As New DbExecutor(UtsDb.RemoteDbType, UtsDb.RemoteConnString) + MsgBox("DBOpen = " & UtsDb.RemoteDbType & " , " & UtsDb.RemoteConnString) db.Open() - + MsgBox("DBOpened") Dim tableName As String = $"{SwUpdateTable.TableName}" Dim colNames As New List(Of String) From { $"{SwUpdateTable.ColNamesEnum.LastVersion}", @@ -386,16 +388,18 @@ Public Class FrmUpdateConfig } Dim condition As String = $"`{SwUpdateTable.ColNamesEnum.SoftwareName}` = '{serviceName}'" + MsgBox("dtServiceInfo = " & condition) Dim dtServiceInfo As DataTable = db.ExecuteDataTable(db.CmdHelper.DbSearch(UtsDb.RemotePublicDb, colNames, tableName, condition)) If dtServiceInfo.Rows.Count <= 0 Then Throw New Exception($"从数据库获取不到{serviceName}的信息!") End If + MsgBox("Step369") Dim packetInfo As New UpdatePackageInfo packetInfo.BinPackageMd5 = CStr(dtServiceInfo(0)($"{SwUpdateTable.ColNamesEnum.BinPackageMd5}")) packetInfo.LastVersion = CStr(dtServiceInfo(0)($"{SwUpdateTable.ColNamesEnum.LastVersion}")) packetInfo.PackageName = CStr(dtServiceInfo(0)($"{SwUpdateTable.ColNamesEnum.PackageName}")) - + MsgBox("Step401") db.Close() Return packetInfo End Using @@ -517,7 +521,6 @@ Public Class FrmUpdateConfig 'If GetUtsHost() = False Then Return '根据License信息,获取服务器地址 - '校验License UpdateInstallTip(20, "Begin CheckLicense...") _license = New License(_destLicenseFilePath) @@ -526,12 +529,17 @@ Public Class FrmUpdateConfig UpdateInstallTip(25, "CheckLicense Success!") - _ftpClient = New FtpService(UtsRegistry.FtpHost, CInt(_license.FtpPort), _license.FtpUser, _license.FtpPwd) + UtsRegistry.FtpHost = _license.FtpHost '写入注册表 + UtsRegistry.DbHost = _license.MysqlServer '写入注册表 + + + _ftpClient = New FtpService(_license.FtpHost, CInt(_license.FtpPort), _license.FtpUser, _license.FtpPwd) '获取远程数据库内容 Dim packetInfo As UpdatePackageInfo = GetUpdateServiceInfo(UpdateServiceName) '检测服务存在 + If WinService.ServicesExists(UpdateServiceName) Then 'Dim updateSerVer As String = UtsRegistry.UpdateServiceVersion 'If NeedToUpdateService(updateSerVer, packetInfo.LastVersion) = False Then diff --git a/AUTS_Studio/AUTS_Studio.vbproj b/AUTS_Studio/AUTS_Studio.vbproj index 4134263..8dd06c3 100644 --- a/AUTS_Studio/AUTS_Studio.vbproj +++ b/AUTS_Studio/AUTS_Studio.vbproj @@ -131,7 +131,12 @@ - + + + {33c6456c-f00d-41ac-a6fb-db0601495c6a} + UTS_Core + + diff --git a/UTS_Core/UTSModule/Station/FrmStationPlan.Designer.vb b/UTS_Core/UTSModule/Station/FrmStationPlan.Designer.vb index 329e4fe..a5c3a83 100644 --- a/UTS_Core/UTSModule/Station/FrmStationPlan.Designer.vb +++ b/UTS_Core/UTSModule/Station/FrmStationPlan.Designer.vb @@ -419,6 +419,7 @@ Namespace UTSModule.Station 'SplPlanDesign ' Me.SplPlanDesign.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplPlanDesign.FixedPanel = System.Windows.Forms.FixedPanel.Panel2 Me.SplPlanDesign.Location = New System.Drawing.Point(0, 0) Me.SplPlanDesign.Margin = New System.Windows.Forms.Padding(4) Me.SplPlanDesign.Name = "SplPlanDesign" @@ -691,7 +692,7 @@ Namespace UTSModule.Station ' Me.SplitContainer1.Panel2.Controls.Add(Me.RtxColTip) Me.SplitContainer1.Size = New System.Drawing.Size(446, 497) - Me.SplitContainer1.SplitterDistance = 409 + Me.SplitContainer1.SplitterDistance = 407 Me.SplitContainer1.SplitterWidth = 6 Me.SplitContainer1.TabIndex = 1 ' @@ -706,7 +707,7 @@ Namespace UTSModule.Station Me.GrdRowNode.Margin = New System.Windows.Forms.Padding(4) Me.GrdRowNode.MouseWheelSpeed = CType(3, Short) Me.GrdRowNode.Name = "GrdRowNode" - Me.GrdRowNode.Size = New System.Drawing.Size(446, 409) + Me.GrdRowNode.Size = New System.Drawing.Size(446, 407) Me.GrdRowNode.TabIndex = 0 ' 'RtxColTip @@ -717,7 +718,7 @@ Namespace UTSModule.Station Me.RtxColTip.Location = New System.Drawing.Point(0, 0) Me.RtxColTip.Margin = New System.Windows.Forms.Padding(4) Me.RtxColTip.Name = "RtxColTip" - Me.RtxColTip.Size = New System.Drawing.Size(446, 82) + Me.RtxColTip.Size = New System.Drawing.Size(446, 84) Me.RtxColTip.TabIndex = 0 Me.RtxColTip.Text = "" ' @@ -782,8 +783,8 @@ Namespace UTSModule.Station Me.Text = "Form1" Me.ToolStrip1.ResumeLayout(False) Me.ToolStrip1.PerformLayout() - Me.StuMain.ResumeLayout(false) - Me.StuMain.PerformLayout + Me.StuMain.ResumeLayout(False) + Me.StuMain.PerformLayout Me.SplStationPlan.Panel1.ResumeLayout(false) Me.SplStationPlan.Panel2.ResumeLayout(false) CType(Me.SplStationPlan,System.ComponentModel.ISupportInitialize).EndInit diff --git a/UTS_Core/UTSModule/Station/StationPlanGrid.vb b/UTS_Core/UTSModule/Station/StationPlanGrid.vb index 66df7ae..546418c 100644 --- a/UTS_Core/UTSModule/Station/StationPlanGrid.vb +++ b/UTS_Core/UTSModule/Station/StationPlanGrid.vb @@ -1412,19 +1412,22 @@ Namespace UTSModule.Station For i As Integer = 0 To _headNode.RowList.Count - 1 If _headNode.RowList(i).RowType = RowNode.RowTypeEnum.FixedModule Then - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) ElseIf _headNode.RowList(i).RowType = RowNode.RowTypeEnum.Module Then If action = False Then - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) Else If _headNode.RowList(i).Action Then - _grd.Row(i).Visible = True + ' _grd.Row(i).Visible = True + SetRowVisible(i, True) Else - _grd.Row(i).Visible = False - + ' _grd.Row(i).Visible = False + SetRowVisible(i, False) For j As Integer = 1 To _headNode.RowList(i).AllChildCount - - _grd.Row(i + j).Visible = False + '_grd.Row(i + j).Visible = False + SetRowVisible(i + j, False) Next i += _headNode.RowList(i).AllChildCount @@ -1433,12 +1436,15 @@ Namespace UTSModule.Station Else If action Then If _headNode.RowList(i).Action Then - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) Else - _grd.Row(i).Visible = False + '_grd.Row(i).Visible = False + SetRowVisible(i, False) End If Else - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) End If End If Next @@ -1446,6 +1452,14 @@ Namespace UTSModule.Station UnLockGridAutoRedraw() End Sub + Public Sub SetRowVisible(row As Integer, visible As Boolean) + If visible Then + _grd.Row(row).Height = _grd.Row(0).Height + Else + _grd.Row(row).Height = 0 + End If + End Sub + Public Sub SetNodeRecordShowMode(recode As Boolean) If _headNode Is Nothing Then Return @@ -1454,18 +1468,23 @@ Namespace UTSModule.Station For i As Integer = 0 To _headNode.RowList.Count - 1 If _headNode.RowList(i).RowType = RowNode.RowTypeEnum.FixedModule Then - _grd.Row(i).Visible = True + ' _grd.Row(i).Visible = True + SetRowVisible(i, True) ElseIf _headNode.RowList(i).RowType = RowNode.RowTypeEnum.Module Then - _grd.Row(i).Visible = Not recode + '_grd.Row(i).Visible = Not recode + SetRowVisible(i, Not recode) Else If recode Then If _headNode.RowList(i).SaveToDb Then - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) Else - _grd.Row(i).Visible = False + '_grd.Row(i).Visible = False + SetRowVisible(i, False) End If Else - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) End If End If Next @@ -1481,20 +1500,24 @@ Namespace UTSModule.Station For i As Integer = 1 To _headNode.RowList.Count - 1 If _headNode.RowList(i).RowType = RowNode.RowTypeEnum.FixedModule Then - _grd.Row(i).Visible = True + ' _grd.Row(i).Visible = True + SetRowVisible(i, True) ElseIf _headNode.RowList(i).RowType = RowNode.RowTypeEnum.Module Then _headNode.RowList(i).Expanded = expand For Each node As RowNode In _headNode.RowList(i).Children - _grd.Row(node.RowListIndex).Visible = expand + '_grd.Row(node.RowListIndex).Visible = expand + SetRowVisible(node.RowListIndex, expand) Next Else If expand Then - _grd.Row(i).Visible = True + '_grd.Row(i).Visible = True + SetRowVisible(i, True) Else If String.IsNullOrEmpty(_headNode.RowList(i).Description) Then - _grd.Row(i).Visible = expand + '_grd.Row(i).Visible = expand + SetRowVisible(i, expand) End If End If End If diff --git a/UTS_Core/UTSModule/UtsDb.vb b/UTS_Core/UTSModule/UtsDb.vb index b958411..2d280f5 100644 --- a/UTS_Core/UTSModule/UtsDb.vb +++ b/UTS_Core/UTSModule/UtsDb.vb @@ -10,7 +10,7 @@ Namespace UTSModule Public Shared Sub InitConnectParams(license As License.License) RemoteDbType = DbExecutor.DbTypeEnum.Mysql - _remoteConn.Add("Server", UtsRegistry.DbHost) '从注册表中获取 + _remoteConn.Add("Server", license.MysqlServer) '从注册表中获取 _remoteConn.Add("Port", license.MysqlPort) _remoteConn.Add("User id", license.MysqlUserID) _remoteConn.Add("Password", license.MysqlPassword)