|
|
@ -217,30 +217,37 @@ class MtorImageAnalysis(QWidget): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_gui(): |
|
|
|
def run_gui(): |
|
|
|
app = QApplication(sys.argv) |
|
|
|
import traceback |
|
|
|
mia = MtorImageAnalysis() |
|
|
|
|
|
|
|
app.exec_() |
|
|
|
try: |
|
|
|
|
|
|
|
|
|
|
|
if mia.analysis_parameters is not None: |
|
|
|
app = QApplication(sys.argv) |
|
|
|
pw = prescan_workflow(**mia.analysis_parameters) |
|
|
|
mia = MtorImageAnalysis() |
|
|
|
iw = image_workflow(pw.parameters) |
|
|
|
app.exec_() |
|
|
|
dw = data_workflow(iw.data, iw.parameters) |
|
|
|
|
|
|
|
fw = postprocessing_workflow(dw.data, dw.parameters) |
|
|
|
if mia.analysis_parameters is not None: |
|
|
|
pdf_path = fw.parameters.data_dir / "report.pdf" |
|
|
|
pw = prescan_workflow(**mia.analysis_parameters) |
|
|
|
if sys.platform.startswith("win"): |
|
|
|
iw = image_workflow(pw.parameters) |
|
|
|
os.startfile(str(pdf_path)) |
|
|
|
dw = data_workflow(iw.data, iw.parameters) |
|
|
|
else: |
|
|
|
fw = postprocessing_workflow(dw.data, dw.parameters) |
|
|
|
if sys.platform.startswith("darwin"): |
|
|
|
pdf_path = fw.parameters.data_dir / "report.pdf" |
|
|
|
cmd = ["open", str(pdf_path)] |
|
|
|
if sys.platform.startswith("win"): |
|
|
|
|
|
|
|
os.startfile(str(pdf_path)) |
|
|
|
else: |
|
|
|
else: |
|
|
|
cmd = ["xdg-open", str(pdf_path)] |
|
|
|
if sys.platform.startswith("darwin"): |
|
|
|
Popen( |
|
|
|
cmd = ["open", str(pdf_path)] |
|
|
|
cmd, |
|
|
|
else: |
|
|
|
shell=False, |
|
|
|
cmd = ["xdg-open", str(pdf_path)] |
|
|
|
stdin=None, |
|
|
|
Popen( |
|
|
|
stdout=None, |
|
|
|
cmd, |
|
|
|
stderr=None, |
|
|
|
shell=False, |
|
|
|
close_fds=True, |
|
|
|
stdin=None, |
|
|
|
) |
|
|
|
stdout=None, |
|
|
|
|
|
|
|
stderr=None, |
|
|
|
sys.exit() |
|
|
|
close_fds=True, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
except Exception as err: |
|
|
|
|
|
|
|
traceback.print_exc() |
|
|
|
|
|
|
|
input("Press enter to close this window") |
|
|
|
|
|
|
|
finally: |
|
|
|
|
|
|
|
sys.exit() |
|
|
|