# -*- coding: utf-8 -*-

from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8

    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class SubsetTabFactory(object):
    def __init__(self):
        pass

    def CreateSubsetTab(self):
        self.tab = QtGui.QWidget()
        self.tab.setObjectName(_fromUtf8("tab"))
        self.verticalLayout_8 = QtGui.QVBoxLayout(self.tab)
        self.verticalLayout_8.setMargin(0)
        self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8"))
        self.gridLayout_9 = QtGui.QGridLayout()
        self.gridLayout_9.setMargin(10)
        self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9"))
        self.line_17 = QtGui.QFrame(self.tab)
        self.line_17.setFrameShape(QtGui.QFrame.VLine)
        self.line_17.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_17.setObjectName(_fromUtf8("line_17"))
        self.gridLayout_9.addWidget(self.line_17, 0, 1, 3, 1)
        self.tabWidget_4 = QtGui.QTabWidget(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tabWidget_4.sizePolicy().hasHeightForWidth())
        self.tabWidget_4.setSizePolicy(sizePolicy)
        self.tabWidget_4.setMinimumSize(QtCore.QSize(750, 200))
        self.tabWidget_4.setMaximumSize(QtCore.QSize(800, 16777215))
        self.tabWidget_4.setObjectName(_fromUtf8("tabWidget_4"))
        self.tab_9 = QtGui.QWidget()
        self.tab_9.setObjectName(_fromUtf8("tab_9"))
        self.horizontalLayout_8 = QtGui.QHBoxLayout(self.tab_9)
        self.horizontalLayout_8.setMargin(0)
        self.horizontalLayout_8.setObjectName(_fromUtf8("horizontalLayout_8"))
        self.gridLayout_6 = QtGui.QGridLayout()
        self.gridLayout_6.setMargin(5)
        self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6"))
        self.component_treewidget = QtGui.QTreeWidget(self.tab_9)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(15)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.component_treewidget.sizePolicy().hasHeightForWidth())
        self.component_treewidget.setSizePolicy(sizePolicy)
        self.component_treewidget.setMaximumSize(QtCore.QSize(250, 16777215))
        self.component_treewidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
        self.component_treewidget.setAlternatingRowColors(True)
        self.component_treewidget.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.component_treewidget.setObjectName(_fromUtf8("component_treewidget"))
        self.gridLayout_6.addWidget(self.component_treewidget, 0, 2, 1, 1)
        self.result_treewidget = QtGui.QTreeWidget(self.tab_9)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(25)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.result_treewidget.sizePolicy().hasHeightForWidth())
        self.result_treewidget.setSizePolicy(sizePolicy)
        self.result_treewidget.setAlternatingRowColors(True)
        self.result_treewidget.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.result_treewidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.result_treewidget.setHeaderHidden(False)
        self.result_treewidget.setObjectName(_fromUtf8("result_treewidget"))
        self.gridLayout_6.addWidget(self.result_treewidget, 0, 0, 1, 1)
        self.residual_treewidget = QtGui.QTreeWidget(self.tab_9)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.residual_treewidget.sizePolicy().hasHeightForWidth())
        self.residual_treewidget.setSizePolicy(sizePolicy)
        self.residual_treewidget.setMaximumSize(QtCore.QSize(16777215, 75))
        self.residual_treewidget.setAlternatingRowColors(True)
        self.residual_treewidget.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.residual_treewidget.setObjectName(_fromUtf8("residual_treewidget"))
        self.gridLayout_6.addWidget(self.residual_treewidget, 2, 0, 1, 3)
        self.line_10 = QtGui.QFrame(self.tab_9)
        self.line_10.setFrameShape(QtGui.QFrame.VLine)
        self.line_10.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_10.setObjectName(_fromUtf8("line_10"))
        self.gridLayout_6.addWidget(self.line_10, 0, 1, 1, 1)
        self.line_11 = QtGui.QFrame(self.tab_9)
        self.line_11.setFrameShape(QtGui.QFrame.HLine)
        self.line_11.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_11.setObjectName(_fromUtf8("line_11"))
        self.gridLayout_6.addWidget(self.line_11, 1, 0, 1, 3)
        self.horizontalLayout_8.addLayout(self.gridLayout_6)
        self.tabWidget_4.addTab(self.tab_9, _fromUtf8(""))
        self.tab_10 = QtGui.QWidget()
        self.tab_10.setObjectName(_fromUtf8("tab_10"))
        self.horizontalLayout_9 = QtGui.QHBoxLayout(self.tab_10)
        self.horizontalLayout_9.setMargin(0)
        self.horizontalLayout_9.setObjectName(_fromUtf8("horizontalLayout_9"))
        self.verticalLayout_5 = QtGui.QVBoxLayout()
        self.verticalLayout_5.setMargin(5)
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.curvestat_treewidget = QtGui.QTreeWidget(self.tab_10)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.curvestat_treewidget.sizePolicy().hasHeightForWidth())
        self.curvestat_treewidget.setSizePolicy(sizePolicy)
        self.curvestat_treewidget.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.curvestat_treewidget.setIndentation(0)
        self.curvestat_treewidget.setColumnCount(5)
        self.curvestat_treewidget.setObjectName(_fromUtf8("curvestat_treewidget"))
        self.verticalLayout_5.addWidget(self.curvestat_treewidget)
        self.horizontalLayout_9.addLayout(self.verticalLayout_5)
        self.tabWidget_4.addTab(self.tab_10, _fromUtf8(""))
        self.gridLayout_9.addWidget(self.tabWidget_4, 2, 0, 1, 1)
        self.verticalLayout_7 = QtGui.QVBoxLayout()
        self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7"))
        self.gridLayout_10 = QtGui.QGridLayout()
        self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10"))
        self.data_combobox = QtGui.QComboBox(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.data_combobox.sizePolicy().hasHeightForWidth())
        self.data_combobox.setSizePolicy(sizePolicy)
        self.data_combobox.setObjectName(_fromUtf8("data_combobox"))
        self.gridLayout_10.addWidget(self.data_combobox, 1, 0, 2, 1)
        self.popmain_btn = QtGui.QPushButton(self.tab)
        self.popmain_btn.setMaximumSize(QtCore.QSize(100, 16777215))
        self.popmain_btn.setObjectName(_fromUtf8("popmain_btn"))
        self.gridLayout_10.addWidget(self.popmain_btn, 3, 2, 1, 1)
        self.time_combobox = QtGui.QComboBox(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.time_combobox.sizePolicy().hasHeightForWidth())
        self.time_combobox.setSizePolicy(sizePolicy)
        self.time_combobox.setMinimumSize(QtCore.QSize(75, 0))
        self.time_combobox.setObjectName(_fromUtf8("time_combobox"))
        self.time_combobox.addItem(_fromUtf8(""))
        self.time_combobox.addItem(_fromUtf8(""))
        self.gridLayout_10.addWidget(self.time_combobox, 1, 1, 2, 2)
        self.plot_btn = QtGui.QPushButton(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.plot_btn.sizePolicy().hasHeightForWidth())
        self.plot_btn.setSizePolicy(sizePolicy)
        self.plot_btn.setMaximumSize(QtCore.QSize(100, 16777215))
        self.plot_btn.setObjectName(_fromUtf8("plot_btn"))
        self.gridLayout_10.addWidget(self.plot_btn, 3, 1, 1, 1)
        self.horizontalLayout_12 = QtGui.QHBoxLayout()
        self.horizontalLayout_12.setObjectName(_fromUtf8("horizontalLayout_12"))
        self.enablegrid_chk = QtGui.QCheckBox(self.tab)
        self.enablegrid_chk.setMinimumSize(QtCore.QSize(0, 0))
        self.enablegrid_chk.setMaximumSize(QtCore.QSize(125, 16777215))
        self.enablegrid_chk.setObjectName(_fromUtf8("enablegrid_chk"))
        self.horizontalLayout_12.addWidget(self.enablegrid_chk)
        self.uselc_chk = QtGui.QCheckBox(self.tab)
        self.uselc_chk.setMaximumSize(QtCore.QSize(125, 16777215))
        self.uselc_chk.setChecked(True)
        self.uselc_chk.setObjectName(_fromUtf8("uselc_chk"))
        self.horizontalLayout_12.addWidget(self.uselc_chk)
        self.autoupdate_chk = QtGui.QCheckBox(self.tab)
        self.autoupdate_chk.setMaximumSize(QtCore.QSize(125, 16777215))
        self.autoupdate_chk.setObjectName(_fromUtf8("autoupdate_chk"))
        self.horizontalLayout_12.addWidget(self.autoupdate_chk)
        self.gridLayout_10.addLayout(self.horizontalLayout_12, 3, 0, 1, 1)
        self.verticalLayout_7.addLayout(self.gridLayout_10)
        self.line_16 = QtGui.QFrame(self.tab)
        self.line_16.setFrameShape(QtGui.QFrame.HLine)
        self.line_16.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_16.setObjectName(_fromUtf8("line_16"))
        self.verticalLayout_7.addWidget(self.line_16)
        self.plotwidget = QtGui.QWidget(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.plotwidget.sizePolicy().hasHeightForWidth())
        self.plotwidget.setSizePolicy(sizePolicy)
        self.plotwidget.setMinimumSize(QtCore.QSize(300, 300))
        self.plotwidget.setObjectName(_fromUtf8("plotwidget"))
        self.verticalLayout_7.addWidget(self.plotwidget)
        self.gridLayout_9.addLayout(self.verticalLayout_7, 0, 2, 3, 1)
        self.line_18 = QtGui.QFrame(self.tab)
        self.line_18.setFrameShape(QtGui.QFrame.HLine)
        self.line_18.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_18.setObjectName(_fromUtf8("line_18"))
        self.gridLayout_9.addWidget(self.line_18, 1, 0, 1, 1)
        self.tabWidget = QtGui.QTabWidget(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
        self.tabWidget.setSizePolicy(sizePolicy)
        self.tabWidget.setMaximumSize(QtCore.QSize(800, 200))
        self.tabWidget.setTabPosition(QtGui.QTabWidget.West)
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.tab_11 = QtGui.QWidget()
        self.tab_11.setObjectName(_fromUtf8("tab_11"))
        self.verticalLayout_6 = QtGui.QVBoxLayout(self.tab_11)
        self.verticalLayout_6.setMargin(0)
        self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6"))
        self.gridLayout_7 = QtGui.QGridLayout()
        self.gridLayout_7.setMargin(10)
        self.gridLayout_7.setHorizontalSpacing(2)
        self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7"))
        self.jd0_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.jd0_chk.setFont(font)
        self.jd0_chk.setObjectName(_fromUtf8("jd0_chk"))
        self.gridLayout_7.addWidget(self.jd0_chk, 0, 0, 1, 1)
        self.s1tstart_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1tstart_chk.setFont(font)
        self.s1tstart_chk.setObjectName(_fromUtf8("s1tstart_chk"))
        self.gridLayout_7.addWidget(self.s1tstart_chk, 5, 4, 1, 1)
        self.dperdt_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.dperdt_chk.setFont(font)
        self.dperdt_chk.setObjectName(_fromUtf8("dperdt_chk"))
        self.gridLayout_7.addWidget(self.dperdt_chk, 0, 4, 1, 1)
        self.tc3b_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.tc3b_chk.setFont(font)
        self.tc3b_chk.setObjectName(_fromUtf8("tc3b_chk"))
        self.gridLayout_7.addWidget(self.tc3b_chk, 4, 4, 1, 1)
        self.el3_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.el3_chk.setFont(font)
        self.el3_chk.setToolTip(_fromUtf8(""))
        self.el3_chk.setObjectName(_fromUtf8("el3_chk"))
        self.gridLayout_7.addWidget(self.el3_chk, 4, 6, 1, 1)
        self.x1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.x1_chk.setFont(font)
        self.x1_chk.setObjectName(_fromUtf8("x1_chk"))
        self.gridLayout_7.addWidget(self.x1_chk, 3, 4, 1, 1)
        self.s1long_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1long_chk.setFont(font)
        self.s1long_chk.setObjectName(_fromUtf8("s1long_chk"))
        self.gridLayout_7.addWidget(self.s1long_chk, 5, 1, 1, 1)
        self.t1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.t1_chk.setFont(font)
        self.t1_chk.setObjectName(_fromUtf8("t1_chk"))
        self.gridLayout_7.addWidget(self.t1_chk, 2, 0, 1, 1)
        self.p0_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.p0_chk.setFont(font)
        self.p0_chk.setObjectName(_fromUtf8("p0_chk"))
        self.gridLayout_7.addWidget(self.p0_chk, 0, 1, 1, 1)
        self.marqmul_spinbox = QtGui.QSpinBox(self.tab_11)
        self.marqmul_spinbox.setMaximumSize(QtCore.QSize(16777215, 25))
        self.marqmul_spinbox.setProperty("value", 5)
        self.marqmul_spinbox.setObjectName(_fromUtf8("marqmul_spinbox"))
        self.gridLayout_7.addWidget(self.marqmul_spinbox, 0, 8, 1, 1)
        self.horizontalLayout_10 = QtGui.QHBoxLayout()
        self.horizontalLayout_10.setObjectName(_fromUtf8("horizontalLayout_10"))
        self.label_82 = QtGui.QLabel(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.label_82.setFont(font)
        self.label_82.setObjectName(_fromUtf8("label_82"))
        self.horizontalLayout_10.addWidget(self.label_82)
        self.label_3 = QtGui.QLabel(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.label_3.setFont(font)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.horizontalLayout_10.addWidget(self.label_3)
        self.gridLayout_7.addLayout(self.horizontalLayout_10, 0, 6, 1, 2)
        self.line_13 = QtGui.QFrame(self.tab_11)
        self.line_13.setFrameShape(QtGui.QFrame.HLine)
        self.line_13.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_13.setObjectName(_fromUtf8("line_13"))
        self.gridLayout_7.addWidget(self.line_13, 2, 6, 1, 3)
        self.clearbaseset_btn = QtGui.QPushButton(self.tab_11)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.clearbaseset_btn.sizePolicy().hasHeightForWidth())
        self.clearbaseset_btn.setSizePolicy(sizePolicy)
        self.clearbaseset_btn.setObjectName(_fromUtf8("clearbaseset_btn"))
        self.gridLayout_7.addWidget(self.clearbaseset_btn, 3, 8, 4, 1)
        self.q_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.q_chk.setFont(font)
        self.q_chk.setObjectName(_fromUtf8("q_chk"))
        self.gridLayout_7.addWidget(self.q_chk, 1, 3, 1, 1)
        self.p3b_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.p3b_chk.setFont(font)
        self.p3b_chk.setObjectName(_fromUtf8("p3b_chk"))
        self.gridLayout_7.addWidget(self.p3b_chk, 4, 1, 1, 1)
        self.perr0_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.perr0_chk.setFont(font)
        self.perr0_chk.setObjectName(_fromUtf8("perr0_chk"))
        self.gridLayout_7.addWidget(self.perr0_chk, 0, 3, 1, 1)
        self.xinc3b_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.xinc3b_chk.setFont(font)
        self.xinc3b_chk.setObjectName(_fromUtf8("xinc3b_chk"))
        self.gridLayout_7.addWidget(self.xinc3b_chk, 4, 2, 1, 1)
        self.g2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.g2_chk.setFont(font)
        self.g2_chk.setObjectName(_fromUtf8("g2_chk"))
        self.gridLayout_7.addWidget(self.g2_chk, 2, 3, 1, 1)
        self.s1lat_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1lat_chk.setFont(font)
        self.s1lat_chk.setObjectName(_fromUtf8("s1lat_chk"))
        self.gridLayout_7.addWidget(self.s1lat_chk, 5, 0, 1, 1)
        self.s2tend_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2tend_chk.setFont(font)
        self.s2tend_chk.setObjectName(_fromUtf8("s2tend_chk"))
        self.gridLayout_7.addWidget(self.s2tend_chk, 6, 7, 1, 1)
        self.s1tend_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1tend_chk.setFont(font)
        self.s1tend_chk.setObjectName(_fromUtf8("s1tend_chk"))
        self.gridLayout_7.addWidget(self.s1tend_chk, 5, 7, 1, 1)
        self.l2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.l2_chk.setFont(font)
        self.l2_chk.setObjectName(_fromUtf8("l2_chk"))
        self.gridLayout_7.addWidget(self.l2_chk, 3, 3, 1, 1)
        self.s1tmax2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1tmax2_chk.setFont(font)
        self.s1tmax2_chk.setObjectName(_fromUtf8("s1tmax2_chk"))
        self.gridLayout_7.addWidget(self.s1tmax2_chk, 5, 6, 1, 1)
        self.label_81 = QtGui.QLabel(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.label_81.setFont(font)
        self.label_81.setObjectName(_fromUtf8("label_81"))
        self.gridLayout_7.addWidget(self.label_81, 1, 6, 1, 2)
        self.dpdt_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.dpdt_chk.setFont(font)
        self.dpdt_chk.setObjectName(_fromUtf8("dpdt_chk"))
        self.gridLayout_7.addWidget(self.dpdt_chk, 0, 2, 1, 1)
        self.pot1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pot1_chk.setFont(font)
        self.pot1_chk.setObjectName(_fromUtf8("pot1_chk"))
        self.gridLayout_7.addWidget(self.pot1_chk, 3, 6, 1, 1)
        self.desextinc_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.desextinc_chk.setFont(font)
        self.desextinc_chk.setObjectName(_fromUtf8("desextinc_chk"))
        self.gridLayout_7.addWidget(self.desextinc_chk, 4, 7, 1, 1)
        self.g1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.g1_chk.setFont(font)
        self.g1_chk.setObjectName(_fromUtf8("g1_chk"))
        self.gridLayout_7.addWidget(self.g1_chk, 2, 2, 1, 1)
        self.l1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.l1_chk.setFont(font)
        self.l1_chk.setObjectName(_fromUtf8("l1_chk"))
        self.gridLayout_7.addWidget(self.l1_chk, 3, 2, 1, 1)
        self.e_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.e_chk.setFont(font)
        self.e_chk.setObjectName(_fromUtf8("e_chk"))
        self.gridLayout_7.addWidget(self.e_chk, 1, 1, 1, 1)
        self.e3b_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.e3b_chk.setFont(font)
        self.e3b_chk.setObjectName(_fromUtf8("e3b_chk"))
        self.gridLayout_7.addWidget(self.e3b_chk, 4, 3, 1, 1)
        self.a3b_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.a3b_chk.setFont(font)
        self.a3b_chk.setObjectName(_fromUtf8("a3b_chk"))
        self.gridLayout_7.addWidget(self.a3b_chk, 4, 0, 1, 1)
        self.s2lat_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2lat_chk.setFont(font)
        self.s2lat_chk.setObjectName(_fromUtf8("s2lat_chk"))
        self.gridLayout_7.addWidget(self.s2lat_chk, 6, 0, 1, 1)
        self.s1temp_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1temp_chk.setFont(font)
        self.s1temp_chk.setObjectName(_fromUtf8("s1temp_chk"))
        self.gridLayout_7.addWidget(self.s1temp_chk, 5, 3, 1, 1)
        self.s2rad_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2rad_chk.setFont(font)
        self.s2rad_chk.setObjectName(_fromUtf8("s2rad_chk"))
        self.gridLayout_7.addWidget(self.s2rad_chk, 6, 2, 1, 1)
        self.pot2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pot2_chk.setFont(font)
        self.pot2_chk.setObjectName(_fromUtf8("pot2_chk"))
        self.gridLayout_7.addWidget(self.pot2_chk, 3, 7, 1, 1)
        self.alb1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.alb1_chk.setFont(font)
        self.alb1_chk.setObjectName(_fromUtf8("alb1_chk"))
        self.gridLayout_7.addWidget(self.alb1_chk, 2, 4, 1, 1)
        self.f2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f2_chk.setFont(font)
        self.f2_chk.setObjectName(_fromUtf8("f2_chk"))
        self.gridLayout_7.addWidget(self.f2_chk, 3, 1, 1, 1)
        self.s1rad_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1rad_chk.setFont(font)
        self.s1rad_chk.setObjectName(_fromUtf8("s1rad_chk"))
        self.gridLayout_7.addWidget(self.s1rad_chk, 5, 2, 1, 1)
        self.s2long_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2long_chk.setFont(font)
        self.s2long_chk.setObjectName(_fromUtf8("s2long_chk"))
        self.gridLayout_7.addWidget(self.s2long_chk, 6, 1, 1, 1)
        self.a_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.a_chk.setFont(font)
        self.a_chk.setObjectName(_fromUtf8("a_chk"))
        self.gridLayout_7.addWidget(self.a_chk, 1, 0, 1, 1)
        self.f1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f1_chk.setFont(font)
        self.f1_chk.setObjectName(_fromUtf8("f1_chk"))
        self.gridLayout_7.addWidget(self.f1_chk, 3, 0, 1, 1)
        self.incl_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.incl_chk.setFont(font)
        self.incl_chk.setObjectName(_fromUtf8("incl_chk"))
        self.gridLayout_7.addWidget(self.incl_chk, 1, 2, 1, 1)
        self.t2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.t2_chk.setFont(font)
        self.t2_chk.setObjectName(_fromUtf8("t2_chk"))
        self.gridLayout_7.addWidget(self.t2_chk, 2, 1, 1, 1)
        self.logd_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.logd_chk.setFont(font)
        self.logd_chk.setObjectName(_fromUtf8("logd_chk"))
        self.gridLayout_7.addWidget(self.logd_chk, 1, 4, 1, 1)
        self.s2tstart_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2tstart_chk.setFont(font)
        self.s2tstart_chk.setObjectName(_fromUtf8("s2tstart_chk"))
        self.gridLayout_7.addWidget(self.s2tstart_chk, 6, 4, 1, 1)
        self.s2tmax2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2tmax2_chk.setFont(font)
        self.s2tmax2_chk.setObjectName(_fromUtf8("s2tmax2_chk"))
        self.gridLayout_7.addWidget(self.s2tmax2_chk, 6, 6, 1, 1)
        self.s2temp_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2temp_chk.setFont(font)
        self.s2temp_chk.setObjectName(_fromUtf8("s2temp_chk"))
        self.gridLayout_7.addWidget(self.s2temp_chk, 6, 3, 1, 1)
        self.vlr_spinbox = QtGui.QDoubleSpinBox(self.tab_11)
        self.vlr_spinbox.setMaximumSize(QtCore.QSize(16777215, 25))
        self.vlr_spinbox.setDecimals(3)
        self.vlr_spinbox.setMaximum(1.0)
        self.vlr_spinbox.setSingleStep(0.01)
        self.vlr_spinbox.setProperty("value", 1.0)
        self.vlr_spinbox.setObjectName(_fromUtf8("vlr_spinbox"))
        self.gridLayout_7.addWidget(self.vlr_spinbox, 1, 8, 1, 1)
        self.s2tmax1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s2tmax1_chk.setFont(font)
        self.s2tmax1_chk.setObjectName(_fromUtf8("s2tmax1_chk"))
        self.gridLayout_7.addWidget(self.s2tmax1_chk, 6, 5, 1, 1)
        self.s1tmax1_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.s1tmax1_chk.setFont(font)
        self.s1tmax1_chk.setObjectName(_fromUtf8("s1tmax1_chk"))
        self.gridLayout_7.addWidget(self.s1tmax1_chk, 5, 5, 1, 1)
        self.alb2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.alb2_chk.setFont(font)
        self.alb2_chk.setObjectName(_fromUtf8("alb2_chk"))
        self.gridLayout_7.addWidget(self.alb2_chk, 2, 5, 1, 1)
        self.perr3b_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.perr3b_chk.setFont(font)
        self.perr3b_chk.setObjectName(_fromUtf8("perr3b_chk"))
        self.gridLayout_7.addWidget(self.perr3b_chk, 4, 5, 1, 1)
        self.pshift_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.pshift_chk.setFont(font)
        self.pshift_chk.setObjectName(_fromUtf8("pshift_chk"))
        self.gridLayout_7.addWidget(self.pshift_chk, 0, 5, 1, 1)
        self.x2_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.x2_chk.setFont(font)
        self.x2_chk.setObjectName(_fromUtf8("x2_chk"))
        self.gridLayout_7.addWidget(self.x2_chk, 3, 5, 1, 1)
        self.vgam_chk = QtGui.QCheckBox(self.tab_11)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.vgam_chk.setFont(font)
        self.vgam_chk.setObjectName(_fromUtf8("vgam_chk"))
        self.gridLayout_7.addWidget(self.vgam_chk, 1, 5, 1, 1)
        self.verticalLayout_6.addLayout(self.gridLayout_7)
        self.tabWidget.addTab(self.tab_11, _fromUtf8(""))
        self.tab_12 = QtGui.QWidget()
        self.tab_12.setObjectName(_fromUtf8("tab_12"))
        self.horizontalLayout_11 = QtGui.QHBoxLayout(self.tab_12)
        self.horizontalLayout_11.setMargin(0)
        self.horizontalLayout_11.setObjectName(_fromUtf8("horizontalLayout_11"))
        self.gridLayout_8 = QtGui.QGridLayout()
        self.gridLayout_8.setMargin(10)
        self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8"))
        self.del_g1_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_g1_ipt.sizePolicy().hasHeightForWidth())
        self.del_g1_ipt.setSizePolicy(sizePolicy)
        self.del_g1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_g1_ipt.setObjectName(_fromUtf8("del_g1_ipt"))
        self.gridLayout_8.addWidget(self.del_g1_ipt, 5, 0, 1, 1)
        self.del_g2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_g2_ipt.sizePolicy().hasHeightForWidth())
        self.del_g2_ipt.setSizePolicy(sizePolicy)
        self.del_g2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_g2_ipt.setObjectName(_fromUtf8("del_g2_ipt"))
        self.gridLayout_8.addWidget(self.del_g2_ipt, 5, 1, 1, 1)
        self.del_alb1_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_alb1_ipt.sizePolicy().hasHeightForWidth())
        self.del_alb1_ipt.setSizePolicy(sizePolicy)
        self.del_alb1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_alb1_ipt.setObjectName(_fromUtf8("del_alb1_ipt"))
        self.gridLayout_8.addWidget(self.del_alb1_ipt, 5, 4, 1, 1)
        self.label_64 = QtGui.QLabel(self.tab_12)
        self.label_64.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_64.setObjectName(_fromUtf8("label_64"))
        self.gridLayout_8.addWidget(self.label_64, 4, 0, 1, 1)
        self.del_pshift_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_pshift_ipt.sizePolicy().hasHeightForWidth())
        self.del_pshift_ipt.setSizePolicy(sizePolicy)
        self.del_pshift_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_pshift_ipt.setObjectName(_fromUtf8("del_pshift_ipt"))
        self.gridLayout_8.addWidget(self.del_pshift_ipt, 3, 4, 1, 1)
        self.label_65 = QtGui.QLabel(self.tab_12)
        self.label_65.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_65.setObjectName(_fromUtf8("label_65"))
        self.gridLayout_8.addWidget(self.label_65, 2, 4, 1, 1)
        self.label_66 = QtGui.QLabel(self.tab_12)
        self.label_66.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_66.setObjectName(_fromUtf8("label_66"))
        self.gridLayout_8.addWidget(self.label_66, 4, 9, 1, 1)
        self.label_67 = QtGui.QLabel(self.tab_12)
        self.label_67.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_67.setObjectName(_fromUtf8("label_67"))
        self.gridLayout_8.addWidget(self.label_67, 2, 0, 1, 1)
        self.label_68 = QtGui.QLabel(self.tab_12)
        self.label_68.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_68.setObjectName(_fromUtf8("label_68"))
        self.gridLayout_8.addWidget(self.label_68, 4, 1, 1, 1)
        self.del_s1lng_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s1lng_ipt.sizePolicy().hasHeightForWidth())
        self.del_s1lng_ipt.setSizePolicy(sizePolicy)
        self.del_s1lng_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s1lng_ipt.setObjectName(_fromUtf8("del_s1lng_ipt"))
        self.gridLayout_8.addWidget(self.del_s1lng_ipt, 7, 1, 1, 1)
        self.label_69 = QtGui.QLabel(self.tab_12)
        self.label_69.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_69.setObjectName(_fromUtf8("label_69"))
        self.gridLayout_8.addWidget(self.label_69, 2, 1, 1, 1)
        self.label_70 = QtGui.QLabel(self.tab_12)
        self.label_70.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_70.setObjectName(_fromUtf8("label_70"))
        self.gridLayout_8.addWidget(self.label_70, 2, 5, 1, 1)
        self.del_l2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_l2_ipt.sizePolicy().hasHeightForWidth())
        self.del_l2_ipt.setSizePolicy(sizePolicy)
        self.del_l2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_l2_ipt.setObjectName(_fromUtf8("del_l2_ipt"))
        self.gridLayout_8.addWidget(self.del_l2_ipt, 3, 9, 1, 1)
        self.del_perr0_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_perr0_ipt.sizePolicy().hasHeightForWidth())
        self.del_perr0_ipt.setSizePolicy(sizePolicy)
        self.del_perr0_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_perr0_ipt.setObjectName(_fromUtf8("del_perr0_ipt"))
        self.gridLayout_8.addWidget(self.del_perr0_ipt, 3, 5, 1, 1)
        self.del_t2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_t2_ipt.sizePolicy().hasHeightForWidth())
        self.del_t2_ipt.setSizePolicy(sizePolicy)
        self.del_t2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_t2_ipt.setObjectName(_fromUtf8("del_t2_ipt"))
        self.gridLayout_8.addWidget(self.del_t2_ipt, 5, 3, 1, 1)
        self.del_s2tmpf_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s2tmpf_ipt.sizePolicy().hasHeightForWidth())
        self.del_s2tmpf_ipt.setSizePolicy(sizePolicy)
        self.del_s2tmpf_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s2tmpf_ipt.setObjectName(_fromUtf8("del_s2tmpf_ipt"))
        self.gridLayout_8.addWidget(self.del_s2tmpf_ipt, 7, 7, 1, 1)
        self.label_71 = QtGui.QLabel(self.tab_12)
        self.label_71.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_71.setObjectName(_fromUtf8("label_71"))
        self.gridLayout_8.addWidget(self.label_71, 2, 7, 1, 1)
        self.label_72 = QtGui.QLabel(self.tab_12)
        self.label_72.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_72.setStatusTip(_fromUtf8(""))
        self.label_72.setObjectName(_fromUtf8("label_72"))
        self.gridLayout_8.addWidget(self.label_72, 6, 5, 1, 1)
        self.del_t1_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_t1_ipt.sizePolicy().hasHeightForWidth())
        self.del_t1_ipt.setSizePolicy(sizePolicy)
        self.del_t1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_t1_ipt.setObjectName(_fromUtf8("del_t1_ipt"))
        self.gridLayout_8.addWidget(self.del_t1_ipt, 5, 2, 1, 1)
        self.label_73 = QtGui.QLabel(self.tab_12)
        self.label_73.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_73.setObjectName(_fromUtf8("label_73"))
        self.gridLayout_8.addWidget(self.label_73, 2, 3, 1, 1)
        self.label_74 = QtGui.QLabel(self.tab_12)
        self.label_74.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_74.setStatusTip(_fromUtf8(""))
        self.label_74.setObjectName(_fromUtf8("label_74"))
        self.gridLayout_8.addWidget(self.label_74, 6, 4, 1, 1)
        self.label_75 = QtGui.QLabel(self.tab_12)
        self.label_75.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_75.setObjectName(_fromUtf8("label_75"))
        self.gridLayout_8.addWidget(self.label_75, 2, 8, 1, 1)
        self.del_s2lng_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s2lng_ipt.sizePolicy().hasHeightForWidth())
        self.del_s2lng_ipt.setSizePolicy(sizePolicy)
        self.del_s2lng_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s2lng_ipt.setObjectName(_fromUtf8("del_s2lng_ipt"))
        self.gridLayout_8.addWidget(self.del_s2lng_ipt, 7, 5, 1, 1)
        self.del_i_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_i_ipt.sizePolicy().hasHeightForWidth())
        self.del_i_ipt.setSizePolicy(sizePolicy)
        self.del_i_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_i_ipt.setObjectName(_fromUtf8("del_i_ipt"))
        self.gridLayout_8.addWidget(self.del_i_ipt, 3, 2, 1, 1)
        self.label_76 = QtGui.QLabel(self.tab_12)
        self.label_76.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_76.setStatusTip(_fromUtf8(""))
        self.label_76.setWhatsThis(_fromUtf8(""))
        self.label_76.setObjectName(_fromUtf8("label_76"))
        self.gridLayout_8.addWidget(self.label_76, 6, 0, 1, 1)
        self.label_77 = QtGui.QLabel(self.tab_12)
        self.label_77.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_77.setObjectName(_fromUtf8("label_77"))
        self.gridLayout_8.addWidget(self.label_77, 2, 9, 1, 1)
        self.label_78 = QtGui.QLabel(self.tab_12)
        self.label_78.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_78.setObjectName(_fromUtf8("label_78"))
        self.gridLayout_8.addWidget(self.label_78, 4, 3, 1, 1)
        self.label_83 = QtGui.QLabel(self.tab_12)
        self.label_83.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_83.setObjectName(_fromUtf8("label_83"))
        self.gridLayout_8.addWidget(self.label_83, 6, 2, 1, 1)
        self.del_pot2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_pot2_ipt.sizePolicy().hasHeightForWidth())
        self.del_pot2_ipt.setSizePolicy(sizePolicy)
        self.del_pot2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_pot2_ipt.setObjectName(_fromUtf8("del_pot2_ipt"))
        self.gridLayout_8.addWidget(self.del_pot2_ipt, 3, 7, 1, 1)
        self.del_s1agrad_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s1agrad_ipt.sizePolicy().hasHeightForWidth())
        self.del_s1agrad_ipt.setSizePolicy(sizePolicy)
        self.del_s1agrad_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s1agrad_ipt.setObjectName(_fromUtf8("del_s1agrad_ipt"))
        self.gridLayout_8.addWidget(self.del_s1agrad_ipt, 7, 2, 1, 1)
        self.label_84 = QtGui.QLabel(self.tab_12)
        self.label_84.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_84.setObjectName(_fromUtf8("label_84"))
        self.gridLayout_8.addWidget(self.label_84, 2, 6, 1, 1)
        self.del_x2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_x2_ipt.sizePolicy().hasHeightForWidth())
        self.del_x2_ipt.setSizePolicy(sizePolicy)
        self.del_x2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_x2_ipt.setObjectName(_fromUtf8("del_x2_ipt"))
        self.gridLayout_8.addWidget(self.del_x2_ipt, 5, 9, 1, 1)
        self.del_s1tmpf_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s1tmpf_ipt.sizePolicy().hasHeightForWidth())
        self.del_s1tmpf_ipt.setSizePolicy(sizePolicy)
        self.del_s1tmpf_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s1tmpf_ipt.setObjectName(_fromUtf8("del_s1tmpf_ipt"))
        self.gridLayout_8.addWidget(self.del_s1tmpf_ipt, 7, 3, 1, 1)
        self.label_85 = QtGui.QLabel(self.tab_12)
        self.label_85.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_85.setObjectName(_fromUtf8("label_85"))
        self.gridLayout_8.addWidget(self.label_85, 4, 2, 1, 1)
        self.label_86 = QtGui.QLabel(self.tab_12)
        self.label_86.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_86.setObjectName(_fromUtf8("label_86"))
        self.gridLayout_8.addWidget(self.label_86, 2, 2, 1, 1)
        self.del_s2lat_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s2lat_ipt.sizePolicy().hasHeightForWidth())
        self.del_s2lat_ipt.setSizePolicy(sizePolicy)
        self.del_s2lat_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s2lat_ipt.setObjectName(_fromUtf8("del_s2lat_ipt"))
        self.gridLayout_8.addWidget(self.del_s2lat_ipt, 7, 4, 1, 1)
        self.label_87 = QtGui.QLabel(self.tab_12)
        self.label_87.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_87.setStatusTip(_fromUtf8(""))
        self.label_87.setObjectName(_fromUtf8("label_87"))
        self.gridLayout_8.addWidget(self.label_87, 6, 7, 1, 1)
        self.label_88 = QtGui.QLabel(self.tab_12)
        self.label_88.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_88.setObjectName(_fromUtf8("label_88"))
        self.gridLayout_8.addWidget(self.label_88, 4, 4, 1, 1)
        self.del_q_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_q_ipt.sizePolicy().hasHeightForWidth())
        self.del_q_ipt.setSizePolicy(sizePolicy)
        self.del_q_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_q_ipt.setObjectName(_fromUtf8("del_q_ipt"))
        self.gridLayout_8.addWidget(self.del_q_ipt, 3, 3, 1, 1)
        self.label_89 = QtGui.QLabel(self.tab_12)
        self.label_89.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_89.setObjectName(_fromUtf8("label_89"))
        self.gridLayout_8.addWidget(self.label_89, 4, 8, 1, 1)
        self.setdeldefaults_btn = QtGui.QPushButton(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.setdeldefaults_btn.sizePolicy().hasHeightForWidth())
        self.setdeldefaults_btn.setSizePolicy(sizePolicy)
        self.setdeldefaults_btn.setObjectName(_fromUtf8("setdeldefaults_btn"))
        self.gridLayout_8.addWidget(self.setdeldefaults_btn, 6, 8, 2, 2)
        self.label_90 = QtGui.QLabel(self.tab_12)
        self.label_90.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_90.setObjectName(_fromUtf8("label_90"))
        self.gridLayout_8.addWidget(self.label_90, 6, 3, 1, 1)
        self.del_f2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_f2_ipt.sizePolicy().hasHeightForWidth())
        self.del_f2_ipt.setSizePolicy(sizePolicy)
        self.del_f2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_f2_ipt.setObjectName(_fromUtf8("del_f2_ipt"))
        self.gridLayout_8.addWidget(self.del_f2_ipt, 5, 7, 1, 1)
        self.del_s2agrad_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s2agrad_ipt.sizePolicy().hasHeightForWidth())
        self.del_s2agrad_ipt.setSizePolicy(sizePolicy)
        self.del_s2agrad_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s2agrad_ipt.setObjectName(_fromUtf8("del_s2agrad_ipt"))
        self.gridLayout_8.addWidget(self.del_s2agrad_ipt, 7, 6, 1, 1)
        self.label_91 = QtGui.QLabel(self.tab_12)
        self.label_91.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_91.setObjectName(_fromUtf8("label_91"))
        self.gridLayout_8.addWidget(self.label_91, 6, 1, 1, 1)
        self.del_alb2_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_alb2_ipt.sizePolicy().hasHeightForWidth())
        self.del_alb2_ipt.setSizePolicy(sizePolicy)
        self.del_alb2_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_alb2_ipt.setObjectName(_fromUtf8("del_alb2_ipt"))
        self.gridLayout_8.addWidget(self.del_alb2_ipt, 5, 5, 1, 1)
        self.label_92 = QtGui.QLabel(self.tab_12)
        self.label_92.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_92.setObjectName(_fromUtf8("label_92"))
        self.gridLayout_8.addWidget(self.label_92, 4, 6, 1, 1)
        self.del_e_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_e_ipt.sizePolicy().hasHeightForWidth())
        self.del_e_ipt.setSizePolicy(sizePolicy)
        self.del_e_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_e_ipt.setObjectName(_fromUtf8("del_e_ipt"))
        self.gridLayout_8.addWidget(self.del_e_ipt, 3, 1, 1, 1)
        self.label_93 = QtGui.QLabel(self.tab_12)
        self.label_93.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_93.setStatusTip(_fromUtf8(""))
        self.label_93.setObjectName(_fromUtf8("label_93"))
        self.gridLayout_8.addWidget(self.label_93, 6, 6, 1, 1)
        self.label_94 = QtGui.QLabel(self.tab_12)
        self.label_94.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_94.setObjectName(_fromUtf8("label_94"))
        self.gridLayout_8.addWidget(self.label_94, 4, 5, 1, 1)
        self.del_x1_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_x1_ipt.sizePolicy().hasHeightForWidth())
        self.del_x1_ipt.setSizePolicy(sizePolicy)
        self.del_x1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_x1_ipt.setObjectName(_fromUtf8("del_x1_ipt"))
        self.gridLayout_8.addWidget(self.del_x1_ipt, 5, 8, 1, 1)
        self.del_a_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_a_ipt.sizePolicy().hasHeightForWidth())
        self.del_a_ipt.setSizePolicy(sizePolicy)
        self.del_a_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_a_ipt.setObjectName(_fromUtf8("del_a_ipt"))
        self.gridLayout_8.addWidget(self.del_a_ipt, 3, 0, 1, 1)
        self.del_s1lat_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_s1lat_ipt.sizePolicy().hasHeightForWidth())
        self.del_s1lat_ipt.setSizePolicy(sizePolicy)
        self.del_s1lat_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_s1lat_ipt.setToolTip(_fromUtf8(""))
        self.del_s1lat_ipt.setObjectName(_fromUtf8("del_s1lat_ipt"))
        self.gridLayout_8.addWidget(self.del_s1lat_ipt, 7, 0, 1, 1)
        self.del_pot1_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_pot1_ipt.sizePolicy().hasHeightForWidth())
        self.del_pot1_ipt.setSizePolicy(sizePolicy)
        self.del_pot1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_pot1_ipt.setObjectName(_fromUtf8("del_pot1_ipt"))
        self.gridLayout_8.addWidget(self.del_pot1_ipt, 3, 6, 1, 1)
        self.del_f1_ipt = QtGui.QLineEdit(self.tab_12)
        self.del_f1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_f1_ipt.setObjectName(_fromUtf8("del_f1_ipt"))
        self.gridLayout_8.addWidget(self.del_f1_ipt, 5, 6, 1, 1)
        self.label_95 = QtGui.QLabel(self.tab_12)
        self.label_95.setMaximumSize(QtCore.QSize(16777215, 30))
        self.label_95.setObjectName(_fromUtf8("label_95"))
        self.gridLayout_8.addWidget(self.label_95, 4, 7, 1, 1)
        self.del_l1_ipt = QtGui.QLineEdit(self.tab_12)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.del_l1_ipt.sizePolicy().hasHeightForWidth())
        self.del_l1_ipt.setSizePolicy(sizePolicy)
        self.del_l1_ipt.setMaximumSize(QtCore.QSize(16777215, 30))
        self.del_l1_ipt.setObjectName(_fromUtf8("del_l1_ipt"))
        self.gridLayout_8.addWidget(self.del_l1_ipt, 3, 8, 1, 1)
        self.label_96 = QtGui.QLabel(self.tab_12)
        self.label_96.setObjectName(_fromUtf8("label_96"))
        self.gridLayout_8.addWidget(self.label_96, 0, 0, 1, 10)
        self.line_14 = QtGui.QFrame(self.tab_12)
        self.line_14.setFrameShape(QtGui.QFrame.HLine)
        self.line_14.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_14.setObjectName(_fromUtf8("line_14"))
        self.gridLayout_8.addWidget(self.line_14, 1, 0, 1, 10)
        self.horizontalLayout_11.addLayout(self.gridLayout_8)
        self.tabWidget.addTab(self.tab_12, _fromUtf8(""))
        self.gridLayout_9.addWidget(self.tabWidget, 0, 0, 1, 1)
        self.verticalLayout_8.addLayout(self.gridLayout_9)
        self.tab_widget.addTab(self.tab, _fromUtf8(""))

        self.tab_widget.setCurrentIndex(0)
        self.tabWidget_4.setCurrentIndex(0)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(Form)
        Form.setWindowTitle(_translate("Form", "Form", None))
        self.component_treewidget.headerItem().setText(0, _translate("Form", "Component", None))
        self.component_treewidget.headerItem().setText(1, _translate("Form", "r (R/a)", None))
        self.component_treewidget.headerItem().setText(2, _translate("Form", "Std. Err.", None))
        self.result_treewidget.headerItem().setText(0, _translate("Form", "Parameter", None))
        self.result_treewidget.headerItem().setText(1, _translate("Form", "Input", None))
        self.result_treewidget.headerItem().setText(2, _translate("Form", "Adjustment", None))
        self.result_treewidget.headerItem().setText(3, _translate("Form", "Output", None))
        self.result_treewidget.headerItem().setText(4, _translate("Form", "Standard Error", None))
        self.residual_treewidget.headerItem().setText(0, _translate("Form", "Mean Residual for Input Values", None))
        self.residual_treewidget.headerItem().setText(1, _translate("Form", "Mean Residual Predicted", None))
        self.residual_treewidget.headerItem().setText(2, _translate("Form", "Determinant", None))
        self.tabWidget_4.setTabText(self.tabWidget_4.indexOf(self.tab_9), _translate("Form", "Results", None))
        self.curvestat_treewidget.headerItem().setText(0, _translate("Form", "Band", None))
        self.curvestat_treewidget.headerItem().setText(1, _translate("Form", "# of Observations", None))
        self.curvestat_treewidget.headerItem().setStatusTip(1, _translate("Form", "Number of observations.", None))
        self.curvestat_treewidget.headerItem().setToolTip(1, _translate("Form", "Number of observations.", None))
        self.curvestat_treewidget.headerItem().setText(2, _translate("Form", "Standard Deviation", None))
        self.curvestat_treewidget.headerItem().setToolTip(2, _translate("Form", "Standard deviation.", None))
        self.curvestat_treewidget.headerItem().setText(3, _translate("Form", "# of Obs. in Phs. Rng.", None))
        self.curvestat_treewidget.headerItem().setToolTip(3, _translate("Form", "Number of observations in phase range as configured in curve properties.", None))
        self.curvestat_treewidget.headerItem().setText(4, _translate("Form", "Std. Dev. in Phs. Rng.", None))
        self.curvestat_treewidget.headerItem().setToolTip(4, _translate("Form", "Standard deviation in phase range as configured in curve properties.", None))
        self.tabWidget_4.setTabText(self.tabWidget_4.indexOf(self.tab_10), _translate("Form", "Statistical Curve Information", None))
        self.popmain_btn.setText(_translate("Form", "Pop", None))
        self.time_combobox.setItemText(0, _translate("Form", "Phase", None))
        self.time_combobox.setItemText(1, _translate("Form", "HJD", None))
        self.plot_btn.setText(_translate("Form", "Plot", None))
        self.enablegrid_chk.setText(_translate("Form", "Enable Grid", None))
        self.uselc_chk.setToolTip(_translate("Form", "Use LC to output higher resolution model curve. [?]", None))
        self.uselc_chk.setWhatsThis(_translate("Form", "This will generate a lcin.active file and run LC, then plot synthetic results onto the observations, instead of reading from dcout.active file. UI will freeze for a moment to compute synthetic points.\n"
"\n"
"Line plotting will be used for LC synthetic points. DC outputs will be plotted with scatter plot.", None))
        self.uselc_chk.setText(_translate("Form", "Use LC", None))
        self.autoupdate_chk.setText(_translate("Form", "Auto Update", None))
        self.jd0_chk.setText(_translate("Form", "T0", None))
        self.s1tstart_chk.setText(_translate("Form", "S1 Tstart", None))
        self.dperdt_chk.setText(_translate("Form", "dω/dt", None))
        self.tc3b_chk.setText(_translate("Form", "T0 (3B)", None))
        self.el3_chk.setText(_translate("Form", "L3", None))
        self.x1_chk.setText(_translate("Form", "x1", None))
        self.s1long_chk.setText(_translate("Form", "S1 Lon.", None))
        self.t1_chk.setText(_translate("Form", "T1", None))
        self.p0_chk.setText(_translate("Form", "P", None))
        self.label_82.setToolTip(_translate("Form", "Multiplier (λ) to be used in the Levenberg-Marquardt method.", None))
        self.label_82.setStatusTip(_translate("Form", "XLAMDA", None))
        self.label_82.setText(_translate("Form", "  λ: ", None))
        self.label_3.setText(_translate("Form", "1.000d −", None))
        self.clearbaseset_btn.setText(_translate("Form", "Clear", None))
        self.q_chk.setText(_translate("Form", "q (M2/M1)", None))
        self.p3b_chk.setText(_translate("Form", "P (3B)", None))
        self.perr0_chk.setText(_translate("Form", "ω", None))
        self.xinc3b_chk.setText(_translate("Form", "i (3B)", None))
        self.g2_chk.setText(_translate("Form", "g2", None))
        self.s1lat_chk.setText(_translate("Form", "S1 Lat.", None))
        self.s2tend_chk.setText(_translate("Form", "S2 Tend", None))
        self.s1tend_chk.setText(_translate("Form", "S1 Tend", None))
        self.l2_chk.setText(_translate("Form", "L2", None))
        self.s1tmax2_chk.setText(_translate("Form", "S1 Tmax2", None))
        self.label_81.setToolTip(_translate("Form", "The fraction of DC’s output corrections to be applied to the input parameters to form the output parameters.", None))
        self.label_81.setStatusTip(_translate("Form", "VLR", None))
        self.label_81.setText(_translate("Form", "Vector Reduction:", None))
        self.dpdt_chk.setText(_translate("Form", "dP/dt", None))
        self.pot1_chk.setText(_translate("Form", "Ω 1", None))
        self.desextinc_chk.setToolTip(_translate("Form", "DESEXTINC", None))
        self.desextinc_chk.setText(_translate("Form", "Des. Ex.", None))
        self.g1_chk.setText(_translate("Form", "g1", None))
        self.l1_chk.setText(_translate("Form", "L1", None))
        self.e_chk.setText(_translate("Form", "e", None))
        self.e3b_chk.setText(_translate("Form", "e (3B)", None))
        self.a3b_chk.setText(_translate("Form", "a (3B)", None))
        self.s2lat_chk.setText(_translate("Form", "S2 Lat.", None))
        self.s1temp_chk.setText(_translate("Form", "S1 Temp.", None))
        self.s2rad_chk.setText(_translate("Form", "S2 Rad.", None))
        self.pot2_chk.setText(_translate("Form", "Ω 2", None))
        self.alb1_chk.setText(_translate("Form", "A1", None))
        self.f2_chk.setText(_translate("Form", "F2", None))
        self.s1rad_chk.setText(_translate("Form", "S1 Rad.", None))
        self.s2long_chk.setText(_translate("Form", "S2 Lon", None))
        self.a_chk.setText(_translate("Form", "a", None))
        self.f1_chk.setText(_translate("Form", "F1", None))
        self.incl_chk.setText(_translate("Form", "i", None))
        self.t2_chk.setText(_translate("Form", "T2", None))
        self.logd_chk.setText(_translate("Form", "log(d)", None))
        self.s2tstart_chk.setText(_translate("Form", "S2 Tstart", None))
        self.s2tmax2_chk.setText(_translate("Form", "S2 Tmax2", None))
        self.s2temp_chk.setText(_translate("Form", "S2 Temp.", None))
        self.s2tmax1_chk.setText(_translate("Form", "S2 Tmax1", None))
        self.s1tmax1_chk.setText(_translate("Form", "S1 Tmax1", None))
        self.alb2_chk.setText(_translate("Form", "A2", None))
        self.perr3b_chk.setText(_translate("Form", " ω (3B)", None))
        self.pshift_chk.setText(_translate("Form", "PShift", None))
        self.x2_chk.setText(_translate("Form", "x2", None))
        self.vgam_chk.setText(_translate("Form", "Vγ", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_11), _translate("Form", "KEEP\'s", None))
        self.del_g1_ipt.setText(_translate("Form", "0.01", None))
        self.del_g2_ipt.setText(_translate("Form", "0.01", None))
        self.del_alb1_ipt.setText(_translate("Form", "0.05", None))
        self.label_64.setToolTip(_translate("Form", "Gravity darkening exponent", None))
        self.label_64.setText(_translate("Form", "G1", None))
        self.del_pshift_ipt.setText(_translate("Form", "0.002", None))
        self.label_65.setToolTip(_translate("Form", "Phase Shift", None))
        self.label_65.setText(_translate("Form", "PSHIFT", None))
        self.label_66.setToolTip(_translate("Form", "Limb darkening coefficient", None))
        self.label_66.setText(_translate("Form", "X2", None))
        self.label_67.setToolTip(_translate("Form", "Semi-major axis", None))
        self.label_67.setText(_translate("Form", "a", None))
        self.label_68.setToolTip(_translate("Form", "Gravity darkening exponent", None))
        self.label_68.setText(_translate("Form", "G2", None))
        self.del_s1lng_ipt.setText(_translate("Form", "0.02", None))
        self.label_69.setToolTip(_translate("Form", "Orbit eccentricity", None))
        self.label_69.setText(_translate("Form", "e", None))
        self.label_70.setToolTip(_translate("Form", "V Gamma", None))
        self.label_70.setText(_translate("Form", "PERR0", None))
        self.del_l2_ipt.setText(_translate("Form", "0.01", None))
        self.del_perr0_ipt.setText(_translate("Form", "0.01", None))
        self.del_t2_ipt.setText(_translate("Form", "0.02", None))
        self.del_s2tmpf_ipt.setText(_translate("Form", "0.02", None))
        self.label_71.setToolTip(_translate("Form", "Surface potential", None))
        self.label_71.setText(_translate("Form", "POT2", None))
        self.label_72.setToolTip(_translate("Form", "Spot 2 Longitude", None))
        self.label_72.setText(_translate("Form", "S2 LON", None))
        self.del_t1_ipt.setText(_translate("Form", "0.02", None))
        self.label_73.setToolTip(_translate("Form", "Mass ratio, star 2/star 1", None))
        self.label_73.setText(_translate("Form", "Q", None))
        self.label_74.setToolTip(_translate("Form", "Spot 2 Latitude", None))
        self.label_74.setText(_translate("Form", "S2 LAT", None))
        self.label_75.setToolTip(_translate("Form", "Relative monochromatic luminosity", None))
        self.label_75.setText(_translate("Form", "L1", None))
        self.del_s2lng_ipt.setText(_translate("Form", "0.001", None))
        self.del_i_ipt.setText(_translate("Form", "0.2", None))
        self.label_76.setToolTip(_translate("Form", "Spot 1 Latitude", None))
        self.label_76.setText(_translate("Form", "S1 LAT", None))
        self.label_77.setToolTip(_translate("Form", "Relative monochromatic luminosity", None))
        self.label_77.setText(_translate("Form", "L2", None))
        self.label_78.setToolTip(_translate("Form", "Average surface temperature in 10000K", None))
        self.label_78.setText(_translate("Form", "T2", None))
        self.label_83.setToolTip(_translate("Form", "Spot 1 Angular Radius", None))
        self.label_83.setText(_translate("Form", "S1 RAD", None))
        self.del_pot2_ipt.setText(_translate("Form", "0.02", None))
        self.del_s1agrad_ipt.setText(_translate("Form", "0.001", None))
        self.label_84.setToolTip(_translate("Form", "Surface potential", None))
        self.label_84.setText(_translate("Form", "POT1", None))
        self.del_x2_ipt.setText(_translate("Form", "0.01", None))
        self.del_s1tmpf_ipt.setText(_translate("Form", "0.02", None))
        self.label_85.setToolTip(_translate("Form", "Average surface temperature in 10000K", None))
        self.label_85.setText(_translate("Form", "T1", None))
        self.label_86.setToolTip(_translate("Form", "Inclination", None))
        self.label_86.setText(_translate("Form", "i", None))
        self.del_s2lat_ipt.setText(_translate("Form", "0.02", None))
        self.label_87.setToolTip(_translate("Form", "Spot 2 Temperature Factor", None))
        self.label_87.setText(_translate("Form", "S2 TEMP", None))
        self.label_88.setToolTip(_translate("Form", "Bolometric Albedo", None))
        self.label_88.setText(_translate("Form", "ALB1", None))
        self.del_q_ipt.setText(_translate("Form", "0.003", None))
        self.label_89.setToolTip(_translate("Form", "Limb darkening coefficient", None))
        self.label_89.setText(_translate("Form", "X1", None))
        self.setdeldefaults_btn.setText(_translate("Form", "Set Defaults", None))
        self.label_90.setToolTip(_translate("Form", "Spot 1 Temperature Factor", None))
        self.label_90.setText(_translate("Form", "S1 TEMP", None))
        self.del_f2_ipt.setText(_translate("Form", "0.01", None))
        self.del_s2agrad_ipt.setText(_translate("Form", "0.0001", None))
        self.label_91.setToolTip(_translate("Form", "Spot 1 Longitude", None))
        self.label_91.setText(_translate("Form", "S1 LON", None))
        self.del_alb2_ipt.setText(_translate("Form", "0.05", None))
        self.label_92.setToolTip(_translate("Form", "Ratio of axial rotation rate vs. mean orbital rate", None))
        self.label_92.setText(_translate("Form", "F1", None))
        self.del_e_ipt.setText(_translate("Form", "0.001", None))
        self.label_93.setToolTip(_translate("Form", "Spot 2 Angular Radius", None))
        self.label_93.setText(_translate("Form", "S2 RAD", None))
        self.label_94.setToolTip(_translate("Form", "Bolometric Albedo", None))
        self.label_94.setText(_translate("Form", "ALB2", None))
        self.del_x1_ipt.setText(_translate("Form", "0.01", None))
        self.del_a_ipt.setText(_translate("Form", "0.05", None))
        self.del_s1lat_ipt.setText(_translate("Form", "0.02", None))
        self.del_pot1_ipt.setText(_translate("Form", "0.02", None))
        self.del_f1_ipt.setText(_translate("Form", "0.01", None))
        self.label_95.setToolTip(_translate("Form", "Ratio of axial rotation rate vs. mean orbital rate", None))
        self.label_95.setText(_translate("Form", "F2", None))
        self.del_l1_ipt.setText(_translate("Form", "0.01", None))
        self.label_96.setText(_translate("Form", "Parameter increments for approximating derivatives in finite differences. ", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_12), _translate("Form", "DEL\'s", None))
        self.tab_widget.setTabText(self.tab_widget.indexOf(self.tab), _translate("Form", "Base Set", None))

if __name__ == "__main__":
    a = SubsetTabFactory()


import os
import sys
import math
import argparse
import itertools
from time import time
from collections import defaultdict

import pickle
import numpy as np
import networkx as nx
import multiprocessing as mp
from scipy.sparse import dia_matrix, diags

import parallel_walks
import parallel_addition
import parallel_centrality
from algo import Algorithms
from load_data import LoadData
from random_walks import chunk_random_walk
from utils import load_bubble_diameter, get_bad_and_good_nodes, get_centralities, sort_edges

parser = argparse.ArgumentParser(description='Run the entire/partial pipeline of FairRandomWalks experiments.')
parser.add_argument('-proc', type=str, default='radius',
                    help='Part of pipeline to execute: diameter to compute the bubble diameter of all partitions, addition to compute new bubble diameter')
#parser.add_argument('-algo', type=str, default='baseline', help='If -proc is addition, choose the algo for addition')
parser.add_argument('-topic', type=str, help='Graph to analyze')
parser.add_argument('-t', type=int, default=15, help='Length of walks')
parser.add_argument('-b', type=int, default=2, help='Threshold to define good nodes')
parser.add_argument('-topk', type=int, default=10, help='Percentage of top-k central nodes to consider')
parser.add_argument('-maxedges', type=int, default=10, help='Maximum number of edges to add to the graph')
parser.add_argument('-iter', type=int, default=10, help='Number of iterations')
parser.add_argument('-unweighted', type=str, default='false', help='Weighted or unweighted graph')

#parser.add_argument('-topic', type=str, help='Graph to analyze')
args = parser.parse_args()

print(args.unweighted, type(args.unweighted), False == args.unweighted)
if args.unweighted == 'false':
    # Recall the graph of interest
    politics = LoadData(args.topic, uniform=False)
elif args.unweighted == 'true':
    politics = LoadData(args.topic, uniform=True)
else:
    print ('NO DATASET')
    exit()
id_color = politics.id_color
dictionary_weights = politics.dictionary_weights
id_name = politics.id_name
G = politics.G
edges_updated = set(list(G.edges()))

# Indeces for the adj matrix
node_id_matrix = {n:i for i,n in enumerate(list(G.nodes()))}
id_matrix_node = {j:i for i,j in node_id_matrix.items()}

# Define adj matrix
A = nx.adjacency_matrix(G)
d = diags(1/A.sum(axis=1).A.ravel())
A = A.T.dot(d).T

# Order nodes labels and colors
labels = np.array([j for i,j in sorted([(i,j) for i,j in id_matrix_node.items()], key=lambda x: x[0])])
color_nodes = np.array([id_color[j] for i,j in sorted([(i,j) for i,j in id_matrix_node.items()], key=lambda x: x[0])])

# Define RW parameters
delta = 0.05
eps = 1
r = int((args.t**2)/(eps**2)*np.log(1/delta))
print("Number of walks per node: ", r)

if args.proc == 'radius':
    if not os.path.exists(args.topic + '/'):
        os.makedirs(args.topic + '/')

    # Compute bubble diameter
    tt = time()
    result_chunks = parallel_walks.parallelization(A, labels, args.t, color_nodes, r)
    with open(args.topic + '/'  + args.topic + '_' + str(args.t) + '_bubble_diameters.pickle', 'wb') as f:
        pickle.dump(result_chunks, f)
    print(time()-tt)

    bubble_diameter = load_bubble_diameter(args.topic, id_matrix_node, args.t)
    red_bubble_diameter, blue_bubble_diameter, bad_red_vertices, bad_blue_vertices = get_bad_and_good_nodes(bubble_diameter, id_color, args.b, args.t)
    # Compute bad nodes centralities Blue
    nodes = np.array([node_id_matrix[n] for n in bad_blue_vertices])
    print('Number blue bad nodes: ', len(nodes))
    print("Number of walks per node: ", r)

    tt = time()
    result_chunks = parallel_centrality.parallelization(A, labels, args.t, color_nodes, r, nodes)
    with open(args.topic + '/'  + args.topic + '_' + 'blue' + '_' + str(args.t) + '_centralities.pickle', 'wb') as f:
        pickle.dump(result_chunks, f)
    print(time()-tt)

    # Compute bad nodes centralities Red
    nodes = np.array([node_id_matrix[n] for n in bad_red_vertices])
    print('Number red bad nodes: ', len(nodes))
    print("Number of walks per node: ", r)

    tt = time()
    result_chunks = parallel_centrality.parallelization(A, labels, args.t, color_nodes, r, nodes)
    with open(args.topic + '/'  + args.topic + '_' + 'red' + '_' + str(args.t) + '_centralities.pickle', 'wb') as f:
        pickle.dump(result_chunks, f)
    print(time()-tt)

elif args.proc == 'addition':
    bubble_diameter = load_bubble_diameter(args.topic, id_matrix_node, args.t)
    red_bubble_diameter, blue_bubble_diameter, bad_red_vertices, bad_blue_vertices = get_bad_and_good_nodes(bubble_diameter, id_color, args.b, args.t)

    # Get partitions' contribution
    s_red = np.sum(list(bad_red_vertices.values()))
    s_blue = np.sum(list(bad_blue_vertices.values()))

    perc_red = s_red/(s_red + s_blue)
    perc_blue = 1 - perc_red

    min_part = min(len(bad_red_vertices)*len(blue_bubble_diameter), len(bad_blue_vertices)*len(red_bubble_diameter))
    K_int = np.append([1],np.arange(2, min(min_part, args.maxedges), 2))

    K_R = [math.floor(i*perc_red) for i in K_int]
    K_B = [k - K_R[i] for i, k in enumerate(K_int)]

    for c in ['blue', 'red']:
        if c=='blue':
            bad = bad_blue_vertices
            K = K_B
        else:
            bad = bad_red_vertices
            K = K_R

        nodes = np.array([node_id_matrix[n] for n in bad])

        if c=='blue':
            alg = Algorithms(bad, red_bubble_diameter, labels, args.t,
                        color_nodes, r, nodes, node_id_matrix, edges_updated, 0)
        else:
            alg = Algorithms(bad, blue_bubble_diameter, labels, args.t,
                        color_nodes, r, nodes, node_id_matrix, edges_updated, 0)

        # ROV
        with open(args.topic + '/rov_candidate_edges.pickle','rb') as infile:
            possible_edges = pickle.load(infile)
        candidate_edges = [(i, j) for i,j,k in possible_edges]
        K = np.arange(2, min(len(candidate_edges), args.maxedges), 2)
        new_edges = candidate_edges
        alg._penalty_bulk_additions(A, K, new_edges,
                                args.topic, algorithm='high_to_high',
                                color=c, perc=args.topk)

        # node2vec
        with open(args.topic + '/n2v_candidate_edges.pickle','rb') as infile:
            possible_edges = pickle.load(infile)

        candidate_edges = [(node_id_matrix[i], node_id_matrix[j]) for i,j,k in possible_edges]
        K = np.arange(2, min(len(candidate_edges), args.maxedges), 2)
        new_edges = candidate_edges
        alg._penalty_bulk_additions(A, K, new_edges,
                                args.topic, algorithm='node2vec',
                                color=c, perc=args.topk)

        for ITER in range(int(args.iter)):
            if c == 'blue':
                alg = Algorithms(bad, red_bubble_diameter, labels, args.t,
                                color_nodes, r, nodes, node_id_matrix, edges_updated, ITER)
            else:
                alg = Algorithms(bad, blue_bubble_diameter, labels, args.t,
                                color_nodes, r, nodes, node_id_matrix, edges_updated, ITER)

            # Baseline
            candidate_edges = alg._compute_candidate_edge(algorithm='baseline',
                                                        top_k=100,
                                                        centrality=[])
            #K = np.arange(2, min(len(candidate_edges), args.maxedges), 2)
            alg._repeat_bulk_additions(A, K, candidate_edges,
                                    args.topic, algorithm='baseline',
                                    color=c, perc=100)

            # Recall centrality
            centrality = get_centralities(id_matrix_node, args.topic, c, args.t, old=False)
            perc = args.topk
            top_k = int(len(centrality)/100*perc)
            # Random pick central edges
            candidate_edges = alg._compute_candidate_edge('rand_central', top_k, centrality)
            alg._repeat_bulk_additions(A, K, candidate_edges,
                                    args.topic, algorithm='rand_central',
                                    color=c, perc=args.topk)
            # Random pick degree weighted central edges
            candidate_edges = alg._compute_candidate_edge('w_rand_central', top_k, centrality, G)
            alg._repeat_bulk_additions(A, K, candidate_edges,
                                    args.topic, algorithm='w_rand_central',
                                    color=c, perc=args.topk)

            # Pick sorted degree weighted central edges
            candidate_edges = alg._compute_candidate_edge('w_pen_central', top_k, centrality, G)
            new_edges = sort_edges(candidate_edges, K)
            alg._penalty_bulk_additions(A, K, new_edges,
                                    args.topic, algorithm='w_pen_central',
                                    color=c, perc=args.topk)


import datetime
from parsers import ozon_parser, wildberries_parser, sbermegamarket_parser, kazanexpress_parser, yandex_market_parser
from database_functions import add_new_price, get_products, get_last_price
from time import sleep
from bot_code import send_alert

def main():
    """
    Function parses prices for all existing products and adds new prices to the database.
    :return:
    """
    products = get_products()
    for product in products:
        id, tg_id, link, shop, product_name = product[0], product[1], product[2], product[3], product[4]

        parser = ''
        if shop == 'sbermarket':
            parser = sbermegamarket_parser()
        if shop == 'ozon':
            parser = ozon_parser()
        if shop == 'wildberries':
            parser = wildberries_parser()
        if shop == 'kazanexpress':
            parser = kazanexpress_parser()
        if shop == 'yandexmarket':
            parser = yandex_market_parser()
        last_price = get_last_price(id)
        _, price = parser.parse(link)
        date = datetime.datetime.now().date()
        if price != -1:
            add_new_price(id, date, price)
        if last_price != -1:
            send_alert(tg_id, float(last_price), float(price), shop, product_name)

if __name__ == "__main__":
    """
    Function which calls 'main' function every day in 10AM to update prices.
    """
    while True:
        time = datetime.datetime.now().hour
        if time == 10:
            main()
        sleep(3600)


continuar = 'S'
j = soma = media = maiorN = menorN = 0
while continuar in 'S':
    n = int(input('Digite um número: '))
    continuar = str(input('Você quer continuar? [S/N] ')).upper().strip()[0]
    soma += n
    j += 1
    if j == 1:
        maiorN = n
        menorN = n
    else:
        if n > maiorN:
            maiorN = n
        if n < maiorN:
            menorN = n
media = soma/j
print(f'Você digitou {j} números e a mádia foi {media}')
print(f'O maior número é {maiorN} e o menor número é {menorN}')


import tkinter as tk

def add(x, y):
    return x + y

def subtract(x, y):
    return x - y

def multiply(x, y):
    return x * y

def divide(x, y):
    if y != 0:
        return x / y
    else:
        return "Cannot divide by zero"

def calculate():
    operation = operation_var.get()
    num1 = float(entry_num1.get())
    num2 = float(entry_num2.get())

    if operation == "add":
        result_var.set(add(num1, num2))
    elif operation == "subtract":
        result_var.set(subtract(num1, num2))
    elif operation == "multiply":
        result_var.set(multiply(num1, num2))
    elif operation == "divide":
        result_var.set(divide(num1, num2))
    else:
        result_var.set("Invalid operation")

# Create the main window
root = tk.Tk()
root.title("Stylish Calculator")

# Create a frame for styling
frame = tk.Frame(root, bg="#e1e1e1", padx=20, pady=20)
frame.pack(padx=20, pady=20)

# Entry widgets for user input
entry_num1 = tk.Entry(frame, font=("Helvetica", 14), bd=0, relief="flat")
entry_num1.pack(fill=tk.X, pady=10)

entry_num2 = tk.Entry(frame, font=("Helvetica", 14), bd=0, relief="flat")
entry_num2.pack(fill=tk.X, pady=10)

# Dropdown menu for selecting operation
operation_var = tk.StringVar(root)
operation_choices = ["add", "subtract", "multiply", "divide"]
operation_var.set(operation_choices[0])

operation_label = tk.Label(frame, text="Select Operation:", font=("Helvetica", 14), bg="#e1e1e1")
operation_label.pack(anchor=tk.W)

operation_menu = tk.OptionMenu(frame, operation_var, *operation_choices)
operation_menu.config(font=("Helvetica", 14), bd=0, relief="flat")
operation_menu.pack(fill=tk.X, pady=10)

# Button to perform calculation
calculate_button = tk.Button(frame, text="Calculate", font=("Helvetica", 14), command=calculate, bd=0, relief="flat", bg="#3498db", fg="white")
calculate_button.pack()

# Label to display the result
result_var = tk.StringVar(root)
result_label = tk.Label(frame, textvariable=result_var, font=("Helvetica", 18, "bold"), bg="#e1e1e1")
result_label.pack(pady=20)

# Start the GUI event loop
root.mainloop()


from sklearn.ensemble import AdaBoostClassifier
from sklearn.datasets import make_classification
import numpy as np
from sklearn import metrics
from random import randrange, uniform, randint
import pandas as pd
from sklearn.ensemble import RandomForestClassifier

arr = []
arr2 = []
arr3 = []
train = open("train_features.csv")
label = open("train_label.csv")
test = open("test_features.csv")

submission = open("sample_Submission.csv")
df = pd.read_csv(submission)
df.index = df.index + 1

try:
    for line in train:
        line = line.strip()
        line_arr = line.split(",")
        arr.append(line_arr)
finally:
    train.close()

try:
    for line in label:
        line = line.strip()
        line_arr = line.split(",")
        arr2.append(line_arr)
finally:
    label.close()

try:
    for line in test:
        line = line.strip()
        line_arr = line.split(",")
        arr3.append(line_arr)
finally:
    test.close()

arr2.pop(0)

def normalize(features):
    minmax = []
    for i in range(features.shape[1]):
        col = features[:,i]
        min_value = np.min(col)
        max_value = np.max(col)
        minmax.append([min_value,max_value])
    for row in features:
        for i in range(len(row)):
            row[i] = (row[i]-minmax[i][0])/(minmax[i][1]-minmax[i][0])
    return features

input_data = np.array(arr).astype(np.float)
input_data = input_data[:,1:]
print(input_data.shape)
labels = np.array(arr2).astype(np.int)
labels = labels[:,1:]

labels = labels.reshape(418,)
test_data = np.array(arr3).astype(np.float)
test_data = test_data[:,1:]

#clf = AdaBoostClassifier(n_estimators=750, random_state=0, base_estimator=RandomForestClassifier(n_estimators=100, max_depth=2,random_state=0)) #0.86505
clf = AdaBoostClassifier(n_estimators=750, random_state=0, base_estimator=RandomForestClassifier(n_estimators=95, max_depth=2,random_state=0))

model = clf.fit(input_data,labels)
test_pred = model.predict(test_data)
df["label"] = test_pred

df.to_csv("submission.csv", index=False)


from django.contrib import admin

from .models import Expert, Skill

class ExpertAdmin(admin.ModelAdmin):
    list_display = ('id', 'username', 'email', 'first_name', 'last_name', 'full_name', 'slug',
                    'created_date', 'is_staff', 'is_active', 'show_skills', 'about', )
    exclude = ('last_login', 'last_update',)
    list_display_links = ('username', 'full_name',)
    prepopulated_fields = {'slug': ('first_name', 'last_name',)}
    ordering = ('id',)

class SkillAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'description',)
    list_display_links = ('title',)
    ordering = ('id',)

# Register your models here.
admin.site.register(Expert, ExpertAdmin)
admin.site.register(Skill, SkillAdmin)


import sys
from rich import print
import random
import math

###############################################################################
# round_half_up()
#  Function meant to perform rounding operations in the same way
#    they are normally performed in mathematics
#  -Round UP when point is >= 5
#  -Round DOWN when point is <= 4
def round_half_up(n, decimals=0):
  multiplier = 10 ** decimals
  return math.floor(n*multiplier + 0.5) / multiplier

###############################################################################
# Class serves to represent singular dice of any size
#
# Data Members:
#   self.sides    -> Variable to hold number of sides for Die
# Methods:
#   __init__ |> Die()  -> Constructs Die object with 6 sides
#            |> Die(s) -> Constructs Die object with (s) sides
#   __str__  -> Allows for easy outputting of Die object
#                (Format: "[1d{Number of Sides}]")
#   roll()   -> Returns random value between 1 and {Number of Sides}
class Die(object):
  #############################################################################
  # __init__
  #  []Checks to see if 'sides' is an int
  #    ()If NO, output error message and end program
  #    ()If YES, 'self.sides' is initialized to 'sides'
  def __init__(self,sides=6):
    if not isinstance(sides, int):
      print("Error! Improper 'Die' Construction Syntax")
      print("-Please refer to documentation")
      sys.exit()
    self.sides = sides

  #############################################################################
  # roll()
  #  []Build list containing values [0, ..., (sides-1)]
  #  []Shuffle List
  #  []Return first value in list
  def roll(self):
    values = [x for x in range(self.sides)]
    random.shuffle(values)
    return values[0] + 1

  #############################################################################
  # __str__
  #  []Output Die info
  #    Format: "[1d" + {Number of Sides} + "]"
  # print(Die(6)) -> "[1d6]"
  def __str__(self):
    return f"[1d{self.sides}]"
###############################################################################

###############################################################################
# Class serves as a container for multiple Die() objects that can
#    then perform various functions using those objects
#
# Data Members:
#   self.dice[]  -> Contains each Die() that makes up Dice()
#   self.rolls[] -> Contains the current roll(s) of each Die
# Methods:
#   __init__ |> Dice()    -> Constructs Dice object containing [1] Die()
#            |> Dice(s,n) |> (if s is int)   -> Constructs Dice object
#                                                containing [n] Die(s)
#                         |> (elif s is str) -> Constructs Dice object from `s`
#                                            -> 's' must be formatted in the
#                                                same way as ("1.d.6")
#   __str__    -> Allows for easy outputting of Dice object
#                  Format: "Die() - ( Die.Roll() )"
#   rollDice() -> Rolls each Die from Dice, storing the value from each roll
#                  within Dice.rolls[]
#   avg()      -> Returns the average of self.rolls[]
#   max()      -> Returns MAXIMUM value within self.rolls[]
#   min()      -> Returns MINIMUM value within self.rolls[]
#   sum()      -> Returns SUM of self.rolls[]
#   roll(rT)   -> Performs self.rollDice()
#              \> (if rT is keyword) -> Return value based on keyword
#                      [Keywords: "avg", "max, "min", "sum"]
class Dice:
  #############################################################################
  # __init__
  #  []Checks to see if 'sides' is a str
  #    ()If YES, 'sides' is split into a list where:
  #      []list[0] = Number of Dice
  #      []list[1] = "d"
  #      []list[2] = Size of each Die
  #      []List[0]/list[2] are stored within num_dice/sides respectively
  #    ()If NO, checks to see if 'sides' is an int
  #      ()If NO, output error message and terminate program
  #  []Builds dice[] and rolls[] as empty lists, then attaches them to Dice
  #  []Populates dice[] with an amount of Die('sides') equal to 'num_sides'
  def __init__(self,sides=6,num_dice=1):
    if isinstance(sides, str):
      # Build List without '.' (4.d.12 -> '4', 'd', '12')
      list1 = sides.split('.')
      num_dice, sides = int(list1[0]),int(list1[2])
    elif not isinstance(sides, int):
        print("Error! Improper 'Dice' Construction Syntax")
        print("-Please refer to documentation")
        sys.exit()
    # create a container
    self.dice = []
    self.rolls = []
    for die in range(num_dice):
      self.dice.append(Die(sides))

  #############################################################################
  # rollDice()
  #  []Checks to see if self.rolls[] is populated with any values
  #    ()if YES, self.rolls[] is cleared of all values
  #    ()if NO, do nothing (Not expressed inline)
  #  []Populates self.rolls[] by rolling each Die object within self.Dice[],
  #    then recording the results in self.rolls[]
  def rollDice(self):
    if self.rolls : self.rolls.clear()
    for i in range(len(self.dice)):
      self.rolls.append(self.dice[i].roll())

  #############################################################################
  # avg()
  #  []Returns average of all values within self.rolls[]
  def avg(self):
    return round_half_up(sum(self.rolls)/len(self.rolls),1)
  #############################################################################
  # max()
  #  []Returns maximum value within self.rolls[]
  def max(self):
    return max(self.rolls)
  #############################################################################
  # min()
  #  []Returns minimum value within self.rolls[]
  def min(self):
    return min(self.rolls)
  #############################################################################
  # sum()
  #  []Returns sum total of all values within self.rolls[]
  def sum(self):
    return sum(self.rolls)

  #############################################################################
  # roll(rT)
  #  []Performs rollDice() to repopulate self.rolls[]
  #  []Checks to see if rT contains a value
  #    ()if NO          -> Do nothing (Not expressed inline)
  #    ()if YES:
  #      ()if rT is not keyword -> Print Error message and terminate program
  #      ()if rT is 'avg'       -> Return self.avg() of self.rolls[]
  #      ()if rT is 'max'       -> Return self.max() of self.rolls[]
  #      ()if rT is 'min'       -> Return self.min() of self.rolls[]
  #      ()if rT is 'sum'       -> Return self.max() of self.rolls[]
  def roll(self,rollType=None):
    self.rollDice()
    if rollType:
      if rollType =='avg':
        return self.avg()
      elif rollType == 'max':
        return self.max()
      elif rollType == 'min':
        return self.min()
      elif rollType == 'sum':
        return self.sum()
      else:
        print("ERROR! Chosen Roll-Type is not found!")
        print("\n-Please refer to documentation")
        sys.exit()

  #############################################################################
  # __str__
  #  []Create starting Variables (s,t) to hold output in
  #  []Checks to see if self.rolls[] is populated
  #    ()if NO, perform self.rollDice()
  #    ()if YES, do nothing (Not expressed inline)
  #  []Iterate through self.dice[]/self.rolls[], formatting and adding each
  #    each member to 's'
  #    FORMAT: " self.Dice[ x ] - ( self.rolls[ x ] ) "
  #                           . . .
  #            "  {Total Dice}  - ( Sum of all rolls) "
  #  []Calculate final dice amount/roll total, then add to 's'
  #  []Return 's'
  # print(Dice(6,3)) -> "Dice:  [1d6] - (3)"
  #                     "       [1d6] - (6)"
  #                     "       [1d6] - (1)"
  #                     "Total:[[3d6]]-((10))"
  def __str__(self):
    s = "Dice: "
    t = f"[{len(self.dice)}d{self.dice[0].sides}]"
    if not self.rolls :
      self.rollDice()
    s = s + f" {self.dice[0]} - ({self.rolls[0]})\n"
    for x in range(len(self.dice)-1):
      s = s + f"       {self.dice[x+1]} - ({self.rolls[x+1]})\n"

    s = s + f"Total:[{t}]-(({sum(self.rolls)}))"
    return s

if __name__=='__main__':
  d1 = Die()
  d2 = Die(30)

  print(d1)
  print(d2)
  print(d2.roll())
  d3 = Dice("2.d.20")
  print(d3)
  d3.rollDice()
  print(f"\n{d3}")
  print(d3.sum())
  print(d3.avg())
  print(d3.max())
  d3.roll()
  print(d3.roll("avg"))
  print(d3.dice[0])
  print(Dice(10,5))


import numpy as np
import random
import time
from game import SnakeGameAI, Direction, Point
from Qlearn import Qlearn
from NN import DQN

class Agent:

    def __init__(self, mode ="train", model_type ="DQN"):

        self.nb_games = 0
        self.epsilon = 0
        self.discount_factor = 0.9
        self.learning_rate = 0.001
        self.ite = 0
        self.record = 0
        self.mode = mode

        self.model_type = model_type
        if self.model_type == "DQN":
            self.model = DQN( self.learning_rate)
        if self.model_type == "Qlearn":
            self.model = Qlearn()

        if self.mode == "play":
            self.model.load()
            self.epsilon = 0
        else:#train
            self.epsilon = 0.8

        self.state_memory = []
        self.action_memory = []
        self.next_state_memory = []
        self.reward_memory = []
        self.done_memory = []

        self.memory_size = 0

        self.max_memory = 10000

    def get_state(self,game):
        head = game.snake[0]
        point_l=Point(head.x - game.block_size, head.y)
        point_r=Point(head.x + game.block_size, head.y)
        point_u=Point(head.x, head.y - game.block_size)
        point_d=Point(head.x, head.y + game.block_size)

        dir_l = game.direction == Direction.LEFT
        dir_r = game.direction == Direction.RIGHT
        dir_u = game.direction == Direction.UP
        dir_d = game.direction == Direction.DOWN

        state = [
            # Danger Straight
            (dir_u and game.is_collision(point_u))or
            (dir_d and game.is_collision(point_d))or
            (dir_l and game.is_collision(point_l))or
            (dir_r and game.is_collision(point_r)),

            # Danger right
            (dir_u and game.is_collision(point_r))or
            (dir_d and game.is_collision(point_l))or
            (dir_u and game.is_collision(point_u))or
            (dir_d and game.is_collision(point_d)),

            #Danger Left
            (dir_u and game.is_collision(point_r))or
            (dir_d and game.is_collision(point_l))or
            (dir_r and game.is_collision(point_u))or
            (dir_l and game.is_collision(point_d)),

            # Move Direction
            dir_l,
            dir_r,
            dir_u,
            dir_d,

            #Food Location
            game.food.x < game.head.x, # food is in left
            game.food.x > game.head.x, # food is in right
            game.food.y < game.head.y, # food is up
            game.food.y > game.head.y  # food is down
        ]
        return np.array(state,dtype=int)

    def get_move(self,state):
        U = random.uniform(0,1)
        action = [0,0,0]
        if (U < self.epsilon):
            action[random.randrange(0,2)] = 1
            return action
        else:
            if self.model_type =="DQN":
                action[np.argmax(self.model.predict(state))]=1
                return action
            else:#!model = Qlearn
                return self.model.predict(state)

    def replay(self,batch_size = 32):#Replay experience

        batch = np.random.choice(len(self.state_memory), batch_size, replace=False)

        states = self.state_memory[batch]
        actions = self.action_memory[batch]
        rewards = self.reward_memory[batch]
        next_states = self.next_state_memory[batch]
        dones = self.done_memory[batch]

        targets = self.model.predict(states)
        target_f = self.model.predict(next_states)

        for idx in range(batch_size):
            y = rewards[idx][0]
            if not dones[idx]:
                y += self.discount_factor * max(target_f[idx])
            targets[idx][np.argmax(actions[idx])] = y

        self.model.model.fit(states,targets,verbose=0)

    def train(self, state, action, reward, next_state, done):
        if self.mode == "train":
            if self.model_type =="Qlearn":
                self.model.train(state, action, next_state,  reward, self.learning_rate, self.discount_factor)
            else:
                self.remember(state,action,reward,next_state,done)
                if (self.memory_size > 32):
                    self.replay()

    def remember(self,state,action,reward,next_state,done):

        self.memory_size +=1

        action = np.reshape(action,((1,3)))
        reward = np.reshape(reward,(1,1))
        done = np.reshape(done,(1,1))

        if self.memory_size == 1:
            self.state_memory = state
            self.action_memory = action
            self.reward_memory = reward
            self.next_state_memory = next_state
            self.done_memory = done
            return

        if self.memory_size <= self.max_memory:
            self.state_memory = np.concatenate((self.state_memory,state),axis=0)
            self.action_memory = np.concatenate((self.action_memory,action),axis=0)
            self.reward_memory = np.concatenate((self.reward_memory,reward),axis=0)
            self.next_state_memory = np.concatenate((self.next_state_memory,next_state),axis=0)
            self.done_memory = np.concatenate((self.done_memory,done) , axis=0)

        else: #memory_size > max_memory
            index = self.memory_size % self.max_memory

            self.state_memory[index] =state
            self.action_memory[index] = action
            self.reward_memory[index] = reward
            self.next_state_memory[index] = next_state
            self.done_memory[index] = done

    def save(self):
        self.model.save()

    def load(self):
        self.model.load()

def play(mode,model):

    #Expantional moving average
    mean_score = 0
    alpha = 0.95

    #Create the game and the agent
    agent = Agent(mode,model)
    game = SnakeGameAI()
    current_time = time.time()

    while True:
        state = agent.get_state(game)
        if agent.model_type == "DQN":#Reshape in this case to be in good format for the tf NN
            state = np.reshape(state,(1,11))

        action = agent.get_move(state)

        reward, done, score = game.play_step(action)

        next_state = agent.get_state(game)
        if agent.model_type == "DQN":
            next_state = np.reshape(next_state,(1,11))

        agent.train(state,action,reward,next_state,done)

        state = next_state

        if done:
            agent.ite +=1
            agent.epsilon = agent.epsilon * 0.9#Diminue the epsilon exploration parameter

            if (game.score > agent.record):#Best result
                agent.record = game.score
                agent.save()

            mean_score = round(alpha * mean_score + (1 - alpha)*score,2)
            timer = round(time.time() - current_time,2)

            print("Game", agent.ite ,"Score", game.score , "Record", agent.record,"EMA", mean_score,\
            "Time", timer , 'seconds')

            game.reset()#Launch new game

MODE = "train"
#MODE= "play"

MODEL = "DQN"
#MODEL = "Qlearn"

if __name__ == '__main__':
    play(MODE,MODEL)