From 1ef766c8367d243f5a8c5dac3e20d17cdbfa8a53 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 21 Feb 2016 15:35:33 +0100 Subject: simpler Export der Temperatur für sox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fhunit.pas | 17 +++++++++ wetter.lps | 114 ++++++++++++++++++++++++++++++------------------------------- 2 files changed, 74 insertions(+), 57 deletions(-) diff --git a/fhunit.pas b/fhunit.pas index f4e5edc..7a5b570 100644 --- a/fhunit.pas +++ b/fhunit.pas @@ -549,6 +549,9 @@ var len: longint; s: string; i: longint; + fi: file; + ma,mi: extended; + lw: longword; begin if not fileexists(von) then begin writeln('Messwertedatei '''+von+''' existiert nicht!'); @@ -571,6 +574,20 @@ begin werte.pmud(pt+2*sizeof(longint),(pLongint(pt)+1)^,len-2*sizeof(longint)); freemem(pt); + assignfile(fi,'/tmp/temperatur.roh'); + rewrite(fi,1); + ma:=werte[0].mW[mgTemperatur]; + mi:=ma; + for i:=1 to werte.count-1 do begin + ma:=max(ma,werte[i].mW[mgTemperatur]); + mi:=min(mi,werte[i].mW[mgTemperatur]); + end; + for i:=0 to werte.count-1 do begin + lw:=round((werte[i].mW[mgTemperatur]-mi)/(ma+mi)*$ffffffff); + blockwrite(fi,lw,sizeof(lw)); + end; + closefile(fi); + if length(muts)=0 then begin setlength(muts,20); for i:=0 to length(muts)-1 do diff --git a/wetter.lps b/wetter.lps index 2fafbe5..7e4ef56 100644 --- a/wetter.lps +++ b/wetter.lps @@ -18,8 +18,8 @@ - - + + @@ -33,9 +33,10 @@ + - - + + @@ -57,9 +58,8 @@ - - + @@ -141,123 +141,123 @@ - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - - + + - + - - + + - - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + - - + + - - + + - - + + - + - - + + -- cgit v1.2.3-70-g09d2