Introduced pattern class

This commit is contained in:
Erik Frojdh
2020-11-27 10:03:15 +01:00
parent 8ca1d9c50c
commit d9b2a90651
22 changed files with 384 additions and 118 deletions

View File

@ -44,9 +44,9 @@ std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
std::string ToString(const slsDetectorDefs::rxParameters &r);
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::rxParameters &r);
std::string ToString(const slsDetectorDefs::patternParameters &r);
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::patternParameters &r);
// std::string ToString(const slsDetectorDefs::patternParameters &r);
// std::ostream &operator<<(std::ostream &os,
// const slsDetectorDefs::patternParameters &r);
std::string ToString(const slsDetectorDefs::scanParameters &r);
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::scanParameters &r);

View File

@ -475,34 +475,34 @@ typedef struct {
} __attribute__((packed));
#endif
/** pattern structure */
#ifdef __cplusplus
struct patternParameters {
#else
typedef struct __attribute__((packed)) {
#endif
uint64_t word[MAX_PATTERN_LENGTH];
uint64_t ioctrl;
uint32_t limits[2];
// loop0 start, loop0 stop .. loop2 start, loop2 stop
uint32_t loop[6];
uint32_t nloop[3];
uint32_t wait[3];
uint64_t waittime[3];
#ifdef __cplusplus
public:
patternParameters() {
// Since the def has to be c compatible we can't use {} for the
// members
memset(this, 0, sizeof(patternParameters));
}
void load(const std::string &fname);
void save(const std::string &fname);
void validate() const;
} __attribute__((packed));
#else
} patternParameters;
#endif
// /** pattern structure */
// #ifdef __cplusplus
// struct patternParameters {
// #else
// typedef struct __attribute__((packed)) {
// #endif
// uint64_t word[MAX_PATTERN_LENGTH];
// uint64_t ioctrl;
// uint32_t limits[2];
// // loop0 start, loop0 stop .. loop2 start, loop2 stop
// uint32_t loop[6];
// uint32_t nloop[3];
// uint32_t wait[3];
// uint64_t waittime[3];
// #ifdef __cplusplus
// public:
// patternParameters() {
// // Since the def has to be c compatible we can't use {} for the
// // members
// memset(this, 0, sizeof(patternParameters));
// }
// void load(const std::string &fname);
// void save(const std::string &fname);
// void validate() const;
// } __attribute__((packed));
// #else
// } patternParameters;
// #endif
#ifdef __cplusplus
protected: