diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml index 2be5bc5..174a0b7 100644 --- a/.gitea/workflows/action.yaml +++ b/.gitea/workflows/action.yaml @@ -23,4 +23,5 @@ jobs: make install - name: test run: | - python3 test/test.py + cd test + python3 test.py diff --git a/db/daq.proto b/db/daq.proto index 6d5fbec..e98c9ed 100644 --- a/db/daq.proto +++ b/db/daq.proto @@ -13,9 +13,10 @@ initialise { in; out "ECHO 2"; # Ask for reponses in "%(\$1MsgTxt)s"; # Clear MsgTxt on Init - @mismatch{ - exec 'echo "Failed to configure DAQ" && exit(1)'; - } + # Probably should cause the ioc to just exit + # @mismatch{ + # exec 'echo "Failed to configure DAQ" && exit(1)'; + # } } fullReset { diff --git a/sim/daq_sim.py b/sim/daq_sim.py index 627a1c6..2df6337 100644 --- a/sim/daq_sim.py +++ b/sim/daq_sim.py @@ -35,7 +35,7 @@ class DAQ: self.monitor = 0 self.minratechannel = 0 - self.minrates = [2] * self.total_channels + self.minrates = [2] * (self.total_channels + 1) self.gate_config = [ #(enabled, count high/low), @@ -92,7 +92,7 @@ class DAQ: if self.countmode == 'time': if elapsed < self.presettime: - if self.minratechannel >= 0 and self.rates[self.minratechannel] < self.minrates[self.minratechannel]: + if self.minratechannel > 0 and self.rates[self.minratechannel - 1] < self.minrates[self.minratechannel]: # adjust the starttime, so that it is as if this polling period didn't happen self.starttime += elapsed - self.elapsed self.status = 5 @@ -115,7 +115,7 @@ class DAQ: elif self.countmode == 'count': if self.getMonitorCount() < self.presetcount: - if self.minratechannel >= 0 and self.rates[self.minratechannel] < self.minrates[self.minratechannel]: + if self.minratechannel > 0 and self.rates[self.minratechannel - 1] < self.minrates[self.minratechannel]: # adjust the starttime, so that it is as if this polling period didn't happen self.starttime += elapsed - self.elapsed self.status = 5 @@ -171,16 +171,16 @@ class DAQ: return float(self.rates[channel - 1]) def getMinRateChannel(self): - return self.minratechannel + 1 + return self.minratechannel def setMinRateChannel(self, channel): - self.minratechannel = channel - 1 + self.minratechannel = channel def getMinRate(self, channel): - return self.minrates[channel - 1] + return self.minrates[channel] def setMinRate(self, channel, rate): - self.minrates[channel - 1] = rate + self.minrates[channel] = rate def getGateStatus(self, channel): return self.gate_config[channel - 1]