
from Core.categories import Category
from Core.fields import Field, FieldValue
from Core.io import Input, InputValue, Output, OutputValue
from Core.module import Module, ModuleStatus
from Core.translate import LocStr, LocStr1, LocStrFormatted
from Core.entities import Entity
from Core.mafi import Fix32

class PLC(Module):
    name: str = "module display name"
    symbol: str = "short name"
    inputs: int = 0
    outputs: int = 0
    entities: int = 0
    variables: int = 0
    fields: int = 0
    categories: list[Category] = []
    controllers: list[str] = []
    width: int = 0
    computing: float = 0

    def __init__(self):
        self.Input = [Fix32]
        self.Output = [Fix32]
        self.Field = [Fix32]
        self.Var = [Fix32]
        self.LED = [False]
        self.Entity = [Entity()]
        # defines status of module
        self.Status = ModuleStatus.Init
        # defines an Tooltip/Error info
        self.Error = ""
        # set an display state to info
        self.Info = False
        # set an display state to warning
        self.Warning = False
    
    def Tr(key: str, default: str) -> LocStr | LocStr1 | LocStrFormatted:
      """Creates and translation string for modules"""
      pass

    def Init(self, prototype):
        pass

    def Action(self):
        pass