@@ -110,7 +110,7 @@ class updata_dlg(QObject):
QObject . __init__ ( self )
self . app = QApplication ( sys . argv )
self . widget = QWidget ( )
self . widget . resize ( 82 0 , 410 )
self . widget . resize ( 87 0 , 410 )
self . widget . setWindowTitle ( " 批检仪程序升级 " )
self . widget . setWindowFlags ( Qt . WindowType . WindowStaysOnTopHint )
self . addrs = " "
@@ -189,9 +189,9 @@ class updata_dlg(QObject):
def hand_but_init ( self ) :
self . hand_but = QPushButton ( self . widget )
self . hand_but . setObjectName ( u " hand_but " )
self . hand_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . hand_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . hand_but . setText ( " 手动添加IP " )
self . hand_but . setText ( " 手动添加IP到列表 " )
self . hand_but . clicked . connect ( self . hand_but_clicked )
self . hand_but . setToolTip ( " 请先在[手动添加IP地址]输入框中输入要添加的地址,然后点击此按钮添加到设备列表中。 " )
# self.hand_but.setToolTipDuration(1)
@@ -200,9 +200,9 @@ class updata_dlg(QObject):
def save_but_init ( self ) :
self . save_but = QPushButton ( self . widget )
self . save_but . setObjectName ( u " save_but " )
self . save_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . save_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . save_but . setText ( " 发送文件 " )
self . save_but . setText ( " 发送文件到主板 " )
self . save_but . clicked . connect ( self . save_but_clicked )
self . save_but . setToolTip ( " 请先选中要升级的主板和文件,然后点击此按钮发送到设备中。 " )
# self.save_but.setToolTipDuration(1)
@@ -211,7 +211,7 @@ class updata_dlg(QObject):
def dhcp_but_init ( self ) :
self . dhcp_but = QPushButton ( self . widget )
self . dhcp_but . setObjectName ( u " dhcp_but " )
self . dhcp_but . setGeometry ( QRect ( 70 0 , 60 , 93 , 28 ) )
self . dhcp_but . setGeometry ( QRect ( 75 0 , 60 , 93 , 28 ) )
self . dhcp_but . setText ( " 打开DHCP " )
self . dhcp_but . clicked . connect ( self . dhcp_but_clicked )
self . dhcp_but . setToolTip ( " 如果没有搜索到从机, 则打开DHCP服务器。 " )
@@ -220,7 +220,7 @@ class updata_dlg(QObject):
def console_but_init ( self ) :
self . console_but = QPushButton ( self . widget )
self . console_but . setObjectName ( u " console_but " )
self . console_but . setGeometry ( QRect ( 70 0 , 100 , 93 , 28 ) )
self . console_but . setGeometry ( QRect ( 75 0 , 100 , 93 , 28 ) )
self . console_but . setText ( " 串口控制台 " )
self . console_but . clicked . connect ( self . console_but_clicked )
self . console_but . setToolTip ( " 通过设备的串口控制台升级程序, 这种方式需要使用到U盘。 " )
@@ -229,7 +229,7 @@ class updata_dlg(QObject):
def settime_but_init ( self ) :
self . settime_but = QPushButton ( self . widget )
self . settime_but . setObjectName ( u " settime_but " )
self . settime_but . setGeometry ( QRect ( 70 0 , 140 , 93 , 28 ) )
self . settime_but . setGeometry ( QRect ( 75 0 , 140 , 93 , 28 ) )
self . settime_but . setText ( " 同步时间 " )
self . settime_but . clicked . connect ( self . settime_but_clicked )
self . settime_but . setToolTip ( " 同步主板时间。 " )
@@ -238,8 +238,8 @@ class updata_dlg(QObject):
def restart_but_init ( self ) :
self . restart_but = QPushButton ( self . widget )
self . restart_but . setObjectName ( u " restart_but " )
self . restart_but . setGeometry ( QRect ( 700 , 180 , 93 , 28 ) )
self . restart_but . setText ( " 重启软件 " )
self . restart_but . setGeometry ( QRect ( 700 , 180 , 150 , 28 ) )
self . restart_but . setText ( " 重启主板 软件 " )
self . restart_but . clicked . connect ( self . restart_but_clicked )
self . restart_but . setToolTip ( " 如果已知设备ip地址, 但刷新不出, 可尝试重启设备软件。 " )
@@ -247,18 +247,18 @@ class updata_dlg(QObject):
def cmd_but_init ( self ) :
self . cmd_but = QPushButton ( self . widget )
self . cmd_but . setObjectName ( u " save_but " )
self . cmd_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . cmd_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . cmd_but . setText ( " 升级MCU " )
self . cmd_but . setText ( " 升级小板程序 " )
self . cmd_but . clicked . connect ( self . cmd_but_clicked )
self . cmd_but . setToolTip ( " 请先将要升级的MCU 程序发送到主板中,然后点击此按钮开始升级MCU 程序。 " )
self . cmd_but . setToolTip ( " 请先将要升级的小板 程序发送到主板中,然后点击此按钮开始升级小板 程序。 " )
# self.cmd_but.setToolTipDuration(1)
# 初始化刷新按钮
def refresh_but_init ( self ) :
self . refresh_but = QPushButton ( self . widget )
self . refresh_but . setObjectName ( u " save_but " )
self . refresh_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . refresh_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . refresh_but . setText ( " 刷新IP地址 " )
self . refresh_but . clicked . connect ( self . refresh_but_clicked )
@@ -269,20 +269,21 @@ class updata_dlg(QObject):
def sstate_but_init ( self ) :
self . sstate_but = QPushButton ( self . widget )
self . sstate_but . setObjectName ( u " sstate_but " )
self . sstate_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . sstate_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . sstate_but . setText ( " MCU 在线状态" )
self . sstate_but . setText ( " 小板 在线状态" )
self . sstate_but . clicked . connect ( self . sstate_but_clicked )
self . sstate_but . setToolTip ( " 点击此按钮查看小板在线情况,显示在线小板的地址。 " )
self . sstate_but . setEnabled ( False )
# self.sstate_but.setToolTipDuration(1)
# 初始化添加文件按钮
def addfile_but_init ( self ) :
self . addfile_but = QPushButton ( self . widget )
self . addfile_but . setObjectName ( u " addfile_but " )
self . addfile_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . addfile_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . addfile_but . setText ( " 添加文件 " )
self . addfile_but . setText ( " 添加外部文件到列表 " )
self . addfile_but . clicked . connect ( self . addfile_but_clicked )
self . addfile_but . setToolTip ( " 如果文件列表中不存在要升级的文件,点击此按钮从外部添加。 " )
# self.addfile_but.setToolTipDuration(1)
@@ -291,9 +292,9 @@ class updata_dlg(QObject):
def scheme_but_init ( self ) :
self . scheme_but = QPushButton ( self . widget )
self . scheme_but . setObjectName ( u " scheme_but " )
self . scheme_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . scheme_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . scheme_but . setText ( " 升级方案 " )
self . scheme_but . setText ( " 升级方案到小板 " )
self . scheme_but . clicked . connect ( self . scheme_but_clicked )
self . scheme_but . setToolTip ( " 请先将要升级的方案文件发送到主板中, 然后点击此按钮开始升级方案到MCU。 " )
# self.addfile_but.setToolTipDuration(1)
@@ -302,9 +303,9 @@ class updata_dlg(QObject):
def download_but_init ( self ) :
self . download_but = QPushButton ( self . widget )
self . download_but . setObjectName ( u " download_but " )
self . download_but . setGeometry ( QRect ( 590 , self . but_y , 93 , 28 ) )
self . download_but . setGeometry ( QRect ( 590 , self . but_y , 150 , 28 ) )
self . but_y + = self . but_y_step
self . download_but . setText ( " 下载文件 " )
self . download_but . setText ( " 从服务器 下载文件" )
self . download_but . clicked . connect ( self . download_but_clicked )
# ip前缀