Пример #1
0
    def defineBooleanOutputs(self, *outputVariableNames):
        """
        Define output variables (of type boolean).
        :param *outputVariableNames: names of output variables of type boolean
        """
        self._booleanOutputNames = list(outputVariableNames)
        self._booleanOutputSize = len(self._booleanOutputNames)
        self._booleanOutputs = fmippex.new_int_array(self._booleanOutputSize)

        # Initialize outputs (of type boolean).
        status = self._defineVariables(
            self._booleanOutputNames, self._booleanOutputSize,
            self._booleanOutputs, bool, self._debugBooleanOutputValues,
            self._backend.initializeBooleanOutputs
            if not self._backend is None else None)

        if not status is fmippex.fmi2OK:
            raise RuntimeError(
                '[FMIAdapter:defineBooleanOutputs] initializeBooleanOutputs not successful'
            )
Пример #2
0
    def defineIntegerInputs(self, *inputVariableNames):
        """
        Define input variables (of type integer).
        :param *inputVariableNames: names of input variables of type integer
        """
        self._integerInputNames = list(inputVariableNames)
        self._integerInputSize = len(self._integerInputNames)
        self._integerInputs = fmippex.new_int_array(self._integerInputSize)

        # Initialize inputs (of type integer).
        status = self._defineVariables(
            self._integerInputNames, self._integerInputSize,
            self._integerInputs, int, self._debugIntegerInputValues,
            self._backend.initializeIntegerInputs
            if not self._backend is None else None)

        if not status is fmippex.fmi2OK:
            raise RuntimeError(
                '[FMIAdapter:defineIntegerInputs] initializeIntegerInputs not successful'
            )
Пример #3
0
    def defineIntegerParameters(self, *parameterNames):
        """
        Define parameters (of type integer).        
        :param *parameterNames: names of parameters of type integer
        """
        self._integerParameterNames = list(parameterNames)
        self._integerParameterSize = len(self._integerParameterNames)
        self._integerParameters = fmippex.new_int_array(
            self._integerParameterSize)

        # Initialize parameters of type integer.
        status = self._defineVariables(
            self._integerParameterNames, self._integerParameterSize,
            self._integerParameters, int, self._debugIntegerParameterValues,
            self._backend.initializeIntegerParameters
            if not self._backend is None else None)

        if not status is fmippex.fmi2OK:
            raise RuntimeError(
                '[FMIAdapter:defineIntegerParameters] initializeIntegerParameters not successful'
            )