September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -1,4 +1,4 @@
constant lines = split(data,'\n')
constant lines = read_lines("demo\\rosetta\\readings.txt")
include builtins\timedate.e
@ -19,7 +19,7 @@ procedure end_bad_run()
end procedure
for i=1 to length(lines) do
sequence oneline = split(lines[i],no_empty:=true), r
sequence oneline = split(lines[i],'\t',no_empty:=true), r
if length(oneline)!=49 then
?"bad line (length!=49)"
else
@ -57,20 +57,16 @@ for i=1 to length(lines) do
end if
end if
end for
if rejects=0 then
readtot += readsum
ntot += 1
end if
-- readtot += readsum
-- ntot += accepts
printf(1,"Date: %s, Rejects: %2d, Accepts: %2d, Line total: %7.3f, Average %6.3f\n",
{format_timedate(td,"DD/MM/YYYY"),rejects, accepts, readsum, readsum/accepts})
readtot += readsum
ntot += accepts
string average = iff(accepts=0?"N/A":sprintf("%6.3f",readsum/accepts))
printf(1,"Date: %s, Rejects: %2d, Accepts: %2d, Line total: %7.3f, Average %s\n",
{format_timedate(td,"DD/MM/YYYY"),rejects, accepts, readsum, average})
end if
end if
end for
printf(1,"Average: %.3f (of %d entirely valid days)\n",{readtot/(24*ntot),ntot})
--printf(1,"Average: %.3f\n",{readtot/ntot})
printf(1,"Average: %.3f (of %d readings)\n",{readtot/ntot,ntot})
end_bad_run()
if max_count then
printf(1,"Maximum run of %d consecutive false readings starting: %s\n",