def menu_opeanFile(self): fileName, filetype = QtWidgets.QFileDialog.getOpenFileName( self, "选取文件", "C:/", "seg Files (*.seg)") # 设置文件扩展名过滤,注意用双分号间隔 if fileName == '': QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Error(1002)'], QtWidgets.QMessageBox.Yes) else: self.segFile = SegFile() reply = self.segFile.loadFile(fileName) if (reply != 0): QtWidgets.QMessageBox.warning(self, "Warning", Message().dict[reply], QtWidgets.QMessageBox.Yes) else: self.stateDiagram = 1 # 1-已加载文件 # self.paintFFT.figure.clf() # for i in range(0,self.segFile.tapeNum): # for i in range(0,1): # self.paintCWT.setAx(i,self.segFile.tapeNum) # self.paintCWT.paint(self.segFile.dataList[i].data,i) #### self.paintFFT.canvas.draw() #在画布上绘制 #self.paintHome.figure.clf() # for i in range(0,self.segFile.tapeNum): for i in range(0, 1): self.paintHome.setAx(i, self.segFile.tapeNum) self.paintHome.paint(self.segFile.dataList[i].data, i) self.paintHome.canvas.draw() #在画布上绘制
def menu_opeanFile(self): fileName, filetype = QtWidgets.QFileDialog.getOpenFileName( self, "选取文件", "C:/", "seg Files (*.seg)") # 设置文件扩展名过滤,注意用双分号间隔 if fileName == '': QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Error(1002)'], QtWidgets.QMessageBox.Yes) else: self.segFile = SegFile() reply = self.segFile.loadFile(fileName) if (reply != 0): QtWidgets.QMessageBox.warning(self, "Warning", Message().dict[reply], QtWidgets.QMessageBox.Yes) else: self.stateDiagram = 1 # 1-已加载文件 self.paintCWT.figureClear() for i in range(0, self.segFile.tapeNum): self.paintFFT.setAx(i, self.segFile.tapeNum, '2d') self.paintFFT.paint(i, self.segFile.dataList[i].data) # cwtmatr,freqs = Algorithm.MyPywtCWT( self.segFile.dataList[ self.segFile.TapeNumCurrent ].data ) cwtmatr = Algorithm.MyScipyCwt( self.segFile.dataList[self.segFile.TapeNumCurrent].data, 64) self.paintCWT.figureClear() # self.paintCWT.setAx(0,2) # 第 1 行, 共 2 行 # self.paintCWT.MyMatshow(0,cwtmatr) self.paintCWT.setAx(0, 1, '3d') # 第 2 行, 共 2 行 self.paintCWT.MyPlot_surface(0, cwtmatr, 1, 10)
def toolButton_Set_clicked(self): if self.stateDiagram >= 1: # 1-已加载文件 self.toolButton_NavigationBar_Update(5) else: QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Warning(1001)'], QtWidgets.QMessageBox.Yes)
def toolButton_LSTM_clicked(self): if self.stateDiagram >= 4: # 4-已完成标准化 self.toolButton_NavigationBar_Update(4) else: QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Warning(1003)'], QtWidgets.QMessageBox.Yes)
def toolButton_normalization_clicked(self): if self.stateDiagram >= 3: # 3-已完成CWT self.toolButton_NavigationBar_Update(3) else: QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Warning(1003)'], QtWidgets.QMessageBox.Yes)
def toolButton_CWT_clicked(self): if self.stateDiagram >= 2: # 2-已完成FFT self.toolButton_NavigationBar_Update(2) else: QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Warning(1002)'], QtWidgets.QMessageBox.Yes)
def menu_opeanFile(self): fileName, filetype = QtWidgets.QFileDialog.getOpenFileName( self, "选取文件", "C:/", "seg Files (*.seg)") # 设置文件扩展名过滤,注意用双分号间隔 self.seg = Seg() reply = self.seg.loadFile(fileName) if(reply != 0): QtWidgets.QMessageBox.warning( self, "Warning", Message().dict[reply], QtWidgets.QMessageBox.Yes) else: pass
def menu_opeanFile(self): fileName, filetype = QtWidgets.QFileDialog.getOpenFileName( self, "选取文件", "C:/", "seg Files (*.seg)") # 设置文件扩展名过滤,注意用双分号间隔 if fileName == '': QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Error(1002)'], QtWidgets.QMessageBox.Yes) else: self.segFile = SegFile() reply = self.segFile.loadFile(fileName) if (reply != 0): QtWidgets.QMessageBox.warning(self, "Warning", Message().dict[reply], QtWidgets.QMessageBox.Yes) else: self.stateDiagram = 1 # 1-已加载文件 self.paintCWT.figureClear() for i in range(0, self.segFile.tapeNum): self.paintFFT.setAx(i, self.segFile.tapeNum, '2d') self.paintFFT.paint(i, self.segFile.dataList[i].data)
def toolButton_CWT_clicked(self): if self.stateDiagram >= 2: # 2-已完成FFT self.toolButton_NavigationBar_Update(2) # cwtmatr,freqs = Algorithm.MyPywtCWT( self.segFile.dataList[ self.segFile.TapeNumCurrent ].data ) cwtmatr = Algorithm.MyScipyCwt( self.segFile.dataList[self.segFile.TapeNumCurrent].data, 128) self.paintCWT.figureClear() # self.paintCWT.setAx(0,2) # 第 1 行, 共 2 行 # self.paintCWT.MyMatshow(0,cwtmatr) self.paintCWT.setAx(0, 1, '3d') # 第 2 行, 共 2 行 self.paintCWT.MyPlot_surface(0, cwtmatr, 1, 1) else: QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Warning(1002)'], QtWidgets.QMessageBox.Yes)
def menu_opeanFile(self): fileName, filetype = QtWidgets.QFileDialog.getOpenFileName( self, "选取文件", "C:/", "seg Files (*.seg)") # 设置文件扩展名过滤,注意用双分号间隔 if fileName == '': QtWidgets.QMessageBox.warning(self, "Warning", Message().dict['Error(1002)'], QtWidgets.QMessageBox.Yes) else: self.segFile = SegFile() reply = self.segFile.loadFile(fileName) if (reply != 0): QtWidgets.QMessageBox.warning(self, "Warning", Message().dict[reply], QtWidgets.QMessageBox.Yes) else: self.stateDiagram = 1 # 1-已加载文件 self.paintFFT.figureClear() for i in range(0, self.segFile.tapeNum): self.paintFFT.setAx(i, self.segFile.tapeNum, '2d') self.paintFFT.paint(i, self.segFile.dataList[i].data) # print(len(self.segFile.dataList[i].data)) # cwtmatr,freqs = Algorithm.MyPywtCWT( self.segFile.dataList[ self.segFile.TapeNumCurrent ].data ) # cwtmatr = Algorithm_CWT.MyScipyCwt(self.segFile.dataList[ self.segFile.TapeNumCurrent ].data, 128) cwtmatr = Algorithm_CWT.MyWavelets( self.segFile.dataList[self.segFile.TapeNumCurrent].data, 128) self.paintCWT.figureClear() # self.paintCWT.setAx(0,2) # 第 1 行, 共 2 行 # self.paintCWT.MyMatshow(0,cwtmatr) self.paintCWT.setAx(0, 1, '3d') # 第 2 行, 共 2 行 self.paintCWT.MyPlot_surface(0, cwtmatr, 1, 2) # 第几行、数据、绘图采样步长:频率、绘图采样步长:时间 # self.paintCWT.My3DView_init(0,45,180) #设置视角 # 绘制LSTM曲线 train_data, train_labels = inputData(4, 5) # number: 1~5 self.out = self.prediction.Prediction(train_data[7], train_labels[7]) self.paintLSTM.setAx(0, 5, '2d') self.paintLSTM.paint(0, self.out) self.out = self.prediction.Prediction(train_data[0], train_labels[0]) self.paintLSTM.setAx(1, 5, '2d') self.paintLSTM.paint(1, self.out) self.out = self.prediction.Prediction(train_data[1], train_labels[1]) self.paintLSTM.setAx(2, 5, '2d') self.paintLSTM.paint(2, self.out) self.out = self.prediction.Prediction(train_data[2], train_labels[2]) self.paintLSTM.setAx(3, 5, '2d') self.paintLSTM.paint(3, self.out) self.out = self.prediction.Prediction(train_data[3], train_labels[3]) self.paintLSTM.setAx(4, 5, '2d') self.paintLSTM.paint(4, self.out)