6 :
ISISVME(), m_init_done(false), m_device(
""), m_trigger_func(NULL), m_trigger_func_arg(NULL), m_qxtrm(NULL),
7 m_dau_memory(dau_memory), m_nwords_memory(nwords_memory), m_dau_registers(dau_registers), m_nwords_registers(nwords_registers)
27 std::string app_dir = Poco::Util::Application::instance().config().getString(
"application.dir");
28 std::string config_file = app_dir +
"..\\..\\..\\qxtrm_config.xml";
29 if ( access(config_file.c_str(), 04) == -1 )
31 config_file = app_dir +
"qxtrm_config.xml";
33 std::cerr <<
"Using config file " << config_file << std::endl;
34 std::cerr <<
"Initialising Qxtrm connection ... ";
42 std::cerr <<
"Creating channel eth1_RDMA1_loop ... ";
44 std::cerr <<
"Creating channel eth1_RDMA2_loop ... ";
49 std::cerr <<
"DONE" << std::endl;
50 std::cerr <<
"Creating channel eth1_RDMA1 ... ";
52 std::cerr <<
"DONE" << std::endl;
53 std::cerr <<
"Creating channel eth1_RDMA2 ... ";
55 std::cerr <<
"DONE" << std::endl;
78 std::ostringstream message;
93 template <
typename F,
typename T>
96 int current_sev = dstatus.
severity();
106 LOGSTR_WARNING(
"retrySingle: address 0x" << std::hex << address << std::dec);
110 stat = (this->*pFunc)(address, data, props, dstatus);
114 if ( !(dstatus >= current_sev) )
121 template <
typename F,
typename T>
125 int current_sev = dstatus.
severity();
134 LOGSTR_WARNING(
"retryBlock: " << nitems <<
" items from address 0x" << std::hex << address << std::dec);
138 stat = (this->*pFunc)(address, data, nitems, props, dstatus);
142 if ( !(dstatus >= current_sev) )
156 return readU16impl(address, data16, props, dstatus);
159 template <
typename T>
168 m_rdma_reg->RDMARead(data, nitems *
sizeof(T), address);
172 m_rdma_mem->RDMARead(data, nitems *
sizeof(T), address);
175 catch(
const std::exception& ex)
185 return readUimpl(address, data16, 1, props, dstatus);
195 return readU32impl(address, data32, props, dstatus);
200 return readUimpl(address, data32, 1, props, dstatus);
214 return readUimpl(address, data16, nitems, props, dstatus);
226 return readUimpl(address, data32, nitems, props, dstatus);
234 template <
typename T>
243 m_rdma_reg->RDMAWrite(data, nitems *
sizeof(T), address);
247 m_rdma_mem->RDMAWrite(data, nitems *
sizeof(T), address);
250 catch(
const std::exception& ex)
260 return writeUimpl(address, &data16, 1, props, dstatus);
270 return writeUimpl(address, &data32, 1, props, dstatus);
284 return writeUimpl(address, data16, nitems, props, dstatus);
296 return writeUimpl(address, data32, nitems, props, dstatus);
306 return writeBlockU32impl(address, reinterpret_cast<isisU32_t*>(data64), 2 * nitems, props, dstatus);
317 return readBlockU32impl(address, reinterpret_cast<isisU32_t*>(data64), 2 * nitems, props, dstatus);
332 return readBlockU32(address, data, nitems, props, status);
337 return readBlockU64(address, data, nitems, props, status);
Poco::SharedPtr< Qxtrm_channel > createChannel(const std::string &chan_name)
int writeBlockU64impl(unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
virtual ~QxtrmInterface()
int writeBlock(unsigned long address, isisU32_t *data, long nitems, TransferProps props, DAEstatus &status)
uint32_t TransferProps
combination of TransferProp values
int writeBlockU16(unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
int writeU32(unsigned long address, isisU32_t data32, TransferProps props, DAEstatus &dstatus)
int readU16noRetry(unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &dstatus)
int writeBlockU32(unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
int writeUimpl(unsigned long address, T *data, int nitems, TransferProps props, DAEstatus &dstatus)
int readU16impl(unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &dstatus)
int writeBlockU16impl(unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
int retryBlock(F pFunc, unsigned long address, T data, long nitems, TransferProps props, DAEstatus &dstatus)
int readBlockU32(unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
int add(DAEstatus &dstatus, bool clear)
int readBlockU64(unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
int close(DAEstatus &dstatus)
int retrySingle(F pFunc, unsigned long address, T data, TransferProps props, DAEstatus &dstatus)
int readBlockU64impl(unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
#define LOGSTR_WARNING(__arg)
int readUimpl(unsigned long address, T *data, int nitems, TransferProps props, DAEstatus &dstatus)
Poco::SharedPtr< Qxtrm_channel > m_rdma_mem
std::ostream & channelTransferStats(std::ostream &os) const
std::ostream & channelStatus(std::ostream &os) const
int writeU16impl(unsigned long address, isisU16_t data16, TransferProps props, DAEstatus &dstatus)
QxtrmInterface(DAEstatus &dstatus, uint32_t *dau_memory=NULL, uint32_t nwords_memory=0, uint32_t *dau_registers=NULL, uint32_t nwords_registers=0)
#define LOGSTR_INFORMATION(__arg)
static const int m_tries
number of times to try a read/write
static const int m_retry_time
milliseconds between retries
int lockDevice(int timeout, DAEstatus &dstatus)
int resetSeverityToAtLeast(int severity)
uint32_t * m_dau_registers
int readBlockU16(unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
Poco::SharedPtr< Qxtrm_channel > m_rdma_reg
CRITICAL_SECTION m_visa_critical
int readU32(unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &dstatus)
int readU32impl(unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &dstatus)
int writeBlockU32impl(unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
void setLoggerName(const std::string &logger_name)
int readBlockU16impl(unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
int readU16(unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &dstatus)
int unlockDevice(DAEstatus &dstatus)
int readBlock(unsigned long address, isisU32_t *data, long nitems, TransferProps props, DAEstatus &status)
int resetSeverityToAtMost(int severity)
int readU32noRetry(unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &dstatus)
int readBlockU32impl(unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
int writeU32impl(unsigned long address, isisU32_t data32, TransferProps propsn, DAEstatus &dstatus)
int writeBlockU64(unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
int open(const char *device, DAEstatus &dstatus)
uint32_t m_nwords_registers
int writeU16(unsigned long address, isisU16_t data16, TransferProps props, DAEstatus &dstatus)
int reinit(DAEstatus &dstatus)