sharedmem: working, need to add replace

This commit is contained in:
2018-06-27 10:05:05 +02:00
parent 0b140111b3
commit a0016cb005
11 changed files with 551 additions and 536 deletions

View File

@ -4,6 +4,7 @@
#include "multiSlsDetector.h"
#include "multiSlsDetectorCommand.h"
#include "sls_detector_exceptions.h"
#include <stdlib.h>
@ -54,7 +55,7 @@ public:
// sls pos scanned
iv=sscanf(argv[0],"%d:%s", &pos, cmd); \
if (iv != 2 ) \
pos = 0; \
pos = -1; \
if (iv == 2 && pos >= 0) { \
argv[0] = cmd; \
cout << pos << ":" ; \
@ -62,8 +63,12 @@ public:
if ((action==slsDetectorDefs::READOUT_ACTION) && (pos != -1) ) { \
cout << "pos " << pos << "is not allowed for readout!" << endl; \
return; \
} \
if (!strlen(cmd)) \
strcpy(cmd, argv[0]); \
// special commands
string scmd = cmd; \
// free without calling multiSlsDetector constructor
@ -74,6 +79,17 @@ public:
multiSlsDetector::freeSharedMemory(id); \
return; \
} \
// (sls level): give error message
// (multi level): free before calling multiSlsDetector constructor
else if (scmd == "hostname") { \
if (pos != -1) { \
cout << "pos " << pos << "not allowed for hostname. " \
"Only from multi detector level." << endl; \
return; \
} \
else \
multiSlsDetector::freeSharedMemory(id); \
} \
// get user details without verify sharedMultiSlsDetector version
else if ((scmd == "userdetails") && (action==slsDetectorDefs::GET_ACTION)) {\
verify = false; \
@ -107,7 +123,7 @@ public:
return; \
}; \
cout<<"id:"<<id<<" pos:"<<pos<<endl;
// call multi detector command line
myCmd=new multiSlsDetectorCommand(myDetector); \
answer=myCmd->executeLine(argc, argv, action, pos); \