[update] pylot.in no longer mandatory
This commit is contained in:
parent
ebf6d4806a
commit
66b7dea706
12
PyLoT.py
12
PyLoT.py
@ -117,15 +117,19 @@ 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) == False:
|
if os.path.isfile(infile) is False:
|
||||||
infile = QFileDialog().getOpenFileName(caption='Choose PyLoT-input file')[0]
|
infile = QFileDialog().getOpenFileName(caption='Choose PyLoT-input file')[0]
|
||||||
|
|
||||||
if not os.path.exists(infile):
|
if not os.path.exists(infile):
|
||||||
QMessageBox.warning(self, "PyLoT Warning",
|
QMessageBox.warning(self, "PyLoT Warning",
|
||||||
"No PyLoT-input file declared!")
|
"No PyLoT-input file declared! Using default parameters!")
|
||||||
sys.exit(0)
|
infile = None
|
||||||
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.
|
||||||
|
@ -26,9 +26,7 @@ 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(os.path.join(os.path.expanduser('~'),
|
FILTERDEFAULTS = readDefaultFilterInformation()
|
||||||
'.pylot',
|
|
||||||
'pylot.in'))
|
|
||||||
|
|
||||||
TIMEERROR_DEFAULTS = os.path.join(os.path.expanduser('~'),
|
TIMEERROR_DEFAULTS = os.path.join(os.path.expanduser('~'),
|
||||||
'.pylot',
|
'.pylot',
|
||||||
|
@ -37,15 +37,14 @@ def getAutoFilteroptions(phase, parameter):
|
|||||||
return filteroptions
|
return filteroptions
|
||||||
|
|
||||||
|
|
||||||
def readDefaultFilterInformation(fname):
|
def readDefaultFilterInformation():
|
||||||
"""
|
"""
|
||||||
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(fname)
|
pparam = PylotParameter()
|
||||||
|
pparam.reset_defaults()
|
||||||
return readFilterInformation(pparam)
|
return readFilterInformation(pparam)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user