package fabrik.simulator.pic16f84;

import fabrik.simulator.pic16f84.interfaces.*;

public abstract class PICComponent {
    DataRegisterInterface dataRegister;
    EEPROMInterface eeprom;
    PreScaler preScaler;
    IOPortInterface ioPorts;
    TimerInterface timer;
    InterruptInterface interrupts;
    //TableInterface table;
    //WindowManagement createWindow;
    FrontendControllerInterface frontendController;
    WatchdogTimerInterface watchdogTimer;
    ProgramStackInterface programStack;
    CommandInterface commands;
    ToggleButtonInterface toggleButtonExt;

    void initialize(PICComponents picComponents) {
        toggleButtonExt = (ToggleButtonInterface) picComponents.getComponent(ToggleButtonInterface.class);
        dataRegister = (DataRegisterInterface) picComponents.getComponent(DataRegisterInterface.class);
        eeprom = (EEPROMInterface) picComponents.getComponent(EEPROMInterface.class);
        ioPorts = (IOPortInterface) picComponents.getComponent(IOPortInterface.class);
        preScaler = (PreScaler) picComponents.getComponent(PreScalerInterface.class);
        timer = (TimerInterface) picComponents.getComponent(TimerInterface.class);
        interrupts = (InterruptInterface) picComponents.getComponent(InterruptInterface.class);
        //table = (TableInterface) picComponents.getComponent(TableInterface.class);
        //createWindow = (WindowManagement) picComponents.getComponent(WindowManagement.class);
        frontendController = (FrontendControllerInterface) picComponents.getComponent(FrontendControllerInterface.class);
        watchdogTimer = (WatchdogTimerInterface) picComponents.getComponent(WatchdogTimerInterface.class);
        programStack = (ProgramStackInterface) picComponents.getComponent(ProgramStackInterface.class);
        commands = (CommandInterface) picComponents.getComponent(CommandInterface.class);
    }
}
