classes for I/O started, QtPyLoT.py cleaned

This commit is contained in:
Sebastian Wehling 2014-02-03 12:51:23 +01:00
parent 25351d3827
commit d016a80a72
3 changed files with 60 additions and 65 deletions

View File

@ -33,57 +33,57 @@ class MainWindow(QMainWindow):
class PickWindow(QDialog): class PickWindow(QDialog):
def __init__(self, station=None, parent=None): def __init__(self, station=None, parent=None):
super(PickWindow, self).__init__(parent) super(PickWindow, self).__init__(parent)
filterDockWidget = FilterOptionsDock() filterDockWidget = FilterOptionsDock()
class PropertiesWindow(QDialog): class PropertiesWindow(QDialog):
def __init__(self, parent=None): def __init__(self, parent=None):
super(PropertiesWindow, self).__init__(parent) super(PropertiesWindow, self).__init__(parent)
class FilterOptionsDock(QDockWidget): class FilterOptionsDock(QDockWidget):
def __init__(self, filterOptions=None): def __init__(self, filterOptions=None):
super(FilterOptionsDock, self).__init__() super(FilterOptionsDock, self).__init__()
if filterOptions and not isinstance(filterOptions, FilterOptions): if filterOptions and not isinstance(filterOptions, FilterOptions):
try: try:
fOptions = FilterOptions(filterOptions) fOptions = FilterOptions(filterOptions)
except e: except e:
raise OptionsError, '%s' % e raise OptionsError, '%s' % e
class FilterOptions(object): class FilterOptions(object):
def __init__(self, filtertype=None, freq=None, order=None): def __init__(self, filtertype=None, freq=None, order=None):
self.__filterInformation = {} self.__filterInformation = {}
self._setfilterType(filtertype) self._setfilterType(filtertype)
self._setFreq(freq) self._setFreq(freq)
self._setOrder(order) self._setOrder(order)
def _getFreq(self): def _getFreq(self):
return self.__filterInformation['freq'] return self.__filterInformation['freq']
def _setFreq(self, freq): def _setFreq(self, freq):
self.__filterInformation['freq'] = freq self.__filterInformation['freq'] = freq
def _getOrder(self): def _getOrder(self):
return self.__filterInformation['order'] return self.__filterInformation['order']
def _setOrder(self, order): def _setOrder(self, order):
self.__filterInformation['order'] = order self.__filterInformation['order'] = order
def _getFilterType(self): def _getFilterType(self):
return self.__filterInformation['filtertype'] return self.__filterInformation['filtertype']
def _setFilterType(self, filtertype):
self.__filterInformation['filtertype'] = filtertype
filterType = property(fget=_getFilterType, fset=_setFilterType)
order = property(fget=_getOrder, fset=_setOrder)
freq = property(fget=_getFreq, fset=_setFreq)
def _setFilterType(self, filtertype):
self.__filterInformation['filtertype'] = filtertype
filterType = property(fget=_getFilterType, fset=_setFilterType)
order = property(fget=_getOrder, fset=_setOrder)
freq = property(fget=_getFreq, fset=_setFreq)
class OptionsError(Exception): pass class OptionsError(Exception): pass
if __name__ == '__main__': if __name__ == '__main__':
@ -91,27 +91,8 @@ if __name__ == '__main__':
pylot_app = QApplication(sys.argv) pylot_app = QApplication(sys.argv)
pylot_main = MainWindow() pylot_main = MainWindow()
pylot_main.setWindowTitle('TestWindow') pylot_main.setWindowTitle('PyLoT-The Picking and Localization Tool')
ok_btn = QPushButton('OK', pylot_main) # Show window and run the app
pylot_main.show()
@pyqtSlot() pylot_app.exec_()
def on_click():
print('clicked')
@pyqtSlot()
def on_press():
print('pressed')
@pyqtSlot()
def on_release():
print('released')
# Connect signals to slots
ok_btn.clicked.connect(on_click)
ok_btn.pressed.connect(on_press)
ok_btn.pressed.connect(on_release)
# Show window and run the app
pylot_main.show()
pylot_app.exec_()

View File

View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
#
# Provide user the opportunity to read arbitrary organized database
# types. This means e.g. seiscomp data structure (SDS) or event based
# EGELADOS structure.
#
class GenericDataBase(object):
def __init__(self, root=None, kwargs**):
pass
class SeiscompDataStructure(GenericDataBase):
pass