public function testSetGetOperation() { $operation = new Operation(); $operation->setName("psych op"); $this->phase->setOperation($operation); $this->assertEquals("psych op", $this->phase->getOperation()->getName()); }
/** * @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(); } }
/** * * @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(); } } }
/** * Performs the Task needed for the given phase * * @param Phase $phase */ public function performTaskFor(Phase $phase) { /** @var EquipmentInterface $equipment */ $equipment = $this->getEquipmentOf($phase->getOperation()->getUnitProcedure()->getUnit()); $equipment->performTask($phase); }