# /////////////////////////////////////////////////////////////// # # BY: WANDERSON M.PIMENTA # PROJECT MADE WITH: Qt Designer and PySide6 # V: 1.0.0 # # This project can be used freely for all uses, as long as they maintain the # respective credits only in the Python scripts, any information in the visual # interface (GUI) can be modified without any implication. # # There are limitations on Qt licenses if you want to use your products # commercially, I recommend reading them on the official website: # https://doc.qt.io/qtforpython/licenses.html # # /////////////////////////////////////////////////////////////// from PySide6.QtWidgets import QMessageBox from Front.back.Program_Run.utils import resource_path # MAIN FILE # /////////////////////////////////////////////////////////////// from Front.main import * import importlib import sqlite3 from select import select from Front.back.GC import GC, GCExport from Front.back.GS import GS, GSExport from Front.back.WD import WD, WDExport from Front.back.GC import GCcompute from Front.back.GS import GScompute from Front.back.WD import WDcompute from Front.back.GC import GCshow from Front.back.GS import GSshow from Front.back.WD import WDshow import os from Front.main import MainWindow from Front.modules import Settings # GLOBALS # /////////////////////////////////////////////////////////////// GLOBAL_STATE = False GLOBAL_TITLE_BAR = True class UIFunctions(MainWindow): # MAXIMIZE/RESTORE # /////////////////////////////////////////////////////////////// def maximize_restore(self): global GLOBAL_STATE status = GLOBAL_STATE if status == False: self.showMaximized() GLOBAL_STATE = True self.ui.appMargins.setContentsMargins(0, 0, 0, 0) self.ui.maximizeRestoreAppBtn.setToolTip("Restore") self.ui.maximizeRestoreAppBtn.setIcon(QIcon(u":/icons/images/icons/icon_restore.png")) self.ui.frame_size_grip.hide() self.left_grip.hide() self.right_grip.hide() self.top_grip.hide() self.bottom_grip.hide() else: GLOBAL_STATE = False self.showNormal() self.resize(self.width() + 1, self.height() + 1) self.ui.appMargins.setContentsMargins(10, 10, 10, 10) self.ui.maximizeRestoreAppBtn.setToolTip("Maximize") self.ui.maximizeRestoreAppBtn.setIcon(QIcon(u":/icons/images/icons/icon_maximize.png")) self.ui.frame_size_grip.show() self.left_grip.show() self.right_grip.show() self.top_grip.show() self.bottom_grip.show() # RETURN STATUS # /////////////////////////////////////////////////////////////// def returStatus(self): return GLOBAL_STATE # SET STATUS # /////////////////////////////////////////////////////////////// def setStatus(self, status): global GLOBAL_STATE GLOBAL_STATE = status # TOGGLE MENU # /////////////////////////////////////////////////////////////// def toggleMenu(self, enable): if enable: # GET WIDTH width = self.ui.leftMenuBg.width() maxExtend = Settings.MENU_WIDTH standard = 60 # SET MAX WIDTH if width == 60: widthExtended = maxExtend else: widthExtended = standard # ANIMATION self.animation = QPropertyAnimation(self.ui.leftMenuBg, b"minimumWidth") self.animation.setDuration(Settings.TIME_ANIMATION) self.animation.setStartValue(width) self.animation.setEndValue(widthExtended) self.animation.setEasingCurve(QEasingCurve.InOutQuart) self.animation.start() # TOGGLE LEFT BOX # /////////////////////////////////////////////////////////////// def toggleLeftBox(self, enable): if enable: # GET WIDTH width = self.ui.extraLeftBox.width() widthRightBox = self.ui.extraRightBox.width() maxExtend = Settings.LEFT_BOX_WIDTH color = Settings.BTN_LEFT_BOX_COLOR standard = 0 # GET BTN STYLE style = self.ui.toggleLeftBox.styleSheet() # SET MAX WIDTH if width == 0: widthExtended = maxExtend # SELECT BTN self.ui.toggleLeftBox.setStyleSheet(style + color) if widthRightBox != 0: style = self.ui.settingsTopBtn.styleSheet() self.ui.settingsTopBtn.setStyleSheet(style.replace(Settings.BTN_RIGHT_BOX_COLOR, '')) else: widthExtended = standard # RESET BTN self.ui.toggleLeftBox.setStyleSheet(style.replace(color, '')) UIFunctions.start_box_animation(self, width, widthRightBox, "left") # TOGGLE RIGHT BOX # /////////////////////////////////////////////////////////////// def toggleRightBox(self, enable): if enable: # GET WIDTH width = self.ui.extraRightBox.width() widthLeftBox = self.ui.extraLeftBox.width() maxExtend = Settings.RIGHT_BOX_WIDTH color = Settings.BTN_RIGHT_BOX_COLOR standard = 0 # GET BTN STYLE style = self.ui.settingsTopBtn.styleSheet() # SET MAX WIDTH if width == 0: widthExtended = maxExtend # SELECT BTN self.ui.settingsTopBtn.setStyleSheet(style + color) if widthLeftBox != 0: style = self.ui.toggleLeftBox.styleSheet() self.ui.toggleLeftBox.setStyleSheet(style.replace(Settings.BTN_LEFT_BOX_COLOR, '')) else: widthExtended = standard # RESET BTN self.ui.settingsTopBtn.setStyleSheet(style.replace(color, '')) UIFunctions.start_box_animation(self, widthLeftBox, width, "right") def start_box_animation(self, left_box_width, right_box_width, direction): right_width = 0 left_width = 0 # Check values if left_box_width == 0 and direction == "left": left_width = 240 else: left_width = 0 # Check values if right_box_width == 0 and direction == "right": right_width = 240 else: right_width = 0 # ANIMATION LEFT BOX self.left_box = QPropertyAnimation(self.ui.extraLeftBox, b"minimumWidth") self.left_box.setDuration(Settings.TIME_ANIMATION) self.left_box.setStartValue(left_box_width) self.left_box.setEndValue(left_width) self.left_box.setEasingCurve(QEasingCurve.InOutQuart) # ANIMATION RIGHT BOX self.right_box = QPropertyAnimation(self.ui.extraRightBox, b"minimumWidth") self.right_box.setDuration(Settings.TIME_ANIMATION) self.right_box.setStartValue(right_box_width) self.right_box.setEndValue(right_width) self.right_box.setEasingCurve(QEasingCurve.InOutQuart) # GROUP ANIMATION self.group = QParallelAnimationGroup() self.group.addAnimation(self.left_box) self.group.addAnimation(self.right_box) self.group.start() # SELECT/DESELECT MENU # /////////////////////////////////////////////////////////////// # SELECT def selectMenu(getStyle): select = getStyle + Settings.MENU_SELECTED_STYLESHEET return select # DESELECT def deselectMenu(getStyle): deselect = getStyle.replace(Settings.MENU_SELECTED_STYLESHEET, "") return deselect # START SELECTION def selectStandardMenu(self, widget): for w in self.ui.topMenu.findChildren(QPushButton): if w.objectName() == widget: w.setStyleSheet(UIFunctions.selectMenu(w.styleSheet())) # RESET SELECTION def resetStyle(self, widget): for w in self.ui.topMenu.findChildren(QPushButton): if w.objectName() != widget: w.setStyleSheet(UIFunctions.deselectMenu(w.styleSheet())) # IMPORT THEMES FILES QSS/CSS # /////////////////////////////////////////////////////////////// def theme(self, file, useCustomTheme): if useCustomTheme: str = open(file, 'r').read() self.ui.styleSheet.setStyleSheet(str) # START - GUI DEFINITIONS # /////////////////////////////////////////////////////////////// def uiDefinitions(self): def dobleClickMaximizeRestore(event): # IF DOUBLE CLICK CHANGE STATUS if event.type() == QEvent.MouseButtonDblClick: QTimer.singleShot(250, lambda: UIFunctions.maximize_restore(self)) self.ui.titleRightInfo.mouseDoubleClickEvent = dobleClickMaximizeRestore if Settings.ENABLE_CUSTOM_TITLE_BAR: # STANDARD TITLE BAR self.setWindowFlags(Qt.FramelessWindowHint) self.setAttribute(Qt.WA_TranslucentBackground) # MOVE WINDOW / MAXIMIZE / RESTORE def moveWindow(event): # IF MAXIMIZED CHANGE TO NORMAL if UIFunctions.returStatus(self): UIFunctions.maximize_restore(self) # MOVE WINDOW if event.buttons() == Qt.LeftButton: self.move(self.pos() + event.globalPos() - self.dragPos) self.dragPos = event.globalPos() event.accept() self.ui.titleRightInfo.mouseMoveEvent = moveWindow # CUSTOM GRIPS self.left_grip = CustomGrip(self, Qt.LeftEdge, True) self.right_grip = CustomGrip(self, Qt.RightEdge, True) self.top_grip = CustomGrip(self, Qt.TopEdge, True) self.bottom_grip = CustomGrip(self, Qt.BottomEdge, True) else: self.ui.appMargins.setContentsMargins(0, 0, 0, 0) self.ui.minimizeAppBtn.hide() self.ui.maximizeRestoreAppBtn.hide() self.ui.closeAppBtn.hide() self.ui.frame_size_grip.hide() # DROP SHADOW self.shadow = QGraphicsDropShadowEffect(self) self.shadow.setBlurRadius(17) self.shadow.setXOffset(0) self.shadow.setYOffset(0) self.shadow.setColor(QColor(0, 0, 0, 150)) self.ui.bgApp.setGraphicsEffect(self.shadow) # RESIZE WINDOW self.sizegrip = QSizeGrip(self.ui.frame_size_grip) self.sizegrip.setStyleSheet("width: 20px; height: 20px; margin 0px; padding: 0px;") # MINIMIZE self.ui.minimizeAppBtn.clicked.connect(lambda: self.showMinimized()) # MAXIMIZE/RESTORE self.ui.maximizeRestoreAppBtn.clicked.connect(lambda: UIFunctions.maximize_restore(self)) # CLOSE APPLICATION self.ui.closeAppBtn.clicked.connect(lambda: self.close()) def resize_grips(self): if Settings.ENABLE_CUSTOM_TITLE_BAR: self.left_grip.setGeometry(0, 10, 10, self.height()) self.right_grip.setGeometry(self.width() - 10, 10, 10, self.height()) self.top_grip.setGeometry(0, 0, self.width(), 10) self.bottom_grip.setGeometry(0, self.height() - 10, self.width(), 10) # 上传文件的方法 def execute_script_based_on_selection(self, file_path): current_text = self.ui.comboBox_2.currentText() # db_path = r"D:/Code/ControlNetwork/UI/SQL/DataBase.db" # 获取当前脚本所在的目录 # current_dir = os.getcwd() # # 构建 SQL 文件夹的相对路径(上一级的上一级中的 SQL 文件夹) # sql_folder = os.path.join(current_dir, '..', '..', 'SQL') # # 将相对路径转换为绝对路径 # sql_folder = os.path.abspath(sql_folder) # db_path = os.path.join(resource_path(sql_folder), f"{self.ui.comboBox.currentText()}.db") db_path = os.path.join(resource_path('SQL'), f"{self.ui.comboBox.currentText()}.db") print(db_path) file_path = file_path if current_text == "水准测段高差稳定计算": GC.main_function(file_path, db_path) # 添加水准执行代码 elif current_text == "控制网复测平面基准计算": GS.main_function(file_path, db_path) # 添加控制网执行代码 elif current_text == "平面控制网稳定性计算": WD.main_function(file_path, db_path) # 添加平面控制网执行代码 # 计算与展示文件的方法 def compute_show_process_excel_file(self, file_path): current_text = self.ui.comboBox_2.currentText() # # 获取当前脚本所在的目录 # current_dir = os.getcwd() # # 构建 SQL 文件夹的相对路径(上一级的上一级中的 SQL 文件夹) # sql_folder = os.path.join(current_dir, '..', '..', 'SQL') # # 将相对路径转换为绝对路径 # sql_folder = os.path.abspath(sql_folder) # db_path = os.path.join(sql_folder, f"{self.ui.comboBox.currentText()}.db") db_path = os.path.join(resource_path('SQL'), f"{self.ui.comboBox.currentText()}.db") # 转换为utf-8 excelname = os.path.basename(file_path) # 文件名 utf_en = excelname.encode('utf-8') # 转换文件名为utf-8编码形式 if current_text == "水准测段高差稳定计算": GCcompute.main_function(file_path, db_path) GCshow.main_function(self.ui, db_path, utf_en) elif current_text == "控制网复测平面基准计算": GScompute.main_function(excelname, db_path) GSshow.main_function(self.ui, db_path, utf_en) elif current_text == "平面控制网稳定性计算": WDcompute.main_function(excelname, db_path) WDshow.main_function(self.ui, db_path, utf_en) # 文件导出的方法 def export_database_to_excel(self, file_path): current_text = self.ui.comboBox_2.currentText() # # 获取当前脚本所在的目录 # current_dir = os.getcwd() # # 构建 SQL 文件夹的相对路径(上一级的上一级中的 SQL 文件夹) # sql_folder = os.path.join(current_dir, '..', '..', 'SQL') # # 将相对路径转换为绝对路径 # sql_folder = os.path.abspath(sql_folder) # db_path = os.path.join(sql_folder, f"{self.ui.comboBox.currentText()}.db") db_path = os.path.join(resource_path('SQL'), f"{self.ui.comboBox.currentText()}.db") # 转换为utf-8 excelname = os.path.basename(file_path) # 文件名 utf_en = excelname.encode('utf-8') # 转换文件名为utf-8编码形式 if current_text == "水准测段高差稳定计算": GCExport.main_function_result(self, utf_en, db_path) elif current_text == "控制网复测平面基准计算": GSExport.main_function(self, db_path, excelname) elif current_text == "平面控制网稳定性计算": WDExport.main_function(self, db_path, excelname) else: QMessageBox.warning(self, '警告', '请选择有效的计算类型') # 数据一览,点击查询 def search_data_to_show(self, file_path, current_text, tablename): utf_en = tablename.encode('utf-8') # 转换文件名为utf-8编码形式 if current_text == "水准测段高差稳定计算": selectModel = GCshow.search_show_function(self.ui, file_path, utf_en) return selectModel elif current_text == "控制网复测平面基准计算": selectModel = GSshow.search_show_function(self.ui, file_path, utf_en) return selectModel elif current_text == "平面控制网稳定性计算": selectModel = WDshow.search_show_function(self.ui, file_path, utf_en) return selectModel # 删除行数据 def del_row_from_db(self, row, methodName, tableName_utf8, dbPath): db1 = sqlite3.connect(dbPath) cursor1 = db1.cursor() # 通过行锁定对应的字段 if methodName == '水准测段高差稳定计算': sqlstr1 = """SELECT * FROM GC_Input_Point WHERE TableName = ? LIMIT 1 OFFSET ?""" cursor1.execute(sqlstr1, (tableName_utf8, row,)) result1 = cursor1.fetchall() list1 = result1[0] # 100%准确查询 # sqlstr3 = """SELECT * FROM GC_Input_Point WHERE TableName = ? and New_SPName = ? and New_EPName = ? and New_HDiff = ? and New_RLen = ?""" # cursor1.execute(sqlstr3, (tableName_utf8, list1[7], list1[8], list1[11], list1[12],)) # result3 = cursor1.fetchall() sqlstr2 = """DELETE FROM GC_Input_Point WHERE TableName = ? and New_SPName = ? and New_EPName = ? and New_HDiff = ? and New_RLen = ?""" cursor1.execute(sqlstr2, (tableName_utf8, list1[7], list1[8], list1[11], list1[12],)) # # 获取删除的记录数量 # deleted_count = cursor1.rowcount # 直接使用计算方式 tableName = tableName_utf8.decode('utf-8') # 先把结果相关的点数据删一下 sqlstr3 = """DELETE FROM GC_Output_Point WHERE TableName = ?""" cursor1.execute(sqlstr3, (tableName_utf8,)) # 提交事务 db1.commit() # 关闭db db1.close() GCcompute.main_function(tableName, dbPath) GCshow.main_function(self.ui, dbPath, tableName_utf8) elif methodName == '控制网复测平面基准计算': sqlstr1 = """SELECT * FROM GS_Input_Point WHERE TableName = ? LIMIT 1 OFFSET ?""" cursor1.execute(sqlstr1, (tableName_utf8, row,)) result1 = cursor1.fetchall() list1 = result1[0] # 100%准确查询 # sqlstr3 = """SELECT * FROM GC_Input_Point WHERE TableName = ? and New_SPName = ? and New_EPName = ? and New_HDiff = ? and New_RLen = ?""" # cursor1.execute(sqlstr3, (tableName_utf8, list1[7], list1[8], list1[11], list1[12],)) # result3 = cursor1.fetchall() sqlstr2 = """DELETE FROM GS_Input_Point WHERE TableName = ? and PointName = ? and New_X = ? and New_Y = ?""" cursor1.execute(sqlstr2, (tableName_utf8, list1[7], list1[5], list1[6],)) # # 获取删除的记录数量 # deleted_count = cursor1.rowcount # 直接使用计算方式 tableName = tableName_utf8.decode('utf-8') # 先把结果相关的点和参数删一下 sqlstr3 = """DELETE FROM GS_Result_Point WHERE TableName = ?""" cursor1.execute(sqlstr3, (tableName_utf8,)) sqlstr4 = """DELETE FROM GS_Trans_Point WHERE TableName = ?""" cursor1.execute(sqlstr4, (tableName_utf8,)) sqlstr5 = """DELETE FROM GS_Trans_Param WHERE TableName = ?""" cursor1.execute(sqlstr5, (tableName_utf8,)) # 提交事务 db1.commit() # 关闭db db1.close() GScompute.main_function(tableName, dbPath) GSshow.main_function(self.ui, dbPath, tableName_utf8) else: # 平面控制网稳定性计算 sqlstr1 = """SELECT * FROM WD_Input_Point WHERE TableName = ? LIMIT 1 OFFSET ?""" cursor1.execute(sqlstr1, (tableName_utf8, row,)) result1 = cursor1.fetchall() list1 = result1[0] # 100%准确查询 # sqlstr3 = """SELECT * FROM GC_Input_Point WHERE TableName = ? and New_SPName = ? and New_EPName = ? and New_HDiff = ? and New_RLen = ?""" # cursor1.execute(sqlstr3, (tableName_utf8, list1[7], list1[8], list1[11], list1[12],)) # result3 = cursor1.fetchall() sqlstr2 = """DELETE FROM WD_Input_Point WHERE TableName = ? and PointName = ? and New_X = ? and New_Y = ?""" cursor1.execute(sqlstr2, (tableName_utf8, list1[11], list1[8], list1[9],)) # # 获取删除的记录数量 # deleted_count = cursor1.rowcount # 直接使用计算方式 tableName = tableName_utf8.decode('utf-8') # 先把结果相关的点和参数删一下 sqlstr3 = """DELETE FROM WD_Result_Point WHERE TableName = ?""" cursor1.execute(sqlstr3, (tableName_utf8,)) sqlstr4 = """DELETE FROM WD_Result_Param WHERE TableName = ?""" cursor1.execute(sqlstr4, (tableName_utf8,)) # 提交事务 db1.commit() # 关闭db db1.close() WDcompute.main_function(tableName, dbPath) WDshow.main_function(self.ui, dbPath, tableName_utf8) #编辑完后的数据更新 #输入模型,方法,表名utf8,数据库 def update_to_db(self,model1,methodName, tableName_utf8, dbPath): print(dbPath) db1 = sqlite3.connect(dbPath) cursor1 = db1.cursor() # 通过行锁定对应的字段 if methodName == '水准测段高差稳定计算': #读取有用的数据,按格式录入 data = GC.get_data_from_excel1(model1) cell_values = GC.read_cells_from_excel1(model1) ms_station = float(model1[0][12]) last_station_count = GC.get_last_numeric_cell_value1(model1, 2) new_station_count = GC.get_last_numeric_cell_value1(model1, 7) last_sum_hdiff = GC.calculate_column_sum1(model1, 4) last_sum_rlen = GC.calculate_column_sum1(model1, 5) new_sum_hdiff = GC.calculate_column_sum1(model1, 9) new_sum_rlen = GC.calculate_column_sum1(model1, 10) # 把所有相关的表都删除 sqlstr1 = """DELETE FROM GC_Input_Point WHERE TableName = ? """ cursor1.execute(sqlstr1, (tableName_utf8,)) sqlstr2 = """DELETE FROM GC_Input_Param WHERE TableName = ? """ cursor1.execute(sqlstr2, (tableName_utf8,)) # 先把结果相关的点和参数删一下 sqlstr3 = """DELETE FROM GC_Output_Point WHERE TableName = ?""" cursor1.execute(sqlstr3, (tableName_utf8,)) # 提交事务 db1.commit() # 关闭db db1.close() # 直接使用计算方式 tableName = tableName_utf8.decode('utf-8') # 重新更新数据库 GC.insert_into_database(tableName, cell_values, ms_station, last_station_count, new_station_count, last_sum_hdiff, new_sum_hdiff, last_sum_rlen, new_sum_rlen, dbPath, tableName_utf8) GC.insert_data_into_database(data, tableName, cell_values, dbPath, tableName_utf8) GCcompute.main_function(tableName, dbPath) GCshow.main_function(self.ui, dbPath, tableName_utf8) elif methodName == '控制网复测平面基准计算': #读取模型 ii = 0 pastname = model1[0][6] newname = model1[0][7] pjbc = float(model1[0][8]) fxzwc = float(model1[0][9]) zrbzwc = float(model1[0][10]) points = len(model1) zbs = float(model1[0][11]) zfxs = float(model1[0][12]) sf = float(model1[0][13]) pjbcs = zbs / points pjfxs = zfxs / points listname1 = [] listpastx1 = [] listpasty1 = [] listcgcs1 = [] listnewx1 = [] listnewy1 = [] while ii < len(model1): if model1[ii][0] == '' or model1[ii][0] == None: ii = ii + 1 else: listname1.append(model1[ii][0]) listpastx1.append(model1[ii][1]) listpasty1.append(model1[ii][2]) listnewx1.append(model1[ii][3]) listnewy1.append(model1[ii][4]) listcgcs1.append(model1[ii][5]) ii = ii + 1 #把所有相关的表都删除 sqlstr1 = """DELETE FROM GS_Input_Point WHERE TableName = ? """ cursor1.execute(sqlstr1, (tableName_utf8, )) sqlstr2 = """DELETE FROM GS_Input_Param WHERE TableName = ? """ cursor1.execute(sqlstr2, (tableName_utf8,)) # 先把结果相关的点和参数删一下 sqlstr3 = """DELETE FROM GS_Result_Point WHERE TableName = ?""" cursor1.execute(sqlstr3, (tableName_utf8,)) sqlstr4 = """DELETE FROM GS_Trans_Point WHERE TableName = ?""" cursor1.execute(sqlstr4, (tableName_utf8,)) sqlstr5 = """DELETE FROM GS_Trans_Param WHERE TableName = ?""" cursor1.execute(sqlstr5, (tableName_utf8,)) # 提交事务 db1.commit() # 关闭db db1.close() # 直接使用计算方式 tableName = tableName_utf8.decode('utf-8') #重新更新数据库 GS.insert_into_database(dbPath, pastname, newname, tableName, listname1, listpastx1, listpasty1, listcgcs1, listnewx1, listnewy1, pjbc, fxzwc, zrbzwc, points, zbs, zfxs, sf, pjbcs, pjfxs) GScompute.main_function(tableName, dbPath) GSshow.main_function(self.ui, dbPath, tableName_utf8) else: # 读取模型 ii = 0 bename = model1[0][8] pastname = model1[0][9] newname = model1[0][10] pjbc = float(model1[0][11]) fxzwc = float(model1[0][12]) points = len(model1) zbs = float(model1[0][13]) zfxs = float(model1[0][14]) sf = float(model1[0][15]) pjbcs = zbs / points pjfxs = zfxs / points listbex1 = [] listbey1 = [] listname1 = [] listpastx1 = [] listpasty1 = [] listcgcs1 = [] listnewx1 = [] listnewy1 = [] while ii < len(model1): if model1[ii][0] == '' or model1[ii][0] == None: ii = ii + 1 else: listname1.append(model1[ii][0]) listbex1.append(model1[ii][1]) listbey1.append(model1[ii][2]) listpastx1.append(model1[ii][3]) listpasty1.append(model1[ii][4]) listcgcs1.append(model1[ii][5]) listnewx1.append(model1[ii][6]) listnewy1.append(model1[ii][7]) ii = ii + 1 # 平面控制网稳定性计算 sqlstr1 = """DELETE FROM WD_Input_Point WHERE TableName = ?""" cursor1.execute(sqlstr1, (tableName_utf8, )) sqlstr2 = """DELETE FROM WD_Input_Param WHERE TableName = ?""" cursor1.execute(sqlstr2, (tableName_utf8,)) # 先把结果相关的点和参数删一下 sqlstr3 = """DELETE FROM WD_Result_Point WHERE TableName = ?""" cursor1.execute(sqlstr3, (tableName_utf8,)) sqlstr4 = """DELETE FROM WD_Result_Param WHERE TableName = ?""" cursor1.execute(sqlstr4, (tableName_utf8,)) # 提交事务 db1.commit() # 关闭db db1.close() # 直接使用计算方式 tableName = tableName_utf8.decode('utf-8') WD.insert_into_database(dbPath, pastname, newname, bename, tableName, listname1, listpastx1, listpasty1, listcgcs1, pjbc, fxzwc, points, zbs, zfxs, sf, pjbcs, pjfxs, listbex1, listbey1, listnewx1, listnewy1) WDcompute.main_function(tableName, dbPath) WDshow.main_function(self.ui, dbPath, tableName_utf8) # END - GUI DEFINITIONS