mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-08-06 16:22:25 +02:00
update rx master file for all threshold energies(m3) when setting dac directly, custom trimbits, setting settings, trimbits etc
This commit is contained in:
@@ -196,6 +196,9 @@ void Module::setSettings(detectorSettings isettings) {
|
||||
"Cannot set settings for Eiger. Use threshold energy.");
|
||||
}
|
||||
sendToDetector<int>(F_SET_SETTINGS, isettings);
|
||||
if (shm()->detType == MYTHEN3) {
|
||||
updateRxAllThresholdMetadata(getAllThresholdEnergy());
|
||||
}
|
||||
}
|
||||
|
||||
int Module::getThresholdEnergy() const {
|
||||
@@ -266,6 +269,8 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||
detectorSettings isettings, bool trimbits) {
|
||||
if (shm()->detType != MYTHEN3) {
|
||||
@@ -414,7 +419,9 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||
throw RuntimeError("setThresholdEnergyAndSettings: Could not set "
|
||||
"settings in Module");
|
||||
}
|
||||
}
|
||||
|
||||
void Module::updateRxAllThresholdMetadata(std::array<int, 3> e_eV) {
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_RECEIVER_SET_ALL_THRESHOLD, e_eV, nullptr);
|
||||
}
|
||||
@@ -477,6 +484,9 @@ int Module::getAllTrimbits() const {
|
||||
|
||||
void Module::setAllTrimbits(int val) {
|
||||
sendToDetector<int>(F_SET_ALL_TRIMBITS, val);
|
||||
if (shm()->detType == MYTHEN3) {
|
||||
updateRxAllThresholdMetadata(getAllThresholdEnergy());
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<int> Module::getTrimEn() const {
|
||||
@@ -784,6 +794,9 @@ void Module::setDAC(int val, dacIndex index, bool mV) {
|
||||
}
|
||||
int args[]{static_cast<int>(index), static_cast<int>(mV), val};
|
||||
sendToDetector<int>(F_SET_DAC, args);
|
||||
if (shm()->detType == MYTHEN3) {
|
||||
updateRxAllThresholdMetadata(getAllThresholdEnergy());
|
||||
}
|
||||
}
|
||||
|
||||
bool Module::getPowerChip() const {
|
||||
@@ -3552,6 +3565,9 @@ void Module::setModule(sls_detector_module &module, bool trimbits) {
|
||||
client.sendCommand(F_SET_MODULE, nullptr, 0);
|
||||
sendModule(&module, client);
|
||||
client.readReply(nullptr, 0);
|
||||
if (shm()->detType == MYTHEN3) {
|
||||
updateRxAllThresholdMetadata(getAllThresholdEnergy());
|
||||
}
|
||||
}
|
||||
|
||||
sls_detector_module Module::getModule() {
|
||||
|
||||
@@ -110,7 +110,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
bool trimbits);
|
||||
void setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||
detectorSettings isettings, bool trimbits);
|
||||
std::string getSettingsDir() const;
|
||||
std::string getSettingsDir() const;
|
||||
void updateRxAllThresholdMetadata(std::array<int, 3> e_eV);
|
||||
std::string setSettingsDir(const std::string &dir);
|
||||
void loadTrimbits(const std::string &fname);
|
||||
void saveTrimbits(const std::string &fname);
|
||||
|
||||
Reference in New Issue
Block a user