2 Commits

Author SHA1 Message Date
5f86266fc0 Simulate more correct counter resetting
All checks were successful
Example Action / Lint (push) Successful in 2s
Example Action / BuildAndTest (push) Successful in 10m13s
2025-09-10 12:51:56 +02:00
eefb8c2053 :( missed the command
Some checks failed
Example Action / Lint (push) Successful in 2s
Example Action / BuildAndTest (push) Failing after 9m44s
2025-07-08 12:33:43 +02:00
2 changed files with 7 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ clearChannel{
}
clearCounter4 {
out "15";
out "CC 15";
in;
@mismatch{in "%(\$1MsgTxt)s";}
}

View File

@@ -50,7 +50,7 @@ class DAQ:
]
def clearCount(self, counter):
self.counts[counter-1] = 0
self.counts[counter] = 0
def clearCounts(self):
self.counts = [0] * self.total_channels
@@ -260,7 +260,11 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
elif re.fullmatch(r'CC (\d+)', data):
counter = int(re.fullmatch(r'CC (\d+)', data).group(1))
daq.clearCount(counter)
num_bits = daq.total_channels
bits = [(counter >> bit) & 1 for bit in range(num_bits - 1, -1, -1)]
for ch, bit in enumerate(bits):
if bit:
daq.clearCount(ch)
send('')
elif re.fullmatch(r'TP (\d+(\.\d+)?)', data):