mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00

* separating pattern levels from command name: command line done * separated patten level from command in examples and default pattern files in servers * command line and server works * python: patnloop not verified, wip * works except for patloop (set, and get does not list properly) * minor * fixed tests * added 3 more levels for ctb and moench * wip * minor err msg * minor * binaries in * separating pattern levels from command name: command line done * separated patten level from command in examples and default pattern files in servers * command line and server works * python: patnloop not verified, wip * works except for patloop (set, and get does not list properly) * minor * fixed tests * added 3 more levels for ctb and moench * wip * minor err msg * minor * binaries in * python working * import fix * changed fw version for ctb and moench. binaries in Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
// SPDX-License-Identifier: LGPL-3.0-or-other
|
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
#pragma once
|
|
#include "sls/sls_detector_defs.h"
|
|
|
|
#ifdef __cplusplus
|
|
#include <memory>
|
|
namespace sls {
|
|
#endif
|
|
|
|
// Common C/C++ structure to handle pattern data
|
|
typedef struct __attribute__((packed)) {
|
|
uint64_t word[MAX_PATTERN_LENGTH];
|
|
uint64_t ioctrl;
|
|
uint32_t limits[2];
|
|
uint32_t startloop[MAX_PATTERN_LEVELS];
|
|
uint32_t stoploop[MAX_PATTERN_LEVELS];
|
|
uint32_t nloop[MAX_PATTERN_LEVELS];
|
|
uint32_t wait[MAX_PATTERN_LEVELS];
|
|
uint64_t waittime[MAX_PATTERN_LEVELS];
|
|
} patternParameters;
|
|
|
|
#ifdef __cplusplus
|
|
class Pattern {
|
|
patternParameters *pat = new patternParameters{};
|
|
|
|
public:
|
|
Pattern();
|
|
~Pattern();
|
|
Pattern(const Pattern &other);
|
|
bool operator==(const Pattern &other) const;
|
|
bool operator!=(const Pattern &other) const;
|
|
patternParameters *data();
|
|
patternParameters *data() const;
|
|
size_t size() const noexcept { return sizeof(patternParameters); }
|
|
void validate() const;
|
|
void load(const std::string &fname);
|
|
void save(const std::string &fname);
|
|
std::string str() const;
|
|
};
|
|
|
|
} // namespace sls
|
|
#endif
|