3#include "reader_four_state_config_base.hpp"
11 using namespace Internal;
30 evalCheckDigit_ = evalCheckDigit;
41 return evalCheckDigit_;
54 transmitCheckDigit_ = transmitCheckDigit;
65 return transmitCheckDigit_;
77 transmitStartStop_ = transmitStartStop;
88 return transmitStartStop_;
100 if(minDigits < minDigitsLimit_ ||
101 minDigits > maxDigits_)
103 if(minDigits_ != minDigits)
105 minDigits_ =
static_cast<short>(minDigits);
116 return static_cast<int>(minDigits_);
128 if(maxDigits < minDigits_ ||
129 maxDigits > maxDigitsLimit_)
131 if(maxDigits_ != maxDigits)
133 maxDigits_ =
static_cast<short>(maxDigits);
144 return static_cast<int>(maxDigits_);
155 if(orientation_ != orientation)
157 orientation_ = orientation;
174 SmartBool evalCheckDigit_;
175 SmartBool transmitCheckDigit_;
176 SmartBool transmitStartStop_;
184 const short minDigitsLimit_ = 7;
185 const short maxDigitsLimit_ = 13;
201 isActiveOut = pConfig->ReadFromHandle(guard);
206 virtual bool ReadFromHandle_(
const HandleGuard<ReaderConfig>& guard)
override
208 CExports::cvbbool_t active;
209 short tmpOrientation;
210 CVB_CALL_CAPI(CvcBcGetFourStateRoyalMail(
reinterpret_cast<std::intptr_t>(guard.Handle()),
219 evalCheckDigit_.Ptr(),
220 transmitCheckDigit_.Ptr(),
221 transmitStartStop_.Ptr()
224 return SmartBool(active);
227 virtual void WriteToHandle_(
bool active, HandleGuard<ReaderConfig>& guard)
override
229 Internal::DoResCall([&]()
231 return CVB_CALL_CAPI(CvcBcSetFourStateRoyalMail(
reinterpret_cast<std::intptr_t>(guard.Handle()),
235 static_cast<short>(orientation_),
248 : ReaderFourStateConfigBase()
Configuration to access parameters of ReaderFourStateConfigBase.
Definition: reader_four_state_config_base.hpp:20
Configuration to access parameters of FourStateRoyalMail (4-State RoyalMail Postal Code).
Definition: four_state_royal_mail.hpp:18
void SetMinDigits(int minDigits)
Sets the minimum number of the 4-State Royal Mail code words.
Definition: four_state_royal_mail.hpp:98
bool EvaluateCheckDigit() const
Returns whether to evaluate/ignore check digit.
Definition: four_state_royal_mail.hpp:39
CodeOrientation Orientation() const
Returns the direction of the 4-State Royal Mail in the picture.
Definition: four_state_royal_mail.hpp:166
int MaxDigits() const
Returns the maximum number of the 4-State Royal Mail code words.
Definition: four_state_royal_mail.hpp:142
int MinDigits() const
Returns the minimum number of the 4-State Royal Mail code words.
Definition: four_state_royal_mail.hpp:114
bool TransmitStartStop() const
Returns whether to transmit start and stop digits with data.
Definition: four_state_royal_mail.hpp:86
void SetTransmitCheckDigit(bool transmitCheckDigit)
Sets whether to append check digit to data.
Definition: four_state_royal_mail.hpp:51
void SetOrientation(CodeOrientation orientation)
Sets the direction of the 4-State Royal Mail in the picture.
Definition: four_state_royal_mail.hpp:153
void SetTransmitStartStop(bool transmitStartStop)
Sets whether to transmit start and stop digits with data.
Definition: four_state_royal_mail.hpp:74
bool TransmitCheckDigit() const
Returns whether to append check digit to data.
Definition: four_state_royal_mail.hpp:63
void SetMaxDigits(int maxDigits)
Sets the maximum number of the 4-State Royal Mail code words.
Definition: four_state_royal_mail.hpp:126
void SetEvaluateCheckDigit(bool evalCheckDigit)
Sets whether to evaluate/ignore check digit.
Definition: four_state_royal_mail.hpp:27
static std::unique_ptr< FourStateRoyalMail > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: four_state_royal_mail.hpp:198
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
@ FourStateRoyalMail
Four State Royal Mail Barcode.
CodeOrientation
Directions that a four state code may have.
Definition: barcode.hpp:190
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24