Skip to content
Snippets Groups Projects
Commit d9179cf9 authored by vargheseg's avatar vargheseg
Browse files

Added zmq support for DoocsIfff

parent b9d4f6e2
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ namespace ChimeraTK {
void auto_init(void) override;
void setMacroPulseNumberSource(boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> macroPulseNumberSource);
void publishZeroMQ() { _publishZMQ = true; }
DataConsistencyGroup _consistencyGroup;
protected:
......@@ -45,6 +46,7 @@ namespace ChimeraTK {
boost::shared_ptr<NDRegisterAccessor<float>> _f3Value;
DoocsUpdater& _updater;
EqFct* _eqFct;
bool _publishZMQ{false};
bool isWriteable;
boost::shared_ptr<ChimeraTK::NDRegisterAccessor<int64_t>> _macroPulseNumberSource;
......
......@@ -60,9 +60,7 @@ namespace ChimeraTK {
ifff.f3_data = _f3Value->accessData(0);
doocs::Timestamp timestamp(_i1Value->getVersionNumber().getTime());
auto sinceEpoch = timestamp.get_seconds_and_microseconds_since_epoch();
auto seconds = sinceEpoch.seconds;
auto microseconds = sinceEpoch.microseconds;
// update global time stamp of DOOCS, but only if our time stamp is newer
if(get_global_timestamp() < timestamp) {
set_global_timestamp(timestamp);
......@@ -82,8 +80,26 @@ namespace ChimeraTK {
this->set_value(&ifff);
}
auto sinceEpoch = timestamp.get_seconds_and_microseconds_since_epoch();
auto seconds = sinceEpoch.seconds;
auto microseconds = sinceEpoch.microseconds;
this->set_tmstmp(seconds, microseconds);
if(_macroPulseNumberSource) this->set_mpnum(_macroPulseNumberSource->accessData(0));
if(_publishZMQ) {
dmsg_info info;
memset(&info, 0, sizeof(info));
info.sec = seconds;
info.usec = microseconds;
if(_macroPulseNumberSource != nullptr) {
info.ident = _macroPulseNumberSource->accessData(0);
}
else {
info.ident = 0;
}
this->send(&info);
}
}
void DoocsIfff::set(EqAdr* eqAdr, EqData* data1, EqData* data2, EqFct* eqFct) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment