mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-17 01:42:26 +01:00
moduleid for eiger m3 and g2, but set only for g2
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user