Skip to content
Snippets Groups Projects
Commit d1cac0c6 authored by Russell Taylor's avatar Russell Taylor
Browse files

Merge remote branch 'origin/feature/9424_merge_upstream_adara'

parents 7e66eb72 1af97ed0
No related merge requests found
......@@ -6,6 +6,8 @@
namespace ADARA {
const std::string VERSION = "1.1.0";
#define ADARA_PKT_TYPE(type, ver) ((((uint32_t) type) << 8) | (ver))
namespace PacketType {
enum Enum {
......@@ -83,6 +85,7 @@ namespace VariableStatus {
SIMULATED = 19,
READ_PERMISSION = 20,
WRITE_PERMISSION = 21,
UPSTREAM_DISCONNECTED = 0xfffe,
NOT_REPORTED = 0xffff,
};
}
......
......@@ -415,6 +415,12 @@ public:
uint32_t devId(void) const { return m_devId; }
const std::string &description(void) const { return m_desc; }
void remapDevice(uint32_t dev) {
uint32_t *fields = (uint32_t *)const_cast<uint8_t *>(payload());
fields[0] = dev;
m_devId = dev;
};
private:
uint32_t m_devId;
std::string m_desc;
......@@ -439,6 +445,11 @@ public:
}
uint32_t value(void) const { return m_fields[3]; }
void remapDevice(uint32_t dev) {
uint32_t *fields = (uint32_t *)const_cast<uint8_t *>(payload());
fields[0] = dev;
};
private:
const uint32_t *m_fields;
......@@ -462,6 +473,11 @@ public:
}
double value(void) const { return *(const double *) &m_fields[3]; }
void remapDevice(uint32_t dev) {
uint32_t *fields = (uint32_t *)const_cast<uint8_t *>(payload());
fields[0] = dev;
};
private:
const uint32_t *m_fields;
......@@ -485,6 +501,11 @@ public:
}
const std::string &value(void) const { return m_val; }
void remapDevice(uint32_t dev) {
uint32_t *fields = (uint32_t *)const_cast<uint8_t *>(payload());
fields[0] = dev;
};
private:
const uint32_t *m_fields;
std::string m_val;
......
These classes are imported from the ADARA project at ORNL (http://www.csm.ornl.gov/newsite/adara.html).
They are not part of Mantid itself, but are required to parse the live stream from SNS instruments and are used by the SNSLiveEventDataListener.
The original versions of the classes are stored in the ADARA git repo. This can be retrieved with the command:
git clone git+ssh://trac.sns.gov/var/repos/ADARA
......@@ -35,6 +35,7 @@ static bool validate_status(uint16_t val)
case VariableStatus::SIMULATED:
case VariableStatus::READ_PERMISSION:
case VariableStatus::WRITE_PERMISSION:
case VariableStatus::UPSTREAM_DISCONNECTED:
case VariableStatus::NOT_REPORTED:
return false;
}
......
#include <string.h>
#include <errno.h>
#include "MantidLiveData/ADARA/ADARAParser.h"
......@@ -80,7 +79,7 @@ int Parser::bufferParse(unsigned int max_packets)
* chunk, consuming our entire buffer.
*/
stopped = rxOversizePkt(&hdr, p, 0, valid_len);
m_oversize_len = hdr.payload_length() - valid_len;
m_oversize_len = hdr.packet_length() - valid_len;
m_oversize_offset = valid_len;
valid_len = 0;
break;
......
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