diff --git a/Static/InfluxDB.api b/Static/InfluxDB.api index ad057ca..78cf3bf 100644 --- a/Static/InfluxDB.api +++ b/Static/InfluxDB.api @@ -1 +1 @@ -gYuFx9QNxg-GxPhpM9hzfS7z5z2jXG9QeQkqMZAGI1UofTf4oA_hmM7bWvTtxjKf3Lbjy1ZWiXjweryfjdOzWA== \ No newline at end of file +jtTFa-rtobjdxWm7fKS7Tk2gZECrXwdM59799SddTcqDWDGiQTPEFYy5VW6IHgsAK5RZMtMLWmpZA3PaipOkmg== \ No newline at end of file diff --git a/Static/Main.qss b/Static/Main.qss index bc6701c..d69f77a 100644 --- a/Static/Main.qss +++ b/Static/Main.qss @@ -637,9 +637,9 @@ QComboBox#setBox{ color: #889399; - font-family: ".SFNSDisplay-Regular"; + font-family: "SFNSDisplay-Regular"; - font-size: 15px; + font-size: 28px; font-weight: 520; @@ -787,6 +787,7 @@ QComboBox#timeBox QAbstractItemView::item:hover{ } + QTextEdit#mesEdit{ border: 2px solid #dddddd; border-radius: 8px; diff --git a/UI/RegisterWidgets/__init__.py b/UI/RegisterWidgets/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/UI/Setting/RTUSetting.py b/UI/Setting/RTUSetting.py index 0a6bbd5..1417e11 100644 --- a/UI/Setting/RTUSetting.py +++ b/UI/Setting/RTUSetting.py @@ -198,7 +198,7 @@ class RTUSettingWidget(QWidget): self.baudrateEdit.setText(baudrate) self.stopbitsBox.setCurrentText(stopbits) self.freEdit.setText(frequency) - + self.offsetBox.setCurrentText(offset) self.parityBox.setCurrentText(parity) def saveSetting(self): diff --git a/UI/Setting/TCPSetting.py b/UI/Setting/TCPSetting.py index b7ebd04..7ce20df 100644 --- a/UI/Setting/TCPSetting.py +++ b/UI/Setting/TCPSetting.py @@ -138,6 +138,7 @@ class TCPSettingWidget(QWidget): self.ipEdit.setText(host) self.portEdit.setText(port) self.freEdit.setText(frequency) + self.offsetBox.setCurrentText(offset) def saveSetting(self): diff --git a/UI/TrendManage/TrendWidget.py b/UI/TrendManage/TrendWidget.py index 454f0ad..f99f4c2 100644 --- a/UI/TrendManage/TrendWidget.py +++ b/UI/TrendManage/TrendWidget.py @@ -190,7 +190,7 @@ class TrendWidgets(QWidget): if self.timeBox.findText(time) == -1: self.timeBox.addItem(time) self.memLsit.append(x.mem) - self.historyDB = HistoryDBManage(bucket = self.proName) + self.historyDB = HistoryDBManage(bucket = self.proName, isCelery = False) # self.refreshList(self.timeBox.currentIndex()) def refreshList(self, index): diff --git a/model/HistoryDBModel/HistoryDBManage.py b/model/HistoryDBModel/HistoryDBManage.py index bdf1aa4..36e1999 100644 --- a/model/HistoryDBModel/HistoryDBManage.py +++ b/model/HistoryDBModel/HistoryDBManage.py @@ -18,13 +18,12 @@ def parseDate(date_string: str): class HistoryDBManage(): - - token = 'jtTFa-rtobjdxWm7fKS7Tk2gZECrXwdM59799SddTcqDWDGiQTPEFYy5VW6IHgsAK5RZMtMLWmpZA3PaipOkmg==' org = "DCS" # bucket = "history" url = "http://localhost:6324" - def __init__(self, bucket, mem = None): + def __init__(self, bucket, mem = None, isCelery = True): + self.getToken(isCelery) self.client = InfluxDBClient(url = self.url, token = self.token, org = self.org) self.writeApi = self.client.write_api(write_options = SYNCHRONOUS) self.deleteApi = self.client.delete_api() @@ -40,6 +39,15 @@ class HistoryDBManage(): def __del__(self): self.client.close() + def getToken(self, isCelery): + if not isCelery: + with open('Static/InfluxDB.api', 'r', encoding='utf-8') as f: + self.token = f.read() + else: + with open('../../../Static/InfluxDB.api', 'r', encoding='utf-8') as f: + self.token = f.read() + + def writeFun(self, varName, value): try: diff --git a/model/ProjectModel/ProjectManage.py b/model/ProjectModel/ProjectManage.py index 7ec74cd..3c6394d 100644 --- a/model/ProjectModel/ProjectManage.py +++ b/model/ProjectModel/ProjectManage.py @@ -256,7 +256,7 @@ class ProjectManage(object): curTime = float("{:.5f}".format(curTime)) cursor.execute('insert into InfluxMem (mem) values ({})'.format(str(curTime))) - historyDB = HistoryDBManage(mem = curTime, bucket = projectName) + historyDB = HistoryDBManage(mem = curTime, bucket = projectName, isCelery = False) return historyDB @classmethod diff --git a/nuitka.txt b/nuitka.txt new file mode 100644 index 0000000..58eb816 --- /dev/null +++ b/nuitka.txt @@ -0,0 +1 @@ +nuitka --standalone --mingw64 --show-memory --show-progress --nofollow-import-to=numpy,pandas,celery,peewee,PIL,cffi,pycparser,pyserial,pywin32,modbus_tk,matplotlib,redis,pyecharts --enable-plugin=pyqt5,numpy,eventlet,gevent,multiprocessing --include-package=model,project,protocol,UI,utils,windoweffect,redis,pythonnet,uuid,logging,openpyxl,matplotlib,importlib,prettytable --output-dir=o bin.py \ No newline at end of file diff --git a/protocol/FF/FFProtocol.py b/protocol/FF/FFProtocol.py index 8f4a6fd..fc9a62a 100644 --- a/protocol/FF/FFProtocol.py +++ b/protocol/FF/FFProtocol.py @@ -1,3 +1,5 @@ +from pythonnet import load +load('coreclr') import clr # 与其他模块不同此处不直接导入pythonnet 而是导入clr(python与c#交互核心) dll_path = 'protocol\\FF\\NationalInstruments.Fieldbus' # 为了方便理解这里给到dll所在的绝对路径且包含dll文件本身 clr.AddReference(dll_path) #加载c#库