mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 05:47:14 +02:00
clang and redoing copy detector server to have a soft link and put that in respawning for blackfin servers
This commit is contained in:
@ -242,6 +242,8 @@ This document describes the differences between v6.0.0 and v5.1.0.
|
|||||||
|
|
||||||
7. [Eiger] fast quad fix for loading trimbits
|
7. [Eiger] fast quad fix for loading trimbits
|
||||||
|
|
||||||
|
8. [Eiger] Can also use copydetectorserver command.
|
||||||
|
|
||||||
Receiver
|
Receiver
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
||||||
#define REQRD_FRMWR_VRSN 0x201005
|
#define REQRD_FRMWR_VRSN 0x201005
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "ctbDetectorServer"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
|
||||||
|
|
||||||
/* Struct Definitions */
|
/* Struct Definitions */
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls/sls_detector_defs.h"
|
#include "sls/sls_detector_defs.h"
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "eigerDetectorServer"
|
||||||
|
|
||||||
#define REQUIRED_FIRMWARE_VERSION (29)
|
#define REQUIRED_FIRMWARE_VERSION (29)
|
||||||
// virtual ones renamed for consistency
|
// virtual ones renamed for consistency
|
||||||
// real ones keep previous name for compatibility (already in production)
|
// real ones keep previous name for compatibility (already in production)
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||||
#define ID_FILE "detid_gotthard2.txt"
|
#define ID_FILE "detid_gotthard2.txt"
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "gotthard2DetectorServer"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||||
|
|
||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include "sls/sls_detector_defs.h"
|
#include "sls/sls_detector_defs.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "gotthardDetectorServer"
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum ADCINDEX { TEMP_FPGA, TEMP_ADC };
|
enum ADCINDEX { TEMP_FPGA, TEMP_ADC };
|
||||||
enum DACINDEX {
|
enum DACINDEX {
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#define REQRD_FRMWRE_VRSN_BOARD2 0x210831 // 1.0 pcb (version = 010)
|
#define REQRD_FRMWRE_VRSN_BOARD2 0x210831 // 1.0 pcb (version = 010)
|
||||||
#define REQRD_FRMWRE_VRSN 0x211008 // 2.0 pcb (version = 011)
|
#define REQRD_FRMWRE_VRSN 0x211008 // 2.0 pcb (version = 011)
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "jungfrauDetectorServer"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||||
|
|
||||||
/* Struct Definitions */
|
/* Struct Definitions */
|
||||||
@ -118,7 +120,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define MAX_FILTER_CELL_VAL (12)
|
#define MAX_FILTER_CELL_VAL (12)
|
||||||
#define MIN_ROWS_PER_READOUT (8)
|
#define MIN_ROWS_PER_READOUT (8)
|
||||||
#define MAX_ROWS_PER_READOUT (512)
|
#define MAX_ROWS_PER_READOUT (512)
|
||||||
#define READ_N_ROWS_MULTIPLE (8) //512 rows/128packets * 2 interfaces
|
#define READ_N_ROWS_MULTIPLE (8) // 512 rows/128packets * 2 interfaces
|
||||||
|
|
||||||
/* Defines in the Firmware */
|
/* Defines in the Firmware */
|
||||||
#define MAX_TIMESLOT_VAL (0x1F)
|
#define MAX_TIMESLOT_VAL (0x1F)
|
||||||
@ -137,8 +139,6 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define ADC_PORT_INVERT_VAL (0x5A5A5A5A)
|
#define ADC_PORT_INVERT_VAL (0x5A5A5A5A)
|
||||||
#define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c)
|
#define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 2.0 pcb (chipv1.1)
|
// 2.0 pcb (chipv1.1)
|
||||||
#define SAMPLE_ADC_FULL_SPEED_CHIP11 \
|
#define SAMPLE_ADC_FULL_SPEED_CHIP11 \
|
||||||
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
||||||
@ -162,8 +162,6 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define ADC_OFST_HALF_SPEED_VAL_CHIP11 (0x08)
|
#define ADC_OFST_HALF_SPEED_VAL_CHIP11 (0x08)
|
||||||
#define ADC_OFST_QUARTER_SPEED_VAL_CHIP11 (0x04)
|
#define ADC_OFST_QUARTER_SPEED_VAL_CHIP11 (0x04)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 2.0 pcb (chipv1.0)
|
// 2.0 pcb (chipv1.0)
|
||||||
#define SAMPLE_ADC_FULL_SPEED_CHIP10 \
|
#define SAMPLE_ADC_FULL_SPEED_CHIP10 \
|
||||||
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
||||||
@ -187,8 +185,6 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
|||||||
#define ADC_OFST_HALF_SPEED_VAL_CHIP10 (0x08)
|
#define ADC_OFST_HALF_SPEED_VAL_CHIP10 (0x08)
|
||||||
#define ADC_OFST_QUARTER_SPEED_VAL_CHIP10 (0x04)
|
#define ADC_OFST_QUARTER_SPEED_VAL_CHIP10 (0x04)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 1.0 pcb (2 resistor network)
|
// 1.0 pcb (2 resistor network)
|
||||||
#define SAMPLE_ADC_HALF_SPEED_BOARD2 \
|
#define SAMPLE_ADC_HALF_SPEED_BOARD2 \
|
||||||
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#define MIN_REQRD_VRSN_T_RD_API 0x180314
|
#define MIN_REQRD_VRSN_T_RD_API 0x180314
|
||||||
#define REQRD_FRMWR_VRSN 0x201005
|
#define REQRD_FRMWR_VRSN 0x201005
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "moenchDetectorServer"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
|
||||||
|
|
||||||
/* Struct Definitions */
|
/* Struct Definitions */
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||||
#define ID_FILE "detid_mythen3.txt"
|
#define ID_FILE "detid_mythen3.txt"
|
||||||
|
|
||||||
|
#define LINKED_SERVER_NAME "mythen3DetectorServer"
|
||||||
|
|
||||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||||
|
|
||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
// defined in the detector specific Makefile
|
// defined in the detector specific Makefile
|
||||||
#ifdef GOTTHARDD
|
#ifdef GOTTHARDD
|
||||||
@ -448,7 +448,7 @@ int executeCommand(char *command, char *result, enum TLogLevel level) {
|
|||||||
memset(result, 0, MAX_STR_LENGTH);
|
memset(result, 0, MAX_STR_LENGTH);
|
||||||
|
|
||||||
// copy command
|
// copy command
|
||||||
char cmd[MAX_STR_LENGTH]= {0};
|
char cmd[MAX_STR_LENGTH] = {0};
|
||||||
sprintf(cmd, "%s 2>&1", command);
|
sprintf(cmd, "%s 2>&1", command);
|
||||||
LOG(level, ("Executing command:\n[%s]\n", cmd));
|
LOG(level, ("Executing command:\n[%s]\n", cmd));
|
||||||
|
|
||||||
@ -1086,7 +1086,7 @@ int validateAndSetDac(enum dacIndex ind, int val, int mV) {
|
|||||||
retval = setHighVoltage(val);
|
retval = setHighVoltage(val);
|
||||||
LOG(logDEBUG1, ("High Voltage: %d\n", retval));
|
LOG(logDEBUG1, ("High Voltage: %d\n", retval));
|
||||||
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \
|
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \
|
||||||
defined(GOTTHARD2D) || defined(MYTHEN3D)
|
defined(GOTTHARD2D) || defined(MYTHEN3D)
|
||||||
validate(&ret, mess, val, retval, "set high voltage", DEC);
|
validate(&ret, mess, val, retval, "set high voltage", DEC);
|
||||||
#endif
|
#endif
|
||||||
#ifdef GOTTHARDD
|
#ifdef GOTTHARDD
|
||||||
@ -1140,12 +1140,12 @@ defined(GOTTHARD2D) || defined(MYTHEN3D)
|
|||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (!isPowerValid(serverDacIndex, val)) {
|
} else if (!isPowerValid(serverDacIndex, val)) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,
|
sprintf(
|
||||||
|
mess,
|
||||||
"Could not set power. Power regulator %d "
|
"Could not set power. Power regulator %d "
|
||||||
"should be between %d and %d mV\n",
|
"should be between %d and %d mV\n",
|
||||||
ind,
|
ind,
|
||||||
(serverDacIndex == D_PWR_IO ? VIO_MIN_MV
|
(serverDacIndex == D_PWR_IO ? VIO_MIN_MV : POWER_RGLTR_MIN),
|
||||||
: POWER_RGLTR_MIN),
|
|
||||||
(VCHIP_MAX_MV - VCHIP_POWER_INCRMNT));
|
(VCHIP_MAX_MV - VCHIP_POWER_INCRMNT));
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
@ -1221,8 +1221,7 @@ defined(GOTTHARD2D) || defined(MYTHEN3D)
|
|||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
if ((val != GET_FLAG && mV &&
|
if ((val != GET_FLAG && mV && checkVLimitCompliant(val) == FAIL) ||
|
||||||
checkVLimitCompliant(val) == FAIL) ||
|
|
||||||
(val != GET_FLAG && !mV &&
|
(val != GET_FLAG && !mV &&
|
||||||
checkVLimitDacCompliant(val) == FAIL)) {
|
checkVLimitDacCompliant(val) == FAIL)) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
@ -2078,7 +2077,8 @@ int set_num_additional_storage_cells(int file_des) {
|
|||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
if (getChipVersion() == 11) {
|
if (getChipVersion() == 11) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "Cannot set addl. number of storage cells for chip v1.1\n");
|
sprintf(mess,
|
||||||
|
"Cannot set addl. number of storage cells for chip v1.1\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (arg > getMaxStoragecellStart()) {
|
} else if (arg > getMaxStoragecellStart()) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
@ -2557,7 +2557,8 @@ int set_storage_cell_delay(int file_des) {
|
|||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
if (getChipVersion() == 11) {
|
if (getChipVersion() == 11) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess, "Storage cell delay is not applicable for chipv 1.1\n");
|
strcpy(mess,
|
||||||
|
"Storage cell delay is not applicable for chipv 1.1\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (arg > MAX_STORAGE_CELL_DLY_NS_VAL) {
|
} else if (arg > MAX_STORAGE_CELL_DLY_NS_VAL) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
@ -3702,7 +3703,10 @@ int program_fpga(int file_des) {
|
|||||||
fclose(fd);
|
fclose(fd);
|
||||||
struct sysinfo info;
|
struct sysinfo info;
|
||||||
sysinfo(&info);
|
sysinfo(&info);
|
||||||
sprintf(mess, "Could not allocate memory to get fpga program. Free space: %d MB\n", (int)(info.freeram/ (1024 * 1024)));
|
sprintf(mess,
|
||||||
|
"Could not allocate memory to get fpga program. Free "
|
||||||
|
"space: %d MB\n",
|
||||||
|
(int)(info.freeram / (1024 * 1024)));
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
@ -3759,8 +3763,7 @@ int program_fpga(int file_des) {
|
|||||||
|
|
||||||
// checksum of copied program
|
// checksum of copied program
|
||||||
if (ret == OK) {
|
if (ret == OK) {
|
||||||
ret =
|
ret = verifyChecksumFromFile(mess, checksum, TEMP_PROG_FILE_NAME);
|
||||||
verifyChecksumFromFile(mess, checksum, TEMP_PROG_FILE_NAME);
|
|
||||||
}
|
}
|
||||||
Server_SendResult(file_des, INT32, NULL, 0);
|
Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
if (ret == FAIL) {
|
if (ret == FAIL) {
|
||||||
@ -4027,7 +4030,8 @@ int storage_cell_start(int file_des) {
|
|||||||
if ((arg == GET_FLAG) || (Server_VerifyLock() == OK)) {
|
if ((arg == GET_FLAG) || (Server_VerifyLock() == OK)) {
|
||||||
if (arg > getMaxStoragecellStart()) {
|
if (arg > getMaxStoragecellStart()) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "Max Storage cell number should not exceed %d\n", getMaxStoragecellStart());
|
sprintf(mess, "Max Storage cell number should not exceed %d\n",
|
||||||
|
getMaxStoragecellStart());
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
retval = selectStoragecellStart(arg);
|
retval = selectStoragecellStart(arg);
|
||||||
@ -4210,7 +4214,7 @@ int copy_detector_server(int file_des) {
|
|||||||
if (receiveData(file_des, args, sizeof(args), OTHER) < 0)
|
if (receiveData(file_des, args, sizeof(args), OTHER) < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
#if defined(EIGERD) || defined(VIRTUAL)
|
#ifdef VIRTUAL
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -4219,59 +4223,102 @@ int copy_detector_server(int file_des) {
|
|||||||
char *sname = args[0];
|
char *sname = args[0];
|
||||||
char *hostname = args[1];
|
char *hostname = args[1];
|
||||||
LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname));
|
LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname));
|
||||||
|
char cmd[MAX_STR_LENGTH] = {0};
|
||||||
|
|
||||||
char cmd[MAX_STR_LENGTH];
|
// tftp server
|
||||||
memset(cmd, 0, MAX_STR_LENGTH);
|
char *format = "tftp %s -r %s -g";
|
||||||
|
if (snprintf(cmd, MAX_STR_LENGTH, format, hostname, sname) >=
|
||||||
// copy server
|
MAX_STR_LENGTH) {
|
||||||
strcpy(cmd, "tftp ");
|
|
||||||
strcat(cmd, hostname);
|
|
||||||
strcat(cmd, " -r ");
|
|
||||||
strcat(cmd, sname);
|
|
||||||
strcat(cmd, " -g");
|
|
||||||
int success = executeCommand(cmd, retvals, logDEBUG1);
|
|
||||||
if (success == FAIL) {
|
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess, retvals);
|
sptrcpy(mess, "Could not copy detector server. Command to copy "
|
||||||
|
"server too long\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
} else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
snprintf(mess, MAX_STR_LENGTH,
|
||||||
|
"Could not copy detector server (tftp). %s\n", retvals);
|
||||||
// LOG(logERROR, (mess)); already printed in executecommand
|
// LOG(logERROR, (mess)); already printed in executecommand
|
||||||
|
} else {
|
||||||
|
LOG(logINFO, ("\tServer copied\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// success
|
|
||||||
else {
|
|
||||||
LOG(logINFO, ("Server copied successfully\n"));
|
|
||||||
// give permissions
|
// give permissions
|
||||||
strcpy(cmd, "chmod 777 ");
|
if (ret == OK) {
|
||||||
strcat(cmd, sname);
|
if (snprintf(cmd, MAX_STR_LENGTH, "chmod 777 %s", sname) >=
|
||||||
executeCommand(cmd, retvals, logDEBUG1);
|
MAX_STR_LENGTH) {
|
||||||
|
ret = FAIL;
|
||||||
#if !defined(GOTTHARD2D) && !defined(MYTHEN3D)
|
sptrcpy(mess, "Could not copy detector server. Command to give "
|
||||||
// edit /etc/inittab
|
"permissions to server is too long\n");
|
||||||
// find line numbers in /etc/inittab where DetectorServer
|
LOG(logERROR, (mess));
|
||||||
strcpy(cmd, "sed -n '/DetectorServer/=' /etc/inittab");
|
} else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||||
executeCommand(cmd, retvals, logDEBUG1);
|
ret = FAIL;
|
||||||
while (strlen(retvals)) {
|
snprintf(mess, MAX_STR_LENGTH,
|
||||||
// get first linen number
|
"Could not copy detector server (permissions). %s\n",
|
||||||
int lineNumber = atoi(retvals);
|
retvals);
|
||||||
// delete that line
|
// LOG(logERROR, (mess)); already printed in executecommand
|
||||||
sprintf(cmd, "sed -i \'%dd\' /etc/inittab", lineNumber);
|
} else {
|
||||||
executeCommand(cmd, retvals, logDEBUG1);
|
LOG(logINFO, ("\tPermissions modified\n"));
|
||||||
// find line numbers again
|
}
|
||||||
strcpy(cmd, "sed -n '/DetectorServer/=' /etc/inittab");
|
|
||||||
executeCommand(cmd, retvals, logDEBUG1);
|
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("Deleted all lines containing DetectorServer in "
|
|
||||||
"/etc/inittab\n"));
|
|
||||||
|
|
||||||
// append line
|
// symbolic link
|
||||||
strcpy(cmd, "echo \"ttyS0::respawn:/./");
|
if (ret == OK) {
|
||||||
strcat(cmd, sname);
|
if (snprintf(cmd, MAX_STR_LENGTH, "ln -sf %s %s", sname,
|
||||||
strcat(cmd, "\" >> /etc/inittab");
|
LINKED_SERVER_NAME) >= MAX_STR_LENGTH) {
|
||||||
executeCommand(cmd, retvals, logDEBUG1);
|
ret = FAIL;
|
||||||
|
strcpy(mess, "Could not copy detector server. Command to "
|
||||||
|
"create symbolic link too long\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
} else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
snprintf(mess, MAX_STR_LENGTH,
|
||||||
|
"Could not copy detector server (symbolic link). %s\n",
|
||||||
|
retvals);
|
||||||
|
// LOG(logERROR, (mess)); already printed in executecommand
|
||||||
|
} else {
|
||||||
|
LOG(logINFO, ("\tSymbolic link created\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LOG(logINFO, ("/etc/inittab modified to have %s\n", sname));
|
// blackfin boards (respawn) (only kept for backwards compatibility)
|
||||||
|
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \
|
||||||
|
defined(GOTTHARDD)
|
||||||
|
// delete every line with DetectorServer in /etc/inittab
|
||||||
|
if (ret == OK) {
|
||||||
|
strcpy(cmd, "sed -i '/DetectorServer/d' /etc/inittab");
|
||||||
|
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
snprintf(
|
||||||
|
mess, MAX_STR_LENGTH,
|
||||||
|
"Could not copy detector server (del respawning). %s\n",
|
||||||
|
retvals);
|
||||||
|
// LOG(logERROR, (mess)); already printed in executecommand
|
||||||
|
} else {
|
||||||
|
LOG(logINFO, ("\t/etc/inittab DetectoServer line deleted\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new link name to /etc/inittab
|
||||||
|
if (ret == OK) {
|
||||||
|
format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab";
|
||||||
|
if (snprintf(cmd, MAX_STR_LENGTH, format, sname) >=
|
||||||
|
MAX_STR_LENGTH) {
|
||||||
|
ret = FAIL;
|
||||||
|
sptrcpy(mess, "Could not copy detector server. Command "
|
||||||
|
"to add new server for spawning is too long\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
} else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
snprintf(mess, MAX_STR_LENGTH,
|
||||||
|
"Could not copy detector server (respawning). %s\n",
|
||||||
|
retvals);
|
||||||
|
// LOG(logERROR, (mess)); already printed in executecommand
|
||||||
|
} else {
|
||||||
|
LOG(logINFO, ("\tLinked server added for respawning\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
|
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
|
||||||
}
|
}
|
||||||
@ -4756,7 +4803,8 @@ int set_read_n_rows(int file_des) {
|
|||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else
|
} else
|
||||||
#elif JUNGFRAUD
|
#elif JUNGFRAUD
|
||||||
if ((check_detector_idle("set number of rows") == OK) && (arg % READ_N_ROWS_MULTIPLE != 0)) {
|
if ((check_detector_idle("set number of rows") == OK) &&
|
||||||
|
(arg % READ_N_ROWS_MULTIPLE != 0)) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,
|
sprintf(mess,
|
||||||
"Could not set number of rows. %d must be a multiple "
|
"Could not set number of rows. %d must be a multiple "
|
||||||
@ -4923,44 +4971,52 @@ int check_detector_idle(const char *s) {
|
|||||||
int is_udp_configured() {
|
int is_udp_configured() {
|
||||||
for (int i = 0; i != numUdpDestinations; ++i) {
|
for (int i = 0; i != numUdpDestinations; ++i) {
|
||||||
if (udpDetails[i].dstip == 0) {
|
if (udpDetails[i].dstip == 0) {
|
||||||
sprintf(configureMessage, "udp destination ip not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp destination ip not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (udpDetails[i].srcip == 0) {
|
if (udpDetails[i].srcip == 0) {
|
||||||
sprintf(configureMessage, "udp source ip not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp source ip not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (udpDetails[i].srcmac == 0) {
|
if (udpDetails[i].srcmac == 0) {
|
||||||
sprintf(configureMessage, "udp source mac not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp source mac not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (udpDetails[i].dstmac == 0) {
|
if (udpDetails[i].dstmac == 0) {
|
||||||
sprintf(configureMessage, "udp destination mac not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp destination mac not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
#if defined(JUNGFRAUD) || defined(GOTTHARD2D)
|
#if defined(JUNGFRAUD) || defined(GOTTHARD2D)
|
||||||
if (getNumberofUDPInterfaces() == 2) {
|
if (getNumberofUDPInterfaces() == 2) {
|
||||||
if (udpDetails[i].srcip2 == 0) {
|
if (udpDetails[i].srcip2 == 0) {
|
||||||
sprintf(configureMessage, "udp source ip2 not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp source ip2 not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (udpDetails[i].dstip2 == 0) {
|
if (udpDetails[i].dstip2 == 0) {
|
||||||
sprintf(configureMessage, "udp destination ip2 not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp destination ip2 not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (udpDetails[i].srcmac2 == 0) {
|
if (udpDetails[i].srcmac2 == 0) {
|
||||||
sprintf(configureMessage, "udp source mac2 not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp source mac2 not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (udpDetails[i].dstmac2 == 0) {
|
if (udpDetails[i].dstmac2 == 0) {
|
||||||
sprintf(configureMessage, "udp destination mac2 not configured [entry:%d]\n", i);
|
sprintf(configureMessage,
|
||||||
|
"udp destination mac2 not configured [entry:%d]\n", i);
|
||||||
LOG(logWARNING, ("%s", configureMessage));
|
LOG(logWARNING, ("%s", configureMessage));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@ -4975,16 +5031,17 @@ void configure_mac() {
|
|||||||
if (is_udp_configured() == OK) {
|
if (is_udp_configured() == OK) {
|
||||||
ret = configureMAC();
|
ret = configureMAC();
|
||||||
if (ret != OK) {
|
if (ret != OK) {
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
sprintf(mess, "Could not allocate RAM\n");
|
sprintf(mess, "Could not allocate RAM\n");
|
||||||
} else {
|
} else {
|
||||||
sprintf(mess, "Could not configure mac because of incorrect "
|
sprintf(mess,
|
||||||
|
"Could not configure mac because of incorrect "
|
||||||
"udp 1G destination IP and port\n");
|
"udp 1G destination IP and port\n");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
sprintf(mess, "Configure Mac failed\n");
|
sprintf(mess, "Configure Mac failed\n");
|
||||||
#endif
|
#endif
|
||||||
strcpy(configureMessage, mess);
|
strcpy(configureMessage, mess);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
@ -5416,7 +5473,8 @@ int set_num_interfaces(int file_des) {
|
|||||||
} else if (check_detector_idle("configure mac") == OK) {
|
} else if (check_detector_idle("configure mac") == OK) {
|
||||||
if (getNumberofUDPInterfaces() != arg) {
|
if (getNumberofUDPInterfaces() != arg) {
|
||||||
setNumberofUDPInterfaces(arg);
|
setNumberofUDPInterfaces(arg);
|
||||||
for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) {
|
for (int iRxEntry = 0; iRxEntry != numUdpDestinations;
|
||||||
|
++iRxEntry) {
|
||||||
if (arg == 1) {
|
if (arg == 1) {
|
||||||
udpDetails[iRxEntry].srcport2 = 0;
|
udpDetails[iRxEntry].srcport2 = 0;
|
||||||
udpDetails[iRxEntry].srcip2 = 0;
|
udpDetails[iRxEntry].srcip2 = 0;
|
||||||
@ -5426,19 +5484,24 @@ int set_num_interfaces(int file_des) {
|
|||||||
udpDetails[iRxEntry].dstmac2 = 0;
|
udpDetails[iRxEntry].dstmac2 = 0;
|
||||||
} else {
|
} else {
|
||||||
// if still 0, set defaults
|
// if still 0, set defaults
|
||||||
udpDetails[iRxEntry].srcport2 = DEFAULT_UDP_SRC_PORTNO + 1;
|
udpDetails[iRxEntry].srcport2 =
|
||||||
|
DEFAULT_UDP_SRC_PORTNO + 1;
|
||||||
if (udpDetails[iRxEntry].dstport2 == 0) {
|
if (udpDetails[iRxEntry].dstport2 == 0) {
|
||||||
udpDetails[iRxEntry].dstport2 = 2 * iRxEntry + 1 + DEFAULT_UDP_DST_PORTNO;
|
udpDetails[iRxEntry].dstport2 =
|
||||||
|
2 * iRxEntry + 1 + DEFAULT_UDP_DST_PORTNO;
|
||||||
}
|
}
|
||||||
// if still 0, copy from entry 0
|
// if still 0, copy from entry 0
|
||||||
if (iRxEntry != 0) {
|
if (iRxEntry != 0) {
|
||||||
udpDetails[iRxEntry].srcip2 = udpDetails[0].srcip2;
|
udpDetails[iRxEntry].srcip2 = udpDetails[0].srcip2;
|
||||||
udpDetails[iRxEntry].srcmac2 = udpDetails[0].srcmac2;
|
udpDetails[iRxEntry].srcmac2 =
|
||||||
|
udpDetails[0].srcmac2;
|
||||||
if (udpDetails[iRxEntry].dstip2 == 0) {
|
if (udpDetails[iRxEntry].dstip2 == 0) {
|
||||||
udpDetails[iRxEntry].dstip2 = udpDetails[0].dstip2;
|
udpDetails[iRxEntry].dstip2 =
|
||||||
|
udpDetails[0].dstip2;
|
||||||
}
|
}
|
||||||
if (udpDetails[iRxEntry].dstmac2 == 0) {
|
if (udpDetails[iRxEntry].dstmac2 == 0) {
|
||||||
udpDetails[iRxEntry].dstmac2 = udpDetails[0].dstmac2;
|
udpDetails[iRxEntry].dstmac2 =
|
||||||
|
udpDetails[0].dstmac2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6706,14 +6769,15 @@ int set_current_source(int file_des) {
|
|||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
if (enable != 0 && enable != 1) {
|
if (enable != 0 && enable != 1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(mess, "Could not enable/disable current source. Enable can "
|
||||||
"Could not enable/disable current source. Enable can be 0 or 1 only.\n");
|
"be 0 or 1 only.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
// disable
|
// disable
|
||||||
else if (enable == 0 && (fix != -1 || normal != -1)) {
|
else if (enable == 0 && (fix != -1 || normal != -1)) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(
|
||||||
|
mess,
|
||||||
"Could not disable current source. Requires no parameters.\n");
|
"Could not disable current source. Requires no parameters.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
@ -6723,8 +6787,8 @@ int set_current_source(int file_des) {
|
|||||||
// no parameters allowed
|
// no parameters allowed
|
||||||
if (fix != -1 || normal != -1) {
|
if (fix != -1 || normal != -1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(mess, "Could not enable current source. Fix and normal "
|
||||||
"Could not enable current source. Fix and normal are invalid parameters for this detector.\n");
|
"are invalid parameters for this detector.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -6747,7 +6811,8 @@ int set_current_source(int file_des) {
|
|||||||
if (fix != 0 && fix != 1) {
|
if (fix != 0 && fix != 1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(mess,
|
||||||
"Could not enable current source. Invalid value for parameter (fix). Options: 0 or 1.\n");
|
"Could not enable current source. Invalid value "
|
||||||
|
"for parameter (fix). Options: 0 or 1.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (normal != -1) {
|
} else if (normal != -1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
@ -6781,7 +6846,8 @@ int set_current_source(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
int retval = getCurrentSource();
|
int retval = getCurrentSource();
|
||||||
LOG(logDEBUG1, ("current source enable retval: %u\n", retval));
|
LOG(logDEBUG1, ("current source enable retval: %u\n", retval));
|
||||||
validate(&ret, mess, enable, retval, "set current source enable", DEC);
|
validate(&ret, mess, enable, retval, "set current source enable",
|
||||||
|
DEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -7847,7 +7913,8 @@ int set_filter_resistor(int file_des) {
|
|||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
if (arg < 0 || arg > ASIC_FILTER_MAX_RES_VALUE) {
|
if (arg < 0 || arg > ASIC_FILTER_MAX_RES_VALUE) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,
|
sprintf(
|
||||||
|
mess,
|
||||||
"Could not set filter resistor. Invalid filter argument %d. "
|
"Could not set filter resistor. Invalid filter argument %d. "
|
||||||
"Options [0-%d]\n",
|
"Options [0-%d]\n",
|
||||||
arg, ASIC_FILTER_MAX_RES_VALUE);
|
arg, ASIC_FILTER_MAX_RES_VALUE);
|
||||||
@ -8483,8 +8550,8 @@ int set_veto_algorithm(int file_des) {
|
|||||||
|
|
||||||
enum vetoAlgorithm alg = args[0];
|
enum vetoAlgorithm alg = args[0];
|
||||||
enum streamingInterface interface = args[1];
|
enum streamingInterface interface = args[1];
|
||||||
LOG(logDEBUG1, ("Setting vetoalgorithm (interface: %d): %u\n", (int)interface,
|
LOG(logDEBUG1, ("Setting vetoalgorithm (interface: %d): %u\n",
|
||||||
(int)alg));
|
(int)interface, (int)alg));
|
||||||
|
|
||||||
#ifndef GOTTHARD2D
|
#ifndef GOTTHARD2D
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
@ -8774,10 +8841,10 @@ int set_flip_rows(int file_des) {
|
|||||||
#else
|
#else
|
||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
if ((check_detector_idle("set flip rows") == OK) && (arg != 0 && arg != 1)) {
|
if ((check_detector_idle("set flip rows") == OK) &&
|
||||||
|
(arg != 0 && arg != 1)) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,
|
sprintf(mess, "Could not set flip rows. Invalid argument %d.\n",
|
||||||
"Could not set flip rows. Invalid argument %d.\n",
|
|
||||||
arg);
|
arg);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
@ -8803,7 +8870,6 @@ int set_flip_rows(int file_des) {
|
|||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int get_filter_cell(int file_des) {
|
int get_filter_cell(int file_des) {
|
||||||
ret = OK;
|
ret = OK;
|
||||||
memset(mess, 0, sizeof(mess));
|
memset(mess, 0, sizeof(mess));
|
||||||
@ -8839,7 +8905,8 @@ int set_filter_cell(int file_des) {
|
|||||||
if (arg < 0 || arg > MAX_FILTER_CELL_VAL) {
|
if (arg < 0 || arg > MAX_FILTER_CELL_VAL) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,
|
sprintf(mess,
|
||||||
"Could not set filter cell. Invalid argument %d. Options: 0 - %d\n",
|
"Could not set filter cell. Invalid argument %d. Options: "
|
||||||
|
"0 - %d\n",
|
||||||
arg, MAX_FILTER_CELL_VAL);
|
arg, MAX_FILTER_CELL_VAL);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
@ -8851,7 +8918,8 @@ int set_filter_cell(int file_des) {
|
|||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
setFilterCell(arg);
|
setFilterCell(arg);
|
||||||
// no validation as it might take time to update status register if acquiring
|
// no validation as it might take time to update status register if
|
||||||
|
// acquiring
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -9043,18 +9111,17 @@ int set_dest_udp_list(int file_des) {
|
|||||||
|
|
||||||
if (entry < 1 || entry > MAX_UDP_DESTINATION) {
|
if (entry < 1 || entry > MAX_UDP_DESTINATION) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(
|
sprintf(mess,
|
||||||
mess,
|
"Could not set udp destination. Invalid entry. Options: 1 "
|
||||||
"Could not set udp destination. Invalid entry. Options: 1 - %d\n",
|
"- %d\n",
|
||||||
MAX_UDP_DESTINATION);
|
MAX_UDP_DESTINATION);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
#ifdef EIGERD
|
#ifdef EIGERD
|
||||||
else if (args[4] != 0 || args64[1] != 0) {
|
else if (args[4] != 0 || args64[1] != 0) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(
|
strcpy(mess, "Could not set udp destination. ip2 and mac2 not "
|
||||||
mess,
|
"implemented for this detector.\n");
|
||||||
"Could not set udp destination. ip2 and mac2 not implemented for this detector.\n");
|
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -9086,12 +9153,14 @@ int set_dest_udp_list(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
udpDetails[entry].srcport = DEFAULT_UDP_SRC_PORTNO;
|
udpDetails[entry].srcport = DEFAULT_UDP_SRC_PORTNO;
|
||||||
if (udpDetails[entry].dstport == 0) {
|
if (udpDetails[entry].dstport == 0) {
|
||||||
udpDetails[entry].dstport = 2 * entry + DEFAULT_UDP_DST_PORTNO;
|
udpDetails[entry].dstport =
|
||||||
|
2 * entry + DEFAULT_UDP_DST_PORTNO;
|
||||||
}
|
}
|
||||||
if (myDetectorType == EIGER || twoInterfaces) {
|
if (myDetectorType == EIGER || twoInterfaces) {
|
||||||
udpDetails[entry].srcport2 = DEFAULT_UDP_SRC_PORTNO + 1;
|
udpDetails[entry].srcport2 = DEFAULT_UDP_SRC_PORTNO + 1;
|
||||||
if (udpDetails[entry].dstport2 == 0) {
|
if (udpDetails[entry].dstport2 == 0) {
|
||||||
udpDetails[entry].dstport2 = 2 * entry + 1 + DEFAULT_UDP_DST_PORTNO;
|
udpDetails[entry].dstport2 =
|
||||||
|
2 * entry + 1 + DEFAULT_UDP_DST_PORTNO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if still 0, copy from entry 0
|
// if still 0, copy from entry 0
|
||||||
@ -9162,9 +9231,10 @@ int get_num_dest_list(int file_des) {
|
|||||||
int retval1 = 0;
|
int retval1 = 0;
|
||||||
if (getNumberofDestinations(&retval1) == FAIL || retval1 != retval) {
|
if (getNumberofDestinations(&retval1) == FAIL || retval1 != retval) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(
|
sprintf(mess,
|
||||||
mess,
|
"Could not get number of udp destinations. (server reads %d, "
|
||||||
"Could not get number of udp destinations. (server reads %d, fpga reads %d).\n", retval1, retval);
|
"fpga reads %d).\n",
|
||||||
|
retval1, retval);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -9232,10 +9302,11 @@ int set_udp_first_dest(int file_des) {
|
|||||||
if (check_detector_idle("set first udp destination") == OK) {
|
if (check_detector_idle("set first udp destination") == OK) {
|
||||||
setFirstUDPDestination(arg);
|
setFirstUDPDestination(arg);
|
||||||
int retval = getFirstUDPDestination();
|
int retval = getFirstUDPDestination();
|
||||||
validate(&ret, mess, arg, retval, "set udp first destination", DEC);
|
validate(&ret, mess, arg, retval, "set udp first destination",
|
||||||
|
DEC);
|
||||||
if (ret == OK) {
|
if (ret == OK) {
|
||||||
firstUDPDestination = arg;
|
firstUDPDestination = arg;
|
||||||
//configure_mac();
|
// configure_mac();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9244,7 +9315,6 @@ int set_udp_first_dest(int file_des) {
|
|||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int get_readout_speed(int file_des) {
|
int get_readout_speed(int file_des) {
|
||||||
ret = OK;
|
ret = OK;
|
||||||
memset(mess, 0, sizeof(mess));
|
memset(mess, 0, sizeof(mess));
|
||||||
@ -9282,7 +9352,8 @@ int set_readout_speed(int file_des) {
|
|||||||
#ifdef JUNGFRAUD
|
#ifdef JUNGFRAUD
|
||||||
if (arg == (int)FULL_SPEED && isHardwareVersion2()) {
|
if (arg == (int)FULL_SPEED && isHardwareVersion2()) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(
|
||||||
|
mess,
|
||||||
"Full speed not implemented for this board version (v1.0).\n");
|
"Full speed not implemented for this board version (v1.0).\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
@ -9319,7 +9390,6 @@ int set_readout_speed(int file_des) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
@ -83,7 +83,8 @@ class Detector {
|
|||||||
/* [Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench] */
|
/* [Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench] */
|
||||||
Result<int64_t> getSerialNumber(Positions pos = {}) const;
|
Result<int64_t> getSerialNumber(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger][Gotthard2][Mythen3] 6 bit value (ideally unique) that is streamed out in the UDP header of the detector.*/
|
/** [Eiger][Gotthard2][Mythen3] 6 bit value (ideally unique) that is
|
||||||
|
* streamed out in the UDP header of the detector.*/
|
||||||
Result<int> getModuleId(Positions pos = {}) const;
|
Result<int> getModuleId(Positions pos = {}) const;
|
||||||
|
|
||||||
Result<int64_t> getReceiverVersion(Positions pos = {}) const;
|
Result<int64_t> getReceiverVersion(Positions pos = {}) const;
|
||||||
@ -310,8 +311,8 @@ class Detector {
|
|||||||
* [Eiger] Options: FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED \n
|
* [Eiger] Options: FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED \n
|
||||||
* [Gotthard2] Options: G2_108MHZ (Default), G2_144MHZ \n
|
* [Gotthard2] Options: G2_108MHZ (Default), G2_144MHZ \n
|
||||||
* [Jungfrau] FULL_SPEED option only available from v2.0 boards and is
|
* [Jungfrau] FULL_SPEED option only available from v2.0 boards and is
|
||||||
* recommended to set number of interfaces to 2. \n Also overwrites adcphase to
|
* recommended to set number of interfaces to 2. \n Also overwrites adcphase
|
||||||
* recommended default.
|
* to recommended default.
|
||||||
*/
|
*/
|
||||||
void setReadoutSpeed(defs::speedLevel value, Positions pos = {});
|
void setReadoutSpeed(defs::speedLevel value, Positions pos = {});
|
||||||
|
|
||||||
@ -404,8 +405,9 @@ class Detector {
|
|||||||
* [Moench] Default is disabled. \n
|
* [Moench] Default is disabled. \n
|
||||||
* [Jungfrau] Default is disabled. Get will return power status. Can be off
|
* [Jungfrau] Default is disabled. Get will return power status. Can be off
|
||||||
* if temperature event occured (temperature over temp_threshold with
|
* if temperature event occured (temperature over temp_threshold with
|
||||||
* temp_control enabled. Will configure chip (only chip v1.1)\n [Mythen3][Gotthard2] Default is 1. If module not
|
* temp_control enabled. Will configure chip (only chip v1.1)\n
|
||||||
* connected or wrong module, powerchip will fail.
|
* [Mythen3][Gotthard2] Default is 1. If module not connected or wrong
|
||||||
|
* module, powerchip will fail.
|
||||||
*/
|
*/
|
||||||
void setPowerChip(bool on, Positions pos = {});
|
void setPowerChip(bool on, Positions pos = {});
|
||||||
|
|
||||||
@ -518,7 +520,9 @@ class Detector {
|
|||||||
|
|
||||||
/** [Eiger] Number of rows to read out per half module
|
/** [Eiger] Number of rows to read out per half module
|
||||||
* Options: 0 - 256. 256 is default. The permissible values depend on
|
* Options: 0 - 256. 256 is default. The permissible values depend on
|
||||||
* dynamic range and 10Gbe enabled. \n[Jungfrau] Number of rows per module starting from the centre. Options: 8 - 512, must be multiples of 8. Default is 512.
|
* dynamic range and 10Gbe enabled. \n[Jungfrau] Number of rows per module
|
||||||
|
* starting from the centre. Options: 8 - 512, must be multiples of 8.
|
||||||
|
* Default is 512.
|
||||||
*/
|
*/
|
||||||
void setReadNRows(const int lines, Positions pos = {});
|
void setReadNRows(const int lines, Positions pos = {});
|
||||||
|
|
||||||
@ -1209,7 +1213,8 @@ class Detector {
|
|||||||
Result<int> getStorageCellStart(Positions pos = {}) const;
|
Result<int> getStorageCellStart(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
||||||
* of the series. Options: 0-max. max is 15 (default) for chipv1.0 and 3 (default) for chipv1.1.
|
* of the series. Options: 0-max. max is 15 (default) for chipv1.0 and 3
|
||||||
|
* (default) for chipv1.1.
|
||||||
*/
|
*/
|
||||||
void setStorageCellStart(int cell, Positions pos = {});
|
void setStorageCellStart(int cell, Positions pos = {});
|
||||||
|
|
||||||
@ -1350,14 +1355,15 @@ class Detector {
|
|||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
Result<defs::streamingInterface> getVetoStream(Positions pos = {}) const;
|
Result<defs::streamingInterface> getVetoStream(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Gotthard2] Options: NONE (Default), LOW_LATENCY_LINK, ETHERNET_10GB (debugging), ALL
|
/** [Gotthard2] Options: NONE (Default), LOW_LATENCY_LINK, ETHERNET_10GB
|
||||||
* Enable or disable the 2 veto streaming interfaces available. Can
|
* (debugging), ALL Enable or disable the 2 veto streaming interfaces
|
||||||
* concatenate more than one interface. \nLOW_LATENCY_LINK is the default
|
* available. Can concatenate more than one interface. \nLOW_LATENCY_LINK is
|
||||||
* interface to work with. \nETHERNET_10GB is for debugging and also enables second
|
* the default interface to work with. \nETHERNET_10GB is for debugging and
|
||||||
* interface in receiver for listening to veto packets (writes a separate
|
* also enables second interface in receiver for listening to veto packets
|
||||||
* file if writing enabled). Also restarts client and receiver zmq sockets
|
* (writes a separate file if writing enabled). Also restarts client and
|
||||||
* if zmq streaming enabled.*/
|
* receiver zmq sockets if zmq streaming enabled.*/
|
||||||
void setVetoStream(const defs::streamingInterface value, Positions pos = {});
|
void setVetoStream(const defs::streamingInterface value,
|
||||||
|
Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
Result<defs::vetoAlgorithm>
|
Result<defs::vetoAlgorithm>
|
||||||
@ -1723,11 +1729,12 @@ class Detector {
|
|||||||
/** [Jungfrau][CTB][Moench] Advanced user Function! */
|
/** [Jungfrau][CTB][Moench] Advanced user Function! */
|
||||||
void resetFPGA(Positions pos = {});
|
void resetFPGA(Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
/** [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
||||||
* Advanced user Function! \n
|
* Advanced user Function! \n
|
||||||
* Copy detector server fname from tftp folder of hostname to detector \n
|
* Copy detector server fname from tftp folder of hostname to detector. Also
|
||||||
* [Jungfrau][Gotthard][CTB][Moench] Also changes respawn server, which is
|
* creates a symbolic link to a shorter name (without vx.x.x) \n
|
||||||
* effective after a reboot.
|
* [Jungfrau][Gotthard][CTB][Moench] Also changes respawn server (to the
|
||||||
|
* link), which is effective after a reboot.
|
||||||
*/
|
*/
|
||||||
void copyDetectorServer(const std::string &fname,
|
void copyDetectorServer(const std::string &fname,
|
||||||
const std::string &hostname, Positions pos = {});
|
const std::string &hostname, Positions pos = {});
|
||||||
|
@ -615,7 +615,8 @@ std::string CmdProxy::ReadoutSpeed(int action) {
|
|||||||
"quarter_speed]\n\t\t[Eiger][Jungfrau] Readout "
|
"quarter_speed]\n\t\t[Eiger][Jungfrau] Readout "
|
||||||
"speed of chip.\n\t\t[Eiger] Default speed is full_speed."
|
"speed of chip.\n\t\t[Eiger] Default speed is full_speed."
|
||||||
"\n\t\t[Jungfrau] Default speed is half_speed. full_speed "
|
"\n\t\t[Jungfrau] Default speed is half_speed. full_speed "
|
||||||
"option only available from v2.0 boards and is recommended to set "
|
"option only available from v2.0 boards and is recommended to "
|
||||||
|
"set "
|
||||||
"number of interfaces to 2. Also overwrites "
|
"number of interfaces to 2. Also overwrites "
|
||||||
"adcphase to recommended default.\n\t [144|108]\n\t\t[Gotthard2] "
|
"adcphase to recommended default.\n\t [144|108]\n\t\t[Gotthard2] "
|
||||||
"Readout speed of chip in MHz. Default is 108."
|
"Readout speed of chip in MHz. Default is 108."
|
||||||
@ -947,7 +948,8 @@ std::string CmdProxy::CurrentSource(int action) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. Default "
|
os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. "
|
||||||
|
"Default "
|
||||||
"is disabled.\n\t[0|1] [fix|nofix] [select source] [(only for "
|
"is disabled.\n\t[0|1] [fix|nofix] [select source] [(only for "
|
||||||
"chipv1.1)normal|low]\n\t\t[Jungfrau] Disable or enable current "
|
"chipv1.1)normal|low]\n\t\t[Jungfrau] Disable or enable current "
|
||||||
"source with some parameters. The select source is 0-63 for "
|
"source with some parameters. The select source is 0-63 for "
|
||||||
@ -1320,7 +1322,8 @@ std::string CmdProxy::Trigger(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
if (cmd == "trigger") {
|
if (cmd == "trigger") {
|
||||||
os << "\n\t[Eiger][Mythen3] Sends software trigger signal to detector";
|
os << "\n\t[Eiger][Mythen3] Sends software trigger signal to "
|
||||||
|
"detector";
|
||||||
} else if (cmd == "blockingtrigger") {
|
} else if (cmd == "blockingtrigger") {
|
||||||
os << "\n\t[Eiger] Sends software trigger signal to detector and "
|
os << "\n\t[Eiger] Sends software trigger signal to detector and "
|
||||||
"blocks till "
|
"blocks till "
|
||||||
@ -2032,7 +2035,8 @@ std::string CmdProxy::VetoStreaming(int action) {
|
|||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[none|lll|10gbe|...]\n\t[Gotthard2] Enable or disable the 2 "
|
os << "[none|lll|10gbe|...]\n\t[Gotthard2] Enable or disable the 2 "
|
||||||
"veto streaming interfaces available. Can include more than one "
|
"veto streaming interfaces available. Can include more than one "
|
||||||
"interface. \n\tDefault: none. lll (low latency link) is the default "
|
"interface. \n\tDefault: none. lll (low latency link) is the "
|
||||||
|
"default "
|
||||||
"interface to work with. \n\t10GbE is for debugging and also "
|
"interface to work with. \n\t10GbE is for debugging and also "
|
||||||
"enables second interface in receiver for listening to veto "
|
"enables second interface in receiver for listening to veto "
|
||||||
"packets (writes a separate file if writing enabled). Also "
|
"packets (writes a separate file if writing enabled). Also "
|
||||||
@ -2839,10 +2843,11 @@ std::string CmdProxy::CopyDetectorServer(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[server_name] "
|
os << "[server_name] "
|
||||||
"[pc_host_name]\n\t[Jungfrau][Ctb][Moench][Mythen3][Gotthard2] "
|
"[pc_host_name]\n\t[Jungfrau][Eiger][Ctb][Moench][Mythen3]["
|
||||||
"Copies detector server via tftp from pc. "
|
"Gotthard2] Copies detector server via tftp from pc. Makes a "
|
||||||
"\n\t[Jungfrau][Ctb][Moench]Also changes respawn server, which "
|
"symbolic link witha shorter name (without "
|
||||||
"is effective after a reboot."
|
"vx.x.x).\n\t[Jungfrau][Ctb][Moench]Also changes respawn server "
|
||||||
|
"to the link, which is effective after a reboot."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
throw sls::RuntimeError("Cannot get");
|
throw sls::RuntimeError("Cannot get");
|
||||||
|
Reference in New Issue
Block a user