How to use the fmpy.ssp.ssd.BaseElement function in FMPy

To help you get started, we’ve selected a few FMPy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
class ParameterSet(BaseElement, TopLevelMetaData):

    def __init__(self, **kwargs):
        super(ParameterSet, self).__init__(**kwargs)
        self.parameters = kwargs.get('parameters', [])
        self.enumerations = kwargs.get('enumerations', [])
        self.units = kwargs.get('units', [])
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')
        self.name = kwargs.get('name')

    def __repr__(self):
        return "ParameterSet (name: %s)" % self.name


class Parameter(BaseElement):

    def __init__(self, **kwargs):
        super(Parameter, self).__init__()
        self.name = kwargs.get('name')
        self.type = kwargs.get('type')
        self.value = kwargs.get('value')
        self.unit = kwargs.get('unit')

    def __repr__(self):
        return "Parameter (name: %s, type: %s, value: %s, unit: %s)" % (self.name, self.type, self.value, self.unit)


def validate_tree(root, schema_file):

    module_dir, _ = os.path.split(__file__)
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
def __init__(self, **kwargs):
        super(SignalDictionary, self).__init__(**kwargs)
        self.entries = kwargs.get('entries', [])
        self.enumerations = kwargs.get('enumerations', [])
        self.units = kwargs.get('units', [])
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')
        self.type = kwargs.get('type')
        self.source = kwargs.get('source')
        self.name = kwargs.get('name')

    def __repr__(self):
        return "SignalDictionary"


class DictionaryEntry(BaseElement):

    def __init__(self, **kwargs):
        super(DictionaryEntry, self).__init__(**kwargs)
        self.name = kwargs.get('name')
        self.type = kwargs.get('type')
        self.unit = kwargs.get('unit')

    def __repr__(self):
        return "DictionaryEntry (name: %s, type: %s, unit=%s)" % (self.name, self.type, self.unit)


class Unit(object):

    def __init__(self, **kwargs):
        super(Unit, self).__init__()
        self.name = kwargs.get('name')
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
def __repr__(self):
        return "IntegerMappingTransformation (entries: %s)" % (self.entries,)


class EnumerationMappingTransformation(object):

    def __init__(self):
        super(EnumerationMappingTransformation, self).__init__()
        self.entries = {}

    def __repr__(self):
        return "EnumerationMappingTransformation (entries: %s)" % (self.entries,)


# system structure description
class SystemStructureDescription(BaseElement, TopLevelMetaData):

    def __init__(self, **kwargs):
        super(SystemStructureDescription, self).__init__(**kwargs)
        self.system = kwargs.get('system')
        self.enumerations = kwargs.get('enumerations', [])
        self.units = kwargs.get('units', [])
        self.defaultExperiment = kwargs.get('defaultExperiment')
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')
        self.name = kwargs.get('name')

    def __repr__(self):
        return "SystemStructureDescription (name: %s)" % self.name


class Element(BaseElement):
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
self.minimumStepSize = kwargs.get('minimumStepSize')
        self.maximumStepSize = kwargs.get('maximumStepSize')
        self.initialStepSize = kwargs.get('initialStepSize')


# parameter mapping
class ParameterMapping(BaseElement, TopLevelMetaData):

    def __init__(self, **kwargs):
        super(ParameterMapping, self).__init__(**kwargs)
        self.mappingEntries = kwargs.get('mappingEntries', [])
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')


class MappingEntry(BaseElement):

    def __init__(self, **kwargs):
        super(MappingEntry, self).__init__(**kwargs)
        self.transformation = kwargs.get('transformation')
        self.source = kwargs.get('source')
        self.target = kwargs.get('target')
        self.suppressUnitConversion = kwargs.get('suppressUnitConversion')


class SignalDictionaryReference(object):

    def __init__(self, **kwargs):
        self.name = kwargs.get('name')
        self.dictionary = kwargs.get('dictionary')
        self.connectors = kwargs.get('connectors', [])
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
def __init__(self, **kwargs):
        super(System, self).__init__(**kwargs)
        self.elements = kwargs.get('elements', [])
        self.connections = kwargs.get('connections', [])
        self.signalDictionaries = kwargs.get('signalDictionaries', [])
        self.systemGeometry = kwargs.get('systemGeometry')
        self.graphicalElements = kwargs.get('graphicalElements', [])
        self.simulationInformation = kwargs.get('simulationInformation')
        self.annotations = kwargs.get('annotations', [])

    def __repr__(self):
        return "System (name: %s, description: %s)" % (self.name, self.description)


class Connector(BaseElement):

    def __init__(self, **kwargs):
        super(Connector, self).__init__(**kwargs)
        self.name = kwargs.get('name')
        self.kind = kwargs.get('kind')

    def __repr__(self):
        return "Connector (name: %s, kind: %s)" % (self.name, self.kind)


class Connection(BaseElement):

    def __init__(self, **kwargs):
        super(Connection, self).__init__(**kwargs)
        self.startElement = kwargs.get('startElement')
        self.startConnector = kwargs.get('startConnector')
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
self.suppressUnitConversion = kwargs.get('suppressUnitConversion')


class SignalDictionaryReference(object):

    def __init__(self, **kwargs):
        self.name = kwargs.get('name')
        self.dictionary = kwargs.get('dictionary')
        self.connectors = kwargs.get('connectors', [])

    def __repr__(self):
        return "SignalDictionaryReference (name: %s, dictionary: %s)" % (self.name, self.dictionary)


# signal dictionary
class SignalDictionary(BaseElement, TopLevelMetaData):

    def __init__(self, **kwargs):
        super(SignalDictionary, self).__init__(**kwargs)
        self.entries = kwargs.get('entries', [])
        self.enumerations = kwargs.get('enumerations', [])
        self.units = kwargs.get('units', [])
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')
        self.type = kwargs.get('type')
        self.source = kwargs.get('source')
        self.name = kwargs.get('name')

    def __repr__(self):
        return "SignalDictionary"
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
def __init__(self, **kwargs):
        super(BaseElement, self).__init__()
        self.id = kwargs.get('id', None)
        self.description = kwargs.get('description', None)
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
class Connection(BaseElement):

    def __init__(self, **kwargs):
        super(Connection, self).__init__(**kwargs)
        self.startElement = kwargs.get('startElement')
        self.startConnector = kwargs.get('startConnector')
        self.endElement = kwargs.get('endElement')
        self.endConnector = kwargs.get('endConnector')

    def __repr__(self):
        return "Connection (startElement: %s, startConnector: %s, endElement: %s, endConnector: %s)" % (self.startElement, self.startConnector, self.endElement, self.endConnector)


class ParameterBinding(BaseElement):

    def __init__(self, **kwargs):
        super(ParameterBinding, self).__init__(**kwargs)
        self.parameterValues = kwargs.get('parameterValues', [])
        self.parameterMapping = kwargs.get('parameterMapping', [])
        self.annotations = kwargs.get('annotations', [])
        self.type = kwargs.get('type')
        self.source = kwargs.get('source')
        self.sourceBase = kwargs.get('sourceBase')
        self.prefix = kwargs.get('prefix')

    def __repr__(self):
        return "ParameterBinding (prefix: %s, source: %s, type: %s)" % (self.prefix, self.source, self.type)


class DefaultExperiment(object):
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
self.description = kwargs.get('description')
        self.stepSize = kwargs.get('stepSize')


class VariableStepMaster(object):

    def __init__(self, **kwargs):
        super(VariableStepMaster, self).__init__()
        self.description = kwargs.get('description')
        self.minimumStepSize = kwargs.get('minimumStepSize')
        self.maximumStepSize = kwargs.get('maximumStepSize')
        self.initialStepSize = kwargs.get('initialStepSize')


# parameter mapping
class ParameterMapping(BaseElement, TopLevelMetaData):

    def __init__(self, **kwargs):
        super(ParameterMapping, self).__init__(**kwargs)
        self.mappingEntries = kwargs.get('mappingEntries', [])
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')


class MappingEntry(BaseElement):

    def __init__(self, **kwargs):
        super(MappingEntry, self).__init__(**kwargs)
        self.transformation = kwargs.get('transformation')
        self.source = kwargs.get('source')
        self.target = kwargs.get('target')
        self.suppressUnitConversion = kwargs.get('suppressUnitConversion')
github CATIA-Systems / FMPy / fmpy / ssp / ssd.py View on Github external
self.kg = int(kwargs.get('kg', 0))
        self.m = int(kwargs.get('m', 0))
        self.s = int(kwargs.get('s', 0))
        self.A = int(kwargs.get('A', 0))
        self.K = int(kwargs.get('K', 0))
        self.mol = int(kwargs.get('mol', 0))
        self.cd = int(kwargs.get('cd', 0))
        self.rad = int(kwargs.get('rad', 0))
        self.factor = float(kwargs.get('factor', 1.0))
        self.offset = float(kwargs.get('offset', 0.0))

    def __repr__(self):
        return "Unit (name: %s, kg: %d, m: %d, s: %d, A: %d, K: %d, mol: %d, cd: %d, rad: %d, factor: %g, offset: %g)" % (self.name, self.kg, self.m, self.s, self.A, self.K, self.mol, self.cd, self.rad, self.factor, self.offset)


class ParameterSet(BaseElement, TopLevelMetaData):

    def __init__(self, **kwargs):
        super(ParameterSet, self).__init__(**kwargs)
        self.parameters = kwargs.get('parameters', [])
        self.enumerations = kwargs.get('enumerations', [])
        self.units = kwargs.get('units', [])
        self.annotations = kwargs.get('annotations', [])
        self.version = kwargs.get('version')
        self.name = kwargs.get('name')

    def __repr__(self):
        return "ParameterSet (name: %s)" % self.name


class Parameter(BaseElement):