#include "stdafx.h" #include "TubeLineMotionSwitchController.h" #include "ICommunicateEntity.h" using namespace DIOS::Dev::Detail::MachineryECOM; TubeLineMotionSwitchController::TubeLineMotionSwitchController() :m_communicate(nullptr) { } TubeLineMotionSwitchController::~TubeLineMotionSwitchController() { } std::string TubeLineMotionSwitchController::CLASSID() { return "662DC234-472B-46f7-AC99-64DAF40E6293"; } void TubeLineMotionSwitchController::Initialize(const std::string &name) { SetName(name); } void TubeLineMotionSwitchController::OnCommunicationEstablished(ICommunicateEntity *communicate) { m_communicate = communicate; } void TubeLineMotionSwitchController::OutputSignal(bool bEnable) { if (!m_communicate) { return; } GPIO_DO_PARAM oriparam; oriparam.active_level = bEnable ? 0x1 : 0x0; m_communicate->GPIO_DO_Ctrl(OP_WRITE, (GPIO_DO_ID)m_functionIds[ID_TUBE_LINE_MOTION_SWITCH_OUT], DO_ATTR_NONE, oriparam); }