From a998f50f2d1c6decf1f0fa393a8dce3f9813ac2d Mon Sep 17 00:00:00 2001 From: Andreas Persson <andreas.persson@ess.eu> Date: Wed, 9 Oct 2024 11:16:28 +0200 Subject: [PATCH] Run pre-commit and commit changes --- .gitlab-ci.yml | 1 - .pre-commit-config.yaml | 4 +- Makefile | 2 +- configure/CONFIG | 1 - configure/CONFIG_MODULE_DEV | 1 - configure/CONFIG_OPTIONS | 1 - configure/RELEASE | 1 - configure/RELEASE_DEV | 1 - configure/RULES | 1 - configure/module/RULES_MODULE | 1 - nblmdaq/Db/nBlmBoard.template | 6 +-- nblmdaq/Db/nBlmBuffer.template | 2 +- nblmdaq/Db/nBlmChannel_settings.template | 44 +++++++++---------- nblmdaq/Db/nBlmEvr.template | 42 +++++++----------- nblmdaq/src/asyn/nBlmDaq.cpp | 30 ++++++------- nblmdaq/src/asyn/nBlmDaq.h | 8 ++-- nblmdaq/src/asyn/nBlmIrq.cpp | 6 +-- nblmdaq/src/asyn/nBlmReg.cpp | 2 +- nblmdaq/src/board/algorithms.cpp | 1 + nblmdaq/src/board/circularBuffer.cpp | 4 +- nblmdaq/src/board/nBlmBoard.h | 2 +- nblmdaq/src/board/nBlmData.h | 24 +++++----- nblmdaq/src/cli/Makefile | 2 +- nblmdaq/src/cli/nBlmCLI.cpp | 14 +++--- nblmdaq/src/cli/nBlmProcessOffline.cpp | 20 ++++----- nblmdaq/src/crc/crc32.h | 2 - nblmdaq/src/dod/dodDispatcher.h | 2 +- .../src/periodic/accumulatedLossClient.cpp | 8 ++-- nblmdaq/src/periodic/accumulatedLossClient.h | 2 +- .../src/periodic/eventStatisticsClient.cpp | 8 ++-- nblmdaq/src/periodic/eventStatisticsClient.h | 2 +- nblmdaq/src/periodic/lossWaveformClient.cpp | 6 +-- nblmdaq/src/periodic/lossWaveformClient.h | 2 +- nblmdaq/src/periodic/periodicClient.h | 2 +- nblmdaq/src/periodic/periodicDispatcher.cpp | 6 +-- nblmdaq/src/periodic/periodicDispatcher.h | 2 +- .../src/periodic/protectionWaveformClient.cpp | 2 +- .../src/periodic/protectionWaveformClient.h | 2 +- .../src/periodic/sampleStatisticsClient.cpp | 9 ++-- nblmdaq/src/periodic/sampleStatisticsClient.h | 2 +- nblmdaq/src/tsc/tscDevice.cpp | 3 +- 41 files changed, 128 insertions(+), 153 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a16adb3..770ce09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,2 @@ --- include: 'https://gitlab.esss.lu.se/ics-infrastructure/gitlab-ci-yml/raw/master/E3ModuleBuild.gitlab-ci.yml' - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f4d85f..80c6195 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,8 @@ repos: rev: v4.0.1 hooks: - id: end-of-file-fixer - files: ^cmds/|^iocsh/ - id: trailing-whitespace - files: ^cmds/|^iocsh/ - repo: https://gitlab.esss.lu.se/e3/dbformat - rev: 0.4.1 + rev: 0.5.2 hooks: - id: dbformat diff --git a/Makefile b/Makefile index 7a53e3b..a5cb8db 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt # -# +# # Author : Jeong Han Lee # email : han.lee@esss.se # Date : 2019Apr30-0740-54CEST diff --git a/configure/CONFIG b/configure/CONFIG index 1d44ce1..403c6af 100644 --- a/configure/CONFIG +++ b/configure/CONFIG @@ -16,4 +16,3 @@ E3_REQUIRE_LOCATION := $(EPICS_BASE)/$(E3_REQUIRE_NAME)/$(E3_REQUIRE_VERSION) REQUIRE_CONFIG := $(E3_REQUIRE_LOCATION)/configure include $(REQUIRE_CONFIG)/CONFIG - diff --git a/configure/CONFIG_MODULE_DEV b/configure/CONFIG_MODULE_DEV index 82869fc..34313b6 100644 --- a/configure/CONFIG_MODULE_DEV +++ b/configure/CONFIG_MODULE_DEV @@ -13,4 +13,3 @@ E3_MODULE_DEV_GITURL:="https://gitlab.esss.lu.se/IOxOS_vanilla/Lodz_development" # The definitions shown below can also be placed in an untracked CONFIG_MODULE_DEV.local -include $(TOP)/configure/CONFIG_MODULE_DEV.local - diff --git a/configure/CONFIG_OPTIONS b/configure/CONFIG_OPTIONS index 2e022c1..97542fa 100644 --- a/configure/CONFIG_OPTIONS +++ b/configure/CONFIG_OPTIONS @@ -3,4 +3,3 @@ # # The definitions shown below can also be placed in an untracked CONFIG_OPTIONS.local -include $(TOP)/configure/CONFIG_OPTIONS.local - diff --git a/configure/RELEASE b/configure/RELEASE index 3695581..f4d0831 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -7,4 +7,3 @@ E3_REQUIRE_VERSION:=5.0.0 -include $(TOP)/../../RELEASE.local -include $(TOP)/../RELEASE.local -include $(TOP)/configure/RELEASE.local - diff --git a/configure/RELEASE_DEV b/configure/RELEASE_DEV index c572254..dfb5fe7 100644 --- a/configure/RELEASE_DEV +++ b/configure/RELEASE_DEV @@ -8,4 +8,3 @@ E3_REQUIRE_VERSION:=3.4.1 -include $(TOP)/../../RELEASE_DEV.local -include $(TOP)/../RELEASE_DEV.local -include $(TOP)/configure/RELEASE_DEV.local - diff --git a/configure/RULES b/configure/RULES index 462c8af..7223aec 100644 --- a/configure/RULES +++ b/configure/RULES @@ -3,4 +3,3 @@ include $(REQUIRE_CONFIG)/RULES_SITEMODS #include $(REQUIRE_CONFIG)/RULES_EPICS include $(TOP)/configure/module/RULES_MODULE - diff --git a/configure/module/RULES_MODULE b/configure/module/RULES_MODULE index 9be7972..028e602 100644 --- a/configure/module/RULES_MODULE +++ b/configure/module/RULES_MODULE @@ -17,4 +17,3 @@ hdrs: # $(QUIET)echo "CHECK_RELEASE = YES" > $(TOP)/$(E3_MODULE_SRC_PATH)/configure/CONFIG_SITE # $(QUIET)echo "INSTALL_LOCATION=$(M_DEVLIB2)" >> $(TOP)/$(E3_MODULE_SRC_PATH)/configure/CONFIG_SITE # $(SUDOBASH) "$(MAKE) -C $(E3_MODULE_SRC_PATH)" - diff --git a/nblmdaq/Db/nBlmBoard.template b/nblmdaq/Db/nBlmBoard.template index 8a3c9f0..e78f9a3 100644 --- a/nblmdaq/Db/nBlmBoard.template +++ b/nblmdaq/Db/nBlmBoard.template @@ -3,7 +3,7 @@ record(longout, "$(P)$(R)ChannelMask") { field(DESC, "CB channel mask") field(DTYP, "asynInt32") field(DRVL, "0") - field(DRVH, "0x3fff") + field(DRVH, "0x3fff") field(PINI, "RUNNING") field(OUT, "@asyn($(ASYN_PORT), $(ASYN_ADDR))ChannelMask") @@ -49,7 +49,7 @@ record(ao, "$(P)$(R)DecimStop") { field(AOFF, "0") field(PREC, "") field(DRVL, "0") - field(DRVH, "34359738") + field(DRVH, "34359738") field(DTYP, "asynInt32") field(PINI, "RUNNING") field(OUT, "@asyn($(ASYN_PORT), $(ASYN_ADDR))DecimStop") @@ -195,4 +195,4 @@ record(ai, "$(P)$(R)ClkMon5-RB") { field(EGU, "Hz") field(SCAN, "I/O Intr") field(INP, "@asyn($(ASYN_PORT), $(ASYN_ADDR))ClkMon5") -} \ No newline at end of file +} diff --git a/nblmdaq/Db/nBlmBuffer.template b/nblmdaq/Db/nBlmBuffer.template index 12a707e..b458ec0 100644 --- a/nblmdaq/Db/nBlmBuffer.template +++ b/nblmdaq/Db/nBlmBuffer.template @@ -4,7 +4,7 @@ record(ai, "$(P)$(R)$(CB_ID)-BufferUse-RB") { field(DTYP, "asynFloat64") field(EGU, "MB") field(SCAN, "1 second") - field(INP, "@asyn($(ASYN_PORT), $(ASYN_ADDR))DodBufferUse") + field(INP, "@asyn($(ASYN_PORT), $(ASYN_ADDR))DodBufferUse") } record(ai, "$(P)$(R)$(CB_ID)-DataSize-RB") { diff --git a/nblmdaq/Db/nBlmChannel_settings.template b/nblmdaq/Db/nBlmChannel_settings.template index ca29195..fe86f88 100644 --- a/nblmdaq/Db/nBlmChannel_settings.template +++ b/nblmdaq/Db/nBlmChannel_settings.template @@ -43,7 +43,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-EvtThr2") { field(ASLO, "0.015258789") field(AOFF, "0") field(DRVL, "-500") - field(DRVH, "500") + field(DRVH, "500") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -131,7 +131,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-NTotMin") { field(ASLO, "4") field(AOFF, "0") field(DRVL, "0") - field(DRVH, "1000") + field(DRVH, "1000") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -191,7 +191,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-PileUpTotMin") { field(ASLO, "4") field(AOFF, "0") field(DRVL, "0") - field(DRVH, "1000") + field(DRVH, "1000") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -220,13 +220,13 @@ record(mbbo, "$(P)$(R)$(CHANNEL_ID)-DataSrc") { field(SCAN, "Passive") field(PINI, "RUNNING") field(OUT, "@asyn($(ASYN_PORT), $(ASYN_ADDR))DataSrc") - field(ZRVL, 0) + field(ZRVL, "0") field(ZRST, "$(CHANNEL_ID)") - field(ONVL, 1) + field(ONVL, "1") field(ONST, "$(CHANNEL_ID)+1") - field(TWVL, 2) + field(TWVL, "2") field(TWST, "$(CHANNEL_ID)+2") - field(THVL, 3) + field(THVL, "3") field(THST, "Generator") info(autosaveFields, "VAL") @@ -238,13 +238,13 @@ record(mbbi, "$(P)$(R)$(CHANNEL_ID)-DataSrc-RB") { field(DTYP, "asynInt32") field(SCAN, "I/O Intr") field(INP, "@asyn($(ASYN_PORT), $(ASYN_ADDR))DataSrc") - field(ZRVL, 0) + field(ZRVL, "0") field(ZRST, "$(CHANNEL_ID)") - field(ONVL, 1) + field(ONVL, "1") field(ONST, "$(CHANNEL_ID)+1") - field(TWVL, 2) + field(TWVL, "2") field(TWST, "$(CHANNEL_ID)+2") - field(THVL, 3) + field(THVL, "3") field(THST, "Generator") info(DESCRIPTION, "Channel data source - readback") @@ -256,7 +256,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-PdstlWStart") { field(PREC, "2") field(ASLO, "0.004") field(AOFF, "0") - field(DRVH, "134217") + field(DRVH, "134217") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -287,7 +287,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-PdstlWSize") { field(ASLO, "0.004") field(AOFF, "0") field(DRVL, "0") - field(DRVH, "134217") + field(DRVH, "134217") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -314,7 +314,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-LossWStart") { field(DESC, "Loss window start") field(EGU, "us") field(DRVL, "0") - field(DRVH, "131071") + field(DRVH, "131071") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -338,7 +338,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-LossWSize") { field(DESC, "Loss window size") field(EGU, "us") field(DRVL, "0") - field(DRVH, "1023") + field(DRVH, "1023") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -362,7 +362,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-LossWWStart") { field(DESC, "Loss waveform window start") field(EGU, "us") field(DRVL, "0") - field(DRVH, "131071") + field(DRVH, "131071") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -385,7 +385,7 @@ record(ai, "$(P)$(R)$(CHANNEL_ID)-LossWWStart-RB") { record(ao, "$(P)$(R)$(CHANNEL_ID)-LossWWSize") { field(DESC, "Loss waveform window size") field(DRVL, "0") - field(DRVH, "1023") + field(DRVH, "1023") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -421,7 +421,7 @@ record(ao, "$(P)$(R)$(CHANNEL_ID)-LossWWDecim") { record(ai, "$(P)$(R)$(CHANNEL_ID)-LossWWDecim-RB") { field(DESC, "Loss waveform decimation factor") - field(AOFF, "1") + field(AOFF, "1") field(ASLO, "1") field(DTYP, "asynInt32") field(SCAN, "I/O Intr") @@ -455,7 +455,7 @@ record(ai, "$(P)$(R)$(CHANNEL_ID)-NCnt-RB") { record(ao, "$(P)$(R)$(CHANNEL_ID)-AvgFlt0Size") { field(DESC, "Moving average filter 0 lengt") field(DRVL, "0") - field(DRVH, "7") + field(DRVH, "7") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -497,7 +497,7 @@ record(ai, "$(P)$(R)$(CHANNEL_ID)-AvgFlt0Thr-RB") { record(ao, "$(P)$(R)$(CHANNEL_ID)-AvgFlt1Size") { field(DESC, "Moving average filter 1 lengt") field(DRVL, "0") - field(DRVH, "127") + field(DRVH, "127") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -581,7 +581,7 @@ record(ai, "$(P)$(R)$(CHANNEL_ID)-XYFltThr-RB") { record(ao, "$(P)$(R)$(CHANNEL_ID)-XYFltThrX") { field(DESC, "X/Y filter X threshold") field(DRVL, "0") - field(DRVH, "7") + field(DRVH, "7") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") @@ -647,7 +647,7 @@ record(ai, "$(P)$(R)$(CHANNEL_ID)-ExpFltLambda-RB") { record(ao, "$(P)$(R)$(CHANNEL_ID)-BeamPermitLUT") { field(DESC, "Beam permit look-up table") field(DRVL, "0") - field(DRVH, "31") + field(DRVH, "31") field(DTYP, "asynInt32") field(SCAN, "Passive") field(PINI, "RUNNING") diff --git a/nblmdaq/Db/nBlmEvr.template b/nblmdaq/Db/nBlmEvr.template index 1b941a0..c59fe4d 100644 --- a/nblmdaq/Db/nBlmEvr.template +++ b/nblmdaq/Db/nBlmEvr.template @@ -1,6 +1,5 @@ # Timestamp from EVR event counter -record(stringin, "$(P)$(R)EvrTimestampIn") -{ +record(stringin, "$(P)$(R)EvrTimestampIn") { field(DTYP, "Soft Timestamp") # not .TIME field(SDIS, "$(EVR_DEV)$(EVR_EVTCNT) CP MS") @@ -11,8 +10,7 @@ record(stringin, "$(P)$(R)EvrTimestampIn") field(FLNK, "$(P)$(R)EvrTimestamp.PROC PP MS") } -record(stringout, "$(P)$(R)EvrTimestamp") -{ +record(stringout, "$(P)$(R)EvrTimestamp") { field(DOL, "$(P)$(R)EvrTimestampIn MS") field(OMSL, "closed_loop") field(DTYP, "asynOctetWrite") @@ -20,14 +18,12 @@ record(stringout, "$(P)$(R)EvrTimestamp") } # EVR link state value -record(longin, "$(P)$(R)EvrLinkIn") -{ +record(longin, "$(P)$(R)EvrLinkIn") { field(INP, "$(EVR_DEV)$(EVR_LNKSTS=Link-Sts).VAL CP MS") field(FLNK, "$(P)$(R)EvrLink.PROC PP MS") } -record(longout, "$(P)$(R)EvrLink") -{ +record(longout, "$(P)$(R)EvrLink") { field(DOL, "$(P)$(R)EvrLinkIn MS") field(OMSL, "closed_loop") field(DTYP, "asynInt32") @@ -35,14 +31,12 @@ record(longout, "$(P)$(R)EvrLink") } # EVR link state alarm status -record(longin, "$(P)$(R)EvrLinkStatIn") -{ +record(longin, "$(P)$(R)EvrLinkStatIn") { field(INP, "$(EVR_DEV)$(EVR_LNKSTS=Link-Sts).STAT CP MS") field(FLNK, "$(P)$(R)EvrLinkStat.PROC PP MS") } -record(longout, "$(P)$(R)EvrLinkStat") -{ +record(longout, "$(P)$(R)EvrLinkStat") { field(DOL, "$(P)$(R)EvrLinkStatIn.STAT MS") field(OMSL, "closed_loop") field(DTYP, "asynInt32") @@ -50,22 +44,19 @@ record(longout, "$(P)$(R)EvrLinkStat") } # EVR link state alarm severity -record(longin, "$(P)$(R)EvrLinkSevrIn") -{ +record(longin, "$(P)$(R)EvrLinkSevrIn") { field(INP, "$(EVR_DEV=LAB-EVR-000:)$(EVR_LNKSTS=Link-Sts).SEVR CP MS") field(FLNK, "$(P)$(R)EvrLinkSevr.PROC PP MS") } -record(longout, "$(P)$(R)EvrLinkSevr") -{ +record(longout, "$(P)$(R)EvrLinkSevr") { field(DOL, "$(P)$(R)EvrLinkSevrIn.SEVR MS") field(OMSL, "closed_loop") field(DTYP, "asynInt32") field(OUT, "@asyn($(ASYN_PORT),$(ASYN_ADDR=0),$(TIMEOUT=1))EvrLinkSeverity") } -record(longin, "$(P)$(R)TsDiff-RB") -{ +record(longin, "$(P)$(R)TsDiff-RB") { field(DESC, "Difference between FW and EVR timestamps") field(DTYP, "asynInt32") field(EGU, "ns") @@ -75,8 +66,7 @@ record(longin, "$(P)$(R)TsDiff-RB") field(TSEL, "-2") } -record(longout, "$(P)$(R)TsAdj") -{ +record(longout, "$(P)$(R)TsAdj") { field(DESC, "Timestamp counting adjustment") field(DTYP, "asynInt32") field(SCAN, "Passive") @@ -86,16 +76,14 @@ record(longout, "$(P)$(R)TsAdj") info(autosaveFields, "VAL") } -record(longin, "$(P)$(R)TsAdj-RB") -{ +record(longin, "$(P)$(R)TsAdj-RB") { field(DESC, "Timestamp counting adjustment") field(DTYP, "asynInt32") field(SCAN, "I/O Intr") field(INP, "@asyn($(ASYN_PORT),$(ASYN_ADDR=0),$(TIMEOUT=1))TimestampAdj") } -record(histogram, "$(P)$(R)TsDiffHist") -{ +record(histogram, "$(P)$(R)TsDiffHist") { field(DESC, "Histogram of TsDiff values") field(SVL, "$(P)$(R)TsDiff-RB CP") field(NELM, "$(HIST_SIZE=1000)") @@ -112,11 +100,11 @@ record(waveform, "$(P)$(R)TsDiffHistX") { } record(acalcout, "$(P)$(R)#HistCalcX") { - field(NELM, $(HIST_SIZE=1000)) - field(NUSE, $(HIST_SIZE=1000)) + field(NELM, "$(HIST_SIZE=1000)") + field(NUSE, "$(HIST_SIZE=1000)") field(INPA, "$(P)$(R)TsDiffHist.LLIM CP") field(INPB, "$(P)$(R)TsDiffHist.ULIM CP") field(INPC, "$(P)$(R)TsDiffHist.NELM") field(OUT, "$(P)$(R)TsDiffHistX PP") field(CALC, "A + IX * (B - A) / C") -} \ No newline at end of file +} diff --git a/nblmdaq/src/asyn/nBlmDaq.cpp b/nblmdaq/src/asyn/nBlmDaq.cpp index 747d918..d723d02 100644 --- a/nblmdaq/src/asyn/nBlmDaq.cpp +++ b/nblmdaq/src/asyn/nBlmDaq.cpp @@ -6,7 +6,7 @@ #include <epicsMutex.h> #include <epicsEvent.h> -#include <sstream> +#include <sstream> #include "nBlmDaq.h" @@ -200,7 +200,7 @@ nBlmDaq::nBlmDaq(const char *portName, int slot) periodic->registerClient(smpStat, FRAME_SMP_STAT); // Loss waveform frame handler - lossWf = new lossWaveformClient(); + lossWf = new lossWaveformClient(); for (int i = FRAME_LOSS_WF_CH0; i <= FRAME_LOSS_WF_CH5; i++) periodic->registerClient(lossWf, i); @@ -381,7 +381,7 @@ void nBlmDaq::initDevice() board->getVersion(&info); ostringstream ss; - ss << (int)info.major << "." << (int)info.minor << "." + ss << (int)info.major << "." << (int)info.minor << "." << (int)info.patch << "-" << hex << info.hash; setStringParam(P_FwVersion, ss.str()); @@ -451,7 +451,7 @@ void nBlmDaq::initDevice() regVal = board->alg.tcsrReadReg(channel, RS_WINDOW_PARAMS_LOSS); setIntegerParam(channel, P_LossWStart, regVal & 0x1FFFF); setIntegerParam(channel, P_LossWSize, (regVal >> 17) & 0x3FF); - + regVal = board->alg.tcsrReadReg(channel, RS_WINDOW_PARAMS_WAVE); setIntegerParam(channel, P_LossWWStart, regVal & 0x1FFFF); setIntegerParam(channel, P_LossWWSize, (regVal >> 17) & 0x3FF); @@ -480,7 +480,7 @@ void nBlmDaq::initDevice() regVal = board->alg.tcsrReadReg(channel, RS_X_THRESHOLD); setIntegerParam(channel, P_XYFltThrX, regVal); - + regVal = board->alg.tcsrReadReg(channel, RS_EXP_THRESHOLD); setIntegerParam(channel, P_ExpFltThr, regVal); @@ -492,7 +492,7 @@ void nBlmDaq::initDevice() regVal = board->alg.tcsrReadReg(channel, RS_INVERSE_OF_QTOT_SINGLE_NEUTRON); setDoubleParam(channel, P_QTotN, (-100.0 / regVal) * (1ull << 32)); - + regVal = board->alg.tcsrReadReg(channel, RS_LAMBDA); setDoubleParam(channel, P_ExpFltLambda, (double)regVal / (1ull << 32)); } @@ -676,7 +676,7 @@ asynStatus nBlmDaq::writeInt32(asynUser *pasynUser, epicsInt32 value) else if (function == P_XYFltThrX) { // unsigned(3,0) - uint32_t regVal = (uint32_t)value & 0x00000007; + uint32_t regVal = (uint32_t)value & 0x00000007; board->alg.tcsrWriteReg(channel, RS_X_THRESHOLD, regVal); } else if (function == P_ExpFltThr) @@ -750,7 +750,7 @@ asynStatus nBlmDaq::writeOctet(asynUser *pasynUser, const char *value, size_t nC getAddress(pasynUser, &address); asynPrint(pasynUser, ASYN_TRACE_FLOW, "writeOctet address %d, reason: %d, value %s\n", address, function, value); - + /* Set the parameter in the parameter library. */ status = setStringParam(address, function, value); @@ -778,7 +778,7 @@ asynStatus nBlmDaq::writeOctet(asynUser *pasynUser, const char *value, size_t nC status = (asynStatus)callParamCallbacks(address); *nActual = nChars; - return status; + return status; } asynStatus nBlmDaq::readFloat64(asynUser *pasynUser, epicsFloat64 *value) @@ -804,7 +804,7 @@ asynStatus nBlmDaq::readFloat64(asynUser *pasynUser, epicsFloat64 *value) } else if (function == P_DodDuration) { if (!dodStarted) { - *value = 0; + *value = 0; } else { epicsTimeStamp now; @@ -831,12 +831,12 @@ void nBlmDaq::setSampleStatistics(int channel, sampleStatisticsData *data) setIntegerParam(channel, P_TnomPosSat, data->positiveSaturations); callParamCallbacks(channel); - + unlock(); } void nBlmDaq::setAccumulatedLoss(int channel, accumulatedLossData *data) -{ +{ lock(); setIntegerParam(channel, P_AccLossWindow, data->lossInWindow); setIntegerParam(channel, P_AccLossPulse, data->lossInPulse); @@ -920,7 +920,7 @@ void nBlmDaq::startDod() getTimeStamp(&now); getIntegerParam(P_ChannelMask, (epicsInt32 *)&channelMask); getStringParam(P_DodFileTemplate, format); - + epicsTimeToStrftime(filebase, sizeof(filebase), format.c_str(), &now); for (int i = 0; i < N_BUFFERS; i++) { @@ -928,7 +928,7 @@ void nBlmDaq::startDod() periodic->resetDataCounter(); } else { - dod[i]->resetDataCounter(); + dod[i]->resetDataCounter(); } if (channelMask & (1 << i)) { @@ -957,7 +957,7 @@ void nBlmDaq::startDod() // Open trigger timestamp file snprintf(filename, sizeof(filename), "%s-ts.bin", filebase); timeStampFile = new std::ofstream(filename, ios::out | ios::binary); - setStringParam(P_DodTimestampFile, filename); + setStringParam(P_DodTimestampFile, filename); callParamCallbacks(); } diff --git a/nblmdaq/src/asyn/nBlmDaq.h b/nblmdaq/src/asyn/nBlmDaq.h index 97a411c..deb8bec 100644 --- a/nblmdaq/src/asyn/nBlmDaq.h +++ b/nblmdaq/src/asyn/nBlmDaq.h @@ -36,7 +36,7 @@ #define P_TimestampDiffString "TimestampDiff" #define P_TimestampAdjString "TimestampAdj" -// Channel parameters - settings +// Channel parameters - settings #define P_EvtThr1String "EvtThr1" #define P_EvtThr2String "EvtThr2" #define P_QTotNString "QTotN" @@ -134,7 +134,7 @@ struct decodeTaskInfo class nBlmDaq : public asynPortDriver { static const uint32_t buffersInBank[2]; - + private: int P_ChannelMask; @@ -160,7 +160,7 @@ private: int P_NTotMin; int P_Pedestal; int P_PileUpTotMin; - int P_DataSrc; + int P_DataSrc; int P_PdstlWStart; int P_PdstlWSize; int P_LossWStart; @@ -239,7 +239,7 @@ private: pthread_mutex_t ackFromWorkersLock; pthread_cond_t ackFromWorkersCond; - nBlmBoard *board; + nBlmBoard *board; // periodic frame handlers periodicDispatcher *periodic; diff --git a/nblmdaq/src/asyn/nBlmIrq.cpp b/nblmdaq/src/asyn/nBlmIrq.cpp index ce08cb2..0f3f461 100644 --- a/nblmdaq/src/asyn/nBlmIrq.cpp +++ b/nblmdaq/src/asyn/nBlmIrq.cpp @@ -65,20 +65,20 @@ void nBlmDaq::softIrqTask(void) if (dodStarted) { // Write trigger timestamp to file logTriggerTimeStamp(fwTime); - } + } // Retreive data from periodic clients and update parameters smpStat->lock(); for (int channel = 0; channel < N_CHANNELS; channel++) { sampleStatisticsData *data = smpStat->getData(channel); - setSampleStatistics(channel, data); + setSampleStatistics(channel, data); } smpStat->unlock(); lossWf->lock(); for (int channel = 0; channel < N_CHANNELS; channel++) { lossWaveformData *data = lossWf->getData(channel); - setLossWaveforms(channel, data); + setLossWaveforms(channel, data); } lossWf->unlock(); diff --git a/nblmdaq/src/asyn/nBlmReg.cpp b/nblmdaq/src/asyn/nBlmReg.cpp index 3385021..804a18e 100644 --- a/nblmdaq/src/asyn/nBlmReg.cpp +++ b/nblmdaq/src/asyn/nBlmReg.cpp @@ -14,7 +14,7 @@ extern "C" { nBlmDaq *drv = (nBlmDaq *)drvPvt; scanPause(); - + drv->terminateAllThreads() ; delete drv ; } diff --git a/nblmdaq/src/board/algorithms.cpp b/nblmdaq/src/board/algorithms.cpp index 50a0c26..b51a834 100644 --- a/nblmdaq/src/board/algorithms.cpp +++ b/nblmdaq/src/board/algorithms.cpp @@ -1,6 +1,7 @@ #include <iostream> #include "algorithms.h" + algorithms::algorithms(tscDevice &dev, uint32_t _muxReg) { #ifdef DEBUG_ALG diff --git a/nblmdaq/src/board/circularBuffer.cpp b/nblmdaq/src/board/circularBuffer.cpp index 117f70e..a7b6275 100644 --- a/nblmdaq/src/board/circularBuffer.cpp +++ b/nblmdaq/src/board/circularBuffer.cpp @@ -44,10 +44,10 @@ circularBuffer::circularBuffer(tscDevice &device, uint8_t bank, uint8_t index, c dmaNextRead = 0; dmaReadPos = 0; dmaWaitForAck = 0; - + dmaSize = 0; dmaMaxSize = device.getDmaMaxSize(); - + #ifdef DEBUG_CB cout << "Mapped buffers for " << (int)index << ": " << hex << " 0x" << (int)dmaBuffers[0].mBuf << " 0x" << (int)dmaBuffers[1].mBuf << endl; #endif diff --git a/nblmdaq/src/board/nBlmBoard.h b/nblmdaq/src/board/nBlmBoard.h index d58cdd3..c1362d9 100644 --- a/nblmdaq/src/board/nBlmBoard.h +++ b/nblmdaq/src/board/nBlmBoard.h @@ -24,7 +24,7 @@ struct nBlmVersionInfo { struct nBlmTimeStamp { uint32_t seconds; // Seconds since POSIX epoch - uint32_t nanoseconds; + uint32_t nanoseconds; }; template<class T> class CircularBufferBlocking; diff --git a/nblmdaq/src/board/nBlmData.h b/nblmdaq/src/board/nBlmData.h index f76ddcd..c23cdd8 100644 --- a/nblmdaq/src/board/nBlmData.h +++ b/nblmdaq/src/board/nBlmData.h @@ -1,5 +1,5 @@ /* nBlmData.h - * + * * Constants and types used for decoding nBLM data frames * See https://confluence.esss.lu.se/x/iKboF */ @@ -21,7 +21,7 @@ typedef unsigned __int128 uint128_t; // Circulare buffer identifiers enum cbId { - CB_EVT_INFO_CH0 = 0, + CB_EVT_INFO_CH0 = 0, CB_EVT_INFO_CH1, CB_EVT_INFO_CH2, CB_EVT_INFO_CH3, @@ -63,7 +63,7 @@ enum frameId { FRAME_LOSS_WF_CH3, FRAME_LOSS_WF_CH4, FRAME_LOSS_WF_CH5, - // Accumulated loss + // Accumulated loss FRAME_ACC_LOSS, // Event statistics FRAME_EVT_STAT_CH0, @@ -92,7 +92,7 @@ const uint32_t EOF_WORD_3 = 0x0fe0fe0fu; struct frame_header { uint32_t magic; // start of frame pattern - uint32_t mtw_ns; // timestamp nanoseconds + uint32_t mtw_ns; // timestamp nanoseconds uint32_t mtw_s; // timestamp seconds uint8_t s; // sample index in current measurement time window (MTW) uint8_t info; // info byte @@ -107,7 +107,7 @@ struct frame_footer { /* * Event info (CB 0-5) * Neutron event diagnostics. Repeated for each event. - * + * * INFO: Data channel * SAMPLES: Number of 128 bit (16 bytes) structures in the frame */ @@ -128,11 +128,11 @@ struct event_info_item { /* * Neutron count (CB 6) * Neutron count and other data summarized every MTW period (1 microsecond) - * + * * INFO: 6 * S: Data channel of the first structure in the frame. Channels follow in decending order (5,4,3,2,1,0,5,4,...) * SAMPLES: Number of 104-bit (13 bytes) structures in the frame - */ + */ struct __attribute__ ((packed)) neutron_count_item { uint32_t q_total:24; // total charge during last MTW (signed, 24 bits) uint32_t background_count:24; // charge of background events (signed, 24 bits) @@ -145,7 +145,7 @@ struct __attribute__ ((packed)) neutron_count_item { /* * Periodic data (CB 7) * Periodic data frames contain structures of different sizes depending on the frame type. - * + * * INFO: Periodic frame type (20-39) * SAMPLES: Number of 128-bit words in the frame */ @@ -255,9 +255,9 @@ struct periodic_info_33_38 { sample_quad samples[]; // variable number of 128 bit sample quads, depending on window_samples value above }; -/* - * Size of data structures in bytes - */ +/* + * Size of data structures in bytes + */ const size_t dataItemSizes[] = { [CB_EVT_INFO_CH0] = sizeof(event_info_item), [CB_EVT_INFO_CH1] = sizeof(event_info_item), @@ -275,4 +275,4 @@ const size_t dataItemSizes[] = { [CB_RAW_DATA_CH5] = sizeof(raw_data_item) }; -#endif // _NBLM_DATA_H_ \ No newline at end of file +#endif // _NBLM_DATA_H_ diff --git a/nblmdaq/src/cli/Makefile b/nblmdaq/src/cli/Makefile index 0fc950e..bd9d0a7 100644 --- a/nblmdaq/src/cli/Makefile +++ b/nblmdaq/src/cli/Makefile @@ -37,7 +37,7 @@ PROC_OBJ=$(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(notdir $(PROC_SRC)))) #define flags CPP_FLAGS += -std=c++11 -fpermissive CPP_FLAGS += -I$(TSC_INC) -CPP_FLAGS += -I../board +CPP_FLAGS += -I../board CPP_FLAGS += -I../tsc CPP_FLAGS += -I../crc CPP_FLAGS += -I../periodic diff --git a/nblmdaq/src/cli/nBlmCLI.cpp b/nblmdaq/src/cli/nBlmCLI.cpp index 2525e78..7dbb21d 100644 --- a/nblmdaq/src/cli/nBlmCLI.cpp +++ b/nblmdaq/src/cli/nBlmCLI.cpp @@ -19,7 +19,7 @@ using namespace std; volatile sig_atomic_t exitLoop = 0; cbParams par = { - .burstsize = 2048, + .burstsize = 2048, .startAddress = 128 * 1024, .endAddress = 64 * 1024 * 1024, .bank0_mask = 0b00011101000111, @@ -88,7 +88,7 @@ void dumpRegs(nBlmBoard *board, int channel) { if (namp_min & (1 << 16)) namp_min -= 1 << 17; - printf("# RS_EVENT_DETECTION_THRESHOLD %d : %d \n", channel, t1); + printf("# RS_EVENT_DETECTION_THRESHOLD %d : %d \n", channel, t1); printf("# RS_EVENT_DETECTION_THRESHOLD2 %d : %d \n", channel, t2); printf("# RS_INVERSE_OF_QTOT_SINGLE_NEUTRON %d : %d \n", channel, qtot); printf("# RS_NEUTRON_AMPL_MIN %d : %d \n", channel, namp_min); @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) for (int i = 0; i < 14; i++) { if ((opts.optChannelMask & (1 << i)) != 0) - { + { auto dd = new dodDispatcher(board, i); dod.push_back(dd); pts.push_back(std::thread(dispatch_thread, dd)); @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) if (utime > 0) usleep(utime); - + exitLoop = 1; board->signalTermination(); @@ -213,7 +213,7 @@ int main(int argc, char *argv[]) } //board->cbDump(opts.optChannelMask) ; - + size_t bytesTotal = 0; for (int i = 0; i < 14; i++) { @@ -222,14 +222,14 @@ int main(int argc, char *argv[]) size_t bytes = board->cbGetDataCounter(i); bytesTotal += bytes; - double rate = bytes / opts.optTimeout / 1024 / 1024; + double rate = bytes / opts.optTimeout / 1024 / 1024; cout << "CB " << i << " received " << bytes << " bytes " << "(" << rate << " MB/s)" << endl; } } - double rateTotal = bytesTotal / opts.optTimeout / 1024 / 1024; + double rateTotal = bytesTotal / opts.optTimeout / 1024 / 1024; cout << "Received " << bytesTotal << " bytes " << "(" << rateTotal << " MB/s)" << endl; diff --git a/nblmdaq/src/cli/nBlmProcessOffline.cpp b/nblmdaq/src/cli/nBlmProcessOffline.cpp index 5cf5a73..4f12b97 100644 --- a/nblmdaq/src/cli/nBlmProcessOffline.cpp +++ b/nblmdaq/src/cli/nBlmProcessOffline.cpp @@ -79,7 +79,7 @@ void processNeutronCounts(Frame &frame) { static bool print_header = true; static size_t count = 0; - + if (print_header) { printf("%8s %22s %15s %15s %15s %15s %15s %15s %15s\n", "#", "Channel", "MTW", "n", "q_n", "neg_sat", "pos_sat", "bcg_cnt", "qtot"); @@ -89,7 +89,7 @@ void processNeutronCounts(Frame &frame) uint64_t ts = frame.timestamp; int channel = frame.info; neutron_count_item *items = (neutron_count_item *)&frame.data[0]; - + for (int i = 0; i < frame.items; i++) { int32_t background_count = items[i].background_count; if (background_count & (1 << 23)) @@ -103,7 +103,7 @@ void processNeutronCounts(Frame &frame) printf("%8d %22d %15ld %15d %15d %15d %15d %15d %15d\n", count, channel, ts, items[i].n, items[i].q_n, - items[i].negative_saturations, items[i].positive_saturations, + items[i].negative_saturations, items[i].positive_saturations, background_count, q_total); channel--; @@ -112,11 +112,11 @@ void processNeutronCounts(Frame &frame) channel = 5; ts += 1000; } - } + } } void processRawData(Frame &frame) -{ +{ static bool print_header = true; static size_t count = 0; @@ -170,7 +170,7 @@ void readFile(FILE *file, int channel) continue; } - fprintf(stderr, "SOF at 0x%08x, mtw_s = %u, mtw_ns = %u, s = %u, info = %u, samples = %u\n", + fprintf(stderr, "SOF at 0x%08x, mtw_s = %u, mtw_ns = %u, s = %u, info = %u, samples = %u\n", byteCnt - sizeof(frame_header), header.mtw_s, header.mtw_ns, header.s, header.info, header.samples); frame.timestamp = (uint64_t)header.mtw_s * 1000000000 + header.mtw_ns; @@ -228,13 +228,13 @@ void readFile(FILE *file, int channel) fprintf(stderr, "EOF not found at byte 0x%08x\n", byteCnt); bad++; } - + byteCnt += sizeof(frame_footer); } auto end = std::chrono::steady_clock::now(); std::chrono::duration<double> elapsed_seconds = end-start; - + fprintf(stderr, "Good frames: %d\n", good); fprintf(stderr, "Bad frames: %d\n", bad); fprintf(stderr, "Elapsed time: %f\n", elapsed_seconds.count()); @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) { int opt; int channel; - + signal(SIGINT, exitHandler); while ((opt = getopt(argc, argv, "c:h")) != -1) { @@ -276,4 +276,4 @@ int main(int argc, char *argv[]) fclose(file); return EXIT_SUCCESS; -} \ No newline at end of file +} diff --git a/nblmdaq/src/crc/crc32.h b/nblmdaq/src/crc/crc32.h index 662ed64..3f6215b 100644 --- a/nblmdaq/src/crc/crc32.h +++ b/nblmdaq/src/crc/crc32.h @@ -11,5 +11,3 @@ uint32_t crc32_16 (const uint32_t init, const uint8_t *buf); inline uint32_t crc_8b (const uint32_t init, const uint8_t b); - - diff --git a/nblmdaq/src/dod/dodDispatcher.h b/nblmdaq/src/dod/dodDispatcher.h index c0e9961..56b924b 100644 --- a/nblmdaq/src/dod/dodDispatcher.h +++ b/nblmdaq/src/dod/dodDispatcher.h @@ -35,4 +35,4 @@ public: uint64_t getDataCounter(); }; -#endif // _DOD_DISPATCHER_H_ \ No newline at end of file +#endif // _DOD_DISPATCHER_H_ diff --git a/nblmdaq/src/periodic/accumulatedLossClient.cpp b/nblmdaq/src/periodic/accumulatedLossClient.cpp index f61b24f..068e2b4 100644 --- a/nblmdaq/src/periodic/accumulatedLossClient.cpp +++ b/nblmdaq/src/periodic/accumulatedLossClient.cpp @@ -15,21 +15,21 @@ accumulatedLossClient::accumulatedLossClient() : periodicClient() uint8_t accumulatedLossClient::putFrame(uint8_t *data, uint32_t frameSize) { // Skip frame header - uint8_t *payload = data + sizeof(frame_header); + uint8_t *payload = data + sizeof(frame_header); periodic_info_8 *info = (periodic_info_8 *)payload; lock(); for (int channel = 0; channel < N_CHANNELS; channel++) { - /* + /* * Neutron events are voltage drops. * The min and max values for voltage and charge are swapped here, * so that the maximum is the "most negative" value. - */ + */ perChannelData[channel].lossInWindow = info[channel].Loss_in_window; perChannelData[channel].lossInPulse = info[channel].neutron_sum; - perChannelData[channel].qTotalMax = info[channel].Qtotal_min; + perChannelData[channel].qTotalMax = info[channel].Qtotal_min; perChannelData[channel].qTotalMin = info[channel].Qtotal_max; perChannelData[channel].qBackgroundMax = info[channel].Qbackground_min; perChannelData[channel].qBackgroundMin = info[channel].Qbackground_max; diff --git a/nblmdaq/src/periodic/accumulatedLossClient.h b/nblmdaq/src/periodic/accumulatedLossClient.h index 0e6cce3..5ec09ca 100644 --- a/nblmdaq/src/periodic/accumulatedLossClient.h +++ b/nblmdaq/src/periodic/accumulatedLossClient.h @@ -41,4 +41,4 @@ public: accumulatedLossData *getData(uint8_t channel); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/periodic/eventStatisticsClient.cpp b/nblmdaq/src/periodic/eventStatisticsClient.cpp index e9ee5f2..53bb4e6 100644 --- a/nblmdaq/src/periodic/eventStatisticsClient.cpp +++ b/nblmdaq/src/periodic/eventStatisticsClient.cpp @@ -16,7 +16,7 @@ eventStatisticsClient::eventStatisticsClient() : periodicClient() uint8_t eventStatisticsClient::putFrame(uint8_t *data, uint32_t frameSize) { frame_header *header = (frame_header *)data; - uint8_t *payload = data + sizeof(frame_header); + uint8_t *payload = data + sizeof(frame_header); int channel = header->info - FRAME_EVT_STAT_CH0; @@ -43,11 +43,11 @@ uint8_t eventStatisticsClient::putFrame(uint8_t *data, uint32_t frameSize) perChannelData[channel].totAvg = (double) info->TOT_sum / info->count; perChannelData[channel].totRms = sqrt((double)(info->TOT_sum_squares * info->count - totSum2) / count2); - /* + /* * Neutron events are voltage drops. * The min and max values for voltage and charge are swapped here, * so that the maximum is the "most negative" value. - */ + */ perChannelData[channel].peakMax = info->peakValue_min; perChannelData[channel].peakMin = info->peakValue_max; perChannelData[channel].peakAvg = (double) info->peakValue_sum / info->count; @@ -59,7 +59,7 @@ uint8_t eventStatisticsClient::putFrame(uint8_t *data, uint32_t frameSize) perChannelData[channel].qTotRms = sqrt((double)(info->Q_TOT_sum_squares * info->count - qTotSum2) / count2); perChannelData[channel].evtCount = info->count; - + unlock(); return 0; } diff --git a/nblmdaq/src/periodic/eventStatisticsClient.h b/nblmdaq/src/periodic/eventStatisticsClient.h index e5ef528..472616d 100644 --- a/nblmdaq/src/periodic/eventStatisticsClient.h +++ b/nblmdaq/src/periodic/eventStatisticsClient.h @@ -40,4 +40,4 @@ public: eventStatisticsData *getData(uint8_t channel); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/periodic/lossWaveformClient.cpp b/nblmdaq/src/periodic/lossWaveformClient.cpp index c2ba52a..c7a1330 100644 --- a/nblmdaq/src/periodic/lossWaveformClient.cpp +++ b/nblmdaq/src/periodic/lossWaveformClient.cpp @@ -19,7 +19,7 @@ lossWaveformClient::lossWaveformClient() : periodicClient() uint8_t lossWaveformClient::putFrame(uint8_t *data, uint32_t frameSize) { frame_header *header = (frame_header *)data; - uint8_t *payload = data + sizeof(frame_header); + uint8_t *payload = data + sizeof(frame_header); int channel = header->info - FRAME_LOSS_WF_CH0; @@ -27,7 +27,7 @@ uint8_t lossWaveformClient::putFrame(uint8_t *data, uint32_t frameSize) cout << "Bad channel number: " << channel << endl; return 1; } - + periodic_info_2_7 *info = (periodic_info_2_7 *)payload; int decimationFactor = info->decimation_factor + 1; @@ -50,7 +50,7 @@ uint8_t lossWaveformClient::putFrame(uint8_t *data, uint32_t frameSize) } perChannelData[channel].size = waveformSize; - + unlock(); return 0; } diff --git a/nblmdaq/src/periodic/lossWaveformClient.h b/nblmdaq/src/periodic/lossWaveformClient.h index bc93a2c..2f38aad 100644 --- a/nblmdaq/src/periodic/lossWaveformClient.h +++ b/nblmdaq/src/periodic/lossWaveformClient.h @@ -36,4 +36,4 @@ public: lossWaveformData *getData(uint8_t channel); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/periodic/periodicClient.h b/nblmdaq/src/periodic/periodicClient.h index 404bd10..e2d53e9 100644 --- a/nblmdaq/src/periodic/periodicClient.h +++ b/nblmdaq/src/periodic/periodicClient.h @@ -13,4 +13,4 @@ public: virtual uint8_t putFrame(uint8_t *data, uint32_t frameSize); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/periodic/periodicDispatcher.cpp b/nblmdaq/src/periodic/periodicDispatcher.cpp index b470d4a..d72e810 100644 --- a/nblmdaq/src/periodic/periodicDispatcher.cpp +++ b/nblmdaq/src/periodic/periodicDispatcher.cpp @@ -21,7 +21,7 @@ periodicDispatcher::periodicDispatcher(nBlmBoard *board, uint8_t cbIndex, uint8_ this->board = board; this->cbIndex = cbIndex; this->maxClientCount = maxClientCount; - this->outfile = NULL; + this->outfile = NULL; clients = new periodicClientConfig[maxClientCount]; @@ -156,7 +156,7 @@ uint32_t periodicDispatcher::checkFrame(uint32_t words[4], uint8_t *frame) cout << "Bad CRC" << endl ; } - if ((footer->magic[0] == EOF_WORD_3) && + if ((footer->magic[0] == EOF_WORD_3) && (footer->magic[1] == EOF_WORD_2) && (footer->magic[2] == EOF_WORD_1)) { @@ -206,7 +206,7 @@ void periodicDispatcher::start() void periodicDispatcher::stop() { started = false; - + } void periodicDispatcher::resetDataCounter() diff --git a/nblmdaq/src/periodic/periodicDispatcher.h b/nblmdaq/src/periodic/periodicDispatcher.h index 6da2c4c..194d5ae 100644 --- a/nblmdaq/src/periodic/periodicDispatcher.h +++ b/nblmdaq/src/periodic/periodicDispatcher.h @@ -54,4 +54,4 @@ public: uint64_t getDataCounter(); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/periodic/protectionWaveformClient.cpp b/nblmdaq/src/periodic/protectionWaveformClient.cpp index 410475b..cd61c78 100644 --- a/nblmdaq/src/periodic/protectionWaveformClient.cpp +++ b/nblmdaq/src/periodic/protectionWaveformClient.cpp @@ -19,7 +19,7 @@ protectionWaveformClient::protectionWaveformClient() : periodicClient() uint8_t protectionWaveformClient::putFrame(uint8_t *data, uint32_t frameSize) { frame_header *header = (frame_header *)data; - uint8_t *payload = data + sizeof(frame_header); + uint8_t *payload = data + sizeof(frame_header); int channel = header->info - FRAME_PROT_WF_CH0; diff --git a/nblmdaq/src/periodic/protectionWaveformClient.h b/nblmdaq/src/periodic/protectionWaveformClient.h index 79c2f6c..8057818 100644 --- a/nblmdaq/src/periodic/protectionWaveformClient.h +++ b/nblmdaq/src/periodic/protectionWaveformClient.h @@ -38,4 +38,4 @@ public: protectionWaveformData *getData(uint8_t channel); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/periodic/sampleStatisticsClient.cpp b/nblmdaq/src/periodic/sampleStatisticsClient.cpp index a13de78..7c1356b 100644 --- a/nblmdaq/src/periodic/sampleStatisticsClient.cpp +++ b/nblmdaq/src/periodic/sampleStatisticsClient.cpp @@ -17,16 +17,16 @@ uint8_t sampleStatisticsClient::putFrame(uint8_t *data, uint32_t frameSize) { // Skip frame header uint8_t *payload = data + sizeof(frame_header); - + periodic_info_1 *info = (periodic_info_1 *)payload; lock(); - + for (int channel = 0; channel < N_CHANNELS; channel++) { - /* + /* * Neutron events are voltage drops. * The polarity of the saturation counters are swapped here, on purpose - */ + */ perChannelData[channel].negativeSaturations = info[channel].num_pos_sat; perChannelData[channel].positiveSaturations = info[channel].num_neg_sat; @@ -57,4 +57,3 @@ sampleStatisticsData *sampleStatisticsClient::getData(uint8_t channel) { return &perChannelData[channel]; } - diff --git a/nblmdaq/src/periodic/sampleStatisticsClient.h b/nblmdaq/src/periodic/sampleStatisticsClient.h index 01a1e40..d43a335 100644 --- a/nblmdaq/src/periodic/sampleStatisticsClient.h +++ b/nblmdaq/src/periodic/sampleStatisticsClient.h @@ -32,4 +32,4 @@ public: sampleStatisticsData *getData(uint8_t channel); }; -#endif \ No newline at end of file +#endif diff --git a/nblmdaq/src/tsc/tscDevice.cpp b/nblmdaq/src/tsc/tscDevice.cpp index 4cf6a20..96b698d 100644 --- a/nblmdaq/src/tsc/tscDevice.cpp +++ b/nblmdaq/src/tsc/tscDevice.cpp @@ -300,7 +300,7 @@ void tscDevice::setTurboDmaMode() mode.op = DMA_MODE_SET; tsc_dma_mode(fd, &mode); } - + //set arbitration mode data = tcsrReadReg(0x800); data &= 0xffffffcf; @@ -334,4 +334,3 @@ int main() return 0 ; } #endif - -- GitLab