def Init(self, year): '''Initializes the HRDesc Panel.''' self.year = year # Set the per person expenses to the correct level self.posSalaryList = Z_mrktInfo.getHRCosts(self.year) for pnl, salary in zip(self.hrSlotPanels, self.posSalaryList): pnl.totPP = salary pnl.totPP_st.SetLabel("$ "+format(salary, ',d')) self.ceo_pnl.SetCEO() # If year != 1, make sure they have at least 1 packager if year != 1 and self.packager_pnl.quantity_sc.GetValue() == 0: self.packager_pnl.quantity_sc.SetRange(1, 3) self.packager_pnl.quantity_sc.SetValue(1)
def __init__(self, parent, *args, **kwargs): super(HRDesc_Pnl, self).__init__(parent, *args, **kwargs) # Style ----------------------------------------------------------- self.style = X_styles.NovusStyle(None) # Data ------------------------------------------------------------ self.data = Q_data.Data(None) # Attributes ------------------------------------------------------ self.year = 0 self.ForecastedRev = 0 self.cyclesRun = 0 self.staffLevel = 0 # Labels ---------------------------------------------------------- lang = self.data.GetData1()[1][1] self.title_lbl = GetPhrase('hr_lbl', lang) self.position_lbl = GetPhrase('position_lbl', lang) self.quantity_lbl = GetPhrase('quantity_lbl', lang) self.totAnnualCostPP_lbl = GetPhrase('totAnnualCostPP_lbl', lang) self.totAnnualCost_lbl = GetPhrase('totAnnualCost_lbl', lang) self.totHrCost_lbl = GetPhrase('totHrCost_lbl', lang) self.ceo_lbl = GetPhrase('ceo_lbl', lang) self.cfo_lbl = GetPhrase('cfo_lbl', lang) self.manager_lbl = GetPhrase('manager_lbl', lang) self.asstManager_lbl = GetPhrase('asstManager_lbl', lang) self.headMarketing_lbl = GetPhrase('headMarketing_lbl', lang) self.salesRep_lbl = GetPhrase('salesRep_lbl', lang) self.custService_lbl = GetPhrase('custService_lbl', lang) self.qualityCtrl_lbl = GetPhrase('qualityCtrl_lbl', lang) self.brewer_lbl = GetPhrase('brewer_lbl', lang) self.packager_lbl = GetPhrase('packager_lbl', lang) self.driver_lbl = GetPhrase('driver_lbl', lang) self.cleaner_lbl = GetPhrase('cleaner_lbl', lang) # Sizer ----------------------------------------------------------- sizer = wx.BoxSizer(wx.VERTICAL) self.title_st = wx.StaticText(self, -1, self.title_lbl) self.title_st.SetFont(self.style.h2_font) sizer.Add(self.title_st, 0, wx.LEFT|wx.TOP, 10) sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) # Column Headers a_box = wx.BoxSizer() self.pos_st = wx.StaticText(self, -1, self.position_lbl) self.quantity_st = wx.StaticText(self, -1, self.quantity_lbl, size=(80, -1)) self.totAnnualCostPP_st = wx.StaticText(self, -1, self.totAnnualCostPP_lbl) self.totAnnualCost_st = wx.StaticText(self, -1, self.totAnnualCost_lbl) for x in [i for i in self.GetChildren() if i.GetClassName()=='wxStaticText'][1:]: x.SetFont(self.style.h5_iu_font) a_box.Add(self.pos_st, 1, wx.LEFT, 10) a_box.Add(self.quantity_st, 0, wx.LEFT|wx.RIGHT, 10) a_box.Add(self.totAnnualCostPP_st, 1, wx.LEFT, 10) a_box.Add(self.totAnnualCost_st, 1, wx.LEFT, 10) sizer.Add(a_box, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 10) sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) # Add HR slot panels -- self.ceo_pnl = HRSlot_Pnl(self, -1) self.cfo_pnl = HRSlot_Pnl(self, -1) self.manager_pnl = HRSlot_Pnl(self, -1) self.asstManager_pnl = HRSlot_Pnl(self, -1) self.headMarketing_pnl = HRSlot_Pnl(self, -1) self.salesRep_pnl = HRSlot_Pnl(self, -1) self.custService_pnl = HRSlot_Pnl(self, -1) self.qualityCtrl_pnl = HRSlot_Pnl(self, -1) self.brewer_pnl = HRSlot_Pnl(self, -1) self.packager_pnl = HRSlot_Pnl(self, -1) self.driver_pnl = HRSlot_Pnl(self, -1) self.cleaner_pnl = HRSlot_Pnl(self, -1) self.hrSlotPanels = [p for p in self.GetChildren() if p.GetClassName()=='wxPanel'] # Pos / Salary List -- self.posLblList = [self.ceo_lbl, self.cfo_lbl, self.manager_lbl, self.asstManager_lbl, self.headMarketing_lbl, self.salesRep_lbl, self.custService_lbl, self.qualityCtrl_lbl, self.brewer_lbl, self.packager_lbl, self.driver_lbl, self.cleaner_lbl] self.posSalaryList = Z_mrktInfo.getHRCosts(self.year) # Add HR Slot Panels to sizer and initialize for pnl, pos, sal in zip(self.hrSlotPanels, self.posLblList, self.posSalaryList): sizer.Add(pnl, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 10) sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) pnl.Init(pos, sal) # Set Hiring Spin Controls to appropriate limits self.cfo_pnl.quantity_sc.SetRange(0, 1) self.headMarketing_pnl.quantity_sc.SetRange(0, 1) self.custService_pnl.quantity_sc.SetRange(0, 1) self.qualityCtrl_pnl.quantity_sc.SetRange(0, 1) self.packager_pnl.quantity_sc.SetRange(0, 3) #--# self.SetSizer(sizer) self.ceo_pnl.SetCEO()