mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-08 06:58:40 +01:00
Rx: refactor memory structure and listener (#496)
* gui message doesnt show if it has a '>' symbol in error msg * minor refactoring for readability (size_t calc fifo size) * refactoring listening udp socket code: activated and datastream dont create udp sockets anyway, rc<=- should be discarded in any case * wip * refactoring memory structure access * wip: bugfix write header + data to binary * wip * wip * wip * wip * wip * wip * wip * wip * wip * portRoi no roi effecto on progress * fail at receiver progress, wip * segfaults for char pointer in struct * reference to header to get header and data * refactoring * use const defined for size of header of fifo * updated release notes * refactoring from review: fwrite, static_cast
This commit is contained in:
@@ -29,11 +29,11 @@ struct MasterAttributes;
|
||||
class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
|
||||
public:
|
||||
DataProcessor(int index, detectorType detectorType, Fifo *fifo,
|
||||
bool *dataStreamEnable, uint32_t *streamingFrequency,
|
||||
uint32_t *streamingTimerInMs, uint32_t *streamingStartFnum,
|
||||
bool *framePadding, std::vector<int> *ctbDbitList,
|
||||
int *ctbDbitOffset, int *ctbAnalogDataBytes);
|
||||
DataProcessor(int index, detectorType dType, Fifo *f,
|
||||
bool *dse, uint32_t *sf,
|
||||
uint32_t *st, uint32_t *sfnum,
|
||||
bool *fp, std::vector<int> *ctblist,
|
||||
int *ctboff, int *ctbad);
|
||||
|
||||
~DataProcessor() override;
|
||||
|
||||
@@ -114,7 +114,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
* Process an image popped from fifo,
|
||||
* write to file if fw enabled & update parameters
|
||||
*/
|
||||
void ProcessAnImage(char *buf);
|
||||
void ProcessAnImage(sls_receiver_header & header, size_t &size, size_t &firstImageIndex, char* data);
|
||||
|
||||
/**
|
||||
* Calls CheckTimer and CheckCount for streaming frequency and timer
|
||||
@@ -137,52 +137,52 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
*/
|
||||
bool CheckCount();
|
||||
|
||||
void PadMissingPackets(char *buf);
|
||||
void PadMissingPackets(sls_receiver_header header, char* data);
|
||||
|
||||
/**
|
||||
* Align corresponding digital bits together (CTB only if ctbDbitlist is not
|
||||
* empty)
|
||||
*/
|
||||
void RearrangeDbitData(char *buf);
|
||||
void RearrangeDbitData(size_t & size, char *data);
|
||||
|
||||
void CropImage(char *buf);
|
||||
void CropImage(size_t & size, char *data);
|
||||
|
||||
static const std::string typeName_;
|
||||
static const std::string typeName;
|
||||
|
||||
const GeneralData *generalData_{nullptr};
|
||||
Fifo *fifo_;
|
||||
detectorType detectorType_;
|
||||
bool *dataStreamEnable_;
|
||||
bool activated_{false};
|
||||
ROI receiverRoi_{};
|
||||
bool receiverRoiEnabled_{false};
|
||||
bool receiverNoRoi_{false};
|
||||
const GeneralData *generalData{nullptr};
|
||||
Fifo *fifo;
|
||||
detectorType detType;
|
||||
bool *dataStreamEnable;
|
||||
bool activated{false};
|
||||
ROI receiverRoi{};
|
||||
bool receiverRoiEnabled{false};
|
||||
bool receiverNoRoi{false};
|
||||
std::unique_ptr<char[]> completeImageToStreamBeforeCropping;
|
||||
/** if 0, sending random images with a timer */
|
||||
uint32_t *streamingFrequency_;
|
||||
uint32_t *streamingTimerInMs_;
|
||||
uint32_t *streamingStartFnum_;
|
||||
uint32_t currentFreqCount_{0};
|
||||
struct timespec timerbegin_ {};
|
||||
bool *framePadding_;
|
||||
std::vector<int> *ctbDbitList_;
|
||||
int *ctbDbitOffset_;
|
||||
int *ctbAnalogDataBytes_;
|
||||
std::atomic<bool> startedFlag_{false};
|
||||
std::atomic<uint64_t> firstIndex_{0};
|
||||
uint32_t *streamingFrequency;
|
||||
uint32_t *streamingTimerInMs;
|
||||
uint32_t *streamingStartFnum;
|
||||
uint32_t currentFreqCount{0};
|
||||
struct timespec timerbegin {};
|
||||
bool *framePadding;
|
||||
std::vector<int> *ctbDbitList;
|
||||
int *ctbDbitOffset;
|
||||
int *ctbAnalogDataBytes;
|
||||
std::atomic<bool> startedFlag{false};
|
||||
std::atomic<uint64_t> firstIndex{0};
|
||||
|
||||
// for statistics
|
||||
uint64_t numFramesCaught_{0};
|
||||
uint64_t numFramesCaught{0};
|
||||
|
||||
/** Frame Number of latest processed frame number */
|
||||
std::atomic<uint64_t> currentFrameIndex_{0};
|
||||
std::atomic<uint64_t> currentFrameIndex{0};
|
||||
|
||||
/** first streamer frame to add frame index in fifo header */
|
||||
bool firstStreamerFrame_{false};
|
||||
bool firstStreamerFrame{false};
|
||||
|
||||
bool streamCurrentFrame_{false};
|
||||
bool streamCurrentFrame{false};
|
||||
|
||||
File *dataFile_{nullptr};
|
||||
File *dataFile{nullptr};
|
||||
|
||||
// call back
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user