Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thông minh sử dụng giao thức mqtt trên máy tính công nghiệp

113 16 0
Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thông minh sử dụng giao thức mqtt trên máy tính công nghiệp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI LUẬN VĂN THẠC SĨ Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thông minh sử dụng giao thức MQTT máy tính cơng nghiệp TRẦN VIỆT THẮNG Thang.TVCB180122@sis.hust.edu.vn Ngành: Kỹ thuật điều khiển tự động hóa Giảng viên hướng dẫn: TS Nguyễn Tùng Lâm Viện: Điện HÀ NỘI, 2020 TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI LUẬN VĂN THẠC SĨ Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thông minh sử dụng giao thức MQTT máy tính cơng nghiệp TRẦN VIỆT THẮNG Thang.TVCB180122@sis.hust.edu.vn Ngành: Kỹ thuật điều khiển tự động hóa Giảng viên hướng dẫn: TS Nguyễn Tùng Lâm Chữ ký GVHD Viện: Điện HÀ NỘI, 2020 CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM Độc lập – Tự – Hạnh phúc BẢN XÁC NHẬN CHỈNH SỬA LUẬN VĂN THẠC SĨ Họ tên tác giả luận văn: Trần Việt Thắng Đề tài luận văn: Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thơng minh sử dụng giao thức MQTT máy tính công nghiệp Chuyên ngành: Kỹ thuật điều khiển tự động hóa Mã số HV: CB180122 Tác giả, Người hướng dẫn khoa học Hội đồng chấm luận văn xác nhận tác giả sửa chữa, bổ sung luận văn theo biên họp Hội đồng ngày 30/10/2020 với nội dung sau: - Tổ chức xếp, rút gọn lại bố cục luận văn sửa số lỗi tả - Đưa lý chọn sở liệu hệ thống kho lưu trữ thông minh - Chỉnh sửa chương phần phụ lục phù hợp với nội dung luận văn Ngày tháng năm 2020 Giáo viên hướng dẫn Tác giả luận văn CHỦ TỊCH HỘI ĐỒNG ĐỀ TÀI LUẬN VĂN Họ tên giáo viên hướng dẫn chính: TS Nguyễn Tùng Lâm Cơ quan: Viện Điện - Trường Đại học Bách khoa Hà Nội Email: lam.nguyentung@hust.edu.vn ĐT: 0989 998 384 Nội dung: Đề tài chuyên ngành: Kỹ thuật Điều khiển Tự động hóa Tên đề tài: Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thông minh sử dụng giao thức MQTT máy tính cơng nghiệp LỜI CẢM ƠN Đầu tiên, tơi xin gửi lời cảm ơn chân thành đến thầy Nguyễn Tùng Lâm, thầy hướng dẫn tơi hồn thành chương trình thạc sĩ trường Đại học Bách Khoa Hà Nội Trong thời gian thực luận văn mình, tơi nhận giúp đỡ tận tình tập thể cán làm việc Viện Kỹ thuật điều khiển tự động hóa, Đại học Bách Khoa Hà Nội Viện tạo môi trường nghiên cứu chuyên nghiệp định hướng cho tơi hồn thành luận Qua tơi xin gửi lời cảm ơn sâu sắc đến thầy Nguyễn Quang Địch (viện trưởng Viện Kỹ thuật điều khiển tự động hóa) tồn thể cán làm việc Viện Hà Nội, ngày tháng năm 2020 Học viên Trần Việt Thắng MỤC LỤC LỜI NÓI ĐẦU CHƯƠNG 1: TỔNG QUAN VỀ HỆ THỐNG KHO LƯU TRỮ THÔNG MINH VÀ GIAO THỨC MQTT 1.1 Đặt vấn đề 1.2 Tổng quan hệ thống lưu trữ tài liệu 1.2.1 Tổng quan hệ thống lưu trữ tài liệu truyền thống 1.2.2 Tổng quan hệ thống lưu trữ tài liệu thông minh 1.2.3 Đánh giá 1.3 Tổng quan giao thức MQTT 1.3.1 Mơ hình MQTT 10 1.3.2 Các gói tin quan trọng giao thức MQTT 10 1.3.3 Ưu điểm giao thức MQTT 15 1.3.4 Đánh giá khả ứng dụng giao thức MQTT hệ thống kho lưu trữ thông minh 15 1.4 Tổng quan cấu trúc xây dựng hệ thống lưu trữ thông minh 16 1.4.1 Cấu trúc thiết kế cho hệ thống lưu trữ thông minh 16 1.4.2 Cấu trúc giao thức MQTT thiết kế hệ thống lưu trữ thông minh 19 1.5 Tổng kết chương 21 CHƯƠNG 2: CƠ SỞ THIẾT KẾ PHẦN MỀM ĐIỀU KHIỂN, GIÁM SÁT HỆ THỐNG KHO THÔNG MINH SỬ DỤNG GIAO THỨC MQTT TRÊN MÁY TÍNH CƠNG NGHIỆP 22 2.1 Đặt vấn đề 22 2.2 Giới thiệu máy tính cơng nghiệp IPC Advantech PPC-3100s 22 2.2.1 Máy tính cơng nghiệp IPC Advantech PPC-3100s 22 i 2.2.2 Kết nối máy tính công nghiệp IPC hệ thống kho lưu trữ thông minh 25 2.3 Cơ sở thiết kế phần mềm máy tính cơng nghiệp IPC 26 2.3.1 Hệ điều hành Ubuntu (Linux) 26 2.3.2 Hệ quản trị sở liệu 30 2.4 Cấu trúc phần mềm điều khiển, giám sát hệ thống kho lưu trữ thơng minh thiết kế máy tính công nghiệp IPC .32 2.5 Tổng kết chương 33 CHƯƠNG 3: CẤU HÌNH SERVER MQTT TRÊN MÁY TÍNH CƠNG NGHIỆP .34 3.1 Cài đặt MQTT Broker máy tính cơng nghiệp 34 3.1.1 Giới thiệu Mosquito mã nguồn mở .34 3.1.2 Cài đặt mosquitto .35 3.2 Cấu hình MQTT Broker máy tính cơng nghiệp .35 3.2.1 Cơ sở xây dựng cấu hình MQTT Broker 35 3.2.2 Cấu hình mosquitto broker 38 3.2.3 Cài đặt phân quyền truy cập topic MQTT Broker 39 3.3 Tổng kết chương 45 CHƯƠNG 4: PHÁT TRIỂN THUẬT TOÁN ĐIỀU KHIỂN GIÁM SÁT HỆ THỐNG KHO LƯU TRỮ THÔNG MINH 46 4.1 Phương pháp tiếp cận 46 4.2 Thiết kế phần mềm giao tiếp với mạch điều khiển trung tâm .47 4.2.1 Khung truyền thông giao tiếp với mạch điều khiển trung tâm 47 4.2.2 Cơ chế phát âm hệ thống tủ lưu trữ tài liệu thông minh 52 4.2.3 Lưu đồ thuật toán giao tiếp với mạch điều khiển trung tâm 53 4.3 Thiết kế phần mềm lưu trữ hoạt động hệ thống 58 4.3.1 Lưu trữ nhiệt độ, độ ẩm môi trường lưu trữ tài liệu 58 ii 4.3.2 Lưu trữ cố, trình thao tác, vận hành hệ thống 59 4.3.3 Lưu đồ thuật toán lưu trữ trình vận hành hệ thống 59 4.4 Thiết kế phần mềm giao tiếp với người sử dụng 61 4.4.1 Ý tưởng thiết kế phần mềm giao tiếp với người sử dụng 61 4.4.2 Lưu đồ thuật toán phần mềm giao tiếp với người sử dụng 63 4.5 Tổng kết chương 65 CHƯƠNG 5: KẾT QUẢ ĐẠT ĐƯỢC 66 5.1 Phần cứng 66 5.2 Phần mềm 67 5.2.1 Phần mềm điều khiển giám sát hệ thống 67 5.2.2 Phần mềm lưu trữ hoạt động hệ thống 70 5.3 Kết luận chương 72 KẾT LUẬN 73 TÀI LIỆU THAM KHẢO 74 PHỤ LỤC 75 iii DANH MỤC CÁC KÝ HIỆU, CÁC TỪ VIẾT TẮT Ký hiệu Tiếng anh Ý nghĩa CPU Central Processing Unit Bộ xử lý trung tâm MQTT Message Queue Telemetry Giao thức truyền thông điệp Transport LAN Local Area Network Mạng máy tính nội IoT Internet of Thing Internet vạn vật IPC Industry Panel pc Máy tính cơng nghiệp UTF-8 Unicode Technical Committee Chuẩn liệu UTF-8 -8 EMC Electromagnetic compatibility Tương thích điện từ I/O Input / Output Đầu vào / Đầu JSON JavaScript Object Notation Một kiểu định dạng liệu tuân theo quy luật định TCP Transmission Control Giao thức điều khiển truyền Protocol QoS Quality of Service Chất lượng dịch vụ HMI Human-Machine-Interface Màn hình cơng nghiệp SCADA Supervisory Control And Data Điều khiển giám sát thu thập EOT Acquisition liệu End of transmission Ký tự kết thúc frame truyền iv DANH MỤC BẢNG BIỂU Bảng 1.1 Bảng so sánh hệ thống lưu trữ truyền thống với hệ thống lưu trữ thông minh Bảng 1.2 Header cố định truyền thông giao thức MQTT 11 Bảng 1.3 Loại Message 11 Bảng 1.4 Bảng miêu tả độ dài ứng với số byte 13 Bảng 1.5 Ý nghĩa gói CONNACK 14 Bảng 2.1 Thông số kỹ thuật máy tính cơng nghiệp Advantech PPC-3100S-PBE 23 Bảng 3.1 Topic điều khiển tủ master hệ thống 40 Bảng 3.2 Topic cài đặt, cấu hình tủ master hệ thống 40 Bảng 3.3 Topic xác định trạng thái tủ master 41 Bảng 3.4 Topic điều khiển tủ slave hệ thống 42 Bảng 3.5 Topic cấu hình, cài đặt tủ slave 42 Bảng 3.6 Topic xác định trạng thái tủ slave 43 Bảng 4.1 Khung truyền thông giao tiếp IPC mạch master 47 Bảng 4.2 Khung truyền thông điều khiển tủ master 48 Bảng 4.3 Khung truyền cấu hình cài đặt tủ master 49 Bảng 4.4 Khung truyền thông mạch master gửi liệu tủ Master lên IPC 50 Bảng 4.5 Khung truyền thông điều khiển tủ Slave 50 Bảng 4.6 Khung truyền thơng cấu hình, cài đặt tủ slave 51 Bảng 4.7 Khung truyền thông mạch master gửi liệu tủ slave lên IPC 51 Bảng 4.8 Âm phát hệ thống 53 v f = open("frame.json","w") data = "" json.dump(data,f) f.close() print("khong ton tai") if data == "": print("frame trong") time.sleep(0.5) else: print("Send UART") data = data.encode('utf-8') print(type(data)) data += b'\x04' print(data) ser.write(data) data = '' with open("frame.json", "w") as fin: json.dump(data,fin) # data = self.LoadFrame # if data == "": # print("frame trong") # else: # #ser.write(data.encode('utf-8')) # print(data) # time.sleep(1) # def LoadFrame(): # # try: with open("frame.json", "r") as fin: # data = json.load(fin) # print(data) # except Exception: 86 # f = open("frame.json","w") # data = "" # json.dump(data,f) # f.close() # print("khong ton tai") # return data def on_message(client, userdata, msg): print(msg.topic+" "+str(msg.payload)) frame.UpadateFrame(msg.topic, str(msg.payload.decode("utf-8"))) # else: # print("Start") # ser.write(dataRecive.encode('utf-8')) # ser.write(b'\x04') # print("Done dataRecive") # a = ser.read_until(b'\x04') # print(a) """ if (str(msg.topic) == "topic/music"): print(msg.topic) #file_music = str(msg.payload) #nhac = file_music.strip("'b") print(str(msg.payload.decode("utf-8"))) #music.stop() A = music.playmusic(str(msg.payload.decode("utf-8"))) print("OK") A.start() """ def on_connect(client, userdata, flags, rc): #client.subscribe("topic/music") print("Connected with result code "+str(rc)) # Subscribing in on_connect() means that if we lose the connection and 87 # reconnect then subscriptions will be renewed client.subscribe("THS/SYS1/+/C/#", 2) client.subscribe("THS/SYS1/+/S/#", 2) if name == " main ": isRead = True isSend = True client = mqtt.Client() client.username_pw_set(username="system1",password='123456') client.on_connect = on_connect client.on_message = on_message client.connect("localhost", 1883, 60) # if RS485.isRS485 == False: # while RS485.isRS485 == False: # client.publish("THS/SYS1/O/R/C", "OFF", 2) # time.sleep(10) # RS485init() # Blocking call that processes network traffic, dispatches callbacks and # handles reconnecting # Other loop*() functions are available that give a threaded interface and a # manual interface theardRead = readRS485(1,"readRS485",1) theardRead.start() theardSend = sendRS485(1,"sendRS485",1) theardSend.start() client.loop_forever() • Phát âm thanh: import threading from pygame import mixer mixer.init() class playmusic(threading.Thread): def init (self, music): super(). init () 88 self.music = music self.deamon = True def run(self): print("play music:" + self.music) try: mixer.music.stop() mixer.music.load(self.music) mixer.music.play() except Exception: print("Khong ton tai file:"+self.music) def stop(self): mixer.music.stop() def stop(): mixer.music.stop() """ music = playmusic("1.mp3") music.start() print("Test") while True: input("press ENTER to stop playback1") music.stop() print("music stop") """ • Xử lý khung truyền thơng giao tiếp mạch master import json import os def LoadFrame(): try: with open("frame.json", "r") as fin: data = json.load(fin) print(data) except Exception: f = open("frame.json","w") 89 data = "" json.dump(data,f) f.close() print("khong ton tai") return data def WriteJson(data): with open("frame.json", "w") as fin: json.dump(data,fin) def DelJson(): data = "" WriteJson(data) def UpadateFrame(topic,mes): data = "" print(len(topic)) if len(topic) != 14: print("Sai ten topic") else: '''data[0] = topic[9] data[1] = topic[11] data[2] = topic[13]''' data = topic[9] + topic[11] + topic[13] print(data) if topic[13] == "t" or topic[13] == "T" or topic[13] == "H" or topic[13] == "t": if len(mes) == 4: try: a = int(mes) isMes = True except Exception: isMes = False if isMes == True: data = data + mes 90 else: data = "" print(data) else: if len(mes) == 2: data = data + mes else: print("sai frame truyen") data = "" print(data) print(data) WriteJson(data) #a = LoadFrame() #print(a) #UpadateFrame("THS/SYS1/0/C/S", "ON") #a = LoadFrame() #print(a)  Code hình hiển thị from PyQt5 import QtCore, QtGui, QtWidgets from kbNumber import Ui_Dialog , MSG_Dialog from PyQt5.QtCore import pyqtSignal import time import threading import paho.mqtt.client as mqtt import datetime import time import frame import json class Ui_MainWindow(object): 91 def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1023, 789) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.frame = QtWidgets.QFrame(self.centralwidget) self.frame.setGeometry(QtCore.QRect(10, 10, 1024, 768)) self.frame.setStyleSheet(".QFrame{background-image: url(:/main/Man_hinh_chinh.png)}\n""") self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.pushTimKiem = QtWidgets.QPushButton(self.frame) self.pushTimKiem.setGeometry(QtCore.QRect(120, 310, 131, 51)) self.pushTimKiem.setStyleSheet("border: none;\n" "background-color: none;") self.pushTimKiem.setText("") self.pushTimKiem.setObjectName("pushTimKiem") self.pushLichSu = QtWidgets.QPushButton(self.frame) self.pushLichSu.setGeometry(QtCore.QRect(290, 310, 131, 51)) self.pushLichSu.setStyleSheet("border: none;\n" "background-color: none;\n" "") self.pushLichSu.setText("") self.pushLichSu.setObjectName("pushLichSu") 92 self.pushSetting = QtWidgets.QPushButton(self.frame) self.pushSetting.setGeometry(QtCore.QRect(30, 690, 181, 61)) self.pushSetting.setStyleSheet("border: none;\n" "background-color: none;") self.pushSetting.setText("") self.pushSetting.setObjectName("pushSetting") self.pushCheck = QtWidgets.QPushButton(self.frame) self.pushCheck.setGeometry(QtCore.QRect(410, 690, 191, 61)) self.pushCheck.setStyleSheet("border: none;\n" "background-color: none;") self.pushCheck.setText("") self.pushCheck.setObjectName("pushCheck") self.pushOpen = QtWidgets.QPushButton(self.frame) self.pushOpen.setGeometry(QtCore.QRect(560, 280, 141, 61)) self.pushOpen.setStyleSheet("border: none;\n" "background-color: none;") self.pushOpen.setText("") self.pushOpen.setObjectName("pushOpen") self.pushCL = QtWidgets.QPushButton(self.frame) self.pushCL.setGeometry(QtCore.QRect(780, 280, 131, 61)) self.pushCL.setStyleSheet("border: none;\n" "background-color: none;\n" "") self.pushCL.setText("") self.pushCL.setObjectName("pushCL") 93 self.pushButton_2 = QtWidgets.QPushButton(self.frame) self.pushButton_2.setGeometry(QtCore.QRect(690, 170, 91, 91)) self.pushButton_2.setStyleSheet("border: none;\n" "background-color: none;\n" "") self.pushButton_2.setText("") self.pushButton_2.setObjectName("pushButton_2") self.label = QtWidgets.QLabel(self.frame) self.label.setGeometry(QtCore.QRect(740, 400, 81, 41)) self.label.setObjectName("label") self.label_2 = QtWidgets.QLabel(self.frame) self.label_2.setGeometry(QtCore.QRect(740, 470, 76, 21)) self.label_2.setText("") self.label_2.setObjectName("label_2") self.label_3 = QtWidgets.QLabel(self.frame) self.label_3.setGeometry(QtCore.QRect(730, 530, 76, 21)) self.label_3.setText("") self.label_3.setObjectName("label_3") self.label_4 = QtWidgets.QLabel(self.frame) self.label_4.setGeometry(QtCore.QRect(750, 590, 76, 21)) self.label_4.setText("") self.label_4.setObjectName("label_4") self.pushButton = QtWidgets.QPushButton(self.frame) self.pushButton.setGeometry(QtCore.QRect(810, 690, 171, 51)) self.pushButton.setStyleSheet("border: none;\n" 94 "background-color: none;") self.pushButton.setText("") self.pushButton.setObjectName("pushButton") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) self.label.setText(_translate("MainWindow", "2")) import ab_rc if name == " main ": import sys app = QtWidgets.QApplication(sys.argv) MainWindow = QtWidgets.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_()) • Code giao diện thiết đặt lực chống kẹt from PyQt5 import QtCore, QtGui, QtWidgets from kbNumber import Ui_Dialog , MSG_Dialog 95 from PyQt5.QtCore import pyqtSignal import server import time import threading import paho.mqtt.client as mqtt import datetime import time import frame import json class MyQLineEdit(QtWidgets.QLineEdit): clicked = pyqtSignal() def mousePressEvent(self,event): self.clicked.emit() QtWidgets.QLineEdit.mousePressEvent(self, event) class Ui_setLucChongKet(object): def setupUi(self, setLucChongKet): setLucChongKet.setObjectName("setLucChongKet") setLucChongKet.resize(1280, 800) setLucChongKet.setStyleSheet("") self.setLucChongKet = setLucChongKet self.frame = QtWidgets.QFrame(setLucChongKet) self.frame.setGeometry(QtCore.QRect(0, 0, 1280, 800)) self.frame.setStyleSheet(".QFrame{background-image: url(:/images/cdlck.png);}.QPushButton:pressed { background-color: #FF6E40}.QPushButton{border-radius: 15px;background-color: #4e9400;font: 96 bold 20pt \"Arial\";color:#ffffff}.MyQLineEdit{border: 2px solid black;borderradius: 10px;padding: 8px;font: bold 32px \"Arial\"; text-align: center;}") self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.btSave = QtWidgets.QPushButton(self.frame) self.btSave.setGeometry(QtCore.QRect(300, 635, 171, 81)) self.btSave.setObjectName("btSave") self.btExit = QtWidgets.QPushButton(self.frame) self.btExit.setGeometry(QtCore.QRect(520, 635, 171, 81)) self.btExit.setObjectName("btExit") self.tbLCKHienTai = MyQLineEdit(self.frame) self.tbLCKHienTai.setGeometry(QtCore.QRect(380, 415, 311, 81)) font = QtGui.QFont() font.setFamily("Arial") font.setBold(True) font.setItalic(False) font.setWeight(75) self.tbLCKHienTai.setFont(font) self.tbLCKHienTai.setObjectName("tbLCKHienTai") self.tbLCKCaiDat = MyQLineEdit(self.frame) self.tbLCKCaiDat.setGeometry(QtCore.QRect(380, 510, 311, 81)) self.tbLCKCaiDat.setFont(font) self.tbLCKCaiDat.setObjectName("tbLCKCaiDat") self.tbChonTu = MyQLineEdit(self.frame) 97 self.tbChonTu.setGeometry(QtCore.QRect(380, 320, 311, 81) self.tbChonTu.setFont(font) self.tbChonTu.setObjectName("tbChonTu") self.retranslateUi(setLucChongKet) QtCore.QMetaObject.connectSlotsByName(setLucChongKet) def retranslateUi(self, setLucChongKet): _translate = QtCore.QCoreApplication.translate setLucChongKet.setWindowTitle(_translate("setLucChongKet", "Form")) self.btSave.setText(_translate("setLucChongKet", "Lưu")) self.btExit.setText(_translate("setLucChongKet", "Thoát")) self.setEvent() def setEvent(self): if server.numClientLeft > 0: nameTu = "Left_1" else : nameTu = 'Right_1' self.tbLCKHienTai.setText(str(int(server.dataSent2Client[nameTu].dt2Pi2Ar[4]) ) self.tbChonTu.setText('1') self.tbChonTu.clicked.connect(self.tbChonTu_click) self.tbLCKHienTai.clicked.connect(self.tbLCKHienTai_click) self.tbLCKCaiDat.clicked.connect(self.tbLCKCaiDat_click) self.btSave.clicked.connect(self.btSave_click) self.btExit.clicked.connect(self.btExit_click) def tbChonTu_click(self): 98 dialogKey= Ui_Dialog(server.numClientLeft + server.numClientRight + 1) value = dialogKey.exec_() if value and int(value) != server.myNumberTu : self.tbChonTu.setText(value) nameTu = server.serverMain.getNameOfTu(int(value)) if self.tbChonTu.text() == '0' : #neu bang khong thi luc chong ket cac tu la nhu self.tbLCKHienTai.setText('0') else : self.tbLCKHienTai.setText(str(int(server.dataSent2Client[nameTu].dt2Pi2Ar[4]) )) def btExit_click(self): self.setLucChongKet.close() pass def btSave_click(self): if len(self.tbLCKCaiDat.text()) > 0: nameTu = server.serverMain.getNameOfTu(int(self.tbChonTu.text())) print('setLucChongKet nameTu',nameTu) if int(self.tbChonTu.text()) == 0: for tu in server.allConnection: server.dataSent2Client[tu].dt2Pi2Ar[4] = int(self.tbLCKCaiDat.text()) server.serverMain.sendMes2Client(tu , b'\xee\xee'+bytes(server.dataSent2Client[tu].dt2Pi2Ar)) else : 99 server.dataSent2Client[nameTu].dt2Pi2Ar[4] = int(self.tbLCKCaiDat.text()) server.serverMain.sendMes2Client(nameTu , b'\xee\xee'+bytes(server.dataSent2Client[nameTu].dt2Pi2Ar)) dialog = MSG_Dialog() dialog.exec_() def tbLCKHienTai_click(self): pass def tbLCKCaiDat_click(self): dialogKey= Ui_Dialog(10) value = dialogKey.exec_() if value : self.tbLCKCaiDat.setText(value) import resources """ if name == " main ": import sys app = QtWidgets.QApplication(sys.argv) setLucChongKet = QtWidgets.QWidget() ui = Ui_setLucChongKet() ui.setupUi(setLucChongKet) setLucChongKet.show() sys.exit(app.exec_()) """ 100 ... điều khiển, giám sát hệ thống kho lưu trữ thơng minh thiết kế máy tính cơng nghiệp IPC Cấu trúc thiết kế phần mềm điều khiển, giám sát cho hệ thống kho lưu trữ thông minh sử dụng giao thức MQTT. .. dựng thiết kế chi tiết phần mềm điều khiển, giám sát toàn hệ thống 21 CHƯƠNG 2: CƠ SỞ THIẾT KẾ PHẦN MỀM ĐIỀU KHIỂN, GIÁM SÁT HỆ THỐNG KHO THÔNG MINH SỬ DỤNG GIAO THỨC MQTT TRÊN MÁY TÍNH CƠNG NGHIỆP... chọn đề tài: ? ?Thiết kế phần mềm điều khiển giám sát hệ thống kho lưu trữ thông minh sử dụng giao thức MQTT máy tính cơng nghiệp? ?? để nghiên cứu phát triển hệ thống điều khiển, giám sát tủ tài liệu

Ngày đăng: 07/12/2021, 23:18

Mục lục

    TÀI LIỆU THAM KHẢO

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan