[WIP] Add zmq xpub feature to camerad and add write_to_zmq function#54
[WIP] Add zmq xpub feature to camerad and add write_to_zmq function#54mikelangmayr wants to merge 2 commits intomainfrom
Conversation
astronomerdave
left a comment
There was a problem hiding this comment.
What I see is that hexpose converts pixel data to a string and then publishes that string to a zmq socket if the zmq server is running; right? So the method of controlling whether or not hexpose data is published is to completely stop/start the server? (Seems fine, just asking.)
But, it might be relatively expensive to convert from int to string, concatenate commas, and publish the string. Since speed is an issue, what about publishing the binary data directly? Instead of building up a string, copying that string to a zmq_message, sending the message, convert the pixel data to a zmq message?
| * @param state_in, string "TRUE, FALSE, 0, or 1" | ||
| * @return ERROR or NO_ERROR | ||
| * | ||
| * NOTE: this assumes LVDS is module 10 |
There was a problem hiding this comment.
I think this is a misplaced comment, as there's no relationship between ZMQ and LVDS?
| std::string function = "Archon::Interface::zmq"; | ||
| std::stringstream message; | ||
| long error = NO_ERROR; | ||
| const std::string& endpoint = "tcp://*:5555"; |
There was a problem hiding this comment.
make endpoint configurable rather than hard-coded?
| state_out = ( this->is_zmq ? "true" : "false" ); | ||
|
|
||
| if (error != NO_ERROR) { | ||
| message.str(""); message << "setting autofetch state to " << state_in; |
| if (message.size() > 0) { | ||
| std::string received_message(static_cast<char*>(message.data()), message.size()); | ||
| // Process subscription messages | ||
| std::cout << "Received ZMQ message: " << received_message << std::endl; |
There was a problem hiding this comment.
What happens here? Maybe this puts data in a dequeue?
| } | ||
| // std::cout << "Image data: " << ss.str() << std::endl; | ||
| this->write_to_zmq(ss.str()); | ||
|
|
There was a problem hiding this comment.
What if write_to_zmq( accepted *buf, bufsz ) and then did something like,
zmq::message_t msg(cbuf16s, sizeof(int) * section_size);
write_to_zmq(msg)
mikelangmayr
left a comment
There was a problem hiding this comment.
These changes will go into camera clean, closing this PR
Work in progress...