Compare commits

..

No commits in common. "8d94440e770468377f5836357773b87952bb3b09" and "207d0b3a6fbb94d2c1d428852d0bea5ef315e268" have entirely different histories.

3 changed files with 19 additions and 15 deletions

@ -117,19 +117,17 @@ class MainWindow(QMainWindow):
if not infile: if not infile:
infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in') infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in')
print('Using default input file {}'.format(infile)) print('Using default input file {}'.format(infile))
if os.path.isfile(infile) is False: if os.path.isfile(infile) == False:
infile = QFileDialog().getOpenFileName(caption='Choose PyLoT-input file')[0] infile = QFileDialog().getOpenFileName(caption='Choose PyLoT-input file')
if not os.path.exists(infile): if not os.path.exists(infile[0]):
QMessageBox.warning(self, "PyLoT Warning", QMessageBox.warning(self, "PyLoT Warning",
"No PyLoT-input file declared! Using default parameters!") "No PyLoT-input file declared!")
infile = None sys.exit(0)
self.infile = infile[0]
else:
self.infile = infile
self._inputs = PylotParameter(infile) self._inputs = PylotParameter(infile)
if not infile:
self._inputs.reset_defaults()
self.infile = infile
self._props = None self._props = None
self.gain = 1. self.gain = 1.
@ -734,12 +732,15 @@ class MainWindow(QMainWindow):
_widget.setLayout(self._main_layout) _widget.setLayout(self._main_layout)
_widget.showFullScreen() _widget.showFullScreen()
self.logwidget = LogWidget(parent=None)
if use_logwidget: if use_logwidget:
self.logwidget = LogWidget(parent=None)
self.logwidget.show() self.logwidget.show()
self.stdout = self.logwidget.stdout self.stdout = self.logwidget.stdout
self.stderr = self.logwidget.stderr self.stderr = self.logwidget.stderr
sys.stdout = self.stdout
sys.stderr = self.stderr
# Not sure why but the lines above kept messing with the Ouput even with use_logwidget disabled # Not sure why but the lines above kept messing with the Ouput even with use_logwidget disabled
sys.stdout = self.stdout sys.stdout = self.stdout
sys.stderr = self.stderr sys.stderr = self.stderr

@ -26,7 +26,9 @@ elif system_name == "Windows":
# suffix for phase name if not phase identified by last letter (P, p, etc.) # suffix for phase name if not phase identified by last letter (P, p, etc.)
ALTSUFFIX = ['diff', 'n', 'g', '1', '2', '3'] ALTSUFFIX = ['diff', 'n', 'g', '1', '2', '3']
FILTERDEFAULTS = readDefaultFilterInformation() FILTERDEFAULTS = readDefaultFilterInformation(os.path.join(os.path.expanduser('~'),
'.pylot',
'pylot.in'))
TIMEERROR_DEFAULTS = os.path.join(os.path.expanduser('~'), TIMEERROR_DEFAULTS = os.path.join(os.path.expanduser('~'),
'.pylot', '.pylot',

@ -37,14 +37,15 @@ def getAutoFilteroptions(phase, parameter):
return filteroptions return filteroptions
def readDefaultFilterInformation(): def readDefaultFilterInformation(fname):
""" """
Read default filter information from pylot.in file Read default filter information from pylot.in file
:param fname: path to pylot.in file
:type fname: str
:return: dictionary containing the defailt filter information :return: dictionary containing the defailt filter information
:rtype: dict :rtype: dict
""" """
pparam = PylotParameter() pparam = PylotParameter(fname)
pparam.reset_defaults()
return readFilterInformation(pparam) return readFilterInformation(pparam)