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