From b2707a93a480f4e79deb85b15980329ae1e7ffdd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 21 Dec 2016 14:15:04 +0100 Subject: speichert erst mal irgendwas --- .gitignore | 1 + analyzer.lpr | 8 +++++ analyzer.lps | 94 ++++++++++++++++++++++++++++++---------------------------- valuesunit.pas | 25 ++++++++++++++++ 4 files changed, 83 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index f995854..19d4e45 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ *.tar.gz *~ analyzer +analyse lib diff --git a/analyzer.lpr b/analyzer.lpr index 5b6d150..e54d375 100644 --- a/analyzer.lpr +++ b/analyzer.lpr @@ -88,6 +88,10 @@ begin halt(1); end; end; + if not directoryexists(optionArgument(oOutput,0)) then begin + writeln('Output directory '''+optionArgument(oOutput,0)+''' does not exist'); + halt(1); + end; { add your program here } setlength(values,oCnt[oAcceleration]); @@ -99,6 +103,10 @@ begin values[i,false].intersect(values[i,true]); end; + for i:=0 to length(values)-1 do begin + values[i,false].writeCombined(values[i,true],optionArgument(oOutput,0)+'/analyse_'+inttostr(i)+'.dat'); + end; + for i:=0 to length(values)-1 do begin values[i,false].free; values[i,true].free; diff --git a/analyzer.lps b/analyzer.lps index 40637d4..aecd74c 100644 --- a/analyzer.lps +++ b/analyzer.lps @@ -7,19 +7,19 @@ - - - - + + + + - - - + + + @@ -28,19 +28,19 @@ - + - + - + @@ -50,121 +50,125 @@ - + - + - + - + - - - - + + + + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - - + + - + + + + + diff --git a/valuesunit.pas b/valuesunit.pas index a571955..0d0a28e 100644 --- a/valuesunit.pas +++ b/valuesunit.pas @@ -25,6 +25,7 @@ type function count: int64; function timeInterval: tInt64Point; procedure intersect(v: tValues); + procedure writeCombined(v: tValues; dat: string); end; function interpolate(w1,w2: tWert; x: extended): tWert; inline; @@ -204,6 +205,30 @@ begin v.intersect(self); end; +procedure tValues.writeCombined(v: tValues; dat: string); +var + i: int64; + f: textfile; +begin + if timeInterval <> v.timeInterval then + raise exception.create('Unequal time intervals - can''t writeCombined.'); + if count <> v.count then + raise exception.create('Unequal number of values - can''t writeCombined.'); + assignFile(f,dat); + rewrite(f); + for i:=0 to count-1 do + writeln(f, + intToStr(werte[i].time) + +#9+floatToStr(werte[i].vec['x']) + +#9+floatToStr(werte[i].vec['y']) + +#9+floatToStr(werte[i].vec['z']) + +#9+floatToStr(v.werte[i].vec['x']) + +#9+floatToStr(v.werte[i].vec['y']) + +#9+floatToStr(v.werte[i].vec['z']) + ); + closefile(f); +end; + // general functions *********************************************************** function interpolate(w1,w2: tWert; x: extended): tWert; inline; -- cgit v1.2.3-70-g09d2