/** * * @see \Brouwkuyp\Bundle\LogicBundle\Model\Equipment\EquipmentInterface::performTask() */ public function performTask(Phase $phase) { if ($phase->getType() == Phase::CONTROL_TEMP) { $this->setHeaterTemperature($phase->getValue()); } elseif ($phase->getType() == Phase::REACH_TEMP) { $this->startReceiving(); $this->amqpManager->wait(); $this->amqpManager->receive(); if ($this->getCurrentTemperature() > $phase->getValue()) { $this->eventDispatcher->dispatch(BrewEvents::PHASE_TEMPERATURE_REACHED, new PhaseTemperatureReachedEvent($phase)); $phase->setFinished(); } } }
/** * @param Phase $phase * @return string */ public function renderPhaseValue(Phase $phase) { switch ($phase->getType()) { case Phase::REACH_TEMP: case Phase::CONTROL_TEMP: return $phase->getValue() . ' °C'; case Phase::ADD_INGREDIENTS: // @todo is this always in grams? return number_format($phase->getValue(), 0, ',', '.') . ' gram'; default: return $phase->getValue(); } }