Exemplo n.º 1
0
			void pushFromPacket(const hexabus::ValuePacket<T>& packet)
			{
				std::ostringstream oss;
				oss << std::fixed << std::setprecision(1) << float(packet.value());

				push_value(packet.eid(), oss.str());
			}
Exemplo n.º 2
0
	void printValuePacket(const hexabus::ValuePacket<T>& packet, const std::string& type)
	{
		addField(F_TYPE, type);
		addField(F_EID, packet.eid());
		addField(F_DATATYPE, hexabus::datatypeName((hexabus::hxb_datatype) packet.datatype()));

		typedef typename std::conditional<
			std::is_same<T, uint8_t>::value,
			unsigned,
			typename std::conditional<
				std::is_same<T, int8_t>::value,
				int,
				const T&>::type
			>::type Widened;
		addField(F_VALUE, Widened(packet.value()));
	}