方案生成字节数据修改
This commit is contained in:
@@ -108,6 +108,8 @@ class updata_dlg(QWidget):
|
||||
end_signal = pyqtSignal([str,bool,str])
|
||||
# 数据库下载文件结束信号
|
||||
sql_download_end_signal =pyqtSignal([])
|
||||
# 扫描从机结束信号
|
||||
scan_slave_end_signal=pyqtSignal([list])
|
||||
|
||||
def __init__(self):
|
||||
QWidget.__init__(self)
|
||||
@@ -143,6 +145,7 @@ class updata_dlg(QWidget):
|
||||
self.infotext_init()
|
||||
self.widget.destroyed.connect(self.quit)
|
||||
self.sql_download_end_signal.connect(self.scan_file)
|
||||
self.scan_slave_end_signal.connect(self.scan_slave_end_slot)
|
||||
|
||||
Logo = QPixmap()
|
||||
Logo.loadFromData(base64.b64decode(memory_pic.icon_ico))
|
||||
@@ -710,14 +713,22 @@ class updata_dlg(QWidget):
|
||||
# 扫描从机
|
||||
def scan_slave(self):
|
||||
self.set_infotext("正在刷新主板IP地址")
|
||||
u=udp.myudp(1,255)
|
||||
ip_prefix=self.ip_prefix.text()
|
||||
t=threading.Thread(target=self.scan_slave_thread, args=(ip_prefix,))
|
||||
t.start()
|
||||
def scan_slave_thread(self,ip_prefix:str):
|
||||
u=udp.myudp(1,255)
|
||||
u.find(ip_prefix)
|
||||
self.scan_slave_end_signal.emit(u.dst_ip_list)
|
||||
|
||||
def scan_slave_end_slot(self,ips:list):
|
||||
list_str=[]
|
||||
for i in u.dst_ip_list:
|
||||
for i in ips:
|
||||
list_str.append(i[0]+','+i[1])
|
||||
if(len(list_str)==0):
|
||||
self.set_infotext("未找到主板IP地址,请确保主板已正常连接并运行")
|
||||
else:
|
||||
self.set_infotext("找到 {d} 个设备ip地址".format(d=len(ips)))
|
||||
self.slave_list.addItems(list_str)
|
||||
|
||||
# 添加单个从机地址
|
||||
|
Reference in New Issue
Block a user