ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
testMultiplexedDataAccesor.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#define BOOST_TEST_DYN_LINK
5
6#include "BackendFactory.h"
7#include "Device.h"
8#include "DummyBackend.h"
9#include "MapFileParser.h"
12
13#include <iostream>
14#include <sstream>
15
16#define BOOST_TEST_MODULE MultiplexedDataAccessorTest
17#include <boost/test/data/test_case.hpp>
18#include <boost/test/unit_test.hpp>
19using namespace boost::unit_test_framework;
20
21using namespace ChimeraTK;
22
23static const std::string DMAP_FILE_NAME_("dummies.dmap");
24static const std::string TEST_MODULE_NAME("TEST");
25static const std::string INVALID_MODULE_NAME("INVALID");
26static const RegisterPath TEST_MODULE_PATH(TEST_MODULE_NAME);
27static const RegisterPath INVALID_MODULE_PATH(INVALID_MODULE_NAME);
28
30 std::string dmapFile;
31 std::string deviceAlias;
32 std::string deviceInvalidAlias;
33 std::string deviceMixedAlias;
34 std::string mapFileName;
35};
36
37// This is necessary for the data test cases
38std::ostream& operator<<(std::ostream& o, const TestParameters& p) {
39 o << p.dmapFile << " " << p.deviceAlias << " " << p.deviceInvalidAlias << " " << p.deviceMixedAlias << " "
40 << p.mapFileName;
41
42 return o;
43}
44
45static TestParameters AREA_PARAMS{"dummies.dmap", "SEQUENCES", "INVALID_SEQUENCES", "SEQUENCES", "sequences.map"};
46
47static TestParameters NEW_AREA_PARAMS{
48 "newMuxedDummies.dmap", "NEW_SEQUENCES", "NEW_INVALID_SEQUENCES", "NEW_SEQUENCES", "newSequences.mapp"};
49
50BOOST_AUTO_TEST_SUITE(MultiplexedDataAccessorTestSuite)
51
52BOOST_DATA_TEST_CASE(testConstructor, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
55 device.open(sample.deviceAlias);
56 TwoDRegisterAccessor<double> deMultiplexer = device.getTwoDRegisterAccessor<double>(TEST_MODULE_PATH / "FRAC_INT");
57 BOOST_TEST(deMultiplexer[0].size() == 5);
58
59 device.close();
60 BOOST_CHECK_THROW(device.open(sample.deviceInvalidAlias), ChimeraTK::logic_error);
61}
62
63// test the de-multiplexing itself, with 'identity' fixed point conversion
64template<class SequenceWordType>
65void testDeMultiplexing(std::string areaName, const TestParameters& sample) {
66 std::cout << "testDeMultiplexing areaName = " << areaName
67 << " SequenceWordType = " << typeid(SequenceWordType).name() << std::endl;
68
69 // open a dummy device with the sequence map file
72 device.open(sample.deviceAlias);
73
74 std::vector<SequenceWordType> ioBuffer(15);
75 auto area = device.getOneDRegisterAccessor<int32_t>(TEST_MODULE_NAME + "/" + areaName + ".MULTIPLEXED_RAW");
76 size_t nBytes = std::min(area.getNElements() * sizeof(int32_t), 15 * sizeof(SequenceWordType));
77 ioBuffer[0] = 'A';
78 ioBuffer[1] = 'a';
79 ioBuffer[2] = '0';
80 ioBuffer[3] = 'B';
81 ioBuffer[4] = 'b';
82 ioBuffer[5] = '1';
83 ioBuffer[6] = 'C';
84 ioBuffer[7] = 'c';
85 ioBuffer[8] = '2';
86 ioBuffer[9] = 'D';
87 ioBuffer[10] = 'd';
88 ioBuffer[11] = '3';
89 ioBuffer[12] = 'E';
90 ioBuffer[13] = 'e';
91 ioBuffer[14] = '4';
92 memcpy(&(area[0]), ioBuffer.data(), nBytes);
93 area.write();
94
96 device.getTwoDRegisterAccessor<SequenceWordType>(TEST_MODULE_PATH / areaName);
97
98 BOOST_TEST(deMultiplexer.isReadOnly() == false);
99 BOOST_TEST(deMultiplexer.isReadable());
100 BOOST_TEST(deMultiplexer.isWriteable());
101
102 deMultiplexer.read();
103
104 BOOST_TEST(deMultiplexer[0][0] == 'A');
105 BOOST_TEST(deMultiplexer[0][1] == 'B');
106 BOOST_TEST(deMultiplexer[0][2] == 'C');
107 BOOST_TEST(deMultiplexer[0][3] == 'D');
108 BOOST_TEST(deMultiplexer[0][4] == 'E');
109 BOOST_TEST(deMultiplexer[1][0] == 'a');
110 BOOST_TEST(deMultiplexer[1][1] == 'b');
111 BOOST_TEST(deMultiplexer[1][2] == 'c');
112 BOOST_TEST(deMultiplexer[1][3] == 'd');
113 BOOST_TEST(deMultiplexer[1][4] == 'e');
114 BOOST_TEST(deMultiplexer[2][0] == '0');
115 BOOST_TEST(deMultiplexer[2][1] == '1');
116 BOOST_TEST(deMultiplexer[2][2] == '2');
117 BOOST_TEST(deMultiplexer[2][3] == '3');
118 BOOST_TEST(deMultiplexer[2][4] == '4');
119
120 for(size_t sequenceIndex = 0; sequenceIndex < 3; ++sequenceIndex) {
121 for(size_t i = 0; i < 5; ++i) {
122 deMultiplexer[sequenceIndex][i] += 5;
123 }
124 }
125
126 deMultiplexer.write();
127 area.read();
128 memcpy(ioBuffer.data(), &(area[0]), nBytes);
129
130 BOOST_TEST(ioBuffer[0] == 'F');
131 BOOST_TEST(ioBuffer[1] == 'f');
132 BOOST_TEST(ioBuffer[2] == '5');
133 BOOST_TEST(ioBuffer[3] == 'G');
134 BOOST_TEST(ioBuffer[4] == 'g');
135 BOOST_TEST(ioBuffer[5] == '6');
136 BOOST_TEST(ioBuffer[6] == 'H');
137 BOOST_TEST(ioBuffer[7] == 'h');
138 BOOST_TEST(ioBuffer[8] == '7');
139 BOOST_TEST(ioBuffer[9] == 'I');
140 BOOST_TEST(ioBuffer[10] == 'i');
141 BOOST_TEST(ioBuffer[11] == '8');
142 BOOST_TEST(ioBuffer[12] == 'J');
143 BOOST_TEST(ioBuffer[13] == 'j');
144 BOOST_TEST(ioBuffer[14] == '9');
145}
146
147BOOST_DATA_TEST_CASE(testDeMultiplexing32, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
148 testDeMultiplexing<int32_t>("INT", sample);
149}
150BOOST_DATA_TEST_CASE(testDeMultiplexing16, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
151 testDeMultiplexing<int16_t>("SHORT", sample);
152}
153BOOST_DATA_TEST_CASE(testDeMultiplexing8, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
154 testDeMultiplexing<int8_t>("CHAR", sample);
155}
156
157// test the de-multiplexing itself, with fixed point conversion
158// and using the factory function
159template<class SequenceWordType>
160void testWithConversion(std::string multiplexedSequenceName, const TestParameters& sample) {
161 // open a dummy device with the sequence map file
164 device.open(sample.deviceAlias);
165
166 std::vector<SequenceWordType> ioBuffer(15);
167 auto area = device.getOneDRegisterAccessor<int32_t>(TEST_MODULE_PATH / multiplexedSequenceName / "MULTIPLEXED_RAW");
168 size_t nBytes = std::min(area.getNElements() * sizeof(int32_t), 15 * sizeof(SequenceWordType));
169
170 for(size_t i = 0; i < ioBuffer.size(); ++i) {
171 ioBuffer[i] = i;
172 }
173 memcpy(&(area[0]), ioBuffer.data(), nBytes);
174 area.write();
175
177 device.getTwoDRegisterAccessor<float>(TEST_MODULE_PATH / multiplexedSequenceName);
178 accessor.read();
179
180 BOOST_TEST(accessor[0][0] == 0);
181 BOOST_TEST(accessor[1][0] == 0.25); // 1 with 2 frac bits
182 BOOST_TEST(accessor[2][0] == 0.25); // 2 with 3 frac bits
183 BOOST_TEST(accessor[0][1] == 1.5); // 3 with 1 frac bits
184 BOOST_TEST(accessor[1][1] == 1); // 4 with 2 frac bits
185 BOOST_TEST(accessor[2][1] == 0.625); // 5 with 3 frac bits
186 BOOST_TEST(accessor[0][2] == 3.); // 6 with 1 frac bits
187 BOOST_TEST(accessor[1][2] == 1.75); // 7 with 2 frac bits
188 BOOST_TEST(accessor[2][2] == 1.); // 8 with 3 frac bits
189 BOOST_TEST(accessor[0][3] == 4.5); // 9 with 1 frac bits
190 BOOST_TEST(accessor[1][3] == 2.5); // 10 with 2 frac bits
191 BOOST_TEST(accessor[2][3] == 1.375); // 11 with 3 frac bits
192 BOOST_TEST(accessor[0][4] == 6.); // 12 with 1 frac bits
193 BOOST_TEST(accessor[1][4] == 3.25); // 13 with 2 frac bits
194 BOOST_TEST(accessor[2][4] == 1.75); // 14 with 3 frac bits
195
196 for(size_t sequenceIndex = 0; sequenceIndex < 3; ++sequenceIndex) {
197 for(size_t i = 0; i < 5; ++i) {
198 accessor[sequenceIndex][i] += 1.;
199 }
200 }
201
202 accessor.write();
203
204 area.read();
205 memcpy(ioBuffer.data(), &(area[0]), nBytes);
206
207 for(size_t i = 0; i < 15; ++i) {
208 // with i%3+1 fractional bits the added floating point value of 1
209 // corresponds to 2^(i%3+1) in fixed point represetation
210 int addedValue = 1 << (i % 3 + 1);
211 std::stringstream message;
212 message << "ioBuffer[" << i << "] is " << ioBuffer[i] << ", expected " << i + addedValue;
213 BOOST_CHECK_MESSAGE(ioBuffer[i] == static_cast<SequenceWordType>(i + addedValue), message.str());
214 }
215}
216
217BOOST_DATA_TEST_CASE(testWithConversion32, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
218 testWithConversion<int32_t>("FRAC_INT", sample);
219}
220BOOST_DATA_TEST_CASE(testWithConversion16, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
221 testWithConversion<int16_t>("FRAC_SHORT", sample);
222}
223BOOST_DATA_TEST_CASE(testWithConversion8, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
224 testWithConversion<int8_t>("FRAC_CHAR", sample);
225}
226
227BOOST_DATA_TEST_CASE(testMixed, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
228 // open a dummy device with the sequence map file
231 device.open(sample.deviceMixedAlias);
232
233 TwoDRegisterAccessor<double> myMixedData = device.getTwoDRegisterAccessor<double>("APP0/DAQ0_BAM");
234 auto myRawData = device.getOneDRegisterAccessor<int32_t>("APP0/DAQ0_BAM.MULTIPLEXED_RAW", 0, 0, {AccessMode::raw});
235
236 BOOST_TEST(myMixedData.getNChannels() == 17);
237 BOOST_TEST(myMixedData.getNElementsPerChannel() == 372);
238 BOOST_TEST(myMixedData[0].size() == 372);
239
240 myMixedData[0][0] = -24673; // 1001 1111 1001 1111
241 myMixedData[1][0] = -13724; // 1100 1010 0110 0100
242 myMixedData[2][0] = 130495;
243 myMixedData[3][0] = 513;
244 myMixedData[4][0] = 1027;
245 myMixedData[5][0] = -56.4;
246 myMixedData[6][0] = 78;
247 myMixedData[7][0] = 45.2;
248 myMixedData[8][0] = -23.9;
249 myMixedData[9][0] = 61.3;
250 myMixedData[10][0] = -12;
251
252 myMixedData.write();
253
254 myRawData.read();
255 BOOST_TEST(myRawData[0] == -899375201);
256 BOOST_TEST(myRawData[1] == 130495);
257 BOOST_TEST(myRawData[2] == 67305985);
258 BOOST_TEST(myRawData[3] == 5112008);
259 BOOST_TEST(myRawData[4] == -197269459);
260
261 myMixedData.read();
262
263 BOOST_TEST(myMixedData[0][0] == -24673);
264 BOOST_TEST(myMixedData[1][0] == -13724);
265 BOOST_TEST(myMixedData[2][0] == 130495);
266 BOOST_TEST(myMixedData[3][0] == 513);
267 BOOST_TEST(myMixedData[4][0] == 1027);
268 BOOST_TEST(myMixedData[5][0] == -56);
269 BOOST_TEST(myMixedData[6][0] == 78);
270 BOOST_TEST(myMixedData[7][0] == 45);
271 BOOST_TEST(myMixedData[8][0] == -24);
272 BOOST_TEST(myMixedData[9][0] == 61);
273 BOOST_TEST(myMixedData[10][0] == -12);
274}
275
276BOOST_DATA_TEST_CASE(testNumberOfSequencesDetected, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
277 auto registerMap = MapFileParser().parse(sample.mapFileName).first;
278 // open a dummy device with the sequence map file
281 device.open(sample.deviceAlias);
282
283 TwoDRegisterAccessor<double> deMuxedData = device.getTwoDRegisterAccessor<double>(TEST_MODULE_PATH / "FRAC_INT");
284
285 BOOST_TEST(deMuxedData.getNChannels() == 3);
286}
287
288BOOST_DATA_TEST_CASE(testAreaOfInterestOffset, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
289 // open a dummy device with the sequence map file
292 device.open(sample.deviceMixedAlias);
293
294 // There are 44 bytes per block. In total the area is 4096 bytes long
295 // => There are 372 elements (=4092 bytes) in the area, the last 4 bytes are unused.
296 const size_t nWordsPerBlock = 44 / sizeof(int32_t); // 32 bit raw words on the transport layer
297
298 // we only request 300 of the 372 elements, with 42 elements offset, so we just cut out an area in the middle
299 TwoDRegisterAccessor<double> myMixedData = device.getTwoDRegisterAccessor<double>("APP0/DAQ0_BAM", 300, 42);
300 auto myRawData = device.getOneDRegisterAccessor<int32_t>(
301 "APP0/DAQ0_BAM.MULTIPLEXED_RAW", 300 * nWordsPerBlock, 42 * nWordsPerBlock, {AccessMode::raw});
302
303 BOOST_TEST(myMixedData.getNChannels() == 17);
304 BOOST_TEST(myMixedData.getNElementsPerChannel() == 300);
305 BOOST_TEST(myMixedData[0].size() == 300);
306
307 for(unsigned int i = 0; i < myMixedData.getNElementsPerChannel(); ++i) {
308 myMixedData[0][i] = -24673; // 1001 1111 1001 1111
309 myMixedData[1][i] = -13724; // 1100 1010 0110 0100
310 myMixedData[2][i] = 130495;
311 myMixedData[3][i] = 513;
312 myMixedData[4][i] = 1027;
313 myMixedData[5][i] = -56.4;
314 myMixedData[6][i] = 78;
315 myMixedData[7][i] = 45.2;
316 myMixedData[8][i] = -23.9;
317 myMixedData[9][i] = 61.3;
318 myMixedData[10][i] = -12;
319
320 myMixedData.write();
321
322 myRawData.read();
323 BOOST_TEST(myRawData[0 + i * nWordsPerBlock] == -899375201);
324 BOOST_TEST(myRawData[1 + i * nWordsPerBlock] == 130495);
325 BOOST_TEST(myRawData[2 + i * nWordsPerBlock] == 67305985);
326 BOOST_TEST(myRawData[3 + i * nWordsPerBlock] == 5112008);
327 BOOST_TEST(myRawData[4 + i * nWordsPerBlock] == -197269459);
328
329 myMixedData.read();
330
331 BOOST_TEST(myMixedData[0][i] == -24673);
332 BOOST_TEST(myMixedData[1][i] == -13724);
333 BOOST_TEST(myMixedData[2][i] == 130495);
334 BOOST_TEST(myMixedData[3][i] == 513);
335 BOOST_TEST(myMixedData[4][i] == 1027);
336 BOOST_TEST(myMixedData[5][i] == -56);
337 BOOST_TEST(myMixedData[6][i] == 78);
338 BOOST_TEST(myMixedData[7][i] == 45);
339 BOOST_TEST(myMixedData[8][i] == -24);
340 BOOST_TEST(myMixedData[9][i] == 61);
341 BOOST_TEST(myMixedData[10][i] == -12);
342
343 myMixedData[0][i] = i;
344 myMixedData[1][i] = 0;
345 myMixedData[2][i] = 0;
346 myMixedData[3][i] = 0;
347 myMixedData[4][i] = 0;
348 myMixedData[5][i] = 0;
349 myMixedData[6][i] = 0;
350 myMixedData[7][i] = 0;
351 myMixedData[8][i] = 0;
352 myMixedData[9][i] = 0;
353 myMixedData[10][i] = 0;
354
355 myMixedData.write();
356
357 myRawData.read();
358 BOOST_TEST(myRawData[0 + i * nWordsPerBlock] == static_cast<int>(i));
359 BOOST_TEST(myRawData[1 + i * nWordsPerBlock] == 0);
360 BOOST_TEST(myRawData[2 + i * nWordsPerBlock] == 0);
361 BOOST_TEST(myRawData[3 + i * nWordsPerBlock] == 0);
362 BOOST_TEST(myRawData[4 + i * nWordsPerBlock] == 0);
363
364 myMixedData.read();
365
366 BOOST_TEST(myMixedData[0][i] == i);
367 BOOST_TEST(myMixedData[1][i] == 0);
368 BOOST_TEST(myMixedData[2][i] == 0);
369 BOOST_TEST(myMixedData[3][i] == 0);
370 BOOST_TEST(myMixedData[4][i] == 0);
371 BOOST_TEST(myMixedData[5][i] == 0);
372 BOOST_TEST(myMixedData[6][i] == 0);
373 BOOST_TEST(myMixedData[7][i] == 0);
374 BOOST_TEST(myMixedData[8][i] == 0);
375 BOOST_TEST(myMixedData[9][i] == 0);
376 BOOST_TEST(myMixedData[10][i] == 0);
377 }
378}
379
380BOOST_DATA_TEST_CASE(testAreaOfInterestLength, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS})) {
381 // open a dummy device with the sequence map file
384 device.open(sample.deviceMixedAlias);
385
386 const size_t nWordsPerBlock = 44 / sizeof(int32_t);
387
388 TwoDRegisterAccessor<double> myMixedData = device.getTwoDRegisterAccessor<double>("APP0/DAQ0_BAM", 120);
389 auto myRawData = device.getOneDRegisterAccessor<int32_t>("APP0/DAQ0_BAM.MULTIPLEXED_RAW", 0, 0, {AccessMode::raw});
390
391 BOOST_TEST(myMixedData.getNChannels() == 17);
392 BOOST_TEST(myMixedData.getNElementsPerChannel() == 120);
393 BOOST_TEST(myMixedData[0].size() == 120);
394
395 for(unsigned int i = 0; i < myMixedData.getNElementsPerChannel(); ++i) {
396 myMixedData[0][i] = -24673; // 1001 1111 1001 1111
397 myMixedData[1][i] = -13724; // 1100 1010 0110 0100
398 myMixedData[2][i] = 130495;
399 myMixedData[3][i] = 513;
400 myMixedData[4][i] = 1027;
401 myMixedData[5][i] = -56.4;
402 myMixedData[6][i] = 78;
403 myMixedData[7][i] = 45.2;
404 myMixedData[8][i] = -23.9;
405 myMixedData[9][i] = 61.3;
406 myMixedData[10][i] = -12;
407
408 myMixedData.write();
409
410 myRawData.read();
411 BOOST_TEST(myRawData[0 + i * nWordsPerBlock] == -899375201);
412 BOOST_TEST(myRawData[1 + i * nWordsPerBlock] == 130495);
413 BOOST_TEST(myRawData[2 + i * nWordsPerBlock] == 67305985);
414 BOOST_TEST(myRawData[3 + i * nWordsPerBlock] == 5112008);
415 BOOST_TEST(myRawData[4 + i * nWordsPerBlock] == -197269459);
416
417 myMixedData.read();
418
419 BOOST_TEST(myMixedData[0][i] == -24673);
420 BOOST_TEST(myMixedData[1][i] == -13724);
421 BOOST_TEST(myMixedData[2][i] == 130495);
422 BOOST_TEST(myMixedData[3][i] == 513);
423 BOOST_TEST(myMixedData[4][i] == 1027);
424 BOOST_TEST(myMixedData[5][i] == -56);
425 BOOST_TEST(myMixedData[6][i] == 78);
426 BOOST_TEST(myMixedData[7][i] == 45);
427 BOOST_TEST(myMixedData[8][i] == -24);
428 BOOST_TEST(myMixedData[9][i] == 61);
429 BOOST_TEST(myMixedData[10][i] == -12);
430
431 myMixedData[0][i] = i;
432 myMixedData[1][i] = 0;
433 myMixedData[2][i] = 0;
434 myMixedData[3][i] = 0;
435 myMixedData[4][i] = 0;
436 myMixedData[5][i] = 0;
437 myMixedData[6][i] = 0;
438 myMixedData[7][i] = 0;
439 myMixedData[8][i] = 0;
440 myMixedData[9][i] = 0;
441 myMixedData[10][i] = 0;
442
443 myMixedData.write();
444
445 myRawData.read();
446 BOOST_TEST(myRawData[0 + i * nWordsPerBlock] == (int)i);
447 BOOST_TEST(myRawData[1 + i * nWordsPerBlock] == 0);
448 BOOST_TEST(myRawData[2 + i * nWordsPerBlock] == 0);
449 BOOST_TEST(myRawData[3 + i * nWordsPerBlock] == 0);
450 BOOST_TEST(myRawData[4 + i * nWordsPerBlock] == 0);
451
452 myMixedData.read();
453
454 BOOST_TEST(myMixedData[0][i] == i);
455 BOOST_TEST(myMixedData[1][i] == 0);
456 BOOST_TEST(myMixedData[2][i] == 0);
457 BOOST_TEST(myMixedData[3][i] == 0);
458 BOOST_TEST(myMixedData[4][i] == 0);
459 BOOST_TEST(myMixedData[5][i] == 0);
460 BOOST_TEST(myMixedData[6][i] == 0);
461 BOOST_TEST(myMixedData[7][i] == 0);
462 BOOST_TEST(myMixedData[8][i] == 0);
463 BOOST_TEST(myMixedData[9][i] == 0);
464 BOOST_TEST(myMixedData[10][i] == 0);
465 }
466}
467
468BOOST_AUTO_TEST_SUITE_END()
static BackendFactory & getInstance()
Static function to get an instance of factory.
void setDMapFilePath(std::string dMapFilePath)
This function sets the _DMapFilePath.
Class allows to read/write registers from device.
Definition Device.h:39
TwoDRegisterAccessor< UserType > getTwoDRegisterAccessor(const RegisterPath &registerPathName, size_t numberOfElements=0, size_t elementsOffset=0, const AccessModeFlags &flags=AccessModeFlags({})) const
Get a TwoDRegisterAccessor object for the given register.
Definition Device.h:286
void close()
Close the device.
Definition Device.cc:66
OneDRegisterAccessor< UserType > getOneDRegisterAccessor(const RegisterPath &registerPathName, size_t numberOfWords=0, size_t wordOffsetInRegister=0, const AccessModeFlags &flags=AccessModeFlags({})) const
Get a OneDRegisterAccessor object for the given register.
Definition Device.h:276
void open(std::string const &aliasName)
Open a device by the given alias name from the DMAP file.
Definition Device.cc:58
static std::pair< NumericAddressedRegisterCatalogue, MetadataCatalogue > parse(const std::string &fileName)
Performs parsing of specified MAP file, resulting in catalogue objects describing all registers and m...
Class to store a register path name.
bool write(ChimeraTK::VersionNumber versionNumber={})
Write the data to device.
bool isReadable() const
Check if transfer element is readable.
void read()
Read the data from the device.
bool isWriteable() const
Check if transfer element is writeable.
bool isReadOnly() const
Check if transfer element is read only, i.e.
Accessor class to read and write 2D registers.
size_t getNElementsPerChannel() const
Return number of elements/samples per channel.
size_t getNChannels() const
Return the number of channels (formerly called sequences)
Exception thrown when a logic error has occured.
Definition Exception.h:51
std::ostream & operator<<(std::ostream &stream, const DataDescriptor::FundamentalType &fundamentalType)
ctk::Device device
BOOST_DATA_TEST_CASE(testConstructor, boost::unit_test::data::make({AREA_PARAMS, NEW_AREA_PARAMS}))
void testWithConversion(std::string multiplexedSequenceName, const TestParameters &sample)
void testDeMultiplexing(std::string areaName, const TestParameters &sample)