Example #1
0
 def compute(self):
     '''
     Computes the totals  
     '''
     input_table = DataTable(InputTable, scenario = self.scenario)
     population_courant = SystemSf(ModelFrance, self.param_courant, self.param_default)
     population_courant.set_inputs(input_table)
     self.data_courant = gen_output_data(population_courant)
Example #2
0
 def compute(self):
     '''
     Computes the totals  
     '''
     input_table = DataTable(InputTable, scenario=self.scenario)
     population_courant = SystemSf(ModelFrance, self.param_courant,
                                   self.param_default)
     population_courant.set_inputs(input_table)
     self.data_courant = gen_output_data(population_courant)
Example #3
0
    def compute_aggregate(self):
        P_default = self._parametres.getParam(defaut = True)    
        P_courant = self._parametres.getParam(defaut = False)
        
        input_table = self.survey

        population = SystemSf(ModelFrance, P_courant, P_default)
        population.set_inputs(input_table)
        
        population.calculate()
        
        return population
Example #4
0
    def compute(self):
        '''
        Computes the totals  
        '''
        input_table = DataTable(InputTable, scenario=self.scenario)
        population_courant = SystemSf(ModelSF, self.param_courant,
                                      self.param_default)
        population_courant.set_inputs(input_table)

        from web.settings import SRC_PATH
        fname = os.path.join(SRC_PATH, 'france', 'totaux.xml')

        self.data_courant = gen_output_data(population_courant, fname)
Example #5
0
    def compute_aggregate(self):
        P_default = self._parametres.getParam(defaut=True)
        P_courant = self._parametres.getParam(defaut=False)

        input_table = self.survey

        output_table = SystemSf(ModelFrance, P_courant, P_default)
        output_table.set_inputs(input_table)

        output_table.calculate()

        return output_table
Example #6
0
    def refresh_bareme(self):
        # Consistency check on scenario
        msg = self.scenario.check_consistency()
        if msg:
            QMessageBox.critical(self, u"Ménage non valide", msg,
                                 QMessageBox.Ok, QMessageBox.NoButton)
            return False
        # Si oui, on lance le calcul
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        self.statusbar.showMessage(u"Calcul en cours...")
        self.action_refresh_bareme.setEnabled(False)
        # set the table model to None before changing data
        self._table.clearModel()

        P_default = self._parametres.getParam(defaut=True)
        P_courant = self._parametres.getParam(defaut=False)

        input_table = DataTable(InputTable, scenario=self.scenario)

        population_courant = SystemSf(ModelFrance, P_courant, P_default)
        population_courant.set_inputs(input_table)
        data_courant = gen_output_data(population_courant)

        if self.reforme:
            population_default = SystemSf(ModelFrance, P_default, P_default)
            population_default.set_inputs(input_table)
            data_default = gen_output_data(population_default)
            data_courant.difference(data_default)
        else:
            data_default = data_courant
        self._table.updateTable(data_courant,
                                reforme=self.reforme,
                                mode=self.mode,
                                dataDefault=data_default)
        self._graph.updateGraph(data_courant,
                                reforme=self.reforme,
                                mode=self.mode,
                                dataDefault=data_default)

        self.statusbar.showMessage(u"")
        QApplication.restoreOverrideCursor()
Example #7
0
    def refresh_bareme(self):
        # Consistency check on scenario
        msg = self.scenario.check_consistency()
        if msg:
            QMessageBox.critical(self, u"Ménage non valide",
                                 msg, 
                                 QMessageBox.Ok, QMessageBox.NoButton)
            return False
        # Si oui, on lance le calcul
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        self.statusbar.showMessage(u"Calcul en cours...")
        self.action_refresh_bareme.setEnabled(False)
        # set the table model to None before changing data
        self._table.clearModel()
        
        P_default = self._parametres.getParam(defaut = True)    
        P_courant = self._parametres.getParam(defaut = False)
        
        input_table = DataTable(InputTable, scenario = self.scenario)

        population_courant = SystemSf(ModelFrance, P_courant, P_default)
        population_courant.set_inputs(input_table)
        data_courant = gen_output_data(population_courant)

        if self.reforme:
            population_default = SystemSf(ModelFrance, P_default, P_default)
            population_default.set_inputs(input_table)
            data_default = gen_output_data(population_default)
            data_courant.difference(data_default)
        else:
            data_default = data_courant
        self._table.updateTable(data_courant, reforme = self.reforme, mode = self.mode, dataDefault = data_default)
        self._graph.updateGraph(data_courant, reforme = self.reforme, mode = self.mode, dataDefault = data_default)

        self.statusbar.showMessage(u"")
        QApplication.restoreOverrideCursor()