def SlotPushbutton_UseThisPara(self): """设置使用该参数列表""" if self.tableinfor_2Save!=self.tableinfor_2:#保存修改后的参数 if self.currentfilepath is not None and self.currentfilepath['type'] == 0: FiveFileParser.updataTable(dict(self.tableinfor_2Save), 'MUBAN', self.currentfilepath['path']) self.Signal_UpdataParas.emit(dict(self.tableinfor_2Save)) #创建数据表(包含参数,用一个data来存数据在数据库中的位置) #当前参数表对应的名字,不要后缀 name="D"+os.path.split(self.currentfilepath['path'])[1].rstrip('.txt')+"时间"+time.strftime('%Y%m%d%M',time.localtime()) #检测当前名字是否合适 while os.path.exists("".join([os.path.join(self.AnotherSavingDir,name),'.d'])): name+='cp' #数据表路径 path=os.path.join(self.AnotherSavingDir,''.join([name,'.d']))#数据表后缀变为‘.d’ FiveFileParser.createTable(path) FiveFileParser.insertTable(dict(self.tableinfor_2Save), '参数',path,0) FiveFileParser.writeComments(path,'\nDataBaseDir*{}\nDataTable*{}'.format(self.AnotherSavingDir,name)) QtWidgets.QMessageBox.information(self, '提示', '参数选择成功:' '数据表为:{}\n立即搜集数据'.format(name), QtWidgets.QMessageBox.Yes) self.Signal_SaveDirChanged_ForDB.emit(self.AnotherSavingDir,name) self.Signal_UseThisParaTable.emit(name) self.Siganl_ManagerWidget.emit('ShuJuBiao',''.join(name)) self.log.info('Create DataTable: {}.d'.format(name))
def SlotPushbutton_Save_CGCS(self): """保存按钮信号槽,用于保存修改的数据""" if self.currentfilepath is not None and self.currentfilepath['type']==0: FiveFileParser.updataTable(dict(self.tableinfor_2Save),'MUBAN', self.currentfilepath['path']) QtWidgets.QMessageBox.information(self, '提示', '更改成功:' '{}'.format(os.path.split(self.currentfilepath['path'])[1]), QtWidgets.QMessageBox.Yes)
def slotNewPushOk(self): path = self.logintablePath if self.line_edit.text() != "": temp = self.regions[self.co_region.currentIndex()][1] temp = "".join([temp, ".", self.line_edit.text()]) self.regions[self.co_region.currentIndex()][1] = temp # print self.regions[self.co_region.currentIndex()][1] self.activeComboxRegin() self.ui.LOGIN_region.setCurrentIndex(self.co_region.currentIndex()) self.ui.LOGIN_gen.setCurrentIndex( len(self.regions[self.co_region.currentIndex()][1].strip().split( '.')) - 1) table = dict() for i in self.regions: table.setdefault(i[0], i[1]) FiveFileParser.updataTable(table, "regions", path) del table self.New.accept()