wip, removed extra virutal server binaries for eiger, --ignore-config for command line

This commit is contained in:
2022-02-23 17:31:46 +01:00
parent 89edf58f41
commit 219318a52e
8 changed files with 81 additions and 101 deletions

View File

@ -16,91 +16,31 @@ include_directories(
../../slsSupportLib/include
)
add_executable(eigerDetectorServerMaster_virtual
add_executable(eigerDetectorServer_virtual
${src}
)
target_include_directories(eigerDetectorServerMaster_virtual
target_include_directories(eigerDetectorServer_virtual
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(eigerDetectorServerMaster_virtual
PUBLIC EIGERD PCCOMPILE STOP_SERVER
PUBLIC VIRTUAL #VIRTUAL_9M
PUBLIC VIRTUAL_MASTER
)
target_link_libraries(eigerDetectorServerMaster_virtual
PUBLIC pthread rt slsProjectCSettings
)
set_target_properties(eigerDetectorServerMaster_virtual PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS eigerDetectorServerMaster_virtual
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
add_executable(eigerDetectorServerSlaveTop_virtual
${src}
)
target_include_directories(eigerDetectorServerSlaveTop_virtual
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(eigerDetectorServerSlaveTop_virtual
PUBLIC EIGERD PCCOMPILE STOP_SERVER
PUBLIC VIRTUAL #VIRTUAL_9M
PUBLIC VIRTUAL_TOP
)
target_link_libraries(eigerDetectorServerSlaveTop_virtual
PUBLIC pthread rt slsProjectCSettings
)
set_target_properties(eigerDetectorServerSlaveTop_virtual PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS eigerDetectorServerSlaveTop_virtual
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
add_executable(eigerDetectorServerSlaveBottom_virtual
${src}
)
target_include_directories(eigerDetectorServerSlaveBottom_virtual
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(eigerDetectorServerSlaveBottom_virtual
target_compile_definitions(eigerDetectorServer_virtual
PUBLIC EIGERD PCCOMPILE STOP_SERVER
PUBLIC VIRTUAL #VIRTUAL_9M
)
target_link_libraries(eigerDetectorServerSlaveBottom_virtual
target_link_libraries(eigerDetectorServer_virtual
PUBLIC pthread rt slsProjectCSettings
)
set_target_properties(eigerDetectorServerSlaveBottom_virtual PROPERTIES
set_target_properties(eigerDetectorServer_virtual PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS eigerDetectorServerSlaveBottom_virtual
install(TARGETS eigerDetectorServer_virtual
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
configure_file(config_eiger.txt ${CMAKE_BINARY_DIR}/bin/config_eiger.txt COPYONLY)
configure_file(detid_eiger.txt ${CMAKE_BINARY_DIR}/bin/detid_eiger.txt COPYONLY)

View File

@ -26,6 +26,7 @@ extern int updateFlag;
extern udpStruct udpDetails[MAX_UDP_DESTINATION];
extern int numUdpDestinations;
extern const enum detectorType myDetectorType;
extern int ignoreConfigFileFlag;
// Global variable from communication_funcs.c
extern int isControlServer;
@ -381,20 +382,9 @@ void initStopServer() {
}
}
void setVirtualDefaultModuleConfigurations() {
void checkVirtual9MFlag() {
LOG(logINFORED, ("updating virtual\n"));
#ifdef VIRTUAL
#ifdef VIRTUAL_MASTER
master = 1;
top = 1;
#else
master = 0;
#ifdef VIRTUAL_TOP
top = 1;
#else
top = 0;
#endif
#endif
#ifdef VIRTUAL_9M
normal = 0;
#else
@ -404,13 +394,17 @@ void setVirtualDefaultModuleConfigurations() {
}
int updateModuleConfiguration() {
#ifdef VIRTUAL
setVirtualDefaultModuleConfigurations();
#else
if (getModuleConfiguration(&master, &top, &normal) == FAIL) {
return FAIL;
}
#ifdef VIRTUAL
checkVirtual9MFlag();
#endif
if (isControlServer) {
LOG(logINFOBLUE,
("Module: %s %s %s\n", (top ? "TOP" : "BOTTOM"),
(master ? "MASTER" : "SLAVE"), (normal ? "NORMAL" : "SPECIAL")));
}
return OK;
}
@ -430,21 +424,17 @@ int getModuleConfiguration(int *m, int *t, int *n) {
return FAIL;
}
#endif
if (isControlServer) {
LOG(logINFOBLUE,
("Module: %s %s %s\n", (*t ? "TOP" : "BOTTOM"),
(*m ? "MASTER" : "SLAVE"), (*n ? "NORMAL" : "SPECIAL")));
}
return OK;
}
int readConfigFile() {
if (initError == FAIL) {
return initError;
}
master = -1;
top = -1;
if (ignoreConfigFileFlag) {
return OK;
}
const int fileNameSize = 128;
char fname[fileNameSize];
@ -1472,6 +1462,7 @@ int setHighVoltage(int val) {
/* parameters - timing, extsig */
int setMaster(int m) {
LOG(logINFO, ("Setting up as %s\n", (m == 1 ? "Master" : "Slave")));
#ifdef VIRTUAL
master = m;
#else