From 98cd0b4f3a9398354c4d5eef0ddb0cc373f9dacc Mon Sep 17 00:00:00 2001 From: Darryl Masson Date: Mon, 18 Jul 2022 09:31:41 +0200 Subject: [PATCH 1/2] Some jank for sum waveform --- V1724.cc | 11 ++++++++++- V1724.hh | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/V1724.cc b/V1724.cc index 1d5657d9..c530fe73 100644 --- a/V1724.cc +++ b/V1724.cc @@ -239,7 +239,15 @@ int V1724::Read(std::unique_ptr& outptr){ // we're busy, let's check which channel std::string msg = "Board " + std::to_string(fBID) + " is BUSY:"; for (unsigned ch = 0; ch < fNChannels; ch++) { - if (ReadRegister(fChStatusRegister + 0x100*ch) & 0x1) msg += " CH" + std::to_string(ch); + if (ReadRegister(fChStatusRegister + 0x100*ch) & 0x1) { + msg += " CH" + std::to_string(ch); + if (fBID == 1390 && ch == 0) { + // sumwf went busy, must raise its threshold + fSumWFthreshold += 5; + fLog->Entry(MongoLog::Warning, "Raising sum wf threshold to %d", fSumWFthreshold); + WriteRegister(fChTrigRegister, fSumWFthreshold); + } + } } fLog->Entry(MongoLog::Local, msg); } @@ -293,6 +301,7 @@ int V1724::LoadDAC(std::vector& dac_values){ int V1724::SetThresholds(std::vector vals) { int ret = 0; + if (fBID == 1390 && vals.size() > 0) fSumWFthreshold = vals[0]; for (unsigned ch = 0; ch < fNChannels; ch++) ret += WriteRegister(fChTrigRegister + 0x100*ch, vals[ch]); return ret; diff --git a/V1724.hh b/V1724.hh index 21d3bd62..20f25047 100644 --- a/V1724.hh +++ b/V1724.hh @@ -93,6 +93,7 @@ protected: int fDefaultDelay; int fDefaultPreTrig; int fRegisterFlags; + int fSumWFthreshold; // Stuff for clock reset tracking int fRolloverCounter; From a5252b41aaeb8d14bc067947fdbf3b79d754af7a Mon Sep 17 00:00:00 2001 From: Darryl Masson Date: Mon, 18 Jul 2022 09:34:03 +0200 Subject: [PATCH 2/2] Inits to some default value --- V1724.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/V1724.cc b/V1724.cc index c530fe73..0205d5e2 100644 --- a/V1724.cc +++ b/V1724.cc @@ -37,6 +37,7 @@ V1724::V1724(std::shared_ptr& log, std::shared_ptr& opts, int fPreTrigChRegister = 0x1038; fError = false; fBufferSize = 0x800000; // 8 MB total memory + fSumWFthreshold = 75; // some reasonable default fSampleWidth = 10; fClockCycle = 10;