mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-23 11:57:58 +02:00
new folder structure
This commit is contained in:
37
core/include/aare/Frame.hpp
Normal file
37
core/include/aare/Frame.hpp
Normal file
@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <sys/types.h>
|
||||
#include <cstdint>
|
||||
#include <bits/unique_ptr.h>
|
||||
#include <vector>
|
||||
#include "aare/defs.hpp"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Frame class to represent a single frame of data
|
||||
* model class
|
||||
* should be able to work with streams coming from files or network
|
||||
*/
|
||||
|
||||
|
||||
template <class DataType> class Frame{
|
||||
|
||||
public:
|
||||
ssize_t rows;
|
||||
ssize_t cols;
|
||||
DataType* data;
|
||||
ssize_t bitdepth = sizeof(DataType)*8;
|
||||
|
||||
Frame(std::byte* fp, ssize_t rows, ssize_t cols);
|
||||
DataType get(int row, int col);
|
||||
|
||||
~Frame(){
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
typedef Frame<uint16_t> Frame16;
|
||||
typedef Frame<uint8_t> Frame8;
|
||||
typedef Frame<uint32_t> Frame32;
|
58
core/include/aare/defs.hpp
Normal file
58
core/include/aare/defs.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <sys/types.h>
|
||||
#include <string_view>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <fmt/format.h>
|
||||
#include <variant>
|
||||
|
||||
typedef struct {
|
||||
uint64_t frameNumber;
|
||||
uint32_t expLength;
|
||||
uint32_t packetNumber;
|
||||
uint64_t bunchId;
|
||||
uint64_t timestamp;
|
||||
uint16_t modId;
|
||||
uint16_t row;
|
||||
uint16_t column;
|
||||
uint16_t reserved;
|
||||
uint32_t debug;
|
||||
uint16_t roundRNumber;
|
||||
uint8_t detType;
|
||||
uint8_t version;
|
||||
uint8_t packetMask[64];
|
||||
}__attribute__((packed)) sls_detector_header;
|
||||
|
||||
struct xy {
|
||||
int row;
|
||||
int col;
|
||||
};
|
||||
|
||||
// using image_shape = std::array<ssize_t, 2>;
|
||||
using dynamic_shape = std::vector<ssize_t>;
|
||||
|
||||
enum class DetectorType { Jungfrau, Eiger, Mythen3, Moench };
|
||||
|
||||
enum class TimingMode {Auto, Trigger};
|
||||
|
||||
template<class T>
|
||||
T StringTo(std::string sv){
|
||||
return T(sv);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
std::string toString(T sv){
|
||||
return T(sv);
|
||||
}
|
||||
|
||||
template <> DetectorType StringTo(std::string);
|
||||
template <> std::string toString(DetectorType type);
|
||||
|
||||
|
||||
template <> TimingMode StringTo(std::string);
|
||||
|
||||
using DataTypeVariants = std::variant<uint16_t, uint32_t>;
|
||||
|
Reference in New Issue
Block a user