mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 10:44:39 +01:00
server works
This commit is contained in:
@@ -1733,7 +1733,8 @@ class Detector {
|
||||
/** [Jungfrau][CTB][Moench] Advanced user Function! */
|
||||
void resetFPGA(Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
||||
/** [[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
|
||||
@@ -1763,7 +1764,7 @@ class Detector {
|
||||
* Function! */
|
||||
void rebootController(Positions pos = {});
|
||||
|
||||
/**
|
||||
/** [[deprecated ("Replaced by overloaded updateDetectorServer, which does not require tftp and has one less argument")]]
|
||||
* Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the
|
||||
* firmware, detector server, make a soft link and then reboots detector
|
||||
* controller. \n [Mythen3][Gotthard2] Will require a script to start up the
|
||||
@@ -1775,6 +1776,16 @@ class Detector {
|
||||
const std::string &hostname,
|
||||
const std::string &fname, Positions pos = {});
|
||||
|
||||
/**
|
||||
* Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the
|
||||
* firmware, detector server, make a soft link and then reboots detector
|
||||
* controller. \n [Mythen3][Gotthard2] Will require a script to start up the
|
||||
* shorter named server link at start up \n sname is full path name of detector
|
||||
* server \n fname is programming file name with full path to it
|
||||
*/
|
||||
void updateFirmwareAndServer(const std::string &sname,
|
||||
const std::string &fname, Positions pos = {});
|
||||
|
||||
/** Advanced user Function! \n
|
||||
* Goes to stop server. Hence, can be called while calling blocking
|
||||
* acquire(). \n [Eiger] Address is +0x100 for only left, +0x200 for only
|
||||
|
||||
@@ -2853,6 +2853,7 @@ 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 "
|
||||
|
||||
@@ -2156,19 +2156,17 @@ void Detector::copyDetectorServer(const std::string &fname,
|
||||
void Detector::updateDetectorServer(const std::string &fname, Positions pos) {
|
||||
LOG(logINFO) << "Updating Detector Server...";
|
||||
|
||||
const std::string &serverName std::vector<char> buffer =
|
||||
std::vector<char> buffer =
|
||||
readBinaryFile(fname, "Update Detector Server");
|
||||
|
||||
// get file name
|
||||
// get only the file name
|
||||
std::string filename(fname);
|
||||
std::size_t pos = fname.rfind('/');
|
||||
if (pos != std::string::npos) {
|
||||
filename = filePath.substr(pos + 1, filePath.size() - 1);
|
||||
std::size_t slashPos = fname.rfind('/');
|
||||
if (slashPos != std::string::npos) {
|
||||
filename = fname.substr(slashPos + 1, fname.size() - 1);
|
||||
}
|
||||
LOG(logINFOBLUE) << "filename:" << filename;
|
||||
exit(-1);
|
||||
std::filesystem::path(fname).filename();
|
||||
pimpl->Parallel(&Module::updateDetectorServer, pos, buffer);
|
||||
|
||||
pimpl->Parallel(&Module::updateDetectorServer, pos, buffer, filename);
|
||||
if (getDetectorType().squash() != defs::EIGER) {
|
||||
rebootController(pos);
|
||||
}
|
||||
@@ -2192,6 +2190,16 @@ void Detector::updateFirmwareAndServer(const std::string &sname,
|
||||
LOG(logINFO) << "Updating Firmware and Detector Server...";
|
||||
pimpl->Parallel(&Module::copyDetectorServer, pos, sname, hostname);
|
||||
programFPGA(fname, pos);
|
||||
rebootController(pos);
|
||||
}
|
||||
|
||||
void Detector::updateFirmwareAndServer(const std::string &sname,
|
||||
const std::string &fname,
|
||||
Positions pos) {
|
||||
LOG(logINFO) << "Updating Firmware and Detector Server (no tftp)...";
|
||||
updateDetectorServer(sname, pos);
|
||||
programFPGA(fname, pos);
|
||||
rebootController(pos);
|
||||
}
|
||||
|
||||
Result<uint32_t> Detector::readRegister(uint32_t addr, Positions pos) const {
|
||||
|
||||
Reference in New Issue
Block a user