mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
clang-tidy modernize
This commit is contained in:
@ -53,7 +53,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
* Destructor
|
* Destructor
|
||||||
* Calls Base Class DestroyThread() and decrements NumberofDataProcessors
|
* Calls Base Class DestroyThread() and decrements NumberofDataProcessors
|
||||||
*/
|
*/
|
||||||
~DataProcessor();
|
~DataProcessor() override;
|
||||||
|
|
||||||
|
|
||||||
//*** getters ***
|
//*** getters ***
|
||||||
@ -61,7 +61,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
* Returns if the thread is currently running
|
* Returns if the thread is currently running
|
||||||
* @returns true if thread is running, else false
|
* @returns true if thread is running, else false
|
||||||
*/
|
*/
|
||||||
bool IsRunning();
|
bool IsRunning() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get acquisition started flag
|
* Get acquisition started flag
|
||||||
@ -170,7 +170,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
void SetupFileWriter(bool fwe, int* nd, uint32_t* maxf, char* fname,
|
void SetupFileWriter(bool fwe, int* nd, uint32_t* maxf, char* fname,
|
||||||
char* fpath, uint64_t* findex,
|
char* fpath, uint64_t* findex,
|
||||||
bool* owenable, int* dindex, int* nunits, uint64_t* nf, uint32_t* dr,
|
bool* owenable, int* dindex, int* nunits, uint64_t* nf, uint32_t* dr,
|
||||||
uint32_t* portno, GeneralData* g = 0);
|
uint32_t* portno, GeneralData* g = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create New File
|
* Create New File
|
||||||
@ -231,7 +231,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
* Get Type
|
* Get Type
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
std::string GetType();
|
std::string GetType() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record First Indices (firstAcquisitionIndex, firstMeasurementIndex)
|
* Record First Indices (firstAcquisitionIndex, firstMeasurementIndex)
|
||||||
@ -250,7 +250,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
* Pop bound addresses, process them,
|
* Pop bound addresses, process them,
|
||||||
* write to file if needed & free the address
|
* write to file if needed & free the address
|
||||||
*/
|
*/
|
||||||
void ThreadExecution();
|
void ThreadExecution() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees dummy buffer,
|
* Frees dummy buffer,
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
#include "DataStreamer.h"
|
#include "DataStreamer.h"
|
||||||
#include "sls_detector_exceptions.h"
|
#include "sls_detector_exceptions.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <cerrno>
|
||||||
#include <errno.h>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
const std::string DataProcessor::TypeName = "DataProcessor";
|
const std::string DataProcessor::TypeName = "DataProcessor";
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo* f,
|
|||||||
std::vector <int> * cdl, int* cdo, int* cad) :
|
std::vector <int> * cdl, int* cdo, int* cad) :
|
||||||
|
|
||||||
ThreadObject(ind),
|
ThreadObject(ind),
|
||||||
runningFlag(0),
|
runningFlag(false),
|
||||||
generalData(nullptr),
|
generalData(nullptr),
|
||||||
fifo(f),
|
fifo(f),
|
||||||
myDetectorType(dtype),
|
myDetectorType(dtype),
|
||||||
@ -281,7 +281,7 @@ void DataProcessor::ThreadExecution() {
|
|||||||
"pop 0x" << std::hex << (void*)(buffer) << std::dec << ":" << buffer;
|
"pop 0x" << std::hex << (void*)(buffer) << std::dec << ":" << buffer;
|
||||||
|
|
||||||
//check dummy
|
//check dummy
|
||||||
uint32_t numBytes = (uint32_t)(*((uint32_t*)buffer));
|
auto numBytes = (uint32_t)(*((uint32_t*)buffer));
|
||||||
FILE_LOG(logDEBUG1) << "DataProcessor " << index << ", Numbytes:" << numBytes;
|
FILE_LOG(logDEBUG1) << "DataProcessor " << index << ", Numbytes:" << numBytes;
|
||||||
if (numBytes == DUMMY_PACKET_VALUE) {
|
if (numBytes == DUMMY_PACKET_VALUE) {
|
||||||
StopProcessing(buffer);
|
StopProcessing(buffer);
|
||||||
@ -316,7 +316,7 @@ void DataProcessor::StopProcessing(char* buf) {
|
|||||||
|
|
||||||
void DataProcessor::ProcessAnImage(char* buf) {
|
void DataProcessor::ProcessAnImage(char* buf) {
|
||||||
|
|
||||||
sls_receiver_header* rheader = (sls_receiver_header*) (buf + FIFO_HEADER_NUMBYTES);
|
auto* rheader = (sls_receiver_header*) (buf + FIFO_HEADER_NUMBYTES);
|
||||||
sls_detector_header header = rheader->detHeader;
|
sls_detector_header header = rheader->detHeader;
|
||||||
uint64_t fnum = header.frameNumber;
|
uint64_t fnum = header.frameNumber;
|
||||||
currentFrameIndex = fnum;
|
currentFrameIndex = fnum;
|
||||||
@ -371,7 +371,7 @@ void DataProcessor::ProcessAnImage(char* buf) {
|
|||||||
|
|
||||||
// call back with modified size
|
// call back with modified size
|
||||||
else if (rawDataModifyReadyCallBack) {
|
else if (rawDataModifyReadyCallBack) {
|
||||||
uint32_t revsize = (uint32_t)(*((uint32_t*)buf));
|
auto revsize = (uint32_t)(*((uint32_t*)buf));
|
||||||
rawDataModifyReadyCallBack(
|
rawDataModifyReadyCallBack(
|
||||||
(char*)rheader,
|
(char*)rheader,
|
||||||
buf + FIFO_HEADER_NUMBYTES + sizeof(sls_receiver_header),
|
buf + FIFO_HEADER_NUMBYTES + sizeof(sls_receiver_header),
|
||||||
@ -456,7 +456,7 @@ void DataProcessor::PadMissingPackets(char* buf) {
|
|||||||
FILE_LOG(logDEBUG) << index << ": Padding Missing Packets";
|
FILE_LOG(logDEBUG) << index << ": Padding Missing Packets";
|
||||||
|
|
||||||
uint32_t pperFrame = generalData->packetsPerFrame;
|
uint32_t pperFrame = generalData->packetsPerFrame;
|
||||||
sls_receiver_header* header = (sls_receiver_header*) (buf + FIFO_HEADER_NUMBYTES);
|
auto* header = (sls_receiver_header*) (buf + FIFO_HEADER_NUMBYTES);
|
||||||
uint32_t nmissing = pperFrame - header->detHeader.packetNumber;
|
uint32_t nmissing = pperFrame - header->detHeader.packetNumber;
|
||||||
sls_bitset pmask = header->packetsMask;
|
sls_bitset pmask = header->packetsMask;
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ void DataProcessor::RearrangeDbitData(char* buf) {
|
|||||||
memset(result, 0, numResult32Bits * sizeof(uint32_t));
|
memset(result, 0, numResult32Bits * sizeof(uint32_t));
|
||||||
|
|
||||||
uint32_t* dest = result;
|
uint32_t* dest = result;
|
||||||
uint64_t* source = (uint64_t*)(buf + digOffset + (*ctbDbitOffset));
|
auto* source = (uint64_t*)(buf + digOffset + (*ctbDbitOffset));
|
||||||
|
|
||||||
// loop through digital bit enable vector
|
// loop through digital bit enable vector
|
||||||
int bitoffset = 0;
|
int bitoffset = 0;
|
||||||
|
Reference in New Issue
Block a user