Newer
Older
tac2grc / src / tacsrc / blockType.py
@lukas lukas on 14 Aug 2022 609 bytes initial commit
from tacsrc.ports import Ports

class BlockType:
    def __init__(self, name):
        self.name = name
        self.inputs =  Ports()
        self.outputs = Ports()

    def getIODescription(self, block):
        result = ""
        inputDescription = self.inputs.getIODescription(block)
        if len(inputDescription) != 0:
            result += "\\\\nINPUTS:"
            result += inputDescription
        outputDescription = self.outputs.getIODescription(block)
        if len(outputDescription) != 0:
            result += "\\\\nOUTPUTS:"
            result += outputDescription
        return result