コード例 #1
0
void CCmdHandler::SetMTCTagValue(std::string tag, std::string value)
{
	Agent * agent = _agentconfig->getAgent();
	Device *dev = agent->getDeviceByName(_device);
	DataItem *di = dev->getDeviceDataItem(tag);
	if (di != NULL)
	{
		std::string time = getCurrentTime(GMT_UV_SEC);
		agent->addToBuffer(di, value, time);
	}
	//else
	//	sLogger << LINFO  <<  "(" << device << ") Could not find data item: " << tag << "\n";
}
コード例 #2
0
void COpcAdapter::SetMTCTagValue(std::string tag, std::string value)
{
#if 1
	Agent * agent = _agentconfig->getAgent();
	Device *pDev = agent->getDeviceByName(_device);
	DataItem *di = pDev->getDeviceDataItem(tag);
	if (di != NULL)
	{
		std::string time = getCurrentTime(GMT_UV_SEC);
		agent->addToBuffer(di, value, time);
	}
	else
	{
		LOGONCE GLogger.LogMessage(StdStringFormat("(%s) Could not find data item: %s  \n",  _device.c_str(), tag.c_str()));
	}

#endif
}