Exemplo n.º 1
0
    def create_block(self, diagram_control=None):
        if diagram_control is None:
            diagram_control = self.create_diagram_control()

        block_model = BlockModel()
        block_model.maxIO = 2

        block = Block(diagram_control.diagram, block_model)
        block.language = "language"
        block.properties = [{"name": "test", "label": "Test", "type": "Test"}]

        block.ports = [{
            "type": "Test",
            "label": "Input",
            "conn_type": "Input",
            "name": "input"
        }, {
            "type": "Test",
            "label": "Output",
            "conn_type": "Outpu",
            "name": "output"
        }]

        BlockControl.load_ports(block, System.get_ports())

        DiagramControl.add_block(diagram_control.diagram, block)
        return block
Exemplo n.º 2
0
    def create_block(self, diagram_control=None):
        if diagram_control is None:
            diagram_control = self.create_diagram_control()

        block_model = BlockModel()
        block_model.maxIO = 2

        block = Block(diagram_control.diagram, block_model)
        block.language = "language"
        DiagramControl.add_block(diagram_control.diagram, block)
        return block