# Path: apasvo/gui/models/filterlistmodel.py
# class FilterListModel(QtCore.QAbstractTableModel):
#     def __init__(self, listobj, header=None):
#     def rowCount(self, parent=QtCore.QModelIndex()):
#     def columnCount(self, parent=QtCore.QModelIndex()):
#     def data(self, index, role=QtCore.Qt.DisplayRole):
#     def headerData(self, section, orientation, role=QtCore.Qt.DisplayRole):
#     def sort(self, column, order=QtCore.Qt.AscendingOrder):
#     def setData(self, index, value, role=QtCore.Qt.EditRole):
#     def flags(self, index):
#     def removeRows(self, row, count, parent=QtCore.QModelIndex()):
#     def addFilter(self, value=10.0):
#     def clearFilters(self):
#     def list(self):
# 
# Path: apasvo/gui/delegates/dsbdelegate.py
# class DoubleSpinBoxDelegate(QtGui.QStyledItemDelegate):
#     def __init__(self, parent=None, minimum=0.0, maximum=100.0, step=0.01):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, spinBox, index):
#     def setModelData(self, spinBox, model, index):
#     def updateEditorGeometry(self, editor, option, index):
# 
# Path: apasvo/_version.py

# 
# Path: apasvo/_version.py



from PySide import QtCore
from PySide import QtGui
from apasvo.gui.models import filterlistmodel
from apasvo.gui.delegates import dsbdelegate
from apasvo._version import _application_name
from apasvo._version import _organization
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''




class AmpaDialog(QtGui.QDialog):
    """
    """

    def __init__(self, stream, trace_list=None, parent=None):
        super(AmpaDialog, self).__init__(parent)

        traces = stream.traces if not trace_list else trace_list
        self.step = 1.0 / max([trace.fs for trace in traces])
        self.max_value = min([((len(trace) - 1) / trace.fs) for trace in traces])



        self.nyquist_freq = max([trace.fs for trace in traces]) / 2.0
        self.setup_ui()

        self._filters = filterlistmodel.FilterListModel([])
        self.filtersTable.setModel(self._filters)
        self._filters.sizeChanged.connect(self._on_size_changed)
        self._filters.dataChanged.connect(self._on_data_changed)

# Path: apasvo/gui/models/filterlistmodel.py
# class FilterListModel(QtCore.QAbstractTableModel):
#     def __init__(self, listobj, header=None):
#     def rowCount(self, parent=QtCore.QModelIndex()):
#     def columnCount(self, parent=QtCore.QModelIndex()):
#     def data(self, index, role=QtCore.Qt.DisplayRole):
#     def headerData(self, section, orientation, role=QtCore.Qt.DisplayRole):
#     def sort(self, column, order=QtCore.Qt.AscendingOrder):
#     def setData(self, index, value, role=QtCore.Qt.EditRole):
#     def flags(self, index):
#     def removeRows(self, row, count, parent=QtCore.QModelIndex()):
#     def addFilter(self, value=10.0):
#     def clearFilters(self):
#     def list(self):
# 
# Path: apasvo/gui/delegates/dsbdelegate.py
# class DoubleSpinBoxDelegate(QtGui.QStyledItemDelegate):
#     def __init__(self, parent=None, minimum=0.0, maximum=100.0, step=0.01):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, spinBox, index):
#     def setModelData(self, spinBox, model, index):
#     def updateEditorGeometry(self, editor, option, index):
# 
# Path: apasvo/_version.py

# 
# Path: apasvo/_version.py



# Path: apasvo/gui/views/ampadialog.py
from PySide import QtCore
from PySide import QtGui
from apasvo.gui.models import filterlistmodel
from apasvo.gui.delegates import dsbdelegate
from apasvo._version import _application_name
from apasvo._version import _organization

  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''




class AmpaDialog(QtGui.QDialog):
    """
    """

    def __init__(self, stream, trace_list=None, parent=None):
        super(AmpaDialog, self).__init__(parent)

        traces = stream.traces if not trace_list else trace_list
        self.step = 1.0 / max([trace.fs for trace in traces])
        self.max_value = min([((len(trace) - 1) / trace.fs) for trace in traces])



        self.nyquist_freq = max([trace.fs for trace in traces]) / 2.0
        self.setup_ui()

        self._filters = filterlistmodel.FilterListModel([])
        self.filtersTable.setModel(self._filters)
        self._filters.sizeChanged.connect(self._on_size_changed)
        self._filters.dataChanged.connect(self._on_data_changed)

        filterDelegate = dsbdelegate.DoubleSpinBoxDelegate(self.filtersTable,