mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
update mode added. need to fix why udpatemode get and set not in allowed functions
This commit is contained in:
@ -1733,8 +1733,8 @@ 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]
|
||||
/** [[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
|
||||
@ -1764,13 +1764,14 @@ 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
|
||||
* shorter named server link at start up \n sname is name of detector
|
||||
* server binary found on tftp folder of host pc \n hostname is name of pc
|
||||
* to tftp from \n fname is programming file name with full path to it
|
||||
/** [[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 shorter named
|
||||
* server link at start up \n sname is name of detector server binary found
|
||||
* on tftp folder of host pc \n hostname is name of pc to tftp from \n fname
|
||||
* is programming file name with full path to it
|
||||
*/
|
||||
void updateFirmwareAndServer(const std::string &sname,
|
||||
const std::string &hostname,
|
||||
@ -1780,12 +1781,19 @@ class Detector {
|
||||
* 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
|
||||
* 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 = {});
|
||||
|
||||
Result<bool> getUpdateMode(Positions pos = {});
|
||||
|
||||
/** Restarts detector server in update mode. This is useful when
|
||||
* server-firmware compatibility is at its worst and server cannot start up
|
||||
* normally */
|
||||
void setUpdateMode(const bool updatemode, 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
|
||||
|
@ -1063,6 +1063,7 @@ class CmdProxy {
|
||||
{"updatekernel", &CmdProxy::UpdateKernel},
|
||||
{"rebootcontroller", &CmdProxy::rebootcontroller},
|
||||
{"update", &CmdProxy::UpdateFirmwareAndDetectorServer},
|
||||
{"updatemode", &CmdProxy::updatemode},
|
||||
{"reg", &CmdProxy::Register},
|
||||
{"adcreg", &CmdProxy::AdcRegister},
|
||||
{"setbit", &CmdProxy::BitOperations},
|
||||
@ -2184,6 +2185,12 @@ class CmdProxy {
|
||||
"\n\t[Jungfrau][Ctb][Moench][Gotthard][Mythen3]["
|
||||
"Gotthard2] Reboot controller of detector.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
updatemode, getUpdateMode, setUpdateMode, StringTo<int>,
|
||||
"[0|1]\n\tRestart the detector server in update mode or not. This is "
|
||||
"useful when server-firmware compatibility is at its worst and server "
|
||||
"cannot start up normally");
|
||||
|
||||
EXECUTE_SET_COMMAND(
|
||||
firmwaretest, executeFirmwareTest,
|
||||
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Firmware "
|
||||
|
@ -2195,6 +2195,15 @@ void Detector::updateFirmwareAndServer(const std::string &sname,
|
||||
programFPGA(fname, pos);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getUpdateMode(Positions pos) {
|
||||
return pimpl->Parallel(&Module::getUpdateMode, pos);
|
||||
}
|
||||
|
||||
void Detector::setUpdateMode(const bool updatemode, Positions pos) {
|
||||
pimpl->Parallel(&Module::setUpdateMode, pos, updatemode);
|
||||
rebootController(pos);
|
||||
}
|
||||
|
||||
Result<uint32_t> Detector::readRegister(uint32_t addr, Positions pos) const {
|
||||
return pimpl->Parallel(&Module::readRegister, pos, addr);
|
||||
}
|
||||
|
@ -2539,8 +2539,9 @@ void Module::updateDetectorServer(std::vector<char> buffer,
|
||||
"Update Detector Server (no tftp)", serverName);
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Updating DetectorServer via the package is not implemented "
|
||||
"for this detector");
|
||||
throw RuntimeError(
|
||||
"Updating DetectorServer via the package is not implemented "
|
||||
"for this detector");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2567,6 +2568,14 @@ void Module::rebootController() {
|
||||
<< "): Controller rebooted successfully!";
|
||||
}
|
||||
|
||||
bool Module::getUpdateMode() { return sendToDetector<int>(F_GET_UPDATE_MODE); }
|
||||
|
||||
void Module::setUpdateMode(const bool updatemode) {
|
||||
sendToDetector(F_SET_UPDATE_MODE, static_cast<int>(updatemode), nullptr);
|
||||
LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname
|
||||
<< "): Update Mode set to " << updatemode << "!";
|
||||
}
|
||||
|
||||
uint32_t Module::readRegister(uint32_t addr) const {
|
||||
return sendToDetectorStop<uint32_t>(F_READ_REGISTER, addr);
|
||||
}
|
||||
|
@ -545,6 +545,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
const std::string &serverName);
|
||||
void updateKernel(std::vector<char> buffer);
|
||||
void rebootController();
|
||||
bool getUpdateMode();
|
||||
void setUpdateMode(const bool updatemode);
|
||||
uint32_t readRegister(uint32_t addr) const;
|
||||
uint32_t writeRegister(uint32_t addr, uint32_t val);
|
||||
void setBit(uint32_t addr, int n);
|
||||
|
Reference in New Issue
Block a user