Gappixels (#89)

* WIP

* WIP virtual delays, imagetest for saturation

* WIP, vertical and horizontal

* WIP

* gap pixels work, fixed 32 bit data out (10gbe=0) for virtual servers

* quad works (also in virtual), handling gappixels and quad

* jungfrau gapppixels work

* jungfrau: done

* complete image or missing packets given in json header and gui

* eiger virtual 4 bit mode bug fix

* working version of zmq add json header, except printout

* printout bug

* fix for json para

* to map WIP

* map done

* map print , mapwith result left

* json result works, testing added

* updated server binaries

* compiling on rhels7, variable size char array iniitalization

* zmqsocket parsing didnt need Document

* const to map, json para is strings not map

* json add header: mapping cleaner without insert make_pair
This commit is contained in:
Dhanya Thattil
2020-03-30 14:54:35 +02:00
committed by GitHub
parent 6a6af528ef
commit d58eb1dc6e
52 changed files with 1879 additions and 1398 deletions

View File

@ -26,8 +26,12 @@ void ASIC_Driver_SetDefines(char* driverfname) {
}
int ASIC_Driver_Set (int index, int length, char* buffer) {
char temp[20];
memset(temp, 0, sizeof(temp));
sprintf(temp, "%d", index + 1);
char fname[MAX_STR_LENGTH];
sprintf(fname, "%s%d", ASIC_Driver_DriverFileName, index + 1);
strcpy(fname, ASIC_Driver_DriverFileName);
strcat(fname, temp);
LOG(logDEBUG2, ("\t[chip index: %d, length: %d, fname: %s]\n", index, length, fname));
{
LOG(logDEBUG2, ("\t[values: \n"));

View File

@ -73,7 +73,11 @@ int LTC2620_D_SetDACValue (int dacnum, int val, int mV, char* dacname, int* dacv
LOG(logINFO, ("Setting DAC %2d [%-12s] : %d dac (%d mV)\n",dacnum, dacname, *dacval, dacmV));
char fname[MAX_STR_LENGTH];
sprintf(fname, "%s%d", LTC2620_D_DriverFileName, dacnum);
strcpy(fname, LTC2620_D_DriverFileName);
char temp[20];
memset(temp, 0, sizeof(temp));
sprintf(temp, "%d", dacnum);
strcat(fname, temp);
LOG(logDEBUG1, ("fname %s\n",fname));
//open file

View File

@ -101,17 +101,25 @@ int main(int argc, char *argv[]){
}
#ifdef STOP_SERVER
char cmd[100];
memset(cmd, 0, 100);
char cmd[MAX_STR_LENGTH];
memset(cmd, 0, MAX_STR_LENGTH);
#endif
if (isControlServer) {
LOG(logINFO, ("Opening control server on port %d \n", portno));
#ifdef STOP_SERVER
{
int i;
for (i = 0; i < argc; ++i)
sprintf(cmd, "%s %s", cmd, argv[i]);
sprintf(cmd,"%s -stopserver -port %d &", cmd, portno + 1);
for (i = 0; i < argc; ++i) {
if (i > 0) {
strcat(cmd, " ");
}
strcat(cmd, argv[i]);
}
char temp[50];
memset(temp, 0, sizeof(temp));
sprintf(temp, " -stopserver -port %d &", portno + 1);
strcat(cmd, temp);
LOG(logDEBUG1, ("Command to start stop server:%s\n", cmd));
system(cmd);
}

View File

@ -776,10 +776,10 @@ int set_image_test_mode(int file_des) {
return printSocketReadError();
LOG(logDEBUG1, ("Setting image test mode to \n", arg));
#ifndef GOTTHARDD
functionNotImplemented();
#else
#if defined(GOTTHARDD) || ((defined(EIGERD) || defined(JUNGFRAUD)) && defined(VIRTUAL))
setTestImageMode(arg);
#else
functionNotImplemented();
#endif
return Server_SendResult(file_des, INT32, UPDATE, NULL, 0);
}
@ -790,11 +790,11 @@ int get_image_test_mode(int file_des) {
int retval = -1;
LOG(logDEBUG1, ("Getting image test mode\n"));
#ifndef GOTTHARDD
functionNotImplemented();
#else
#if defined(GOTTHARDD) || ((defined(EIGERD) || defined(JUNGFRAUD)) && defined(VIRTUAL))
retval = getTestImageMode();
LOG(logDEBUG1, ("image test mode retval: %d\n", retval));
#else
functionNotImplemented();
#endif
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
}
@ -1844,7 +1844,8 @@ int start_acquisition(int file_des) {
#endif
if (configured == FAIL) {
ret = FAIL;
sprintf(mess, "Could not start acquisition because %s\n", configureMessage);
strcpy(mess, "Could not start acquisition because ");
strcat(mess, configureMessage);
LOG(logERROR,(mess));
} else {
ret = startStateMachine();
@ -1979,7 +1980,8 @@ int start_and_read_all(int file_des) {
#endif
if (configured == FAIL) {
ret = FAIL;
sprintf(mess, "Could not start acquisition because %s\n", configureMessage);
strcpy(mess, "Could not start acquisition because ");
strcat(mess, configureMessage);
LOG(logERROR,(mess));
} else {
ret = startStateMachine();
@ -4352,7 +4354,11 @@ int copy_detector_server(int file_des) {
memset(cmd, 0, MAX_STR_LENGTH);
// copy server
sprintf(cmd, "tftp %s -r %s -g", hostname, sname);
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;
@ -4364,7 +4370,8 @@ int copy_detector_server(int file_des) {
else {
LOG(logINFO, ("Server copied successfully\n"));
// give permissions
sprintf(cmd, "chmod 777 %s", sname);
strcpy(cmd, "chmod 777 ");
strcat(cmd, sname);
executeCommand(cmd, retvals, logDEBUG1);
// edit /etc/inittab
@ -4384,7 +4391,9 @@ int copy_detector_server(int file_des) {
LOG(logINFO, ("Deleted all lines containing DetectorServer in /etc/inittab\n"));
// append line
sprintf(cmd, "echo \"ttyS0::respawn:/./%s\" >> /etc/inittab", sname);
strcpy(cmd, "echo \"ttyS0::respawn:/./");
strcat(cmd, sname);
strcat(cmd, "\" >> /etc/inittab");
executeCommand(cmd, retvals, logDEBUG1);
LOG(logINFO, ("/etc/inittab modified to have %s\n", sname));