def on_pushButton_next_clicked(self): """ Slot documentation goes here. """ # TODO: not implemented yet self.test_result=test_results() addr_sa=str(self.maddress) addr_sa = "TCPIP0::" + addr_sa + "::inst0::INSTR" if not self.demo: try: self.sa=SpectrumAnalyzer.SpectrumAnalyzer(addr_sa) except: QMessageBox.warning(self,ModuleConstants.QMESSAGEBOX_WARN, ModuleConstants.QMESSAGEBOX_WARN_INSTR_NOT_VALID) return self.test_result.test_item = ModuleConstants.TESTITEM_TR_LO self.test_result.test_condition = '--' self.test_result.test_results=str(self.testProcess()) if self.test_result.test_results ==self.threshold: QMessageBox.information(self,ModuleConstants.QMESSAGEBOX_INFO,ModuleConstants.QMESSAGEBOX_CONTENTS_TEST_NORMAL,QMessageBox.Ok) self.test_result.test_conclusion=ModuleConstants.TESTRESULT_PASS else: QMessageBox.information(self,ModuleConstants.QMESSAGEBOX_INFO,ModuleConstants.TESTITEM_TR_LO+ ModuleConstants.QMESSAGEBOX_CONTENTS_TEST_ABNORMAL,QMessageBox.Ok) self.test_result.test_conclusion=ModuleConstants.TESTRESULT_FAIL self._signalTest.emit("test_lo") self.accept() self.close()
def on_pushButton_next_clicked(self): """ Slot documentation goes here. """ # TODO: not implemented yet try: self.freq_sg = float(self.lineEdit_freq_sg.text()) * 1e6 self.power_sg = float(self.lineEdit_power_sg.text()) self.freq_sa = float(self.lineEdit_freq_sa.text()) * 1e6 self.bw_sa = float(self.lineEdit_bw_sa.text()) * 1e6 addr_sg = str(self.addr_sg) addr_sa = str(self.addr_sa) except: QMessageBox.warning( self, ModuleConstants.QMESSAGEBOX_WARN, ModuleConstants.QMESSAGEBOX_WARN_INPUT_PARAMETER_NOT_ENOUGH) return addr_sg = "TCPIP0::" + addr_sg + "::inst0::INSTR" addr_sa = "TCPIP0::" + addr_sa + "::inst0::INSTR" self.test_result = test_results() if not self.demo: try: self.sa = SpectrumAnalyzer.SpectrumAnalyzer(addr_sa) self.sg = SignalGenerator.SignalGenerator(addr_sg) except: QMessageBox.warning( self, ModuleConstants.QMESSAGEBOX_WARN, ModuleConstants.QMESSAGEBOX_WARN_INSTR_NOT_VALID) return self.test_result.test_item = ModuleConstants.TESTITEM_TR_R self.test_result.test_condition = ModuleConstants.TESTCONDITION_FREQ+self.lineEdit_freq_sg.text()+\ ModuleConstants.TESTCONDITION_FREQ_UNIT+','+ModuleConstants.TESTCONDITION_POWER+\ self.lineEdit_power_sg.text()+ModuleConstants.TESTCONDITION_POWER_UNIT self.test_result.test_results = self.testProcess() if self.thresholdL < self.test_result.test_results < self.thresholdH: QMessageBox.information( self, ModuleConstants.QMESSAGEBOX_INFO, ModuleConstants.QMESSAGEBOX_CONTENTS_TEST_NORMAL, QMessageBox.Ok) self.test_result.test_conclusion = ModuleConstants.TESTRESULT_PASS else: QMessageBox.information( self, ModuleConstants.QMESSAGEBOX_INFO, ModuleConstants.TESTITEM_TR_R + ModuleConstants.QMESSAGEBOX_CONTENTS_TEST_ABNORMAL, QMessageBox.Ok) self.test_result.test_conclusion = ModuleConstants.TESTRESULT_FAIL if not self.demo: self.sa.Preset() self.sg.Preset() self._signalTest.emit("test") self.accept() self.close()