From d28fd4f87f16822bd39524a7dff810065efaf9f5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 17 Jan 2020 09:49:19 +0100 Subject: irgendwie fertig --- .gitignore | 1 + Makefile | 5 +++-- statistics.pas | 54 +++++++++++++++++++++++++++++++----------------------- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 5c9870e..19a2392 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ lib statistics +werte.dat diff --git a/Makefile b/Makefile index 8efab47..9a332e2 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,11 @@ statistics: statistics.pas mkdir -p lib fpc -Mobjfpc -FUlib -Fu/usr/lib/fpc/src/packages/* -Fu../units "$<" -run: statistics +werte.dat: statistics gpx-to-tsv find ~/tmp/ -name '*.gpx' \ | sort \ | tr '\n' '\0' \ | xargs -0r cat \ | ./gpx-to-tsv \ - | ./statistics + | ./statistics \ + >"$@" diff --git a/statistics.pas b/statistics.pas index 525b353..0fc5d87 100644 --- a/statistics.pas +++ b/statistics.pas @@ -74,7 +74,7 @@ var ps: array[boolean] of tPosition; ws: array of tMesswert; minB,maxB,minL,maxL: extended; - zoom: extended; + zoom,w: extended; wL,wU,wBr,wHo: int64; anz: array of int64; sum,qSum: array of extended; @@ -82,7 +82,7 @@ var begin i:=0; ShortDateFormat:='y-m-d'; - zoom:=500; + zoom:=5000; for b:=false to true do ps[b]:=tPosition.create; setLength(ws,0); @@ -97,35 +97,43 @@ begin if i>0 then begin if ps[false].zeitbreite) then - minB:=breite; - if (length(ws)=1) or (maxBlaenge) then - minL:=laenge; - if (length(ws)=1) or (maxL 11.70) or + (ps[true].breite < 50.85) or + (ps[true].breite > 50.99) then + continue; + if ps[false].zeit-ps[true].zeit>=30 then + continue; + w:=abstand(ps[true],ps[false])/(ps[false].zeit-ps[true].zeit); + if w*3.6 > 100 then + continue; + setLength(ws,length(ws)+1); + ws[length(ws)-1]:=tMesswert.create; + with ws[length(ws)-1] do begin + copyFrom(ps[true]); + wert:=w; + if (length(ws)=1) or (minB>breite) then + minB:=breite; + if (length(ws)=1) or (maxBlaenge) then + minL:=laenge; + if (length(ws)=1) or (maxL10000 then - break; +// if i>100000 then +// break; end; for b:=false to true do ps[b].free; - writeln(minB,' .. ',maxB,' x ',minL,' .. ',maxL); + writeln(stderr,minL,' .. ',maxL,' x ',minB,' .. ',maxB); wU:=round(floor(minB*zoom)); - wHo:=round(floor(maxB*zoom)+1)-wU; + wHo:=round(floor(maxB*zoom)+1-wU); wL:=round(floor(minL*cos(minB+maxB)*zoom)); - wBr:=round(floor(maxL*cos(minB+maxB)*zoom)+1)-wL; - writeln(wBr,' x ',wHo); + wBr:=round(floor(maxL*cos(minB+maxB)*zoom)+1-wL); + writeln(stderr,wBr,' x ',wHo); setLength(anz,wBr*wHo); setLength(sum,wBr*wHo); setLength(qSum,wBr*wHo); -- cgit v1.2.3-54-g00ecf