21 socket.
bind(
"tcp://*:6665");
28 socket.recv(&request);
29 const char* request_data = (
const char*)request.
data();
31 if (strncmp(request_data,
"[get_data_names]", 16) == 0)
37 std::map<QString, double>::iterator it;
40 string_reply.append(it->first + QString(
" "));
47 else if (strncmp(request_data,
"[get_data]", 10) == 0)
50 QString string_request = QString::fromUtf8(&request_data[10], request.
size() - 10);
51 QStringList names = string_request.split(
';');
56 for (
int i = 0; i < names.count(); i++)
58 std::map<QString, double>::iterator it =
_current_data.find(names.at(i));
66 double value = it->second;
67 string_reply.append(QString::number(value) + QString(
" "));
75 memcpy(reply.
data(),
"Error", 5);
87 memcpy(reply.
data(),
"Error", 5);
105 PlotDataMap::iterator it;
110 for (it = datamap->begin(); it != datamap->end(); it++)
112 const QString&
name = it->first;
113 PlotDataPtr plotdata = it->second;
enum MQTTPropertyCodes value
virtual void updateState(PlotDataMap *datamap, double current_time)
size_t send(const void *buf_, size_t len_, int flags_=0)
void * data() ZMQ_NOTHROW
virtual ~StatePublisherZMQ()
size_t size() const ZMQ_NOTHROW
std::map< QString, double > _current_data
void bind(std::string const &addr)
PlotDataMap * _prev_dataplot