示例#1
0
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBFluid", self.name)
        self.labelButtonAdd = _U("Add fluid")
        self.labelButtonDelete = _U("Delete fluid")

        # DBFluid_ID needs to remain as first entry although it is not shown on the GUI
        self.colLabels = "DBFluid_ID", "FluidName", "RefrigerantCode"

        self.db = Status.DB.dbfluid
        self.table = "dbfluid"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[2]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('General information on fluid'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Main physical properties'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Specific properties required only for refrigerants'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("RefrigerantCode"),
                                   tip = _U("Show only equipment of type"))

        self.tc_help = wx.StaticBox(self.page0, -1, _U('Help'))
        self.tc_help_text = wx.StaticText(self.page0, -1, _U('Click on the column labels to sort the table.'))
        self.tc_help_text.SetFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False, 'Tahoma'))

        #
        # tab 1 - General information on fluid
        #
        self.frame_general_information = wx.StaticBox(self.page1, -1, _U("General information on fluid"))
        self.frame_general_information.SetForegroundColour(TITLE_COLOR)
        self.frame_general_information.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_information.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Name of the fluid"),
                             tip = _U("Name of the fluid"))

        self.tc2 = TextEntry(self.page1, maxchars = 6, value = '',
                             label = _U("Refrigerant code"),
                             tip = _U("Refrigerant code"))

        fs = FieldSizes(wHeight = HEIGHT_TE_MULTILINE, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc3 = TextEntry(self.page1, maxchars = 200, value = '',
                             isMultiline = True,
                             label = _U("Source of data"),
                             tip = _U("Source of data"))

        self.tc4 = TextEntry(self.page1, maxchars = 200, value = '',
                             isMultiline = True,
                             label = _U("Additional comments"),
                             tip = _U("Additional comments"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 2 - Main physical properties
        #
        self.frame_main_properties = wx.StaticBox(self.page2, -1, _U("Main physical properties"))
        self.frame_main_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_main_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_main_properties.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_LONG,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH_LARGE)

        self.tc5 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'SPECIFICHEAT',
                              label = _U("Specific heat in liquid state"),
                              tip = _U("Specific heat in liquid state"))

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'TEMPERATURE',
                              label = _U("Temperature of evaporation"),
                              tip = _U("Temperature of evaporation"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'SPECIFICHEAT',
                              label = _U("Specific heat in gaseous state (vapour)"),
                              tip = _U("Specific heat in gaseous state (vapour)"))

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'SPECIFICENTHALPY',
                              label = _U("Latent heat of evaporation"),
                              tip = _U("Latent heat of evaporation"))

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'DENSITY',
                              label = _U("Density"),
                              tip = _U("Density"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_LONG,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 3 - Specific properties required only for refrigerants
        #
        self.frame_refrigerant_properties = wx.StaticBox(self.page3, -1, _U("Specific properties required only for refrigerants"))
        self.frame_refrigerant_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_refrigerant_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_refrigerant_properties.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_LONG,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH_LARGE)

        self.tc10 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'CO2RATIO',
                               label = _U("Typical specific mass flow of refrigerant"),
                               tip = _U("Typical specific mass flow of refrigerant"))

        self.tc11 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'TEMPERATURE',
                               label = _U("Typical outlet temperature of compressor"),
                               tip = _U("Typical outlet temperature of compressor"))

        self.tc12 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'CINEMATICVISCOSITY',
                               label = _U("Dynamic Viscosity at typical working conditions"),
                               tip = _U("Dynamic Viscosity at typical working conditions"))

        self.tc13 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'CONDUCTIVITY',
                               label = _U("Thermal conductivity at typical working conditions"),
                               tip = _U("Thermal conductivity at typical working conditions"))

        self.tc14 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'SPECIFICENTHALPY',
                               label = _U("Senisble heat at typical working conditions"),
                               tip = _U("Senisble heat at typical working conditions"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_LONG,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBHeatPump", self.name)

        # DBHeatPump_ID needs to remain as first entry
        self.colLabels = "DBHeatPump_ID", "HPManufacturer", "HPModel", "HPType", "HPSubType", "HPHeatCAP"

        self.db = Status.DB.dbheatpump
        self.table = "dbheatpump"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]
        self.subtype = self.colLabels[4]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('Descriptive Data'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Technical Data'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Heat source / sink'))
        self.page4 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page4, _U('Economic Parameters'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        self.tc_subtype = ChoiceEntry(self.page0,
                                      values = [],
                                      label = _U("Subtype"),
                                      tip = _U("Show only equipment of subtype"))

        #
        # tab 1 - Descriptive Data
        #
        self.frame_descriptive_data = wx.StaticBox(self.page1, -1, _U("Descriptive data"))
        self.frame_descriptive_data.SetForegroundColour(TITLE_COLOR)
        self.frame_descriptive_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_descriptive_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("HPManufacturer"),
                             tip = _U("Heatpump Manufacturer"))

        self.tc2 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("HPModel"),
                             tip = _U("Heatpump Model"))

        self.tc3 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("HPType"),
                             tip = _U("Heatpump Type"))

        self.tc4 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("HPSubType"),
                             tip = _U("Heatpump Sub Type"))

        self.tc5 = TextEntry(self.page1, maxchars = 200, value = '',
                             label = _U("Reference"),
                             tip = _U("Source of data"))

        #
        # tab 2 - Technical data
        #
        self.frame_technical_data = wx.StaticBox(self.page2, -1, _U("Technical data"))
        self.frame_heating = wx.StaticBox(self.page2, -1, _U("Heating"))
        self.frame_cooling = wx.StaticBox(self.page2, -1, _U("Cooling"))
        self.frame_general = wx.StaticBox(self.page2, -1, _U("General"))
        self.frame_nominal_working_conditions = wx.StaticBox(self.page2, -1, _U("Nominal working conditions"))
        self.frame_theoretical_efficiency = wx.StaticBox(self.page2, -1, _U("Theoretical efficiency and exergetic efficiency"))
        self.frame_technical_data.SetForegroundColour(TITLE_COLOR)
        self.frame_technical_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_technical_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              label = _U("HPHeatCap"),
                              tip = _U("Nominal heating capacity"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              label = _U("HPHeatCOP"),
                              tip = _U("Nominal COP for heating mode"))

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              label = _U("HPCoolCap"),
                              tip = _U("Nominal cooling capacity"))

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              label = _U("HPCoolCOP"),
                              tip = _U("Nominal COP for cooling mode"))

        self.tc10 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPFuelConsum"),
                               tip = _U("Nominal fuel consumption"))

        self.tc11 = ChoiceEntry(self.page2,
                                values = [],
                                label = _U("FuelType"),
                                tip = _U("Fuel type"))

        self.tc12 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPElectConsum"),
                               tip = _U("Nominal electrical power consumption"))

        self.tc13 = TextEntry(self.page2, maxchars = 45, value = '',
                              label = _U("HPWorkFluid"),
                              tip = _U("Refrigerant / absorbent refrigerant pair"))

        self.tc14 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPCondTinC"),
                               tip = _U("inlet temperature to the condenser (and absorber)"))

        self.tc15 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPGenTinC"),
                               tip = _U("inlet temperature to the generator"))

        self.tc16 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPEvapTinC"),
                               tip = _U("inlet temperature to the evaporator"))

        self.tc17 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPConstExCoolCOP"),
                               tip = _U("Temperature range around the nominal temperatures for which the constant exergetic COP approximation is valid (e.g. +-20 K)"))

        self.tc18 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPCondTinH"),
                               tip = _U("inlet temperature to the condenser (and absorber)"))

        self.tc19 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPGenTinH"),
                               tip = _U("inlet temperature to the generator"))

        self.tc20 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPEvapTinH"),
                               tip = _U("inlet temperature to the evaporator"))

        self.tc21 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPConstExHeatCOP"),
                               tip = _U("Temperature range around the nominal temperatures for which the constant exergetic COP approximation is valid (e.g. +-20 K)"))

        self.tc22 = StaticTextEntry(self.page2, maxchars = 255, value = '',
                                    label = _U("HPExCoolCOP"),
                                    tip = _U("Calculated from the nominal and theoretical COP at the manufact. catalogue nominal conditions and applied as a constant in extrapolation for other working conditions (see next point)."))

        self.tc23 = StaticTextEntry(self.page2, maxchars = 255, value = '',
                                    label = _U("HPThCoolCOP"),
                                    tip = _U("Carnot COP for cooling mode at nominal conditions (see next point)."))

        self.tc24 = StaticTextEntry(self.page2, maxchars = 255, value = '',
                                    label = _U("HPExHeatCOP"),
                                    tip = _U("Calculated from the nominal and theoretical COP at the manufact. catalogue nominal conditions and applied as a constant in extrapolation for other working conditions (see next point)."))

        self.tc25 = StaticTextEntry(self.page2, maxchars = 255, value = '',
                                    label = _U("HPThHeatCOP"),
                                    tip = _U("Carnot COP for heating mode at nominal conditions (see next point)."))

        #
        # tab 3 - Heat source / sink
        #
        self.frame_heat_source_sink = wx.StaticBox(self.page3, -1, _U("Heat source / sink"))
        self.frame_low_temp_heat_source_sink = wx.StaticBox(self.page3, -1, _U("Low temperature heat source / sink"))
        self.frame_high_temp_heat_source_sink = wx.StaticBox(self.page3, -1, _U("High temperature heat source / sink"))
        self.frame_heat_source_sink.SetForegroundColour(TITLE_COLOR)
        self.frame_heat_source_sink.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_heat_source_sink.SetFont(fp.getFont())
        fp.popFont()

        self.tc26 = ChoiceEntry(self.page3,
                                values = [],
                                label = _U("HPAbsEffects"),
                                tip = _U("Heat source and sink"))

        self.tc27 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPLimDT"),
                               tip = _U("Maximum acceptable temperature difference between evaporator and condenser temperatures (primary fluid: Tco - Tev) - working limit"))

        self.tc28 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPCondTmax"),
                               tip = _U("Maximum condensing (and absorption) temperature (primary fluid) - working limit"))

        self.tc29 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPEvapTmin"),
                               tip = _U("Minimum evaporating temperature (primary fluid) - working limit"))

        self.tc30 = ChoiceEntry(self.page3,
                                values = [],
                                label = _U("HPAbsHeatMed"),
                                tip = _U("Heat transport medium used for heat supply to the generator"))

        self.tc31 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPGenTmin"),
                               tip = _U("Minimum required inlet temperature to the generator"))

        #
        # tab 4 - Economic Parameters
        #
        self.frame_economic_parameters = wx.StaticBox(self.page4, -1, _U("Economic parameters"))
        self.frame_economic_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_economic_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_economic_parameters.SetFont(fp.getFont())
        fp.popFont()

        self.tc32 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPPrice"),
                               tip = _U("Equipment price at factory applied installer's discount"))

        self.tc33 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPTurnKeyPrice"),
                               tip = _U("Price of installed equipment (including work, additional accessories, pumps, regulation, etc)"))

        self.tc34 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPOandMfix"),
                               tip = _U("Annual operational and maintenance fixed costs (approximate average per kW heating)"))

        self.tc35 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("HPOandMvar"),
                               tip = _U("Annual operational and maintenance variable costs dependant on usage (approximate average per MWh heating)"))

        self.tc36 = FloatEntry(self.page4,
                               ipart = 4, decimals = 0, minval = 1900, maxval = 2100, value = 2010,
                               label = _U("HPYearUpdate"),
                               tip = _U("Year of last update of the economic data"))
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBCHP", self.name)

        # DBCHP_ID needs to remain as first entry
        self.colLabels = "DBCHP_ID", "Manufacturer", "CHPequip", "Type", "SubType", "CHPPt"

        self.db = Status.DB.dbchp
        self.table = "dbchp"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]
        self.subtype = self.colLabels[4]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('Descriptive Data'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Technical Data'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Heat source / sink'))
        self.page4 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page4, _U('Economic Parameters'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        self.tc_subtype = ChoiceEntry(self.page0,
                                      values = [],
                                      label = _U("Subtype"),
                                      tip = _U("Show only equipment of subtype"))

        #
        # tab 1 - Descriptive Data
        #
        self.frame_descriptive_data = wx.StaticBox(self.page1, -1, _U("Descriptive data"))
        self.frame_descriptive_data.SetForegroundColour(TITLE_COLOR)
        self.frame_descriptive_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_descriptive_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Manufacturer"),
                             tip = _U("Manufacturer"))

        self.tc2 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("CHPequip"),
                             tip = _U("CHPequip"))

        self.tc3 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Type"),
                             tip = _U("Type"))

        self.tc4 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("SubType"),
                             tip = _U("SubType"))

        self.tc5 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Reference"),
                             tip = _U("Source of data"))

        #
        # tab 2 - Technical data
        #
        self.frame_technical_data = wx.StaticBox(self.page2, -1, _U("Technical data"))
        self.frame_electricity = wx.StaticBox(self.page2, -1, _U("Electricity generation parameters"))
        self.frame_technical_data.SetForegroundColour(TITLE_COLOR)
        self.frame_technical_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_technical_data.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              label = _U("CHPPt"),
                              tip = _U("Nominal thermal power"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc7 = ChoiceEntry(self.page2,
                               values = [],
                               label = _U("FuelType"),
                               tip = _U("Fuel type"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              label = _U("FuelConsum"),
                              tip = _U("Nominal fuel consumption"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              unitdict = 'FRACTION',
                              label = _U("Eta_t"),
                              tip = _U("Nominal thermal conversion efficiency"))

        self.tc10 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'POWER',
                               label = _U("CHPPe"),
                               tip = _U("Nominal electrical power"))

        self.tc11 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Eta_e"),
                               tip = _U("Electrical efficiency"))

        #
        # tab 3 - Heat source / sink
        #
        self.frame_heat_source_sink = wx.StaticBox(self.page3, -1, _U("Heat source / sink"))
        self.frame_heat_source_sink.SetForegroundColour(TITLE_COLOR)
        self.frame_heat_source_sink.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_heat_source_sink.SetFont(fp.getFont())
        fp.popFont()

        self.tc12 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'POWER',
                               label = _U("FluidSupply"),
                               tip = _U("Heat transport medium"))

        self.tc13 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'TEMPERATURE',
                               label = _U("Tsupply"),
                               tip = _U("Outlet temperature at nominal conditions"))

        self.tc14 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'MASSFLOWRATE',
                               unitdict = 'FRACTION',
                               label = _U("FlowRateSupply"),
                               tip = _U("Mass flow rate of heat transport medium"))

        self.tc15 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'POWER',
                               label = _U("FluidSupply2"),
                               tip = _U("Heat transport medium"))

        self.tc16 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'TEMPERATURE',
                               label = _U("Tsupply2"),
                               tip = _U("Outlet temperature at nominal conditions"))

        self.tc17 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'MASSFLOWRATE',
                               unitdict = 'FRACTION',
                               label = _U("FlowRateSupply2"),
                               tip = _U("Mass flow rate of heat transport medium"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 4 - Economic Parameters
        #
        self.frame_economic_parameters = wx.StaticBox(self.page4, -1, _U("Economic parameters"))
        self.frame_economic_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_economic_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_economic_parameters.SetFont(fp.getFont())
        fp.popFont()

        self.tc18 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'PRICE',
                               label = _U("Price"),
                               tip = _U("Equipment price at factory applied installer's discount"))

        self.tc19 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'PRICE',
                               label = _U("InvRate"),
                               tip = _U("Turn-key price"))

        self.tc20 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'UNITPRICE',
                               unitdict = 'FRACTION',
                               label = _U("OMRateFix"),
                               tip = _U("Annual operational and maintenance fixed costs (approximate average per kW heating)"))

        self.tc21 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'UNITPRICEENERGY',
                               unitdict = 'FRACTION',
                               label = _U("OMRateVar"),
                               tip = _U("Annual operational and maintenance variable costs dependant on usage (approximate average per MWh heating)"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc22 = FloatEntry(self.page4,
                               ipart = 4, decimals = 0, minval = 1900, maxval = 2100, value = 2010,
                               label = _U("YearUpdate"),
                               tip = _U("Year of last update of the economic data"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBBoiler", self.name)

        # DBBoiler_ID needs to remain as first entry
        self.colLabels = "DBBoiler_ID", "BoilerManufacturer", "BoilerModel", "BoilerType", "BBPnom"

        self.db = Status.DB.dbboiler
        self.table = "dbboiler"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('Descriptive Data'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Technical Data'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Heat source / sink'))
        self.page4 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page4, _U('Economic Parameters'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        #
        # tab 1 - Descriptive Data
        #
        self.frame_descriptive_data = wx.StaticBox(self.page1, -1, _U("Descriptive data"))
        self.frame_descriptive_data.SetForegroundColour(TITLE_COLOR)
        self.frame_descriptive_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_descriptive_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("BoilerManufacturer"),
                             tip = _U("Boiler Manufacturer"))

        self.tc2 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("BoilerModel"),
                             tip = _U("Boiler Model"))

        self.tc3 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("BoilerType"),
                             tip = _U("Boiler Type"))

        self.tc4 = TextEntry(self.page1, maxchars = 200, value = '',
                             label = _U("Reference"),
                             tip = _U("Source of data"))

        #
        # tab 2 - Technical data
        #
        self.frame_technical_data = wx.StaticBox(self.page2, -1, _U("Technical data"))
        self.frame_boiler_spec = wx.StaticBox(self.page2, -1, _U("Boiler specific technical parameters"))
        self.frame_eco_preh = wx.StaticBox(self.page2, -1, _U("Economiser / Preheater"))
        self.frame_technical_data.SetForegroundColour(TITLE_COLOR)
        self.frame_technical_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_technical_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc5 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'POWER',
                              unitdict = 'FRACTION',
                              label = _U("BBPnom"),
                              tip = _U("Nominal thermal power"))

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              unitdict = 'FRACTION',
                              label = _U("BBEfficiency"),
                              tip = _U("Nominal efficiency"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'POWER',
                              unitdict = 'FRACTION',
                              label = _U("FuelConsum"),
                              tip = _U("Nominal fuel consumption (LCV)"))

        self.tc8 = ChoiceEntry(self.page2,
                               values = [],
                               label = _U("FuelType"),
                               tip = _U("Fuel type"))

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'POWER',
                              unitdict = 'FRACTION',
                              label = _U("ElConsum"),
                              tip = _U("Nominal electrical power consumption"))

        self.tc10 = ChoiceEntry(self.page2,
                                values = ["Yes", "No"],
                                label = _U("Economiser"),
                                tip = _U("Does the equipment include an economiser (water preheater)?"))

        self.tc11 = ChoiceEntry(self.page2,
                                values = ["Yes", "No"],
                                label = _U("Preheater"),
                                tip = _U("Does the equipment include an air preheater ?"))

        self.tc12 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("ExcessAirRatio"),
                               tip = _U("Typical excess air ratio"))

        self.tc13 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("BBA1"),
                               tip = _U("Linear dependence of the efficiency on the load"))

        self.tc14 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("BBA2"),
                               tip = _U("Quadratic dependence of the efficiency on the load"))

        self.tc15 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'INVTEMP',
                               unitdict = 'FRACTION',
                               label = _U("BBK1"),
                               tip = _U("Linear dependence of the efficiency on the temperature"))

        self.tc16 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'INVTEMP2',
                               unitdict = 'FRACTION',
                               label = _U("BBK2"),
                               tip = _U("Quadratic dependence of the efficiency on the temperature"))

        #
        # tab 3 - Heat source / sink
        #
        self.frame_heat_source_sink = wx.StaticBox(self.page3, -1, _U("Heat source / sink"))
        self.frame_heat_source_sink.SetForegroundColour(TITLE_COLOR)
        self.frame_heat_source_sink.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_heat_source_sink.SetFont(fp.getFont())
        fp.popFont()

        self.tc17 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               unitdict = 'TEMPERATURE',
                               label = _U("BoilerTemp"),
                               tip = _U("Maximum outlet temperature"))

        #
        # tab 4 - Economic Parameters
        #
        self.frame_economic_parameters = wx.StaticBox(self.page4, -1, _U("Economic parameters"))
        self.frame_economic_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_economic_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_economic_parameters.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc18 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("BoilerPrice"),
                               tip = _U("Equipment price at factory applied installer's discount"))

        self.tc19 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("BoilerTurnKeyPrice"),
                               tip = _U("Price of installed equipment (including work, additional accessories, pumps, regulation, etc)"))

        self.tc20 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("BoilerOandMfix"),
                               tip = _U("Annual operational and maintenance fixed costs (approximate average per kW heating)"))

        self.tc21 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("BoilerOandMvar"),
                               tip = _U("Annual operational and maintenance variable costs dependant on usage (approximate average per MWh heating)"))

        self.tc22 = FloatEntry(self.page4,
                               ipart = 4, decimals = 0, minval = 1900, maxval = 2100, value = 2010,
                               label = _U("YearUpdate"),
                               tip = _U("Year of last update of the economic data"))


        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)
示例#5
0
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBBenchmark", self.name)
        self.labelButtonAdd = _U("Add")
        self.labelButtonDelete = _U("Delete")

        # DBBenchmark_ID needs to remain as first entry although it is not shown on the GUI
        self.colLabels = "DBBenchmark_ID", "NACECode", "UnitOp", "ProductCode", "Product", "Reference"

        self.db = Status.DB.dbbenchmark
        self.table = "dbbenchmark"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[1]
        self.subtype = self.colLabels[3]
        self.subtype2 = self.colLabels[2]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('Validity of benchmark'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Electricity consumption'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Fuel consumption'))
        self.page4 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page4, _U('Total final energy consumption'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("NACECode"),
                                   tip = _U("Show only"))

        self.tc_subtype = ChoiceEntry(self.page0,
                                      values = [],
                                      label = _U("ProductCode"),
                                      tip = _U("Show only"))

        self.tc_subtype2 = ChoiceEntry(self.page0,
                                       values = [],
                                       label = _U("UnitOp"),
                                       tip = _U("Show only"))

        self.tc_help = wx.StaticBox(self.page0, -1, _U('Help'))
        self.tc_help_text = wx.StaticText(self.page0, -1, _U('Click on the column labels to sort the table.'))
        self.tc_help_text.SetFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False, 'Tahoma'))

        #
        # tab 1 - Validity of benchmark - association with industrial sector, unit operation and product type
        #
        self.frame_validity_of_benchmark = wx.StaticBox(self.page1, -1, _U("Validity of benchmark - association with industrial sector, unit operation and product type"))
        self.frame_validity_range = wx.StaticBox(self.page1, -1, _U("Validity range for benchmark (general)"))
        self.frame_limits_of_validity = wx.StaticBox(self.page1, -1, _U("Limits of validity range depending on company size / production volume"))
        self.frame_data_source = wx.StaticBox(self.page1, -1, _U("Data source"))
        self.frame_validity_of_benchmark.SetForegroundColour(TITLE_COLOR)
        self.frame_validity_of_benchmark.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_validity_of_benchmark.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = ChoiceEntry(self.page1,
                               values = [],
                               label = _U("NACE code of the industrial sector"),
                               tip = _U("The benchmark can be general or only valid for a specific industrial sector"))

        self.tc2 = ChoiceEntry(self.page1,
                               values = [],
                               label = _U("Unit operation code"),
                               tip = _U("The benchmark can be general for the industrial sector, or specific for some unit operation in the sector. \"General\" could be an unit-operation code = 0, or empty"))

        self.tc3 = ChoiceEntry(self.page1,
                               values = [],
                               label = _U("Product Code"),
                               tip = _U("Final product or intermediate product for unit operation specific benchmarks"))

        self.tc4 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Product short name"),
                             tip = _U("Final product or intermediate product for unit operation specific benchmarks"))

        self.tc5 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Measurement unit for product"),
                             tip = _U("Measurement unit for product"))

        fs = FieldSizes(wHeight = HEIGHT_TE_MULTILINE, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc6 = TextEntry(self.page1, value = '',
                             isMultiline = True,
                             label = _U("Comments on range of application"),
                             tip = _U("Additional comments on validity range (e.g. restrictions to certain types of machinery, etc.)"))

        self.tc7 = TextEntry(self.page1, maxchars = 200, value = '',
                             isMultiline = True,
                             label = _U("Data relevance/reliability"),
                             tip = _U("Data relevance/reliability"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc8 = FloatEntry(self.page1,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'CURRENCY',
                              label = _U("Yearly turnover (minimum)"),
                              tip = _U("Yearly turnover (minimum)"))

        self.tc9 = FloatEntry(self.page1,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'CURRENCY',
                              label = _U("Yearly turnover (maximum)"),
                              tip = _U("Yearly turnover (maximum)"))

        self.tc10 = FloatEntry(self.page1,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'PU',
                               label = _U("Yearly production volume (minimum)"),
                               tip = _U("Yearly production volume (minimum)"))

        self.tc11 = FloatEntry(self.page1,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'PU',
                               label = _U("Yearly production volume (maximum)"),
                               tip = _U("Yearly production volume (maximum)"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc12 = FloatEntry(self.page1,
                               ipart = 4, decimals = 0, minval = 1900, maxval = 2100, value = 2010,
                               label = _U("Year (reference for economic data)"),
                               tip = _U("Reference year for the economic data"))

        fs = FieldSizes(wHeight = HEIGHT_TE_MULTILINE, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc13 = TextEntry(self.page1, value = '',
                              isMultiline = True,
                              label = _U("References"),
                              tip = _U("Bibliographic reference (data source) of the benchmark"))

        self.tc14 = TextEntry(self.page1, value = '',
                              isMultiline = True,
                              label = _U("Complementary literature"),
                              tip = _U("Additional bibliography"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 2 - Electricity consumption
        #
        self.frame_electricity_consumption = wx.StaticBox(self.page2, -1, _U("Electricity consumption"))
        self.frame_electricity_consumption.SetForegroundColour(TITLE_COLOR)
        self.frame_electricity_consumption.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_electricity_consumption.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_SHORT,
                        wData = 0, wUnits = 0)

        self.tc_2_label_prod_cost = TextEntry(self.page2, label = _U("Energy intensity (production cost)"))
        self.tc_2_label_turnover = TextEntry(self.page2, label = _U("Energy intensity (turnover)"))
        self.tc_2_label_spec_e_cons = TextEntry(self.page2, label = _U("Specific Energy Consumption"))

        fs = FieldSizes(wHeight = HEIGHT + 20, wLabel = 0,
                        wData = 0, wUnits = 0)

        self.tc_2_label_space = TextEntry(self.page2, label = _U(""))

        fs = FieldSizes(wHeight = HEIGHT + 20, wLabel = 40,
                        wData = 0, wUnits = 0)

        self.tc_2_label_min = TextEntry(self.page2, label = _U("MIN"))
        self.tc_2_label_max = TextEntry(self.page2, label = _U("MAX"))
        self.tc_2_label_tar = TextEntry(self.page2, label = _U("TARGET"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = 0,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc15 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc16 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc17 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc18 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc19 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc20 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc21 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per pruduct unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        self.tc22 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per pruduct unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        self.tc23 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per pruduct unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc24 = ChoiceEntry(self.page2,
                                values = [],
                                label = _U("Unit of measurement"),
                                tip = _U("Measuring unit for the quantity of product or the quantity of processed medium"))

        #
        # tab 3 - Fuel consumption
        #
        self.frame_fuel_consumption = wx.StaticBox(self.page3, -1, _U("Fuel consumption"))
        self.frame_fuel_consumption.SetForegroundColour(TITLE_COLOR)
        self.frame_fuel_consumption.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_fuel_consumption.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_SHORT,
                        wData = 0, wUnits = 0)

        self.tc_3_label_prod_cost = TextEntry(self.page3, label = _U("Energy intensity (production cost)"))
        self.tc_3_label_turnover = TextEntry(self.page3, label = _U("Energy intensity (turnover)"))
        self.tc_3_label_spec_e_cons = TextEntry(self.page3, label = _U("Specific Energy Consumption"))

        fs = FieldSizes(wHeight = HEIGHT + 20, wLabel = 0,
                        wData = 0, wUnits = 0)

        self.tc_3_label_space = TextEntry(self.page3, label = _U(""))

        fs = FieldSizes(wHeight = HEIGHT + 20, wLabel = 40,
                        wData = 0, wUnits = 0)

        self.tc_3_label_min = TextEntry(self.page3, label = _U("MIN"))
        self.tc_3_label_max = TextEntry(self.page3, label = _U("MAX"))
        self.tc_3_label_tar = TextEntry(self.page3, label = _U("TARGET"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = 0,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc25 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc26 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc27 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc28 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc29 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc30 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc31 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per pruduct unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        self.tc32 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per pruduct unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        self.tc33 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per pruduct unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc34 = ChoiceEntry(self.page3,
                                values = [],
                                label = _U("Unit of measurement"),
                                tip = _U("Measuring unit for the quantity of product or the quantity of processed medium"))

        #
        # tab 4 - Total final energy consumption
        #
        self.frame_energy_consumption = wx.StaticBox(self.page4, -1, _U("Total final energy consumption"))
        self.frame_energy_consumption.SetForegroundColour(TITLE_COLOR)
        self.frame_energy_consumption.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_energy_consumption.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_SHORT,
                        wData = 0, wUnits = 0)

        self.tc_4_label_prod_cost = TextEntry(self.page4, label = _U("Energy intensity (production cost)"))
        self.tc_4_label_turnover = TextEntry(self.page4, label = _U("Energy intensity (turnover)"))
        self.tc_4_label_spec_e_cons = TextEntry(self.page4, label = _U("Specific Energy Consumption"))

        fs = FieldSizes(wHeight = HEIGHT + 20, wLabel = 0,
                        wData = 0, wUnits = 0)

        self.tc_4_label_space = TextEntry(self.page4, label = _U(""))

        fs = FieldSizes(wHeight = HEIGHT + 20, wLabel = 40,
                        wData = 0, wUnits = 0)

        self.tc_4_label_min = TextEntry(self.page4, label = _U("MIN"))
        self.tc_4_label_max = TextEntry(self.page4, label = _U("MAX"))
        self.tc_4_label_tar = TextEntry(self.page4, label = _U("TARGET"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = 0,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc35 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc36 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc37 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc38 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc39 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc40 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERCU',
                               label = _U(""),
                               tip = _U("Energetic intensity (energetic consumption  with respect to an economic value: (a) expressed as a production cost and (b) expressed as a turnover"))

        self.tc41 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per product unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        self.tc42 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per product unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        self.tc43 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'ENERGYPERPU',
                               label = _U(""),
                               tip = _U("Specific energetic consumption per product unit (generic ratios) or processed medium unit (specific ratios for determined unitary operation)"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc44 = ChoiceEntry(self.page4,
                                values = [],
                                label = _U("Unit of measurement"),
                                tip = _U("Measuring unit for the quantity of product or the quantity of processed medium"))
示例#6
0
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBAuditor", self.name)
        self.labelButtonAdd = _U("Add Auditor")
        self.labelButtonDelete = _U("Delete Auditor")

        # Auditor_ID needs to remain as first entry although it is not shown on the GUI
        self.colLabels = "Auditor_ID", "Name", "City", "Country", "Company", "CompanyType"

        self.db = Status.DB.auditor
        self.table = "auditor"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]
        self.subtype = self.colLabels[5]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('General Data'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Country"),
                                   tip = _U("Show only auditors of country"))

        self.tc_subtype = ChoiceEntry(self.page0,
                                      values = [],
                                      label = _U("Company type"),
                                      tip = _U("Show only auditors of company type"))

        self.tc_help = wx.StaticBox(self.page0, -1, _U('Help'))
        self.tc_help_text = wx.StaticText(self.page0, -1, _U('Click on the column labels to sort the table.'))
        self.tc_help_text.SetFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False, 'Tahoma'))

        #
        # tab 1 - General Data
        #
        self.frame_general_data = wx.StaticBox(self.page1, -1, _U("General data"))
        self.frame_general_data.SetForegroundColour(TITLE_COLOR)
        self.frame_general_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Name"),
                             tip = _U("Name"))

        self.tc2 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("City"),
                             tip = _U("City"))

        self.tc3 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Country"),
                             tip = _U("Country"))

        self.tc4 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Company"),
                             tip = _U("Company"))

        self.tc5 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("CompanyType"),
                             tip = _U("CompanyType"))

        fs = FieldSizes(wHeight = HEIGHT_TE_MULTILINE, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc6 = TextEntry(self.page1, maxchars = 100, value = '',
                             isMultiline = True,
                             label = _U("Adress"),
                             tip = _U("Adress"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc7 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Phone"),
                             tip = _U("Phone"))

        self.tc8 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Fax"),
                             tip = _U("Fax"))

        self.tc9 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("EMail"),
                             tip = _U("EMail"))

        self.tc10 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Web"),
                             tip = _U("Web"))
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBElectricityMix", self.name)
        self.labelButtonAdd = _U("Add")
        self.labelButtonDelete = _U("Delete")

        # id needs to remain as first entry although it is not shown on the GUI
        self.colLabels = "id", "Country", "Year", "Type"

        self.db = Status.DB.dbelectricitymix
        self.table = "dbelectricitymix"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('General information'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Data'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        self.tc_help = wx.StaticBox(self.page0, -1, _U('Help'))
        self.tc_help_text = wx.StaticText(self.page0, -1, _U('Click on the column labels to sort the table.'))
        self.tc_help_text.SetFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False, 'Tahoma'))

        #
        # tab 1 - General information
        #
        self.frame_general_information = wx.StaticBox(self.page1, -1, _U("General information"))
        self.frame_general_information.SetForegroundColour(TITLE_COLOR)
        self.frame_general_information.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_information.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Country or region"),
                             tip = _U("Country or region"))

        self.tc2 = FloatEntry(self.page1,
                              ipart = 4, decimals = 0, minval = 1900, maxval = 2100, value = 2010,
                              label = _U("Year of data"),
                              tip = _U("Year of data"))

        self.tc3 = TextEntry(self.page1, maxchars = 20, value = '',
                             label = _U("Type of electricity (user, source, supplier, etc.)"),
                             tip = _U("Specify e.g. average of national grid, high voltage grid, ..."))

        fs = FieldSizes(wHeight = HEIGHT_TE_MULTILINE, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc4 = TextEntry(self.page1, maxchars = 200, value = '',
                             isMultiline = True,
                             label = _U("Bibliographic reference / data source"),
                             tip = _U("Please give a full reference of the data source that allows for tracking back the data"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc5 = TextEntry(self.page1, value = '',
                             isStatic = True,
                             label = _U("Auditor responsible for data set"),
                             tip = _U("Auditor responsible for data set"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 2 - Data
        #
        self.frame_data = wx.StaticBox(self.page2, -1, _U("Data"))
        self.frame_percentage_of_generation = wx.StaticBox(self.page2, -1, _U("Percentage of generation by:"))
        self.frame_data.SetForegroundColour(TITLE_COLOR)
        self.frame_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_data.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT + 20,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH_LARGE)

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'FRACTION',
                              label = _U("Primary energy per unit of electricity"),
                              tip = _U("Only non-renewable part of primary energy"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'CO2RATIO',
                              label = _U("CO2 generation per unit of electricity"),
                              tip = _U("CO2 generation per unit of electricity"))

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'CO2RATIO',
                              label = _U("Highly radiactive nuclear waste per unit of electricity"),
                              tip = _U("Highly radiactive nuclear waste per unit of electricity"))

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'FRACTION',
                              label = _U("Natural Gas"),
                              tip = _U("natural gas"))

        self.tc10 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Carbon"),
                               tip = _U("carbon"))

        self.tc11 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Oil"),
                               tip = _U("oil"))

        self.tc12 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Renewables"),
                               tip = _U("renewables"))

        self.tc13 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Nukes"),
                               tip = _U("nuclear"))

        self.tc14 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("CHP"),
                               tip = _U("CHP (except CHP using renewables)"))

        self.tc15 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Other"),
                               tip = _U("other"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)
    def _init_ctrls(self, parent):
        # ------------------------------------------------------------------------------
        # --- UI setup
        # ------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBSolarThermal", self.name)

        # DBSolarThermal_ID needs to remain as first entry
        self.colLabels = "DBSolarThermal_ID", "STManufacturer", "STModel", "STType", "STPnomColl"

        self.db = Status.DB.dbsolarthermal
        self.table = "dbsolarthermal"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style=0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U("Summary table"))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U("Descriptive Data"))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U("Technical Data"))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U("Economic Parameters"))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name="summarytable", parent=self.page0, pos=wx.Point(42, 32), style=0)

        self.tc_type = ChoiceEntry(self.page0, values=[], label=_U("Type"), tip=_U("Show only equipment of type"))

        #
        # tab 1 - Descriptive Data
        #
        self.frame_descriptive_data = wx.StaticBox(self.page1, -1, _U("Descriptive data"))
        self.frame_descriptive_data.SetForegroundColour(TITLE_COLOR)
        self.frame_descriptive_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_descriptive_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(
            self.page1, maxchars=20, value="", label=_U("STManufacturer"), tip=_U("Solarthermal Manufacturer")
        )

        self.tc2 = TextEntry(self.page1, maxchars=20, value="", label=_U("STModel"), tip=_U("Solarthermal Model"))

        self.tc3 = TextEntry(self.page1, maxchars=45, value="", label=_U("STType"), tip=_U("Solarthermal Type"))

        self.tc4 = TextEntry(self.page1, maxchars=200, value="", label=_U("STReference"), tip=_U("Source of data"))

        #
        # tab 2 - Technical data
        #
        self.frame_technical_data = wx.StaticBox(self.page2, -1, _U("Technical data"))
        self.frame_col_eff_par = wx.StaticBox(self.page2, -1, _U("Collector efficiency parameters"))
        self.frame_col_dim_wei = wx.StaticBox(self.page2, -1, _U("Collector dimension and weight"))
        self.frame_technical_data.SetForegroundColour(TITLE_COLOR)
        self.frame_technical_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_technical_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc5 = StaticTextEntry(self.page2, maxchars=255, value="", label=_U("STPnomColl"), tip=_U("STPnomColl"))

        self.tc6 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="FRACTION",
            label=_U("STc0"),
            tip=_U("Optical efficiency"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits=0)

        self.tc7 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            label=_U("STc1"),
            tip=_U("Linear thermal loss coefficient"),
        )

        self.tc8 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            label=_U("STc2"),
            tip=_U("Quadratic thermal loss coefficient"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)

        self.tc9 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="FRACTION",
            label=_U("K50L"),
            tip=unicode("Incidence angle correction factor at 50º (longitudinal)", "latin-1"),
        )

        self.tc10 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="FRACTION",
            label=_U("K50T"),
            tip=unicode("Incidence angle correction factor at 50º (transversal)", "latin-1"),
        )

        self.tc11 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="MASSORVOLUMEFLOW",
            label=_U("STMassFlowRate"),
            tip=_U("Recommended collector mass flow rate"),
        )

        self.tc12 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="LENGTH",
            label=_U("STLengthGross"),
            tip=_U("STLengthGross"),
        )

        self.tc13 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="LENGTH",
            label=_U("STHeightGross"),
            tip=_U("STHeightGross"),
        )

        self.tc14 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="AREA",
            label=_U("STAreaGross"),
            tip=_U("STAreaGross"),
        )

        self.tc15 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="LENGTH",
            label=_U("STLengthAper"),
            tip=_U("STLengthAper"),
        )

        self.tc16 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="LENGTH",
            label=_U("STHeightAper"),
            tip=_U("STHeightAper"),
        )

        self.tc17 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="AREA",
            label=_U("STAreaAper"),
            tip=_U("STAreaAper"),
        )

        self.tc18 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            unitdict="FRACTION",
            label=_U("STAreaFactor"),
            tip=_U("STAreaFactor"),
        )

        self.tc19 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            # unitdict = 'MASSPERAREA',
            unitdict="FRACTION",
            label=_U("STWeightFactor"),
            tip=_U("STWeightFactor"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)

        #
        # tab 3 - Economic Parameters
        #
        self.frame_economic_parameters = wx.StaticBox(self.page3, -1, _U("Economic parameters"))
        self.frame_economic_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_economic_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_economic_parameters.SetFont(fp.getFont())
        fp.popFont()

        self.tc20 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            # unitdict = 'UNITPRICE',
            unitdict="FRACTION",
            label=_U("STUnitPrice300kW"),
            tip=_U("STUnitPrice300kW"),
        )

        self.tc21 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            # unitdict = 'UNITPRICE',
            unitdict="FRACTION",
            label=_U("STUnitTurnKeyPrice30kW"),
            tip=_U("STUnitTurnKeyPrice30kW"),
        )

        self.tc22 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            # unitdict = 'UNITPRICE',
            unitdict="FRACTION",
            label=_U("STUnitTurnKeyPrice300kW"),
            tip=_U("STUnitTurnKeyPrice300kW"),
        )

        self.tc23 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            # unitdict = 'UNITPRICE',
            unitdict="FRACTION",
            label=_U("STUnitTurnKeyPrice3000kW"),
            tip=_U("STUnitTurnKeyPrice3000kW"),
        )

        self.tc24 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=0.0,
            maxval=1.0e12,
            value=0.0,
            # unitdict = 'UNITPRICE',
            unitdict="FRACTION",
            label=_U("STOMUnitFix"),
            tip=_U("STOMUnitFix"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits=0)

        self.tc25 = FloatEntry(
            self.page3,
            ipart=4,
            decimals=0,
            minval=1900,
            maxval=2100,
            value=2010,
            label=_U("STYearUpdate"),
            tip=_U("Year of last update of the economic data"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBSolarThermal", self.name)

        # DBSolarThermal_ID needs to remain as first entry although it is not shown on the GUI
        self.colLabels = "DBSolarThermal_ID", "STManufacturer", "STModel", "STType", "STPnomColl"

        self.db = Status.DB.dbsolarthermal
        self.table = "dbsolarthermal"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[3]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('Descriptive Data'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Technical Data'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Economic Parameters'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        self.tc_help = wx.StaticBox(self.page0, -1, _U('Help'))
        self.tc_help_text = wx.StaticText(self.page0, -1, _U('Click on the column labels to sort the table.'))
        self.tc_help_text.SetFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False, 'Tahoma'))

        #
        # tab 1 - Descriptive Data
        #
        self.frame_descriptive_data = wx.StaticBox(self.page1, -1, _U("Descriptive data"))
        self.frame_descriptive_data.SetForegroundColour(TITLE_COLOR)
        self.frame_descriptive_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_descriptive_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 20, value = '',
                             label = _U("Solarthermal Manufacturer"),
                             tip = _U("Solarthermal Manufacturer"))

        self.tc2 = TextEntry(self.page1, maxchars = 20, value = '',
                             label = _U("Solarthermal Model"),
                             tip = _U("Solarthermal Model"))

        self.tc3 = ChoiceEntry(self.page1,
                               values = [],
                               label = _U("Solarthermal Type"),
                               tip = _U("Solarthermal Type"))

        fs = FieldSizes(wHeight = HEIGHT_TE_MULTILINE, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc4 = TextEntry(self.page1, maxchars = 200, value = '',
                             isMultiline = True,
                             label = _U("Reference"),
                             tip = _U("Source of data"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 2 - Technical data
        #
        self.frame_technical_data = wx.StaticBox(self.page2, -1, _U("Technical data"))
        self.frame_col_eff_par = wx.StaticBox(self.page2, -1, _U("Collector efficiency parameters"))
        self.frame_col_dim_wei = wx.StaticBox(self.page2, -1, _U("Collector dimension and weight"))
        self.frame_technical_data.SetForegroundColour(TITLE_COLOR)
        self.frame_technical_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_technical_data.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_LONG,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc5 = FloatEntry(self.page2,
                              isStatic = True,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'POWER',
                              label = _U("STPnomColl"),
                              tip = _U("STPnomColl"))

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'FRACTION',
                              label = _U("Optical efficiency"),
                              tip = _U("Optical efficiency"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'HEATLOSSCOEFF',
                              label = _U("Linear thermal loss coefficient"),
                              tip = _U("Linear thermal loss coefficient"))

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'HEATLOSSCOEFF2',
                              label = _U("Quadratic thermal loss coefficient"),
                              tip = _U("Quadratic thermal loss coefficient"))

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                              unitdict = 'FRACTION',
                              label = _U("Incidence angle correction factor at 50º (longitudinal)"),
                              tip = unicode("Incidence angle correction factor at 50º (longitudinal)", 'latin-1'))

        self.tc10 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("Incidence angle correction factor at 50º (transversal)"),
                               tip = unicode("Incidence angle correction factor at 50º (transversal)", 'latin-1'))

        self.tc11 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'MASSORVOLUMEFLOW',
                               label = _U("Recommended collector mass flow rate"),
                               tip = _U("Recommended collector mass flow rate"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.tc12 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'LENGTH',
                               label = _U("STLengthGross"),
                               tip = _U("STLengthGross"))

        self.tc13 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'LENGTH',
                               label = _U("STHeightGross"),
                               tip = _U("STHeightGross"))

        self.tc14 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'AREA',
                               label = _U("STAreaGross"),
                               tip = _U("STAreaGross"))

        self.tc15 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'LENGTH',
                               label = _U("STLengthAper"),
                               tip = _U("STLengthAper"))

        self.tc16 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'LENGTH',
                               label = _U("STHeightAper"),
                               tip = _U("STHeightAper"))

        self.tc17 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'AREA',
                               label = _U("STAreaAper"),
                               tip = _U("STAreaAper"))

        self.tc18 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'FRACTION',
                               label = _U("STAreaFactor"),
                               tip = _U("STAreaFactor"))

        self.tc19 = FloatEntry(self.page2,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'MASSPERAREA',
                               label = _U("STWeightFactor"),
                               tip = _U("STWeightFactor"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 3 - Economic Parameters
        #
        self.frame_economic_parameters = wx.StaticBox(self.page3, -1, _U("Economic parameters"))
        self.frame_economic_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_economic_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_economic_parameters.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT + 70,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH_LARGE)

        self.tc20 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'UNITPRICE',
                               label = _U("STUnitPrice300kW"),
                               tip = _U("STUnitPrice300kW"))

        self.turn_key_price_grid = wx.grid.Grid(name = 'STUnitTurnKeyPrice', parent = self.page3, style = 0)
        self.turn_key_price_grid.CreateGrid(1, 3)
        self.turn_key_price_grid.SetRowLabelValue(0, 'EUR/kW')
        self.turn_key_price_grid.EnableGridLines(True)
        self.turn_key_price_grid.SetDefaultRowSize(20)
        self.turn_key_price_grid.SetRowLabelSize(85)
        self.turn_key_price_grid.SetDefaultColSize(160)
        self.turn_key_price_grid.EnableEditing(True)
        self.turn_key_price_grid.SetSelectionMode(wx.grid.Grid.wxGridSelectCells)
        self.turn_key_price_grid.SetLabelFont(wx.Font(9, wx.ROMAN, wx.ITALIC, wx.BOLD))
        self.turn_key_price_grid.SetColLabelValue(0, "STUnitTurnKeyPrice30kW")
        self.turn_key_price_grid.SetColLabelValue(1, "STUnitTurnKeyPrice300kW")
        self.turn_key_price_grid.SetColLabelValue(2, "STUnitTurnKeyPrice3000kW")
        self.turn_key_price_grid.SetGridCursor(0, 0)

        self.tc24 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = -INFINITE, maxval = INFINITE, value = 0.,
                               unitdict = 'UNITPRICE',
                               label = _U("STOMUnitFix"),
                               tip = _U("STOMUnitFix"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT + 70,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH_LARGE, wUnits = 0)

        self.tc25 = FloatEntry(self.page3,
                               ipart = 4, decimals = 0, minval = 1900, maxval = 2100, value = 2010,
                               label = _U("Year of last update of the economic data"),
                               tip = _U("Year of last update of the economic data"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT_SHORT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBFluid", self.name)

        # DBFluid_ID needs to remain as first entry
        self.colLabels = "DBFluid_ID", "FluidName", "RefrigerantCode"

        self.db = Status.DB.dbfluid
        self.table = "dbfluid"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[2]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('General information on fluid'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Main physical properties'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Specific properties required only for refrigerants'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        #
        # tab 1 - General information on fluid
        #
        self.frame_general_information = wx.StaticBox(self.page1, -1, _U("General information on fluid"))
        self.frame_general_information.SetForegroundColour(TITLE_COLOR)
        self.frame_general_information.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_information.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("FluidName"),
                             tip = _U("Name of the fluid"))

        self.tc2 = TextEntry(self.page1, maxchars = 6, value = '',
                             label = _U("RefrigerantCode"),
                             tip = _U("Refrigerant code"))

        self.tc3 = TextEntry(self.page1, maxchars = 200, value = '',
                             label = _U("FluidDataSource"),
                             tip = _U("Source of data"))

        self.tc4 = TextEntry(self.page1, maxchars = 200, value = '',
                             label = _U("FluidComment"),
                             tip = _U("Additional comments"))

        #
        # tab 2 - Main physical properties
        #
        self.frame_main_properties = wx.StaticBox(self.page2, -1, _U("Main physical properties"))
        self.frame_main_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_main_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_main_properties.SetFont(fp.getFont())
        fp.popFont()

        self.tc5 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'HEATCAPACITY',
                              unitdict = 'FRACTION',
                              label = _U("FluidCp"),
                              tip = _U("Specific heat in liquid state"))

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'TEMPERATURE',
                              unitdict = 'FRACTION',
                              label = _U("TCond"),
                              tip = _U("Temperature of evaporation"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'HEATCAPACITY',
                              unitdict = 'FRACTION',
                              label = _U("FluidCpG"),
                              tip = _U("Specific heat in gaseous state (vapour)"))

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'SPECIFICENTHALPY',
                              unitdict = 'FRACTION',
                              label = _U("LatentHeat"),
                              tip = _U("Latent heat of evaporation"))

        self.tc9 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'DENSITY',
                              unitdict = 'FRACTION',
                              label = _U("FluidDensity"),
                              tip = _U("Density"))

        #
        # tab 3 - Specific properties required only for refrigerants
        #
        self.frame_refrigerant_properties = wx.StaticBox(self.page3, -1, _U("Specific properties required only for refrigerants"))
        self.frame_refrigerant_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_refrigerant_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_refrigerant_properties.SetFont(fp.getFont())
        fp.popFont()

        self.tc10 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'CO2RATIO',
                               unitdict = 'FRACTION',
                               label = _U("SpecificMassFlow"),
                               tip = _U("Typical specific mass flow of refrigerant"))

        self.tc11 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'TEMPERATURE',
                               unitdict = 'FRACTION',
                               label = _U("THighP"),
                               tip = _U("Typical outlet temperature of compressor"))

        self.tc12 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'DYNAMICVISCOSITY',
                               unitdict = 'FRACTION',
                               label = _U("Viscosity"),
                               tip = _U("Dynamic Viscosity at typical working conditions"))

        self.tc13 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'CONDUCTIVITY',
                               unitdict = 'FRACTION',
                               label = _U("Conductivity"),
                               tip = _U("Thermal conductivity at typical working conditions"))

        self.tc14 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'SPECIFICENTHALPY',
                               unitdict = 'FRACTION',
                               label = _U("SensibleHeat"),
                               tip = _U("Senisble heat at typical working conditions"))
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBFuel", self.name)

        # DBFuel_ID needs to remain as first entry
        self.colLabels = "DBFuel_ID", "FuelName", "FuelType", "DBFuelUnit"

        self.db = Status.DB.dbfuel
        self.table = "dbfuel"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[2]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('General information on fuel'))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U('Main physical properties'))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U('Properties for offgas calculations'))
        self.page4 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page4, _U('Environment parameters'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        #
        # tab 1 - General information on fuel
        #
        self.frame_general_information = wx.StaticBox(self.page1, -1, _U("General information on fuel"))
        self.frame_general_information.SetForegroundColour(TITLE_COLOR)
        self.frame_general_information.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_information.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("FuelName"),
                             tip = _U("Name of the fuel"))

        self.tc2 = ChoiceEntry(self.page1,
                               values = [],
                               label = _U("FuelType"),
                               tip = _U("Fuel type"))

        self.tc3 = ChoiceEntry(self.page1,
                               values = [],
                               label = _U("DBFuelUnit"),
                               tip = _U("Default measurement unit"))

        self.tc4 = TextEntry(self.page1, maxchars = 200, value = '',
                             label = _U("FuelDataSource"),
                             tip = _U("Source of data"))

        self.tc5 = TextEntry(self.page1, maxchars = 200, value = '',
                             label = _U("FuelComment"),
                             tip = _U("Additional comments"))

        #
        # tab 2 - Main physical properties
        #
        self.frame_main_properties = wx.StaticBox(self.page2, -1, _U("Main physical properties"))
        self.frame_main_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_main_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_main_properties.SetFont(fp.getFont())
        fp.popFont()

        self.tc6 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'SPECIFICENTHALPY',
                              unitdict = 'FRACTION',
                              label = _U("FuelLCV"),
                              tip = _U("Lower calorific value"))

        self.tc7 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'SPECIFICENTHALPY',
                              unitdict = 'FRACTION',
                              label = _U("FuelHCV"),
                              tip = _U("Higher calorific value"))

        self.tc8 = FloatEntry(self.page2,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'DENSITY',
                              unitdict = 'FRACTION',
                              label = _U("FuelDensity"),
                              tip = _U("Density"))

        #
        # tab 3 - Properties for offgas calculations
        #
        self.frame_offgas_properties = wx.StaticBox(self.page3, -1, _U("Properties for offgas calculations"))
        self.frame_offgas_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_offgas_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_offgas_properties.SetFont(fp.getFont())
        fp.popFont()

        self.tc9 = FloatEntry(self.page3,
                              ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                              #unitdict = 'HEATCAPACITY',
                              unitdict = 'FRACTION',
                              label = _U("OffgasHeatCapacity"),
                              tip = _U("OffgasHeatCapacity"))

        self.tc10 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'DENSITY',
                               unitdict = 'FRACTION',
                               label = _U("OffgasDensity"),
                               tip = _U("OffgasDensity"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT + UNITS_WIDTH, wUnits = 0)

        self.tc11 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("Humidity"),
                               tip = _U("Humidity"))

        self.tc12 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("CombAir"),
                               tip = _U("CombAir"))

        self.tc13 = FloatEntry(self.page3,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               label = _U("Offgas"),
                               tip = _U("Offgas"))

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        #
        # tab 4 - Environment parameters
        #
        self.frame_environment_parameters = wx.StaticBox(self.page4, -1, _U("Environment parameters"))
        self.frame_environment_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_environment_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_environment_parameters.SetFont(fp.getFont())
        fp.popFont()

        self.tc14 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'DENSITY',
                               unitdict = 'FRACTION',
                               label = _U("PEConvFuel"),
                               tip = _U("Primary energy conversion ratio"))

        self.tc15 = FloatEntry(self.page4,
                               ipart = 6, decimals = 1, minval = 0., maxval = 1.e+12, value = 0.,
                               #unitdict = 'CO2RATIO',
                               unitdict = 'FRACTION',
                               label = _U("CO2ConvFuel"),
                               tip = _U("Ratio of CO2 generation"))
    def _init_ctrls(self, parent):
#------------------------------------------------------------------------------
#--- UI setup
#------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBAuditor", self.name)

        # Auditor_ID needs to remain as first entry
        self.colLabels = "Auditor_ID", "Name", "City", "Country", "Company", "CompanyType"

        self.db = Status.DB.auditor
        self.table = "auditor"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[2]
        self.subtype = self.colLabels[4]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight = HEIGHT, wLabel = LABEL_WIDTH_LEFT,
                        wData = DATA_ENTRY_WIDTH_LEFT, wUnits = UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style = 0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U('Summary table'))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U('General Data'))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name = 'summarytable', parent = self.page0,
                                 pos = wx.Point(42, 32), style = 0)

        self.tc_type = ChoiceEntry(self.page0,
                                   values = [],
                                   label = _U("Type"),
                                   tip = _U("Show only equipment of type"))

        self.tc_subtype = ChoiceEntry(self.page0,
                                      values = [],
                                      label = _U("Subtype"),
                                      tip = _U("Show only equipment of subtype"))

        #
        # tab 1 - General Data
        #
        self.frame_general_data = wx.StaticBox(self.page1, -1, _U("General data"))
        self.frame_general_data.SetForegroundColour(TITLE_COLOR)
        self.frame_general_data.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_data.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Name"),
                             tip = _U("Name"))

        self.tc2 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("City"),
                             tip = _U("City"))

        self.tc3 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Country"),
                             tip = _U("Country"))

        self.tc4 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Company"),
                             tip = _U("Company"))

        self.tc5 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("CompanyType"),
                             tip = _U("CompanyType"))

        self.tc6 = TextEntry(self.page1, maxchars = 100, value = '',
                             label = _U("Adress"),
                             tip = _U("Adress"))

        self.tc7 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Phone"),
                             tip = _U("Phone"))

        self.tc8 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Fax"),
                             tip = _U("Fax"))

        self.tc9 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("EMail"),
                             tip = _U("EMail"))

        self.tc10 = TextEntry(self.page1, maxchars = 45, value = '',
                             label = _U("Web"),
                             tip = _U("Web"))
示例#13
0
    def _init_ctrls(self, parent):
        # ------------------------------------------------------------------------------
        # --- UI setup
        # ------------------------------------------------------------------------------

        PanelDBBase.__init__(self, self.parent, "Edit DBFuel", self.name)
        self.labelButtonAdd = _U("Add fuel")
        self.labelButtonDelete = _U("Delete fuel")

        # DBFuel_ID needs to remain as first entry although it is not shown on the GUI
        self.colLabels = "DBFuel_ID", "FuelName", "FuelType", "DBFuelUnit", "FuelLCV", "FuelHCV"

        self.db = Status.DB.dbfuel
        self.table = "dbfuel"
        self.identifier = self.colLabels[0]
        self.type = self.colLabels[2]

        # access to font properties object
        fp = FontProperties()

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)

        self.notebook = wx.Notebook(self, -1, style=0)
        self.notebook.SetFont(fp.getFont())

        self.page0 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page0, _U("Summary table"))
        self.page1 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page1, _U("General information on fuel"))
        self.page2 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page2, _U("Main physical properties"))
        self.page3 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page3, _U("Properties for offgas calculations"))
        self.page4 = wx.Panel(self.notebook)
        self.notebook.AddPage(self.page4, _U("Environment parameters"))

        #
        # tab 0 - Summary table
        #
        self.frame_summary_table = wx.StaticBox(self.page0, -1, _U("Summary table"))
        self.frame_summary_table.SetForegroundColour(TITLE_COLOR)
        self.frame_summary_table.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_summary_table.SetFont(fp.getFont())
        fp.popFont()

        self.grid = wx.grid.Grid(name="summarytable", parent=self.page0, pos=wx.Point(42, 32), style=0)

        self.tc_type = ChoiceEntry(self.page0, values=[], label=_U("Type"), tip=_U("Show only equipment of type"))

        self.tc_help = wx.StaticBox(self.page0, -1, _U("Help"))
        self.tc_help_text = wx.StaticText(self.page0, -1, _U("Click on the column labels to sort the table."))
        self.tc_help_text.SetFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False, "Tahoma"))

        #
        # tab 1 - General information on fuel
        #
        self.frame_general_information = wx.StaticBox(self.page1, -1, _U("General information on fuel"))
        self.frame_general_information.SetForegroundColour(TITLE_COLOR)
        self.frame_general_information.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_general_information.SetFont(fp.getFont())
        fp.popFont()

        self.tc1 = TextEntry(
            self.page1, maxchars=45, value="", label=_U("Name of the fuel"), tip=_U("Name of the fuel")
        )

        self.tc2 = ChoiceEntry(self.page1, values=[], label=_U("Fuel type"), tip=_U("Fuel type"))

        self.tc3 = ChoiceEntry(
            self.page1, values=[], label=_U("Default measurement unit"), tip=_U("Default measurement unit")
        )

        fs = FieldSizes(
            wHeight=HEIGHT_TE_MULTILINE, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH
        )

        self.tc4 = TextEntry(
            self.page1, maxchars=200, value="", isMultiline=True, label=_U("Source of data"), tip=_U("Source of data")
        )

        self.tc5 = TextEntry(
            self.page1,
            maxchars=200,
            value="",
            isMultiline=True,
            label=_U("Additional comments"),
            tip=_U("Additional comments"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)

        #
        # tab 2 - Main physical properties
        #
        self.frame_main_properties = wx.StaticBox(self.page2, -1, _U("Main physical properties"))
        self.frame_main_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_main_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_main_properties.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH_LARGE)

        self.tc6 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="SPECIFICENTHALPY",
            label=_U("Lower calorific value"),
            tip=_U("Lower calorific value"),
        )

        self.tc7 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="SPECIFICENTHALPY",
            label=_U("Higher calorific value"),
            tip=_U("Higher calorific value"),
        )

        self.tc8 = FloatEntry(
            self.page2,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="DENSITY",
            label=_U("Density"),
            tip=_U("Density"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)

        #
        # tab 3 - Properties for offgas calculations
        #
        self.frame_offgas_properties = wx.StaticBox(self.page3, -1, _U("Properties for offgas calculations"))
        self.frame_offgas_properties.SetForegroundColour(TITLE_COLOR)
        self.frame_offgas_properties.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_offgas_properties.SetFont(fp.getFont())
        fp.popFont()

        self.tc9 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="SPECIFICHEAT",
            label=_U("OffgasHeatCapacity"),
            tip=_U("OffgasHeatCapacity"),
        )

        self.tc10 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="DENSITY",
            label=_U("OffgasDensity"),
            tip=_U("OffgasDensity"),
        )

        self.tc11 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="FRACTION",
            label=_U("Humidity"),
            tip=_U("Humidity"),
        )

        self.tc12 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="FRACTION",
            label=_U("CombAir"),
            tip=_U("CombAir"),
        )

        self.tc13 = FloatEntry(
            self.page3,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="FRACTION",
            label=_U("Offgas"),
            tip=_U("Offgas"),
        )

        #
        # tab 4 - Environment parameters
        #
        self.frame_environment_parameters = wx.StaticBox(self.page4, -1, _U("Environment parameters"))
        self.frame_environment_parameters.SetForegroundColour(TITLE_COLOR)
        self.frame_environment_parameters.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD))
        fp.pushFont()
        self.frame_environment_parameters.SetFont(fp.getFont())
        fp.popFont()

        fs = FieldSizes(
            wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT + 20, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH_LARGE
        )

        self.tc14 = FloatEntry(
            self.page4,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="DENSITY",
            label=_U("Primary energy conversion ratio"),
            tip=_U("Primary energy conversion ratio"),
        )

        self.tc15 = FloatEntry(
            self.page4,
            ipart=6,
            decimals=1,
            minval=-INFINITE,
            maxval=INFINITE,
            value=0.0,
            unitdict="CO2RATIO",
            label=_U("Ratio of CO2 generation"),
            tip=_U("Ratio of CO2 generation"),
        )

        fs = FieldSizes(wHeight=HEIGHT, wLabel=LABEL_WIDTH_LEFT, wData=DATA_ENTRY_WIDTH_LEFT, wUnits=UNITS_WIDTH)