moduleid for eiger m3 and g2, but set only for g2

This commit is contained in:
2021-09-01 17:06:34 +02:00
parent 25d03f949e
commit a51deda2a4
22 changed files with 180 additions and 95 deletions

View File

@@ -41,4 +41,5 @@ install(TARGETS mythen3DetectorServer_virtual
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
configure_file(DefaultPattern_mythen3.txt ${CMAKE_BINARY_DIR}/bin/DefaultPattern_mythen3.txt COPYONLY)
configure_file(DefaultPattern_mythen3.txt ${CMAKE_BINARY_DIR}/bin/DefaultPattern_mythen3.txt COPYONLY)
configure_file(detid_mythen3.txt ${CMAKE_BINARY_DIR}/bin/detid_mythen3.txt COPYONLY)

View File

@@ -34,6 +34,7 @@ $(PROGS): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
mv $(PROGS) $(DESTDIR)
cp DefaultPattern_mythen3.txt $(DESTDIR)
cp detid_mythen3.txt $(DESTDIR)
rm $(main_src)*.o
clean:

View File

@@ -274,28 +274,17 @@ u_int16_t getHardwareVersionNumber() {
MCB_SERIAL_NO_VRSN_OFST);
}
void readDetectorNumber() {
#ifndef VIRTUAL
if (initError == FAIL) {
return;
}
FILE *fd = fopen(ID_FILE, "r");
if (fd == NULL) {
sprintf(initErrorMessage, "No %s file found.\n", ID_FILE);
LOG(logERROR, ("%s\n\n", initErrorMessage));
initError = FAIL;
return;
}
char output[255];
fgets(output, sizeof(output), fd);
sscanf(output, "%u", &detID);
if (isControlServer) {
LOG(logINFOBLUE, ("Detector ID: %u\n", detID));
}
u_int32_t getDetectorNumber() {
#ifdef VIRTUAL
return 0;
#endif
return bus_r(MCB_SERIAL_NO_REG);
}
u_int32_t getDetectorNumber() { return detID; }
int getModuleId(int *ret, char *mess) {
return getModuleIdInFile(ret, mess, ID_FILE);
}
u_int64_t getDetectorMAC() {
#ifdef VIRTUAL
@@ -481,7 +470,7 @@ void setupDetector() {
#ifdef VIRTUAL
enableTenGigabitEthernet(0);
#endif
readDetectorNumber();
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
if (initError == FAIL) {
return;
}