#include "stdafx.h" #include "CEqCurrentRecipeChangeStep.h" #include "Log.h" #include "ToolUnits.h" namespace SERVO { CEqCurrentRecipeChangeStep::CEqCurrentRecipeChangeStep() : CReadStep() { m_nDataDev = 0; } CEqCurrentRecipeChangeStep::~CEqCurrentRecipeChangeStep() { } void CEqCurrentRecipeChangeStep::setDataDev(int nDev) { m_nDataDev = nDev; } void CEqCurrentRecipeChangeStep::getAttributeVector(CAttributeVector& attrubutes) { CReadStep::getAttributeVector(attrubutes); attrubutes.addAttribute(new CAttribute("UnitNo", std::to_string(m_nUnitNo).c_str(), "")); attrubutes.addAttribute(new CAttribute("CurrentMasterRecipeId", std::to_string(m_nCurrentMasterRecipeId).c_str(), "")); attrubutes.addAttribute(new CAttribute("LocalRecipeId", std::to_string(m_nLocalRecipeId).c_str(), "")); } int CEqCurrentRecipeChangeStep::onReadData() { CReadStep::onReadData(); char szBuffer[64]; int nRet = m_pCclink->ReadData2(m_station, DeviceType::W, m_nDataDev, 6, szBuffer); if (0 != nRet) { return -1; } m_nUnitNo = (unsigned int)CToolUnits::toInt16(&szBuffer[0]); m_nCurrentMasterRecipeId = (unsigned int)CToolUnits::toInt16(&szBuffer[2]); m_nLocalRecipeId = (unsigned int)CToolUnits::toInt16(&szBuffer[4]); LOGI(" Current Recipe Changed\n", m_nUnitNo, m_nCurrentMasterRecipeId, m_nLocalRecipeId); return 0; } int CEqCurrentRecipeChangeStep::onComplete() { CReadStep::onComplete(); LOGI(" onComplete."); return 0; } int CEqCurrentRecipeChangeStep::onTimeout() { CReadStep::onTimeout(); LOGI(" onTimeout."); return 0; } int CEqCurrentRecipeChangeStep::getUnitNo() { return m_nUnitNo; } int CEqCurrentRecipeChangeStep::getCurrentMasterRecipeId() { return m_nCurrentMasterRecipeId; } int CEqCurrentRecipeChangeStep::getLocalRecipeId() { return m_nLocalRecipeId; } }