public BoilerController(IBoilerApi hardwareApi) { _heater = new Heater(hardwareApi); _steamValve = new SteamValve(hardwareApi); _pressureSensor = new PressureSensor(hardwareApi); _temperatureSensor = new TemperatureSensor(hardwareApi); _pressureSensor.PressureChanged += NormalizePressure; _temperatureSensor.TemperatureIsChanged += NormalizeTemperature; Init(); }
public MainController(ICoffeeMakerApi cofeeMakerApi, IBoilerApi boilerApi) { var boiler = new BoilerController(boilerApi); var makeCoffeeButton = new MakeCoffeeButton(cofeeMakerApi); var waterSensor = new WaterSensor(cofeeMakerApi); _pump = new Pump(cofeeMakerApi); _cupSizeSelector = new CupSizeSelector(cofeeMakerApi); _volumetricSensor = new VolumetricSensor(cofeeMakerApi); _readyLamp = new ReadyLamp(cofeeMakerApi); _boilerIsReady = boiler.BoilerIsReady; _waterTankIsFull = waterSensor.IsWaterTankFull(); _volumetricSensor.Done += StopPourCoffee; makeCoffeeButton.ButtonPressed += StartPourCoffee; waterSensor.WaterTaankStatusChanged += OnWaterSensorWaterTaankStatusChanged; boiler.BoilerStatusChanged += OnBoilerStatusChanged; CheckReadyLamp(); }