Esempio n. 1
0
    def _prepare_input_parameter(value, type):
        if type == ResolverTypes.Static() or ResolverTypes.Remote() in type:
            return value
        else:
            if PARAM_PREFIX in value:
                return value

            value_parts = value.split('.')
            return f'{PARAM_PREFIX}{value_parts[0]}.op.{value_parts[1]}'
Esempio n. 2
0
    def _set_validity_flag(self, type):
        convertable = True
        try:
            float(self.value.get_value())
        except Exception:
            convertable = False

        self.value.set_validity(ParameterState.Valid())
        if type == ResolverTypes.Static() and not convertable:
            self.value.set_value(self.default.get_value())
        if type == ResolverTypes.Local() and convertable:
            self.value.set_validity(ParameterState.Invalid())
        if ResolverTypes.Remote() in type:
            self.value.set_validity(ParameterState.Valid())
Esempio n. 3
0
 def _get_validator_type(self) -> str:
     if ResolverTypes.Remote() in self.type.get_value():
         return ValidatorTypes.NoValidation
     else:
         return ValidatorTypes.FloatValidation