# Path: apasvo/gui/views/generated/ui_loaddialog.py
# class Ui_LoadDialog(object):
#     def setupUi(self, LoadDialog):
#     def retranslateUi(self, LoadDialog):
# 
# Path: apasvo/utils/formats/rawfile.py
# class RawFile(object):
# class BinFile(RawFile):
# class TextFile(RawFile):
#     def __init__(self):
#     def read(self):
#     def read_in_blocks(self, block_size):
#     def write(self, array):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
# def get_file_handler(filename, fmt='', dtype='float64', byteorder='native', **kwargs):


from PySide import QtGui
from apasvo.gui.views.generated import ui_loaddialog
from apasvo.utils.formats import rawfile

    The class also infers the right parameters for the chosen file and shows
    a preview of the loaded data for the selected parameters.

    Attributes:
        filename: Name of the opened file.
    """

    def __init__(self, parent, filename):
        super(LoadDialog, self).__init__(parent)
        self.setupUi(self)

        self.FileFormatComboBox.currentIndexChanged.connect(self.on_format_change)
        self.FileFormatComboBox.currentIndexChanged.connect(self.load_preview)
        self.DataTypeComboBox.currentIndexChanged.connect(self.load_preview)
        self.ByteOrderComboBox.currentIndexChanged.connect(self.load_preview)
        # init file format combobox
        self.FileFormatComboBox.addItems(FORMATS.keys())
        self.FileFormatComboBox.setCurrentIndex(FORMATS.keys().index(DEFAULT_FORMAT))
        # init datatype combobox
        self.DataTypeComboBox.addItems(DTYPES_LABELS)
        self.DataTypeComboBox.setCurrentIndex(DTYPES.index(rawfile.datatype_float64))

        self.filename = filename

        self.load_preview()

    def on_format_change(self, idx):
        """Updates UI after toggling the format value."""
        fmt = FORMATS[self.FileFormatComboBox.currentText()]

# Path: apasvo/gui/views/generated/ui_loaddialog.py
# class Ui_LoadDialog(object):
#     def setupUi(self, LoadDialog):
#     def retranslateUi(self, LoadDialog):
# 
# Path: apasvo/utils/formats/rawfile.py
# class RawFile(object):
# class BinFile(RawFile):
# class TextFile(RawFile):
#     def __init__(self):
#     def read(self):
#     def read_in_blocks(self, block_size):
#     def write(self, array):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
# def get_file_handler(filename, fmt='', dtype='float64', byteorder='native', **kwargs):


# Path: apasvo/gui/views/loaddialog.py
from PySide import QtGui
from apasvo.gui.views.generated import ui_loaddialog
from apasvo.utils.formats import rawfile


    The class also infers the right parameters for the chosen file and shows
    a preview of the loaded data for the selected parameters.

    Attributes:
        filename: Name of the opened file.
    """

    def __init__(self, parent, filename):
        super(LoadDialog, self).__init__(parent)
        self.setupUi(self)

        self.FileFormatComboBox.currentIndexChanged.connect(self.on_format_change)
        self.FileFormatComboBox.currentIndexChanged.connect(self.load_preview)
        self.DataTypeComboBox.currentIndexChanged.connect(self.load_preview)
        self.ByteOrderComboBox.currentIndexChanged.connect(self.load_preview)
        # init file format combobox
        self.FileFormatComboBox.addItems(FORMATS.keys())
        self.FileFormatComboBox.setCurrentIndex(FORMATS.keys().index(DEFAULT_FORMAT))
        # init datatype combobox
        self.DataTypeComboBox.addItems(DTYPES_LABELS)
        self.DataTypeComboBox.setCurrentIndex(DTYPES.index(rawfile.datatype_float64))

        self.filename = filename

        self.load_preview()

    def on_format_change(self, idx):
        """Updates UI after toggling the format value."""
        fmt = FORMATS[self.FileFormatComboBox.currentText()]

        if fmt == rawfile.format_binary: