summaryrefslogtreecommitdiff
path: root/fhunit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'fhunit.pas')
-rw-r--r--fhunit.pas17
1 files changed, 17 insertions, 0 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