Beispiel #1
0
 def getFilterForSelecteds(self):
   table = self.panel.tblIssues
   n = table.getSelectedRow()
   if n<0:
     return None
   n = table.convertRowIndexToModel(n)
   ID_ACCIDENTE = table.getModel().getAccidenteId(n)
   exp = ExpressionUtils.createExpression("ID_ACCIDENTE = '%s'" % ID_ACCIDENTE)
   return exp
Beispiel #2
0
 def execute(self, rule, line, parameters):
     try:
         if self.correcExpression == None:
             formula = rule.getParameters().getDynValue(
                 "CorrectiveExpression")
             if formula == None or formula == "":
                 pass
             self.correcExpression = ExpressionUtils.createExpression(
                 formula)
             datamanager = DALLocator.getDataManager()
             self.fst = datamanager.createFeatureSymbolTable()
             self.fst.setFeature(line.getFeature1().getFeature())
             self.correcExpression.execute(self.fst)
     except:
         ex = sys.exc_info()[1]
         gvsig.logger(
             "Can't execute action. Class Name: " + ex.__class__.__name__ +
             ". Exception: " + str(ex), gvsig.LOGGER_ERROR)
Beispiel #3
0
 def check(self, taskStatus, report, feature1):
     try:
         if self.checkExpression == None:
             formula = self.getParameters().getDynValue("CheckExpression")
             self.checkExpression = ExpressionUtils.createExpression(
                 formula)
             datamanager = DALLocator.getDataManager()
             self.fst = datamanager.createFeatureSymbolTable()
         self.fst.setFeature(feature1)
         x = self.checkExpression.execute(self.fst)
         if not x:
             report.addLine(self, self.getDataSet1(), None,
                            feature1.getDefaultGeometry(),
                            feature1.getDefaultGeometry(),
                            feature1.getReference(), None, -1, -1, False,
                            "This feature does False the Check Expression",
                            "")
     except:
         ex = sys.exc_info()[1]
         gvsig.logger(
             "Can't execute rule. Class Name: " + ex.__class__.__name__ +
             ". Exception: " + str(ex), gvsig.LOGGER_ERROR)