mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-27 08:40:02 +02:00
pattern load and save works
This commit is contained in:
parent
c043e74c07
commit
8e773c97dd
@ -7653,15 +7653,14 @@ int get_pattern(int file_des) {
|
|||||||
LOG(logDEBUG,
|
LOG(logDEBUG,
|
||||||
("retval pattern word (printing every 10 words that are not 0\n"));
|
("retval pattern word (printing every 10 words that are not 0\n"));
|
||||||
for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) {
|
for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) {
|
||||||
int retval = readPatternWord(i);
|
pat->word[i] = readPatternWord(i);
|
||||||
if (retval == -1) {
|
if ((int64_t)pat->word[i] == -1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "could not read pattern word for address 0x%x\n",
|
sprintf(mess, "could not read pattern word for address 0x%x\n",
|
||||||
i);
|
i);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pat->word[i] = retval;
|
|
||||||
// debug print
|
// debug print
|
||||||
if ((i % 10 == 0) && pat->word[i] != 0) {
|
if ((i % 10 == 0) && pat->word[i] != 0) {
|
||||||
LOG(logDEBUG,
|
LOG(logDEBUG,
|
||||||
|
@ -174,8 +174,8 @@ void Pattern::save(const std::string &fname) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
// pattern word
|
// pattern word
|
||||||
for (uint32_t i = pat->limits[0]; i <= pat->limits[1]; ++i) {
|
for (uint32_t i = pat->limits[0]; i <= pat->limits[1]; ++i) {
|
||||||
output_file << "patword [" << ToStringHex(i, 4) << ", "
|
output_file << "patword " << ToStringHex(i, 4) << " "
|
||||||
<< ToStringHex(pat->word[i], 16) << "]" << std::endl;
|
<< ToStringHex(pat->word[i], 16) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// patioctrl
|
// patioctrl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user