diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | analyzer.lpr | 8 | ||||
-rw-r--r-- | analyzer.lps | 94 | ||||
-rw-r--r-- | valuesunit.pas | 25 |
4 files changed, 83 insertions, 45 deletions
@@ -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]); @@ -100,6 +104,10 @@ begin 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; end; diff --git a/analyzer.lps b/analyzer.lps index 40637d4..aecd74c 100644 --- a/analyzer.lps +++ b/analyzer.lps @@ -7,19 +7,19 @@ <Unit0> <Filename Value="analyzer.lpr"/> <IsPartOfProject Value="True"/> - <IsVisibleTab Value="True"/> - <TopLine Value="79"/> - <CursorPos Y="100"/> - <UsageCount Value="31"/> + <TopLine Value="86"/> + <CursorPos X="21" Y="107"/> + <UsageCount Value="37"/> <Loaded Value="True"/> </Unit0> <Unit1> <Filename Value="valuesunit.pas"/> <IsPartOfProject Value="True"/> + <IsVisibleTab Value="True"/> <EditorIndex Value="1"/> - <TopLine Value="169"/> - <CursorPos Y="188"/> - <UsageCount Value="29"/> + <TopLine Value="173"/> + <CursorPos X="37" Y="211"/> + <UsageCount Value="35"/> <Loaded Value="True"/> </Unit1> <Unit2> @@ -28,19 +28,19 @@ <EditorIndex Value="-1"/> <TopLine Value="348"/> <CursorPos X="44" Y="351"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit2> <Unit3> <Filename Value="optionunit.pas"/> <EditorIndex Value="-1"/> - <UsageCount Value="19"/> + <UsageCount Value="18"/> </Unit3> <Unit4> <Filename Value="../units/mystringlistunit.pas"/> <EditorIndex Value="-1"/> <TopLine Value="35"/> <CursorPos X="7" Y="52"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit4> <Unit5> <Filename Value="../units/lowlevelunit.pas"/> @@ -50,121 +50,125 @@ <UsageCount Value="10"/> </Unit5> </Units> - <JumpHistory Count="29" HistoryIndex="28"> + <JumpHistory Count="30" HistoryIndex="29"> <Position1> <Filename Value="valuesunit.pas"/> - <Caret Line="25" Column="26"/> + <Caret Line="69" Column="21" TopLine="45"/> </Position1> <Position2> <Filename Value="valuesunit.pas"/> - <Caret Line="69" Column="21" TopLine="45"/> + <Caret Line="212" Column="30" TopLine="176"/> </Position2> <Position3> <Filename Value="valuesunit.pas"/> - <Caret Line="212" Column="30" TopLine="176"/> + <Caret Line="38"/> </Position3> <Position4> - <Filename Value="valuesunit.pas"/> - <Caret Line="38"/> - </Position4> - <Position5> <Filename Value="analyzer.lpr"/> <Caret Line="58" Column="3" TopLine="46"/> + </Position4> + <Position5> + <Filename Value="valuesunit.pas"/> + <Caret Line="226" Column="67" TopLine="187"/> </Position5> <Position6> <Filename Value="valuesunit.pas"/> - <Caret Line="226" Column="67" TopLine="187"/> + <Caret Line="47" Column="30" TopLine="22"/> </Position6> <Position7> - <Filename Value="valuesunit.pas"/> - <Caret Line="47" Column="30" TopLine="22"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="47" Column="30" TopLine="33"/> </Position7> <Position8> <Filename Value="analyzer.lpr"/> - <Caret Line="47" Column="30" TopLine="33"/> + <Caret Line="97" Column="98" TopLine="66"/> </Position8> <Position9> <Filename Value="analyzer.lpr"/> - <Caret Line="97" Column="98" TopLine="66"/> + <Caret Line="9" Column="66" TopLine="3"/> </Position9> <Position10> - <Filename Value="analyzer.lpr"/> - <Caret Line="9" Column="66" TopLine="3"/> + <Filename Value="valuesunit.pas"/> + <Caret Line="176" Column="28" TopLine="151"/> </Position10> <Position11> <Filename Value="valuesunit.pas"/> - <Caret Line="176" Column="28" TopLine="151"/> + <Caret Line="186" Column="30" TopLine="165"/> </Position11> <Position12> <Filename Value="valuesunit.pas"/> - <Caret Line="186" Column="30" TopLine="165"/> + <Caret Line="188" Column="63" TopLine="162"/> </Position12> <Position13> <Filename Value="valuesunit.pas"/> - <Caret Line="188" Column="63" TopLine="162"/> + <Caret Line="190" Column="32" TopLine="168"/> </Position13> <Position14> <Filename Value="valuesunit.pas"/> - <Caret Line="190" Column="32" TopLine="168"/> </Position14> <Position15> <Filename Value="valuesunit.pas"/> + <Caret Line="26" Column="28" TopLine="4"/> </Position15> <Position16> <Filename Value="valuesunit.pas"/> - <Caret Line="26" Column="28" TopLine="4"/> + <Caret Line="172" Column="38" TopLine="150"/> </Position16> <Position17> <Filename Value="valuesunit.pas"/> - <Caret Line="172" Column="38" TopLine="150"/> + <Caret Line="176" Column="28" TopLine="153"/> </Position17> <Position18> <Filename Value="valuesunit.pas"/> - <Caret Line="176" Column="28" TopLine="153"/> + <Caret Line="188" Column="47" TopLine="121"/> </Position18> <Position19> <Filename Value="valuesunit.pas"/> - <Caret Line="188" Column="47" TopLine="121"/> + <Caret Line="23"/> </Position19> <Position20> - <Filename Value="valuesunit.pas"/> - <Caret Line="23"/> - </Position20> - <Position21> <Filename Value="analyzer.lpr"/> <Caret Line="99" Column="47" TopLine="75"/> + </Position20> + <Position21> + <Filename Value="valuesunit.pas"/> + <Caret Line="23" Column="43"/> </Position21> <Position22> <Filename Value="valuesunit.pas"/> - <Caret Line="23" Column="43"/> + <Caret Line="53" Column="38" TopLine="31"/> </Position22> <Position23> <Filename Value="valuesunit.pas"/> - <Caret Line="53" Column="38" TopLine="31"/> + <Caret Line="56" Column="42" TopLine="34"/> </Position23> <Position24> <Filename Value="valuesunit.pas"/> - <Caret Line="56" Column="42" TopLine="34"/> + <Caret Line="204" Column="21" TopLine="172"/> </Position24> <Position25> <Filename Value="valuesunit.pas"/> - <Caret Line="204" Column="21" TopLine="172"/> </Position25> <Position26> <Filename Value="valuesunit.pas"/> + <Caret Line="214" Column="10" TopLine="178"/> </Position26> <Position27> <Filename Value="valuesunit.pas"/> - <Caret Line="214" Column="10" TopLine="178"/> + <Caret Line="217" Column="36" TopLine="181"/> </Position27> <Position28> - <Filename Value="valuesunit.pas"/> - <Caret Line="217" Column="36" TopLine="181"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="100" Column="147" TopLine="79"/> </Position28> <Position29> <Filename Value="analyzer.lpr"/> - <Caret Line="100" Column="147" TopLine="79"/> + <Caret Line="107" Column="106" TopLine="87"/> </Position29> + <Position30> + <Filename Value="valuesunit.pas"/> + <Caret Line="188" TopLine="169"/> + </Position30> </JumpHistory> </ProjectSession> </CONFIG> 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; |