Beispiel #1
0
        def updateMessages(self):
            """Modify the messages created by internal validation for each tool parameter.
            This method is called after internal validation."""

            import LUCI_PTFs.lib.input_validation as input_validation
            refresh_modules(input_validation)

            # Populate converstion factor automatically when either OM or OC is chosen has been chosen
            CarbParamNo = None
            ConvFactorParamNo = None
            for i in range(0, len(self.params)):
                if self.params[i].name == 'Carbon_content':
                    CarbParamNo = i
                if self.params[i].name == 'Conversion_factor':
                    ConvFactorParamNo = i

            CarbPairs = [('Organic carbon', 1.724),
                         ('Organic matter', 0.58)]

            if CarbParamNo is not None and ConvFactorParamNo is not None:
                # If this is the most recently changed param ...
                if not self.params[CarbParamNo].hasBeenValidated:

                    # Update the linking code with the correct value
                    for CarbPair in CarbPairs:
                        if self.params[CarbParamNo].valueAsText == CarbPair[0]:
                            self.params[ConvFactorParamNo].value = CarbPair[1]
            
            input_validation.checkFilePaths(self)
Beispiel #2
0
        def updateMessages(self):
            """Modify the messages created by internal validation for each tool parameter.
            This method is called after internal validation."""

            import LUCI_PTFs.lib.input_validation as input_validation
            refresh_modules(input_validation)

            input_validation.checkFilePaths(self)
            input_validation.checkThresholdValues(self, "SoilMoisture")
Beispiel #3
0
        def updateMessages(self):
            """Modify the messages created by internal validation for each tool parameter.
            This method is called after internal validation."""

            import LUCI_PTFs.lib.input_validation as input_validation
            refresh_modules(input_validation)

            # Populate converstion factor automatically when either OM or OC is chosen has been chosen
            CarbParamNo = None
            ConvFactorParamNo = None
            for i in range(0, len(self.params)):
                if self.params[i].name == 'Carbon_content':
                    CarbParamNo = i
                if self.params[i].name == 'Conversion_factor':
                    ConvFactorParamNo = i

            CarbPairs = [('Organic carbon', 1.724), ('Organic matter', 0.58)]

            if CarbParamNo is not None and ConvFactorParamNo is not None:
                # If this is the most recently changed param ...
                if not self.params[CarbParamNo].hasBeenValidated:

                    # Update the linking code with the correct value
                    for CarbPair in CarbPairs:
                        if self.params[CarbParamNo].valueAsText == CarbPair[0]:
                            self.params[ConvFactorParamNo].value = CarbPair[1]

            # Populate pressures
            vgChoiceNo = None
            vgPressuresNo = None
            for i in range(0, len(self.params)):
                if self.params[i].name == 'VG_of_choice':
                    vgChoiceNo = i
                if self.params[i].name == 'Pressure_heads_VG':
                    vgPressuresNo = i

            vgPairs = [('Wosten et al. (1999) topsoil',
                        '10 30 100 330 1000 2000 10000 15000'),
                       ('Wosten et al. (1999) subsoil',
                        '10 30 100 330 1000 2000 10000 15000'),
                       ('Vereecken et al. (1989)',
                        '10 30 100 330 1000 2000 10000 15000'),
                       ('Zacharias and Wessolek (2007)',
                        '1 3 10 33 100 200 1000 1500')]

            if vgChoiceNo is not None and vgPressuresNo is not None:
                # If this is the most recently changed param ...
                if not self.params[vgChoiceNo].hasBeenValidated:

                    # Update the linking code with the correct value
                    for vgPair in vgPairs:
                        if self.params[vgChoiceNo].valueAsText == vgPair[0]:
                            self.params[vgPressuresNo].value = vgPair[1]

            input_validation.checkFilePaths(self)