Compare commits

...

5 commits

Author SHA1 Message Date
Stephan I. Böttcher
c69b231ddd ahepam: make %.HD 2025-08-01 13:33:13 +02:00
Stephan I. Böttcher
8ff9eccb55 AHEPAM: @include pressure 2025-08-01 13:32:41 +02:00
Stephan I. Böttcher
785f560e46 dorn_hk: return slice with the data 2025-08-01 13:31:40 +02:00
Stephan I. Böttcher
f077df1366 chmod a+x pressure.awk 2025-08-01 13:30:13 +02:00
Stephan I. Böttcher
831342b7e6 udpterm: add periodic jobs to sockets 2025-08-01 13:29:25 +02:00
6 changed files with 23 additions and 11 deletions

View file

@ -1,5 +1,7 @@
#!/usr/bin/gawk -i
@include "../pressure.awk"
/^EDB /{skip_ED++}
skip_ED && /^ED / {next}

View file

@ -34,6 +34,11 @@ doScut=100
%.HDORN: %.AHA HDORN.awk
./HDORN.awk 'isHDORN(){doHDORN()}' $< > $@
HDINST=--seth
HDTYPE=cooked
%.HD: %.AHA
../dorn_hk.py $(HDINST) --what=$(HDTYPE) $< | tr -d '[],' > $@
SIGMA=600
%.HD4BIAS: %.HDORN

16
dorn.py
View file

@ -187,23 +187,23 @@ def hk(sl, what="print", data=None):
if isinstance(data, str):
# HDORN … data line
if "x" in data:
return
return sl, None
data = data.split()
if data[0] != "HDORN":
return
return sl, None
data = list(map(int, data[1:]))
if sl is None:
sl = data[0] & 3;
if data[0] & 3 != sl:
return None
return sl, None
if what=="data":
return data
return sl, data
ND = CONFIG.n_adc()
NV = ND
data = [d & 0xfff for d in data]
data = [data[ND*i+1:ND*i+1+NV] for i in range(8)]
if what=="raw":
return data
return sl, data
Vref = CONFIG.Vref(sl)/4096
ddata = []
for a in range(8):
@ -237,9 +237,9 @@ def hk(sl, what="print", data=None):
V[H[0]] = data[a][c]
if what=="cooked":
return data
return sl, data
if what=="dict":
return ddata
return sl, ddata
r = []
for a in range(8):
@ -249,7 +249,7 @@ def hk(sl, what="print", data=None):
if what=="print":
sys.stderr.write("".join(r))
return r
return sl, r
def dorn_config(a, v=None, mes=None, slice=0):
verb = CONFIG.verbose

View file

@ -30,11 +30,11 @@ def hk_file(f):
continue
if not T:
continue
h = dorn.hk(sl, what=what, data=l)
s, h = dorn.hk(sl, what=what, data=l)
if not h:
continue
for c in ch:
print(T, c, h[c])
print(T, s, c, h[c])
if not ff:
hk_file(sys.stdin)

0
pressure.awk Normal file → Executable file
View file

View file

@ -181,6 +181,7 @@ class messagelog(asyncore.dispatcher):
self.bind(("", port))
self.logfile = None
self.open_logfile(fn)
self.jobs = []
def writable(self):
return False
@ -213,7 +214,11 @@ class messagelog(asyncore.dispatcher):
if self.sync>1:
os.fsync(self.logfile.fileno())
self.blocks += 1
if self.Jobs:
t = time.time()
for j in self.Jobs:
j.poll(t)
def Status(self, name):
return "%s socket %s file %s blocks %d" % (name, repr(self), repr(self.logfile), self.blocks)