mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-05 17:40:40 +02:00
format
This commit is contained in:
parent
492b4815a6
commit
007330caa7
@ -106,7 +106,6 @@ static PyObject *decode(PyObject *Py_UNUSED(self), PyObject *args,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (n_threads == 1) {
|
||||
pm_decode(src, dst, pm, n_frames, n_rows * n_cols);
|
||||
} else {
|
||||
@ -120,7 +119,8 @@ static PyObject *decode(PyObject *Py_UNUSED(self), PyObject *args,
|
||||
arguments[i].src = src + (i * frames_per_thread * pm_size);
|
||||
arguments[i].dst = dst + (i * frames_per_thread * pm_size);
|
||||
arguments[i].pm = pm;
|
||||
arguments[i].n_frames = frames_per_thread; // TODO! not matching frames.
|
||||
arguments[i].n_frames =
|
||||
frames_per_thread; // TODO! not matching frames.
|
||||
arguments[i].n_pixels = n_rows * n_cols;
|
||||
assigned_frames += frames_per_thread;
|
||||
}
|
||||
@ -137,8 +137,6 @@ static PyObject *decode(PyObject *Py_UNUSED(self), PyObject *args,
|
||||
free(arguments);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Py_DECREF(raw_data);
|
||||
Py_DECREF(pixel_map);
|
||||
|
||||
|
@ -7,7 +7,8 @@ void thread_pmdecode(void* args){
|
||||
pm_decode(a->src, a->dst, a->pm, a->n_frames, a->n_pixels);
|
||||
}
|
||||
|
||||
void pm_decode(uint16_t* src, uint16_t* dst, uint32_t* pm, size_t n_frames, size_t n_pixels){
|
||||
void pm_decode(uint16_t *src, uint16_t *dst, uint32_t *pm, size_t n_frames,
|
||||
size_t n_pixels) {
|
||||
for (size_t i = 0; i < n_frames; i++) {
|
||||
for (size_t j = 0; j < n_pixels; j++) {
|
||||
*dst++ = src[pm[j]];
|
||||
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
// Wrapper to be used with pthreads
|
||||
void thread_pmdecode(void *args);
|
||||
|
||||
|
||||
void pm_decode(uint16_t* src, uint16_t* dst, uint32_t* pm, size_t n_frames, size_t n_pixels);
|
||||
void pm_decode(uint16_t *src, uint16_t *dst, uint32_t *pm, size_t n_frames,
|
||||
size_t n_pixels);
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
typedef struct {
|
||||
uint16_t *src;
|
||||
uint16_t *dst;
|
||||
|
@ -206,13 +206,11 @@ int createSymbolicLinksForDevices(int adcDeviceIndex, int dacDeviceIndex,
|
||||
// delete andcreate iio device links folder (deleting because cannot
|
||||
// overwrite symbolic links with -sf)
|
||||
if (deleteAbsoluteDirectory(mess, IIO_DEVICE_FOLDER,
|
||||
"create sym links for device trees") ==
|
||||
FAIL) {
|
||||
"create sym links for device trees") == FAIL) {
|
||||
return FAIL;
|
||||
}
|
||||
if (createAbsoluteDirectory(mess, IIO_DEVICE_FOLDER,
|
||||
"create sym links for device trees") ==
|
||||
FAIL) {
|
||||
"create sym links for device trees") == FAIL) {
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@ -243,8 +241,7 @@ int createSymbolicLinksForDevices(int adcDeviceIndex, int dacDeviceIndex,
|
||||
memset(retvals, 0, MAX_STR_LENGTH);
|
||||
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not create sym link [dac%d] (%s)\n", idac,
|
||||
retvals);
|
||||
"Could not create sym link [dac%d] (%s)\n", idac, retvals);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
|
@ -8470,7 +8470,8 @@ int start_readout(int file_des) {
|
||||
#else
|
||||
if (Server_VerifyLock() == OK) {
|
||||
enum runStatus s = getRunStatus();
|
||||
if ((s == RUNNING || s == WAITING) && (myDetectorType != XILINX_CHIPTESTBOARD)) {
|
||||
if ((s == RUNNING || s == WAITING) &&
|
||||
(myDetectorType != XILINX_CHIPTESTBOARD)) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not start readout because the detector is "
|
||||
"already running!\n");
|
||||
|
@ -567,7 +567,8 @@ int powerChip(int on, char *mess) {
|
||||
LOG(logERROR, (mess));
|
||||
|
||||
// to be removed when fixed later
|
||||
LOG(logWARNING, ("Bypassing this error for now. To be fixed later...\n"));
|
||||
LOG(logWARNING,
|
||||
("Bypassing this error for now. To be fixed later...\n"));
|
||||
return OK;
|
||||
|
||||
return FAIL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user