mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
WIP
This commit is contained in:
parent
ca0bc3e0f3
commit
2e669c585b
@ -1756,40 +1756,8 @@ void Detector::setLEDEnable(bool enable, Positions pos) {
|
|||||||
void Detector::savePattern(const std::string &fname) {
|
void Detector::savePattern(const std::string &fname) {
|
||||||
auto t = pimpl->Parallel(&Module::getPattern, {});
|
auto t = pimpl->Parallel(&Module::getPattern, {});
|
||||||
auto pat = t.tsquash("Inconsistent pattern parameters between modules");
|
auto pat = t.tsquash("Inconsistent pattern parameters between modules");
|
||||||
|
// auto pat = t[0];
|
||||||
pat->save(fname);
|
pat->save(fname);
|
||||||
|
|
||||||
/*
|
|
||||||
std::ofstream outfile;
|
|
||||||
outfile.open(fname.c_str(), std::ios_base::out);
|
|
||||||
if (!outfile.is_open()) {
|
|
||||||
throw RuntimeError("Could not create file to save pattern");
|
|
||||||
}
|
|
||||||
// get pattern limits
|
|
||||||
auto r = pimpl->Parallel(&Module::getPatternLoopAddresses, {}, -1)
|
|
||||||
.tsquash("Inconsistent pattern limits");
|
|
||||||
|
|
||||||
CmdProxy proxy(this);
|
|
||||||
// pattern words
|
|
||||||
for (int i = r[0]; i <= r[1]; ++i) {
|
|
||||||
std::ostringstream os;
|
|
||||||
os << "0x" << std::hex << i;
|
|
||||||
auto addr = os.str();
|
|
||||||
proxy.Call("patword", {addr}, -1, defs::GET_ACTION, outfile);
|
|
||||||
}
|
|
||||||
// rest of pattern file
|
|
||||||
std::vector<std::string> commands{
|
|
||||||
"patioctrl", "patlimits", "patloop0", "patnloop0",
|
|
||||||
"patloop1", "patnloop1", "patloop2", "patnloop2",
|
|
||||||
"patwait0", "patwaittime0", "patwait1", "patwaittime1",
|
|
||||||
"patwait2", "patwaittime2", "patmask", "patsetbit",
|
|
||||||
};
|
|
||||||
auto det_type = getDetectorType().squash();
|
|
||||||
if (det_type == defs::MYTHEN3) {
|
|
||||||
commands.erase(commands.begin(), commands.begin() + 2);
|
|
||||||
}
|
|
||||||
for (const auto &cmd : commands)
|
|
||||||
proxy.Call(cmd, {}, -1, defs::GET_ACTION, outfile);
|
|
||||||
*/
|
|
||||||
} // namespace sls
|
} // namespace sls
|
||||||
|
|
||||||
void Detector::setPattern(const std::string &fname, Positions pos) {
|
void Detector::setPattern(const std::string &fname, Positions pos) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user