Surface NMR processing and inversion GUI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

callScript.py 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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, TxCoil, 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, TxCoil, kernelParams, SaveStr])
  21. def append(self, text):
  22. cursor = self.ui.textEdit.textCursor()
  23. cursor.movePosition(cursor.End)
  24. cursor.insertText(text)
  25. self.ui.textEdit.ensureCursorVisible()
  26. #MyTextEdit.verticalScrollBar()->setValue(MyTextEdit.verticalScrollBar()->maximum());
  27. def stdoutReady(self):
  28. text = str(self.process.readAllStandardOutput(), encoding='utf-8')
  29. #print (text)
  30. self.append(text)
  31. def stderrReady(self):
  32. text = str(self.process.readAllStandardError())
  33. #print (text) #.strip())
  34. self.append(text)
  35. #def main():
  36. # import sys
  37. # app = QApplication(sys.argv)
  38. # win = MainWindow()
  39. # win.show()
  40. # sys.exit(app.exec_())
  41. #if __name__ == '__main__':
  42. # main()