SinGen.py 870 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/python3
  2. # This file was automatically generated from drawio2cbd with the command:
  3. # /home/red/git/DrawioConvert/__main__.py SinGen.xml -fav -F CBD -e SinGen -E delta=0.1
  4. from CBD.Core import *
  5. from CBD.lib.std import *
  6. DELTA_T = 0.1
  7. class SinGen(CBD):
  8. def __init__(self, name="SinGen"):
  9. CBD.__init__(self, name, input_ports=[], output_ports=["OUT1"])
  10. # Add the 't' parameter
  11. # Let's call it 'time'
  12. self.addBlock(TimeBlock("time"))
  13. # Add the block that computes the actual sine function
  14. # Let's call it 'sin'
  15. self.addBlock(GenericBlock("sin", block_operator="sin"))
  16. # Connect them together
  17. self.addConnection("time", "sin", input_port_name='IN1', output_port_name='OUT1')
  18. # Connect the output port
  19. self.addConnection("sin", "OUT1", output_port_name='OUT1')