| 1234567891011121314151617181920 |
- from CBD.src.CBD import BaseBlock
- class ComputerBlock(BaseBlock):
- def __init__(self, block_name):
- super().__init__(block_name, ["IN1"], ["OUT1"])
- def compute(self, curIteration):
- time = self.getInputSignal(curIteration, "IN1").value
- if time < 10:
- res = 0
- elif time < 160:
- res = 10
- elif time < 200:
- res = 4
- elif time < 260:
- res = 14
- else:
- res = 6
- self.appendToSignal(res)
|