mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
removed copydetectorserver
This commit is contained in:
parent
11bf6a5c58
commit
150d27cf95
@ -60,6 +60,7 @@ This document describes the differences between v7.0.0 and v6.x.x
|
||||
- master binary file in json format now
|
||||
- fixed bug introduced in 6.0.0: hdf5 files created 1 file per frame after the initial file which had maxframesperfile
|
||||
- updatedetectorserver - removes old server current binary pointing to for blackfin
|
||||
- removing copydetectorserver using tftp
|
||||
|
||||
|
||||
2. Resolved Issues
|
||||
|
@ -1551,11 +1551,6 @@ void init_det(py::module &m) {
|
||||
.def("resetFPGA",
|
||||
(void (Detector::*)(sls::Positions)) & Detector::resetFPGA,
|
||||
py::arg() = Positions{})
|
||||
.def("copyDetectorServer",
|
||||
(void (Detector::*)(const std::string &, const std::string &,
|
||||
sls::Positions)) &
|
||||
Detector::copyDetectorServer,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("updateDetectorServer",
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::updateDetectorServer,
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -132,7 +132,6 @@ int check_version(int);
|
||||
int software_trigger(int);
|
||||
int led(int);
|
||||
int digital_io_delay(int);
|
||||
int copy_detector_server(int);
|
||||
int reboot_controller(int);
|
||||
int set_adc_enable_mask(int);
|
||||
int get_adc_enable_mask(int);
|
||||
|
@ -93,7 +93,6 @@ int updateModeAllowedFunction(int file_des) {
|
||||
F_PROGRAM_FPGA,
|
||||
F_RESET_FPGA,
|
||||
F_CHECK_VERSION,
|
||||
F_COPY_DET_SERVER,
|
||||
F_REBOOT_CONTROLLER,
|
||||
F_GET_KERNEL_VERSION,
|
||||
F_UPDATE_KERNEL,
|
||||
@ -322,7 +321,6 @@ void function_table() {
|
||||
flist[F_SOFTWARE_TRIGGER] = &software_trigger;
|
||||
flist[F_LED] = &led;
|
||||
flist[F_DIGITAL_IO_DELAY] = &digital_io_delay;
|
||||
flist[F_COPY_DET_SERVER] = ©_detector_server;
|
||||
flist[F_REBOOT_CONTROLLER] = &reboot_controller;
|
||||
flist[F_SET_ADC_ENABLE_MASK] = &set_adc_enable_mask;
|
||||
flist[F_GET_ADC_ENABLE_MASK] = &get_adc_enable_mask;
|
||||
@ -4143,65 +4141,6 @@ int digital_io_delay(int file_des) {
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
||||
int copy_detector_server(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
char args[2][MAX_STR_LENGTH];
|
||||
char retvals[MAX_STR_LENGTH] = {0};
|
||||
|
||||
memset(args, 0, sizeof(args));
|
||||
memset(retvals, 0, sizeof(retvals));
|
||||
|
||||
if (receiveData(file_des, args, sizeof(args), OTHER) < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
#ifdef VIRTUAL
|
||||
functionNotImplemented();
|
||||
#else
|
||||
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
char *sname = args[0];
|
||||
char *hostname = args[1];
|
||||
LOG(logINFOBLUE, ("Copying server %s from host %s\n", sname, hostname));
|
||||
char cmd[MAX_STR_LENGTH] = {0};
|
||||
|
||||
#ifdef BLACKFIN_DEFINED
|
||||
// check update is allowed (Non Amd OR AMD + current kernel)
|
||||
ret = allowUpdate(mess, "copy detector server");
|
||||
#endif
|
||||
|
||||
// tftp server
|
||||
if (ret == OK) {
|
||||
if (snprintf(cmd, MAX_STR_LENGTH, "tftp %s -r %s -g", hostname,
|
||||
sname) >= MAX_STR_LENGTH) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not copy detector server. Command to copy "
|
||||
"server too long\n");
|
||||
LOG(logERROR, (mess));
|
||||
} else if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
ret = FAIL;
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not copy detector server (tftp). %s\n",
|
||||
retvals);
|
||||
// LOG(logERROR, (mess)); already printed in executecommand
|
||||
} else {
|
||||
LOG(logINFO, ("\tServer copied\n"));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
// a fail here is not a show stopper (just for memory)
|
||||
deleteOldServers(mess, serverName, "update detector server");
|
||||
#endif
|
||||
if (ret == OK) {
|
||||
ret = setupDetectorServer(mess, sname);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
|
||||
}
|
||||
|
||||
int reboot_controller(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
|
@ -1766,23 +1766,11 @@ class Detector {
|
||||
/** [Jungfrau][CTB][Moench] Advanced user Function! */
|
||||
void resetFPGA(Positions pos = {});
|
||||
|
||||
/** [[deprecated ("Replaced by updateDetectorServer, which does not require
|
||||
* tftp")]] [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
||||
* Advanced user Function! \n
|
||||
* Copy detector server fname from tftp folder of hostname to detector. Also
|
||||
* creates a symbolic link to a shorter name (without vx.x.x). Then the
|
||||
* detector controller reboots (except eiger) \n
|
||||
* [Jungfrau][Gotthard][CTB][Moench] Also changes respawn server (to the
|
||||
* link), which is effective after a reboot.
|
||||
*/
|
||||
void copyDetectorServer(const std::string &fname,
|
||||
const std::string &hostname, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Eiger][Ctb][Moench][Mythen3][Gotthard2] Copies detector
|
||||
* server via TCP (without tftp).\nMakes a symbolic link with a shorter
|
||||
* name (without vx.x.x).\nThen, detector controller reboots (except
|
||||
* Eiger).\n[Jungfrau][Ctb][Moench]Also changes respawn server to the
|
||||
* link, which is effective after a reboot.
|
||||
* Eiger).\n[Jungfrau][Ctb][Moench] Also deletes old server binary and
|
||||
* changes respawn server to the link, which is effective after a reboot.
|
||||
*/
|
||||
void updateDetectorServer(const std::string &fname, Positions pos = {});
|
||||
|
||||
|
@ -2911,35 +2911,6 @@ std::string CmdProxy::ProgramFpga(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::CopyDetectorServer(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
LOG(logWARNING) << "Deprecated! Replaced by updatedetectorserver that "
|
||||
"requires no tftp.\n";
|
||||
os << "[server_name (in tftp folder)] "
|
||||
"[pc_host_name]\n\t[Jungfrau][Eiger][Ctb][Moench][Mythen3]["
|
||||
"Gotthard2] Copies detector server via TFTP from pc. Ensure that "
|
||||
"server is in the pc's tftp folder. Makes a symbolic link with a "
|
||||
"shorter name (without vx.x.x). Then, detector controller "
|
||||
"reboots (except "
|
||||
"Eiger).\n\t[Jungfrau][Ctb][Moench]Also changes respawn server "
|
||||
"to the link, which is effective after a reboot."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
throw sls::RuntimeError("Cannot get");
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
det->copyDetectorServer(args[0], args[1], std::vector<int>{det_id});
|
||||
os << "successful\n";
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::UpdateDetectorServer(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
|
@ -743,7 +743,11 @@ class CmdProxy {
|
||||
|
||||
/* Pattern */
|
||||
/* Moench */
|
||||
|
||||
/* Advanced */
|
||||
{"copydetectorserver", "updatedetectorserver"},
|
||||
|
||||
|
||||
/* Insignificant */
|
||||
{"nframes", "framecounter"},
|
||||
{"now", "runtime"},
|
||||
@ -1062,7 +1066,6 @@ class CmdProxy {
|
||||
/* Advanced */
|
||||
{"programfpga", &CmdProxy::ProgramFpga},
|
||||
{"resetfpga", &CmdProxy::resetfpga},
|
||||
{"copydetectorserver", &CmdProxy::CopyDetectorServer},
|
||||
{"updatedetectorserver", &CmdProxy::UpdateDetectorServer},
|
||||
{"updatekernel", &CmdProxy::UpdateKernel},
|
||||
{"rebootcontroller", &CmdProxy::rebootcontroller},
|
||||
@ -1189,7 +1192,6 @@ class CmdProxy {
|
||||
std::string JsonParameter(int action);
|
||||
/* Advanced */
|
||||
std::string ProgramFpga(int action);
|
||||
std::string CopyDetectorServer(int action);
|
||||
std::string UpdateDetectorServer(int action);
|
||||
std::string UpdateKernel(int action);
|
||||
std::string UpdateFirmwareAndDetectorServer(int action);
|
||||
|
@ -2242,15 +2242,6 @@ void Detector::resetFPGA(Positions pos) {
|
||||
pimpl->Parallel(&Module::resetFPGA, pos);
|
||||
}
|
||||
|
||||
void Detector::copyDetectorServer(const std::string &fname,
|
||||
const std::string &hostname, Positions pos) {
|
||||
LOG(logINFO) << "Updating Detector Server (via tftp)...";
|
||||
pimpl->Parallel(&Module::copyDetectorServer, pos, fname, hostname);
|
||||
if (getDetectorType().squash() != defs::EIGER) {
|
||||
rebootController(pos);
|
||||
}
|
||||
}
|
||||
|
||||
void Detector::updateDetectorServer(const std::string &fname, Positions pos) {
|
||||
LOG(logINFO) << "Updating Detector Server (no tftp)...";
|
||||
std::vector<char> buffer = readBinaryFile(fname, "Update Detector Server");
|
||||
|
@ -2611,28 +2611,6 @@ void Module::programFPGA(std::vector<char> buffer,
|
||||
|
||||
void Module::resetFPGA() { sendToDetector(F_RESET_FPGA); }
|
||||
|
||||
void Module::copyDetectorServer(const std::string &fname,
|
||||
const std::string &hostname) {
|
||||
char args[2][MAX_STR_LENGTH]{};
|
||||
sls::strcpy_safe(args[0], fname.c_str());
|
||||
sls::strcpy_safe(args[1], hostname.c_str());
|
||||
LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname
|
||||
<< "): Sending detector server " << args[0] << " from host "
|
||||
<< args[1];
|
||||
auto client = DetectorSocket(shm()->hostname, shm()->controlPort);
|
||||
client.Send(F_COPY_DET_SERVER);
|
||||
client.Send(args);
|
||||
if (client.Receive<int>() == FAIL) {
|
||||
std::cout << '\n';
|
||||
std::ostringstream os;
|
||||
os << "Module " << moduleIndex << " (" << shm()->hostname << ")"
|
||||
<< " returned error: " << client.readErrorMessage();
|
||||
throw DetectorError(os.str());
|
||||
}
|
||||
LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname
|
||||
<< "): Detector server copied";
|
||||
}
|
||||
|
||||
void Module::updateDetectorServer(std::vector<char> buffer,
|
||||
const std::string &serverName) {
|
||||
switch (shm()->detType) {
|
||||
|
@ -548,8 +548,6 @@ class Module : public virtual slsDetectorDefs {
|
||||
void programFPGA(std::vector<char> buffer,
|
||||
const bool forceDeleteNormalFile);
|
||||
void resetFPGA();
|
||||
void copyDetectorServer(const std::string &fname,
|
||||
const std::string &hostname);
|
||||
void updateDetectorServer(std::vector<char> buffer,
|
||||
const std::string &serverName);
|
||||
void updateKernel(std::vector<char> buffer);
|
||||
|
@ -111,7 +111,6 @@ enum detFuncs {
|
||||
F_SOFTWARE_TRIGGER,
|
||||
F_LED,
|
||||
F_DIGITAL_IO_DELAY,
|
||||
F_COPY_DET_SERVER,
|
||||
F_REBOOT_CONTROLLER,
|
||||
F_SET_ADC_ENABLE_MASK,
|
||||
F_GET_ADC_ENABLE_MASK,
|
||||
@ -477,7 +476,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_SOFTWARE_TRIGGER: return "F_SOFTWARE_TRIGGER";
|
||||
case F_LED: return "F_LED";
|
||||
case F_DIGITAL_IO_DELAY: return "F_DIGITAL_IO_DELAY";
|
||||
case F_COPY_DET_SERVER: return "F_COPY_DET_SERVER";
|
||||
case F_REBOOT_CONTROLLER: return "F_REBOOT_CONTROLLER";
|
||||
case F_SET_ADC_ENABLE_MASK: return "F_SET_ADC_ENABLE_MASK";
|
||||
case F_GET_ADC_ENABLE_MASK: return "F_GET_ADC_ENABLE_MASK";
|
||||
|
@ -2,14 +2,14 @@
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
/** API versions */
|
||||
#define GITBRANCH "developer"
|
||||
#define APILIB 0x211125
|
||||
#define APIRECEIVER 0x211124
|
||||
#define APIGUI 0x211124
|
||||
|
||||
#define APICTB 0x220404
|
||||
#define APIGOTTHARD 0x220404
|
||||
#define APIGOTTHARD2 0x220404
|
||||
#define APIJUNGFRAU 0x220404
|
||||
#define APIMYTHEN3 0x220404
|
||||
#define APIMOENCH 0x220404
|
||||
#define APIEIGER 0x220404
|
||||
#define APILIB 0x220405
|
||||
#define APIRECEIVER 0x220405
|
||||
#define APIGUI 0x220328
|
||||
#define APICTB 0x220405
|
||||
#define APIGOTTHARD 0x220405
|
||||
#define APIGOTTHARD2 0x220405
|
||||
#define APIJUNGFRAU 0x220405
|
||||
#define APIMYTHEN3 0x220405
|
||||
#define APIMOENCH 0x220405
|
||||
#define APIEIGER 0x220405
|
||||
|
Loading…
x
Reference in New Issue
Block a user