
#from Core.mafi import fix
#from Core.plc import PLC
#
##   | Description:                     | Used capacity:   | Width limits:
##   |                                  |                  | 4    | 8    | 12   | 16
## E | connectable entities (read only) | 4 per connection | 0-1  | 0-2  | 0-3  | 0-4
## I | connectable inputs (read only)   | 1 per connection | 0-4  | 0-8  | 0-12 | 0-16
## O | connectable outputs (set only)   | 1 per connection | 0-4  | 0-8  | 0-12 | 0-16
## L | displayed LEDs (set only)        | 1 per connection | 0-3  | 0-7  | 0-11 | 0-15
## V | variables                        | 2 per connection | 0-2  | 0-4  | 0-6  | 0-8
##   | total available computing power  | 1 per 4 slots    | 1=16 | 2=32 | 2=48 | 3=64
#
## 1 computing can hold up to 16 values
## for example PLC bellow
##      1 entity * 4, 4 inputs * 1, 0 outputs * 1, 3 LEDs * 1, 2 variables * 2
##           4      +      4      +       0      +      3    ,        4          = 15 < 16 => 1 computing
#
##         EIOLV
#class PLC_14032_Copy(PLC):
#    name = "PLC-14032 - Copy"
#    symbol = "PLC-14032"
#    width = 4
#    leds = 3
#    inputs = 4
#    outputs = 0
#    entities = 1
#    variables = 2
#    # computing = 1 # calculated automatically from configuration
#    # no idea what the PLC does, but use 1 computing power (engineer work)
#
#    def Action(self):
#        # example of code
#        self.LED[0] = bool(self.Input[0]) or bool(self.Input[1])
#        self.LED[1] = bool(self.Input[2]) or bool(self.Input[3])
#        self.LED[2] = self.Entity[0].IsPaused or bool(self.Var[0] + self.Var[1])
#        self.Var[0] = bool(self.Input[0]) or bool(self.Input[1])
#        self.Var[1] = bool(self.Input[2]) or bool(self.Input[3])