OpenSRX 0.1.0
C++ library for interfacing with Keyence SR series barcode readers
Loading...
Searching...
No Matches
ParamTraits.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
7
8namespace OpenSRX {
9
10// ─── Primary template (intentionally undefined) ─────────────────────────────
11
13template <ParamType>
15
16// ─── Non-integer wire formats ───────────────────────────────────────────────
17
18template <>
20 using type = std::string;
21};
22
23template <>
25 using type = std::string;
26};
27
28template <>
30 using type = std::vector<int>;
31};
32
33// ─── Raw integer ────────────────────────────────────────────────────────────
34
35template <>
37 using type = int;
38};
39
40// ─── Enumerated integer types ───────────────────────────────────────────────
41
42template <>
44 using type = Toggle;
45};
46
47template <>
51
52template <>
56
57template <>
61
62template <>
66
67template <>
71
72template <>
76
77template <>
81
82template <>
86
87template <>
91
92template <>
96
97template <>
101
102template <>
106
107template <>
111
112template <>
116
117template <>
121
122template <>
126
127template <>
131
132template <>
136
137template <>
141
142template <>
146
147template <>
151
152template <>
156
157template <>
161
162template <>
166
167template <>
171
172template <>
176
177template <>
181
182template <>
186
187template <>
191
192template <>
196
197template <>
201
202template <>
206
207template <>
211
212template <>
216
217template <>
221
222template <>
226
227template <>
231
232template <>
236
237template <>
241
242template <>
246
247template <>
251
252template <>
256
257template <>
261
262template <>
266
267template <>
271
272template <>
276
277template <>
281
282template <>
286
287template <>
291
292template <>
296
297template <>
301
302// ─── Convenience alias ──────────────────────────────────────────────────────
303
305template <ParamType PT>
307
308// ─── Parsing / formatting helpers ───────────────────────────────────────────
309
311template <ParamType PT>
312ParamCppT<PT> parseParam(const std::string& raw);
313
315template <ParamType PT>
316std::string formatParam(const ParamCppT<PT>& value);
317
318} // namespace OpenSRX
Definition AsioInterface.hpp:5
OutputDirection
Output direction (command 307).
Definition ParamValues.hpp:41
MultiCodeOutputFormat
Multiple-code output format (command 290).
Definition ParamValues.hpp:204
VerificationMethod
Verification method (command 403).
Definition ParamValues.hpp:285
TimingMode
Timing mode (command 101).
Definition ParamValues.hpp:157
UpcAOutput
UPC-A output format.
Definition ParamValues.hpp:84
ParityCheck
RS-232C parity check (command 102).
Definition ParamValues.hpp:329
VerificationThreshold
Verification threshold grade (commands 231, 232, 235, 237).
Definition ParamValues.hpp:268
ParamCppT< PT > parseParam(const std::string &raw)
Parse a raw response string into the C++ type for a given ParamType.
TriggerCommandResponse
Trigger command response string mode (command 610).
Definition ParamValues.hpp:245
CalibrationLighting
Code verification calibration lighting (command 890).
Definition ParamValues.hpp:277
MultipleReadingSameCode
Multiple reading of same code type/data (command 243).
Definition ParamValues.hpp:197
LiveViewDisplayImage
LiveView display image (command 900).
Definition ParamValues.hpp:262
DataTransmission
Data transmission timing (command 201).
Definition ParamValues.hpp:171
PresentationMode
Presentation mode (command 616).
Definition ParamValues.hpp:254
InternalLightingType
Internal lighting type (command 010).
Definition ParamValues.hpp:14
BaudRateHigh
RS-232C baud rate high range (command 100).
Definition ParamValues.hpp:314
SubfolderNameMethod
Subfolder name setting method (command 411).
Definition ParamValues.hpp:389
PharmacodeReadDirection
Pharmacode read direction.
Definition ParamValues.hpp:104
ImageSavingMode
Image saving mode (command 505).
Definition ParamValues.hpp:222
Toggle
Generic enable/disable toggle used by many parameters.
Definition ParamValues.hpp:8
TCPClientConnectionTiming
TCP client connection timing (command 213).
Definition ParamValues.hpp:363
Binning
Binning (command 513).
Definition ParamValues.hpp:237
ParamType
Combined wire format and value-enum type for a parameter.
Definition ParamTypeMap.hpp:20
@ INT_VECTOR
Colon-separated list of integer values (e.g. "a:b:c:d:e").
Definition ParamTypeMap.hpp:30
@ REVERSE_MODE
Definition ParamTypeMap.hpp:47
@ TOGGLE
Definition ParamTypeMap.hpp:35
@ TEST_MODE_ASSIGNMENT
Definition ParamTypeMap.hpp:50
@ ETHERNET_COMMAND_MODE
Definition ParamTypeMap.hpp:80
@ IMAGE_SAVING_DESTINATION
Definition ParamTypeMap.hpp:62
@ LENGTH_LIMITATION_METHOD
Definition ParamTypeMap.hpp:40
@ SUBFOLDER_NAME_METHOD
Definition ParamTypeMap.hpp:85
@ GRID_CORRECTION
Definition ParamTypeMap.hpp:41
@ INT
Definition ParamTypeMap.hpp:34
@ SORT_ORDER
Definition ParamTypeMap.hpp:73
@ VERIFICATION_THRESHOLD
Definition ParamTypeMap.hpp:69
@ HEX
Hex-encoded value (bit-field, byte sequence, or Unicode string).
Definition ParamTypeMap.hpp:24
@ INPUT_POLARITY
Definition ParamTypeMap.hpp:51
@ ETHERNET_DATA_CLIENT_MODE
Definition ParamTypeMap.hpp:81
@ CONTRAST_ADJUSTMENT
Definition ParamTypeMap.hpp:37
@ INPUT_PULSE_WIDTH
Definition ParamTypeMap.hpp:52
@ DUPLICATE_READING_PREVENTION
Definition ParamTypeMap.hpp:57
@ GRADE_EXPRESSION
Definition ParamTypeMap.hpp:72
@ LIVE_VIEW_DISPLAY_IMAGE
Definition ParamTypeMap.hpp:68
@ FILTER_TYPE
Definition ParamTypeMap.hpp:38
@ ASCII
Plain ASCII string (names, descriptions, IP addresses, coordinates).
Definition ParamTypeMap.hpp:27
@ INVERSE_MODE
Definition ParamTypeMap.hpp:46
@ IN_TERMINAL_FUNCTION
Definition ParamTypeMap.hpp:49
EthernetDataClientMode
Ethernet data client setting (command 207).
Definition ParamValues.hpp:356
SortOrder
Sorting order (commands 280–285).
Definition ParamValues.hpp:297
InputPulseWidth
Input pulse width (commands 043, 044).
Definition ParamValues.hpp:143
PDF417ReadCodeType
PDF417 read code type.
Definition ParamValues.hpp:60
NW7StartStopLetterType
NW-7 (CodaBar) start/stop letter type.
Definition ParamValues.hpp:67
typename ParamCppType< PT >::type ParamCppT
Shorthand: the C++ type for a given ParamType.
Definition ParamTraits.hpp:306
AlternateOrder
Specifying alternate order (command 204).
Definition ParamValues.hpp:184
ImageFormat
Image format (command 511).
Definition ParamValues.hpp:231
FilterType
Filter type for filter slots 1–4 (commands 200–203).
Definition ParamValues.hpp:29
ReverseMode
Reverse reading mode.
Definition ParamValues.hpp:97
std::string formatParam(const ParamCppT< PT > &value)
Format a C++ value into the string to send as a parameter value.
@ NW7_START_STOP_LETTER_TYPE
Definition BankParam.hpp:139
@ INTERNAL_LIGHTING_TYPE
Definition BankParam.hpp:21
@ OUTPUT_DIRECTION
Definition BankParam.hpp:47
@ PDF417_READ_CODE_TYPE
Definition BankParam.hpp:74
@ PHARMACODE_READ_DIRECTION
Definition BankParam.hpp:214
@ NW7_CHECK_DIGIT_TYPE
Definition BankParam.hpp:142
@ UPC_A_OUTPUT
Definition BankParam.hpp:150
LengthLimitationMethod
Length limitation method used by many code types.
Definition ParamValues.hpp:47
EthernetCommandMode
Ethernet command mode (command 203).
Definition ParamValues.hpp:349
CommProtocol
RS-232C communication protocol (command 104).
Definition ParamValues.hpp:342
ReadingMode
Reading mode (command 200).
Definition ParamValues.hpp:163
AutoPointerLighting
Automatic pointer lighting (command 209).
Definition ParamValues.hpp:190
MasterSlaveOperation
Master/Slave operation configuration (command 500).
Definition ParamValues.hpp:395
InputPolarity
Input polarity (commands 040, 041, 050, 051, 052).
Definition ParamValues.hpp:137
@ MULTIPLE_READING_SAME_CODE
Definition OperationParam.hpp:66
@ CALIBRATION_LIGHTING
Definition OperationParam.hpp:215
@ READING_MODE
Definition OperationParam.hpp:52
@ STARTUP_TEST_MODE
Definition OperationParam.hpp:42
@ IMAGE_FORMAT
Definition OperationParam.hpp:149
@ IMAGE_SAVING_MODE
Definition OperationParam.hpp:146
@ VERIFICATION_METHOD
Definition OperationParam.hpp:137
@ BINNING
Definition OperationParam.hpp:151
@ DATA_TRANSMISSION
Definition OperationParam.hpp:53
@ AUTO_POINTER_LIGHTING
Definition OperationParam.hpp:60
@ TRIGGER_COMMAND_RESPONSE
Definition OperationParam.hpp:165
@ MULTI_CODE_OUTPUT_FORMAT
Definition OperationParam.hpp:111
@ PRESENTATION_MODE
Definition OperationParam.hpp:170
@ TIMING_MODE
Definition OperationParam.hpp:43
@ ALTERNATE_ORDER
Definition OperationParam.hpp:55
GridCorrection
Grid correction mode (command 500).
Definition ParamValues.hpp:53
DataLength
RS-232C data length (command 101).
Definition ParamValues.hpp:323
BaudRateLow
RS-232C baud rate low range (command 105).
Definition ParamValues.hpp:305
@ FTP_CONNECTION_TIMING
Definition CommParam.hpp:96
@ COMM_PROTOCOL
Definition CommParam.hpp:33
@ MASTER_SLAVE_OPERATION
Definition CommParam.hpp:121
@ TCP_CLIENT_CONNECTION_TIMING
Definition CommParam.hpp:54
@ PLC_PROTOCOL
Definition CommParam.hpp:74
@ DATA_LENGTH
Definition CommParam.hpp:30
@ BAUD_RATE_HIGH
Definition CommParam.hpp:29
@ PARITY_CHECK
Definition CommParam.hpp:31
@ STOP_BIT_LENGTH
Definition CommParam.hpp:32
@ BAUD_RATE_LOW
Definition CommParam.hpp:34
InTerminalFunction
IN terminal function (commands 000, 001).
Definition ParamValues.hpp:114
DuplicateReadingPrevention
Standard duplicate reading prevention (command 239).
Definition ParamValues.hpp:177
StartupTestMode
Test mode on startup (command 100).
Definition ParamValues.hpp:150
InverseMode
Inverse reading mode.
Definition ParamValues.hpp:90
StopBitLength
RS-232C stop bit length (command 103).
Definition ParamValues.hpp:336
TestModeAssignment
Test mode assignment (commands 002, 003).
Definition ParamValues.hpp:131
NW7CheckDigitType
NW-7 (CodaBar) check-digit type.
Definition ParamValues.hpp:73
ContrastAdjustment
Contrast adjustment method (command 108).
Definition ParamValues.hpp:21
FTPConnectionTiming
FTP connection timing (commands 405, 426).
Definition ParamValues.hpp:382
GradeExpression
Grade expression setting (command 350).
Definition ParamValues.hpp:291
PLCProtocol
PLC protocol setting (command 303).
Definition ParamValues.hpp:369
ImageSavingDestination
Image saving destination (commands 500–504).
Definition ParamValues.hpp:211
AlternateOrder type
Definition ParamTraits.hpp:159
std::string type
Definition ParamTraits.hpp:25
AutoPointerLighting type
Definition ParamTraits.hpp:164
BaudRateHigh type
Definition ParamTraits.hpp:244
BaudRateLow type
Definition ParamTraits.hpp:239
Binning type
Definition ParamTraits.hpp:194
CalibrationLighting type
Definition ParamTraits.hpp:219
CommProtocol type
Definition ParamTraits.hpp:264
ContrastAdjustment type
Definition ParamTraits.hpp:54
DataLength type
Definition ParamTraits.hpp:249
DataTransmission type
Definition ParamTraits.hpp:149
DuplicateReadingPrevention type
Definition ParamTraits.hpp:154
EthernetCommandMode type
Definition ParamTraits.hpp:269
EthernetDataClientMode type
Definition ParamTraits.hpp:274
FilterType type
Definition ParamTraits.hpp:59
FTPConnectionTiming type
Definition ParamTraits.hpp:289
GradeExpression type
Definition ParamTraits.hpp:229
GridCorrection type
Definition ParamTraits.hpp:74
std::string type
Definition ParamTraits.hpp:20
ImageFormat type
Definition ParamTraits.hpp:189
ImageSavingDestination type
Definition ParamTraits.hpp:179
ImageSavingMode type
Definition ParamTraits.hpp:184
InputPolarity type
Definition ParamTraits.hpp:124
InputPulseWidth type
Definition ParamTraits.hpp:129
InternalLightingType type
Definition ParamTraits.hpp:49
int type
Definition ParamTraits.hpp:37
std::vector< int > type
Definition ParamTraits.hpp:30
InverseMode type
Definition ParamTraits.hpp:99
InTerminalFunction type
Definition ParamTraits.hpp:114
LengthLimitationMethod type
Definition ParamTraits.hpp:69
LiveViewDisplayImage type
Definition ParamTraits.hpp:209
MasterSlaveOperation type
Definition ParamTraits.hpp:299
MultipleReadingSameCode type
Definition ParamTraits.hpp:169
MultiCodeOutputFormat type
Definition ParamTraits.hpp:174
NW7CheckDigitType type
Definition ParamTraits.hpp:89
NW7StartStopLetterType type
Definition ParamTraits.hpp:84
OutputDirection type
Definition ParamTraits.hpp:64
ParityCheck type
Definition ParamTraits.hpp:254
PDF417ReadCodeType type
Definition ParamTraits.hpp:79
PharmacodeReadDirection type
Definition ParamTraits.hpp:109
PLCProtocol type
Definition ParamTraits.hpp:284
PresentationMode type
Definition ParamTraits.hpp:204
ReadingMode type
Definition ParamTraits.hpp:144
ReverseMode type
Definition ParamTraits.hpp:104
SortOrder type
Definition ParamTraits.hpp:234
StartupTestMode type
Definition ParamTraits.hpp:134
StopBitLength type
Definition ParamTraits.hpp:259
SubfolderNameMethod type
Definition ParamTraits.hpp:294
TCPClientConnectionTiming type
Definition ParamTraits.hpp:279
TestModeAssignment type
Definition ParamTraits.hpp:119
TimingMode type
Definition ParamTraits.hpp:139
Toggle type
Definition ParamTraits.hpp:44
TriggerCommandResponse type
Definition ParamTraits.hpp:199
UpcAOutput type
Definition ParamTraits.hpp:94
VerificationMethod type
Definition ParamTraits.hpp:224
VerificationThreshold type
Definition ParamTraits.hpp:214
Maps a ParamType enumerator to its corresponding C++ type.
Definition ParamTraits.hpp:14