Surface NMR processing and inversion GUI
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

callScript.py 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from PyQt5 import uic
  2. from PyQt5 import QtGui, QtCore
  3. from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication, QTextEdit, QApplication, QDialog
  4. def p(x):
  5. print (x)
  6. class callScript(QDialog):
  7. #def __init__(self):
  8. # super().__init__()
  9. def setupCB(self, akvoData, kernelParams, SaveStr):
  10. #QtGui.QWidget.__init__(self)
  11. #uic.loadUi('redirect.ui', self)
  12. #print ('Connecting process')
  13. self.process = QtCore.QProcess(self)
  14. self.process.readyReadStandardOutput.connect(self.stdoutReady)
  15. self.process.readyReadStandardError.connect(self.stderrReady)
  16. self.process.started.connect(lambda: p('Started!'))
  17. self.process.finished.connect(lambda: p('Finished!'))
  18. #print ('Starting process')
  19. #self.process.start('python', ['calcAkvoKernel.py', akvoData, TxCoil, SaveStr])
  20. self.process.start('akvoK0', [ akvoData, kernelParams, SaveStr])
  21. def setupQTInv(self, params):
  22. #QtGui.QWidget.__init__(self)
  23. #uic.loadUi('redirect.ui', self)
  24. #print ('Connecting process')
  25. self.process = QtCore.QProcess(self)
  26. self.process.readyReadStandardOutput.connect(self.stdoutReady)
  27. self.process.readyReadStandardError.connect(self.stderrReady)
  28. self.process.started.connect(lambda: p('Started!'))
  29. self.process.finished.connect(lambda: p('Finished!'))
  30. #print ('Starting process')
  31. #self.process.start('python', ['calcAkvoKernel.py', akvoData, TxCoil, SaveStr])
  32. self.process.start('akvoQT', [params])
  33. def append(self, text):
  34. cursor = self.ui.textEdit.textCursor()
  35. cursor.movePosition(cursor.End)
  36. cursor.insertText(text)
  37. self.ui.textEdit.ensureCursorVisible()
  38. #MyTextEdit.verticalScrollBar()->setValue(MyTextEdit.verticalScrollBar()->maximum());
  39. def stdoutReady(self):
  40. text = str(self.process.readAllStandardOutput(), encoding='utf-8')
  41. #print (text)
  42. self.append(text)
  43. def stderrReady(self):
  44. text = str(self.process.readAllStandardError())
  45. #print (text) #.strip())
  46. self.append(text)
  47. #def main():
  48. # import sys
  49. # app = QApplication(sys.argv)
  50. # win = MainWindow()
  51. # win.show()
  52. # sys.exit(app.exec_())
  53. #if __name__ == '__main__':
  54. # main()