mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-04 09:00:41 +02:00
merged detFuncs for c and c++
This commit is contained in:
parent
ea7cc9db8c
commit
2c83abcac7
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "clogger.h"
|
||||
#include "sls_detector_defs.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
|
||||
enum numberMode { DEC, HEX };
|
||||
#define GOODBYE (-200)
|
||||
@ -11,7 +12,6 @@ int printSocketReadError();
|
||||
void init_detector();
|
||||
int decode_function(int);
|
||||
const char *getRetName();
|
||||
const char *getFunctionName(enum detFuncs func);
|
||||
void function_table();
|
||||
void functionNotImplemented();
|
||||
void modeNotImplemented(char *modename, int mode);
|
||||
|
@ -76,7 +76,7 @@ int decode_function(int file_des) {
|
||||
if (n <= 0) {
|
||||
LOG(logDEBUG3,
|
||||
("ERROR reading from socket n=%d, fnum=%d, file_des=%d, fname=%s\n",
|
||||
n, fnum, file_des, getFunctionName((enum detFuncs)fnum)));
|
||||
n, fnum, file_des, getFunctionNameFromEnum((enum detFuncs)fnum)));
|
||||
return FAIL;
|
||||
} else
|
||||
LOG(logDEBUG3, ("Received %d bytes\n", n));
|
||||
@ -86,16 +86,16 @@ int decode_function(int file_des) {
|
||||
ret = (M_nofunc)(file_des);
|
||||
} else {
|
||||
LOG(logDEBUG1, (" calling function fnum=%d, (%s)\n", fnum,
|
||||
getFunctionName((enum detFuncs)fnum)));
|
||||
getFunctionNameFromEnum((enum detFuncs)fnum)));
|
||||
ret = (*flist[fnum])(file_des);
|
||||
|
||||
if (ret == FAIL) {
|
||||
LOG(logDEBUG1, ("Error executing the function = %d (%s)\n", fnum,
|
||||
getFunctionName((enum detFuncs)fnum)));
|
||||
getFunctionNameFromEnum((enum detFuncs)fnum)));
|
||||
} else
|
||||
LOG(logDEBUG1,
|
||||
("Function (%s) executed %s\n",
|
||||
getFunctionName((enum detFuncs)fnum), getRetName()));
|
||||
getFunctionNameFromEnum((enum detFuncs)fnum), getRetName()));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -136,389 +136,6 @@ const char *getRunStateName(enum runStatus ind) {
|
||||
}
|
||||
}
|
||||
|
||||
const char *getFunctionName(enum detFuncs func) {
|
||||
switch (func) {
|
||||
case F_EXEC_COMMAND:
|
||||
return "F_EXEC_COMMAND";
|
||||
case F_GET_DETECTOR_TYPE:
|
||||
return "F_GET_DETECTOR_TYPE";
|
||||
case F_SET_EXTERNAL_SIGNAL_FLAG:
|
||||
return "F_SET_EXTERNAL_SIGNAL_FLAG";
|
||||
case F_SET_TIMING_MODE:
|
||||
return "F_SET_TIMING_MODE";
|
||||
case F_GET_FIRMWARE_VERSION:
|
||||
return "F_GET_FIRMWARE_VERSION";
|
||||
case F_GET_SERVER_VERSION:
|
||||
return "F_GET_SERVER_VERSION";
|
||||
case F_GET_SERIAL_NUMBER:
|
||||
return "F_GET_SERIAL_NUMBER";
|
||||
case F_SET_FIRMWARE_TEST:
|
||||
return "F_SET_FIRMWARE_TEST";
|
||||
case F_SET_BUS_TEST:
|
||||
return "F_SET_BUS_TEST";
|
||||
case F_SET_IMAGE_TEST_MODE:
|
||||
return "F_SET_IMAGE_TEST_MODE";
|
||||
case F_GET_IMAGE_TEST_MODE:
|
||||
return "F_GET_IMAGE_TEST_MODE";
|
||||
case F_SET_DAC:
|
||||
return "F_SET_DAC";
|
||||
case F_GET_ADC:
|
||||
return "F_GET_ADC";
|
||||
case F_WRITE_REGISTER:
|
||||
return "F_WRITE_REGISTER";
|
||||
case F_READ_REGISTER:
|
||||
return "F_READ_REGISTER";
|
||||
case F_SET_MODULE:
|
||||
return "F_SET_MODULE";
|
||||
case F_GET_MODULE:
|
||||
return "F_GET_MODULE";
|
||||
case F_SET_SETTINGS:
|
||||
return "F_SET_SETTINGS";
|
||||
case F_GET_THRESHOLD_ENERGY:
|
||||
return "F_GET_THRESHOLD_ENERGY";
|
||||
case F_START_ACQUISITION:
|
||||
return "F_START_ACQUISITION";
|
||||
case F_STOP_ACQUISITION:
|
||||
return "F_STOP_ACQUISITION";
|
||||
case F_START_READOUT:
|
||||
return "F_START_READOUT";
|
||||
case F_GET_RUN_STATUS:
|
||||
return "F_GET_RUN_STATUS";
|
||||
case F_START_AND_READ_ALL:
|
||||
return "F_START_AND_READ_ALL";
|
||||
case F_READ_ALL:
|
||||
return "F_READ_ALL";
|
||||
case F_GET_NUM_FRAMES:
|
||||
return "F_GET_NUM_FRAMES";
|
||||
case F_SET_NUM_FRAMES:
|
||||
return "F_SET_NUM_FRAMES";
|
||||
case F_GET_NUM_TRIGGERS:
|
||||
return "F_GET_NUM_TRIGGERS";
|
||||
case F_SET_NUM_TRIGGERS:
|
||||
return "F_SET_NUM_TRIGGERS";
|
||||
case F_GET_NUM_ADDITIONAL_STORAGE_CELLS:
|
||||
return "F_GET_NUM_ADDITIONAL_STORAGE_CELLS";
|
||||
case F_SET_NUM_ADDITIONAL_STORAGE_CELLS:
|
||||
return "F_SET_NUM_ADDITIONAL_STORAGE_CELLS";
|
||||
case F_GET_NUM_ANALOG_SAMPLES:
|
||||
return "F_GET_NUM_ANALOG_SAMPLES";
|
||||
case F_SET_NUM_ANALOG_SAMPLES:
|
||||
return "F_SET_NUM_ANALOG_SAMPLES";
|
||||
case F_GET_NUM_DIGITAL_SAMPLES:
|
||||
return "F_GET_NUM_DIGITAL_SAMPLES";
|
||||
case F_SET_NUM_DIGITAL_SAMPLES:
|
||||
return "F_SET_NUM_DIGITAL_SAMPLES";
|
||||
case F_GET_EXPTIME:
|
||||
return "F_GET_EXPTIME";
|
||||
case F_SET_EXPTIME:
|
||||
return "F_SET_EXPTIME";
|
||||
case F_GET_PERIOD:
|
||||
return "F_GET_PERIOD";
|
||||
case F_SET_PERIOD:
|
||||
return "F_SET_PERIOD";
|
||||
case F_GET_DELAY_AFTER_TRIGGER:
|
||||
return "F_GET_DELAY_AFTER_TRIGGER";
|
||||
case F_SET_DELAY_AFTER_TRIGGER:
|
||||
return "F_SET_DELAY_AFTER_TRIGGER";
|
||||
case F_GET_SUB_EXPTIME:
|
||||
return "F_GET_SUB_EXPTIME";
|
||||
case F_SET_SUB_EXPTIME:
|
||||
return "F_SET_SUB_EXPTIME";
|
||||
case F_GET_SUB_DEADTIME:
|
||||
return "F_GET_SUB_DEADTIME";
|
||||
case F_SET_SUB_DEADTIME:
|
||||
return "F_SET_SUB_DEADTIME";
|
||||
case F_GET_STORAGE_CELL_DELAY:
|
||||
return "F_GET_STORAGE_CELL_DELAY";
|
||||
case F_SET_STORAGE_CELL_DELAY:
|
||||
return "F_SET_STORAGE_CELL_DELAY";
|
||||
case F_GET_FRAMES_LEFT:
|
||||
return "F_GET_FRAMES_LEFT";
|
||||
case F_GET_TRIGGERS_LEFT:
|
||||
return "F_GET_TRIGGERS_LEFT";
|
||||
case F_GET_EXPTIME_LEFT:
|
||||
return "F_GET_EXPTIME_LEFT";
|
||||
case F_GET_PERIOD_LEFT:
|
||||
return "F_GET_PERIOD_LEFT";
|
||||
case F_GET_DELAY_AFTER_TRIGGER_LEFT:
|
||||
return "F_GET_DELAY_AFTER_TRIGGER_LEFT";
|
||||
case F_GET_MEASURED_PERIOD:
|
||||
return "F_GET_MEASURED_PERIOD";
|
||||
case F_GET_MEASURED_SUBPERIOD:
|
||||
return "F_GET_MEASURED_SUBPERIOD";
|
||||
case F_GET_FRAMES_FROM_START:
|
||||
return "F_GET_FRAMES_FROM_START";
|
||||
case F_GET_ACTUAL_TIME:
|
||||
return "F_GET_ACTUAL_TIME";
|
||||
case F_GET_MEASUREMENT_TIME:
|
||||
return "F_GET_MEASUREMENT_TIME";
|
||||
case F_SET_DYNAMIC_RANGE:
|
||||
return "F_SET_DYNAMIC_RANGE";
|
||||
case F_SET_ROI:
|
||||
return "F_SET_ROI";
|
||||
case F_GET_ROI:
|
||||
return "F_GET_ROI";
|
||||
case F_EXIT_SERVER:
|
||||
return "F_EXIT_SERVER";
|
||||
case F_LOCK_SERVER:
|
||||
return "F_LOCK_SERVER";
|
||||
case F_GET_LAST_CLIENT_IP:
|
||||
return "F_GET_LAST_CLIENT_IP";
|
||||
case F_SET_PORT:
|
||||
return "F_SET_PORT";
|
||||
case F_ENABLE_TEN_GIGA:
|
||||
return "F_ENABLE_TEN_GIGA";
|
||||
case F_SET_ALL_TRIMBITS:
|
||||
return "F_SET_ALL_TRIMBITS";
|
||||
case F_SET_PATTERN_IO_CONTROL:
|
||||
return "F_SET_PATTERN_IO_CONTROL";
|
||||
case F_SET_PATTERN_CLOCK_CONTROL:
|
||||
return "F_SET_PATTERN_CLOCK_CONTROL";
|
||||
case F_SET_PATTERN_WORD:
|
||||
return "F_SET_PATTERN_WORD";
|
||||
case F_SET_PATTERN_LOOP_ADDRESSES:
|
||||
return "F_SET_PATTERN_LOOP_ADDRESSES";
|
||||
case F_SET_PATTERN_LOOP_CYCLES:
|
||||
return "F_SET_PATTERN_LOOP_CYCLES";
|
||||
case F_SET_PATTERN_WAIT_ADDR:
|
||||
return "F_SET_PATTERN_WAIT_ADDR";
|
||||
case F_SET_PATTERN_WAIT_TIME:
|
||||
return "F_SET_PATTERN_WAIT_TIME";
|
||||
case F_SET_PATTERN_MASK:
|
||||
return "F_SET_PATTERN_MASK";
|
||||
case F_GET_PATTERN_MASK:
|
||||
return "F_GET_PATTERN_MASK";
|
||||
case F_SET_PATTERN_BIT_MASK:
|
||||
return "F_SET_PATTERN_BIT_MASK";
|
||||
case F_GET_PATTERN_BIT_MASK:
|
||||
return "F_GET_PATTERN_BIT_MASK";
|
||||
case F_WRITE_ADC_REG:
|
||||
return "F_WRITE_ADC_REG";
|
||||
case F_SET_COUNTER_BIT:
|
||||
return "F_SET_COUNTER_BIT";
|
||||
case F_PULSE_PIXEL:
|
||||
return "F_PULSE_PIXEL";
|
||||
case F_PULSE_PIXEL_AND_MOVE:
|
||||
return "F_PULSE_PIXEL_AND_MOVE";
|
||||
case F_PULSE_CHIP:
|
||||
return "F_PULSE_CHIP";
|
||||
case F_SET_RATE_CORRECT:
|
||||
return "F_SET_RATE_CORRECT";
|
||||
case F_GET_RATE_CORRECT:
|
||||
return "F_GET_RATE_CORRECT";
|
||||
case F_SET_TEN_GIGA_FLOW_CONTROL:
|
||||
return "F_SET_TEN_GIGA_FLOW_CONTROL";
|
||||
case F_GET_TEN_GIGA_FLOW_CONTROL:
|
||||
return "F_GET_TEN_GIGA_FLOW_CONTROL";
|
||||
case F_SET_TRANSMISSION_DELAY_FRAME:
|
||||
return "F_SET_TRANSMISSION_DELAY_FRAME";
|
||||
case F_GET_TRANSMISSION_DELAY_FRAME:
|
||||
return "F_GET_TRANSMISSION_DELAY_FRAME";
|
||||
case F_SET_TRANSMISSION_DELAY_LEFT:
|
||||
return "F_SET_TRANSMISSION_DELAY_LEFT";
|
||||
case F_GET_TRANSMISSION_DELAY_LEFT:
|
||||
return "F_GET_TRANSMISSION_DELAY_LEFT";
|
||||
case F_SET_TRANSMISSION_DELAY_RIGHT:
|
||||
return "F_SET_TRANSMISSION_DELAY_RIGHT";
|
||||
case F_GET_TRANSMISSION_DELAY_RIGHT:
|
||||
return "F_GET_TRANSMISSION_DELAY_RIGHT";
|
||||
case F_PROGRAM_FPGA:
|
||||
return "F_PROGRAM_FPGA";
|
||||
case F_RESET_FPGA:
|
||||
return "F_RESET_FPGA";
|
||||
case F_POWER_CHIP:
|
||||
return "F_POWER_CHIP";
|
||||
case F_ACTIVATE:
|
||||
return "F_ACTIVATE";
|
||||
case F_PREPARE_ACQUISITION:
|
||||
return "F_PREPARE_ACQUISITION";
|
||||
case F_THRESHOLD_TEMP:
|
||||
return "F_THRESHOLD_TEMP";
|
||||
case F_TEMP_CONTROL:
|
||||
return "F_TEMP_CONTROL";
|
||||
case F_TEMP_EVENT:
|
||||
return "F_TEMP_EVENT";
|
||||
case F_AUTO_COMP_DISABLE:
|
||||
return "F_AUTO_COMP_DISABLE";
|
||||
case F_STORAGE_CELL_START:
|
||||
return "F_STORAGE_CELL_START";
|
||||
case F_CHECK_VERSION:
|
||||
return "F_CHECK_VERSION";
|
||||
case F_SOFTWARE_TRIGGER:
|
||||
return "F_SOFTWARE_TRIGGER";
|
||||
case F_LED:
|
||||
return "F_LED";
|
||||
case F_DIGITAL_IO_DELAY:
|
||||
return "F_DIGITAL_IO_DELAY";
|
||||
case F_COPY_DET_SERVER:
|
||||
return "F_COPY_DET_SERVER";
|
||||
case F_REBOOT_CONTROLLER:
|
||||
return "F_REBOOT_CONTROLLER";
|
||||
case F_SET_ADC_ENABLE_MASK:
|
||||
return "F_SET_ADC_ENABLE_MASK";
|
||||
case F_GET_ADC_ENABLE_MASK:
|
||||
return "F_GET_ADC_ENABLE_MASK";
|
||||
case F_SET_ADC_INVERT:
|
||||
return "F_SET_ADC_INVERT";
|
||||
case F_GET_ADC_INVERT:
|
||||
return "F_GET_ADC_INVERT";
|
||||
case F_EXTERNAL_SAMPLING_SOURCE:
|
||||
return "F_EXTERNAL_SAMPLING_SOURCE";
|
||||
case F_EXTERNAL_SAMPLING:
|
||||
return "F_EXTERNAL_SAMPLING";
|
||||
case F_SET_STARTING_FRAME_NUMBER:
|
||||
return "F_SET_STARTING_FRAME_NUMBER";
|
||||
case F_GET_STARTING_FRAME_NUMBER:
|
||||
return "F_GET_STARTING_FRAME_NUMBER";
|
||||
case F_SET_QUAD:
|
||||
return "F_SET_QUAD";
|
||||
case F_GET_QUAD:
|
||||
return "F_GET_QUAD";
|
||||
case F_SET_INTERRUPT_SUBFRAME:
|
||||
return "F_SET_INTERRUPT_SUBFRAME";
|
||||
case F_GET_INTERRUPT_SUBFRAME:
|
||||
return "F_GET_INTERRUPT_SUBFRAME";
|
||||
case F_SET_READ_N_LINES:
|
||||
return "F_SET_READ_N_LINES";
|
||||
case F_GET_READ_N_LINES:
|
||||
return "F_GET_READ_N_LINES";
|
||||
case F_SET_POSITION:
|
||||
return "F_SET_POSITION";
|
||||
case F_SET_SOURCE_UDP_MAC:
|
||||
return "F_SET_SOURCE_UDP_MAC";
|
||||
case F_GET_SOURCE_UDP_MAC:
|
||||
return "F_GET_SOURCE_UDP_MAC";
|
||||
case F_SET_SOURCE_UDP_MAC2:
|
||||
return "F_SET_SOURCE_UDP_MAC2";
|
||||
case F_GET_SOURCE_UDP_MAC2:
|
||||
return "F_GET_SOURCE_UDP_MAC2";
|
||||
case F_SET_SOURCE_UDP_IP:
|
||||
return "F_SET_SOURCE_UDP_IP";
|
||||
case F_GET_SOURCE_UDP_IP:
|
||||
return "F_GET_SOURCE_UDP_IP";
|
||||
case F_SET_SOURCE_UDP_IP2:
|
||||
return "F_SET_SOURCE_UDP_IP2";
|
||||
case F_GET_SOURCE_UDP_IP2:
|
||||
return "F_GET_SOURCE_UDP_IP2";
|
||||
case F_SET_DEST_UDP_MAC:
|
||||
return "F_SET_DEST_UDP_MAC";
|
||||
case F_GET_DEST_UDP_MAC:
|
||||
return "F_GET_DEST_UDP_MAC";
|
||||
case F_SET_DEST_UDP_MAC2:
|
||||
return "F_SET_DEST_UDP_MAC2";
|
||||
case F_GET_DEST_UDP_MAC2:
|
||||
return "F_GET_DEST_UDP_MAC2";
|
||||
case F_SET_DEST_UDP_IP:
|
||||
return "F_SET_DEST_UDP_IP";
|
||||
case F_GET_DEST_UDP_IP:
|
||||
return "F_GET_DEST_UDP_IP";
|
||||
case F_SET_DEST_UDP_IP2:
|
||||
return "F_SET_DEST_UDP_IP2";
|
||||
case F_GET_DEST_UDP_IP2:
|
||||
return "F_GET_DEST_UDP_IP2";
|
||||
case F_SET_DEST_UDP_PORT:
|
||||
return "F_SET_DEST_UDP_PORT";
|
||||
case F_GET_DEST_UDP_PORT:
|
||||
return "F_GET_DEST_UDP_PORT";
|
||||
case F_SET_DEST_UDP_PORT2:
|
||||
return "F_SET_DEST_UDP_PORT2";
|
||||
case F_GET_DEST_UDP_PORT2:
|
||||
return "F_GET_DEST_UDP_PORT2";
|
||||
case F_SET_NUM_INTERFACES:
|
||||
return "F_SET_NUM_INTERFACES";
|
||||
case F_GET_NUM_INTERFACES:
|
||||
return "F_GET_NUM_INTERFACES";
|
||||
case F_SET_INTERFACE_SEL:
|
||||
return "F_SET_INTERFACE_SEL";
|
||||
case F_GET_INTERFACE_SEL:
|
||||
return "F_GET_INTERFACE_SEL";
|
||||
case F_SET_PARALLEL_MODE:
|
||||
return "F_SET_PARALLEL_MODE";
|
||||
case F_GET_PARALLEL_MODE:
|
||||
return "F_GET_PARALLEL_MODE";
|
||||
case F_SET_OVERFLOW_MODE:
|
||||
return "F_SET_OVERFLOW_MODE";
|
||||
case F_GET_OVERFLOW_MODE:
|
||||
return "F_GET_OVERFLOW_MODE";
|
||||
case F_SET_STOREINRAM_MODE:
|
||||
return "F_SET_STOREINRAM_MODE";
|
||||
case F_GET_STOREINRAM_MODE:
|
||||
return "F_GET_STOREINRAM_MODE";
|
||||
case F_SET_READOUT_MODE:
|
||||
return "F_SET_READOUT_MODE";
|
||||
case F_GET_READOUT_MODE:
|
||||
return "F_GET_READOUT_MODE";
|
||||
case F_SET_CLOCK_FREQUENCY:
|
||||
return "F_SET_CLOCK_FREQUENCY";
|
||||
case F_GET_CLOCK_FREQUENCY:
|
||||
return "F_GET_CLOCK_FREQUENCY";
|
||||
case F_SET_CLOCK_PHASE:
|
||||
return "F_SET_CLOCK_PHASE";
|
||||
case F_GET_CLOCK_PHASE:
|
||||
return "F_GET_CLOCK_PHASE";
|
||||
case F_GET_MAX_CLOCK_PHASE_SHIFT:
|
||||
return "F_GET_MAX_CLOCK_PHASE_SHIFT";
|
||||
case F_SET_CLOCK_DIVIDER:
|
||||
return "F_SET_CLOCK_DIVIDER";
|
||||
case F_GET_CLOCK_DIVIDER:
|
||||
return "F_GET_CLOCK_DIVIDER";
|
||||
case F_SET_PIPELINE:
|
||||
return "F_SET_PIPELINE";
|
||||
case F_GET_PIPELINE:
|
||||
return "F_GET_PIPELINE";
|
||||
case F_SET_ON_CHIP_DAC:
|
||||
return "F_SET_ON_CHIP_DAC";
|
||||
case F_GET_ON_CHIP_DAC:
|
||||
return "F_GET_ON_CHIP_DAC";
|
||||
case F_SET_INJECT_CHANNEL:
|
||||
return "F_SET_INJECT_CHANNEL";
|
||||
case F_GET_INJECT_CHANNEL:
|
||||
return "F_GET_INJECT_CHANNEL";
|
||||
case F_SET_VETO_PHOTON:
|
||||
return "F_SET_VETO_PHOTON";
|
||||
case F_GET_VETO_PHOTON:
|
||||
return "F_GET_VETO_PHOTON";
|
||||
case F_SET_VETO_REFERENCE:
|
||||
return "F_SET_VETO_REFERENCE";
|
||||
case F_GET_BURST_MODE:
|
||||
return "F_GET_BURST_MODE";
|
||||
case F_SET_BURST_MODE:
|
||||
return "F_SET_BURST_MODE";
|
||||
case F_SET_ADC_ENABLE_MASK_10G:
|
||||
return "F_SET_ADC_ENABLE_MASK_10G";
|
||||
case F_GET_ADC_ENABLE_MASK_10G:
|
||||
return "F_GET_ADC_ENABLE_MASK_10G";
|
||||
case F_SET_COUNTER_MASK:
|
||||
return "F_SET_COUNTER_MASK";
|
||||
case F_GET_COUNTER_MASK:
|
||||
return "F_GET_COUNTER_MASK";
|
||||
case F_GET_NUM_BURSTS:
|
||||
return "F_GET_NUM_BURSTS";
|
||||
case F_SET_NUM_BURSTS:
|
||||
return "F_SET_NUM_BURSTS";
|
||||
case F_GET_BURST_PERIOD:
|
||||
return "F_GET_BURST_PERIOD";
|
||||
case F_SET_BURST_PERIOD:
|
||||
return "F_SET_BURST_PERIOD";
|
||||
case F_GET_CURRENT_SOURCE:
|
||||
return "F_GET_CURRENT_SOURCE";
|
||||
case F_SET_CURRENT_SOURCE:
|
||||
return "F_SET_CURRENT_SOURCE";
|
||||
case F_GET_TIMING_SOURCE:
|
||||
return "F_GET_TIMING_SOURCE";
|
||||
case F_SET_TIMING_SOURCE:
|
||||
return "F_SET_TIMING_SOURCE";
|
||||
case F_GET_NUM_CHANNELS:
|
||||
return "F_GET_NUM_CHANNELS";
|
||||
case F_UPDATE_RATE_CORRECTION:
|
||||
return "F_UPDATE_RATE_CORRECTION";
|
||||
case F_GET_RECEIVER_PARAMETERS:
|
||||
return "F_GET_RECEIVER_PARAMETERS";
|
||||
|
||||
default:
|
||||
return "Unknown Function";
|
||||
}
|
||||
}
|
||||
|
||||
void function_table() {
|
||||
flist[F_EXEC_COMMAND] = &exec_command;
|
||||
@ -722,14 +339,14 @@ void function_table() {
|
||||
int iloop = 0;
|
||||
for (iloop = 0; iloop < NUM_DET_FUNCTIONS; ++iloop) {
|
||||
LOG(logDEBUG3, ("function fnum=%d, (%s)\n", iloop,
|
||||
getFunctionName((enum detFuncs)iloop)));
|
||||
getFunctionNameFromEnum((enum detFuncs)iloop)));
|
||||
}
|
||||
}
|
||||
|
||||
void functionNotImplemented() {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Function (%s) is not implemented for this detector\n",
|
||||
getFunctionName((enum detFuncs)fnum));
|
||||
getFunctionNameFromEnum((enum detFuncs)fnum));
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "ToString.h"
|
||||
#include "file_utils.h"
|
||||
#include "network_utils.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include "string_utils.h"
|
||||
#include "versionAPI.h"
|
||||
@ -139,7 +140,7 @@ void Module::sendToDetector(int fnum, std::nullptr_t, Ret &retval) {
|
||||
void Module::sendToDetector(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< "]";
|
||||
sendToDetector(fnum, nullptr, 0, nullptr, 0);
|
||||
}
|
||||
@ -147,7 +148,7 @@ void Module::sendToDetector(int fnum) {
|
||||
template <typename Ret> Ret Module::sendToDetector(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
|
||||
<< sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -160,7 +161,7 @@ template <typename Ret, typename Arg>
|
||||
Ret Module::sendToDetector(int fnum, const Arg &args) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< ", " << args << ", " << sizeof(args) << ", "
|
||||
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -216,7 +217,7 @@ void Module::sendToDetectorStop(int fnum, std::nullptr_t, Ret &retval) const {
|
||||
void Module::sendToDetectorStop(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending to detector stop: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< "]";
|
||||
sendToDetectorStop(fnum, nullptr, 0, nullptr, 0);
|
||||
}
|
||||
@ -237,7 +238,7 @@ void Module::sendToReceiver(int fnum, const void *args, size_t args_size,
|
||||
std::ostringstream oss;
|
||||
oss << "Set rx_hostname first to use receiver parameters, ";
|
||||
oss << getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum));
|
||||
static_cast<detFuncs>(fnum));
|
||||
throw RuntimeError(oss.str());
|
||||
}
|
||||
auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
|
||||
@ -278,7 +279,7 @@ void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const {
|
||||
template <typename Ret> Ret Module::sendToReceiver(int fnum) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
|
||||
<< sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -290,7 +291,7 @@ template <typename Ret> Ret Module::sendToReceiver(int fnum) {
|
||||
template <typename Ret> Ret Module::sendToReceiver(int fnum) const {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
|
||||
<< sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -303,7 +304,7 @@ template <typename Ret, typename Arg>
|
||||
Ret Module::sendToReceiver(int fnum, const Arg &args) {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< ", " << args << ", " << sizeof(args) << ", "
|
||||
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
@ -316,7 +317,7 @@ template <typename Ret, typename Arg>
|
||||
Ret Module::sendToReceiver(int fnum, const Arg &args) const {
|
||||
LOG(logDEBUG1) << "Sending: ["
|
||||
<< getFunctionNameFromEnum(
|
||||
static_cast<slsDetectorDefs::detFuncs>(fnum))
|
||||
static_cast<detFuncs>(fnum))
|
||||
<< ", " << args << ", " << sizeof(args) << ", "
|
||||
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
|
||||
Ret retval{};
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "ServerSocket.h"
|
||||
#include "StaticVector.h"
|
||||
#include "ToString.h"
|
||||
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include "string_utils.h"
|
||||
#include "versionAPI.h"
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "Implementation.h"
|
||||
#include "ServerSocket.h"
|
||||
#include "receiver_defs.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
#include "sls_detector_defs.h"
|
||||
class ServerInterface;
|
||||
|
||||
|
@ -483,9 +483,9 @@ typedef struct {
|
||||
protected:
|
||||
#endif
|
||||
|
||||
#ifndef MYROOT
|
||||
#include "sls_detector_funcs.h"
|
||||
#endif
|
||||
// #ifndef MYROOT
|
||||
// #include "sls_detector_funcs.h"
|
||||
// #endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
@ -296,8 +296,7 @@ enum detFuncs {
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
#ifdef __cplusplus
|
||||
static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
inline const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
switch (func) {
|
||||
case F_EXEC_COMMAND: return "F_EXEC_COMMAND";
|
||||
case F_GET_DETECTOR_TYPE: return "F_GET_DETECTOR_TYPE";
|
||||
@ -588,4 +587,3 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user