diff options
-rw-r--r-- | analyzer.lps | 118 | ||||
-rw-r--r-- | valuesunit.pas | 48 |
2 files changed, 96 insertions, 70 deletions
diff --git a/analyzer.lps b/analyzer.lps index e39f80b..40637d4 100644 --- a/analyzer.lps +++ b/analyzer.lps @@ -3,37 +3,37 @@ <ProjectSession> <Version Value="9"/> <BuildModes Active="Default"/> - <Units Count="5"> + <Units Count="6"> <Unit0> <Filename Value="analyzer.lpr"/> <IsPartOfProject Value="True"/> - <TopLine Value="75"/> - <CursorPos X="47" Y="99"/> - <UsageCount Value="30"/> + <IsVisibleTab Value="True"/> + <TopLine Value="79"/> + <CursorPos Y="100"/> + <UsageCount Value="31"/> <Loaded Value="True"/> </Unit0> <Unit1> + <Filename Value="valuesunit.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="1"/> + <TopLine Value="169"/> + <CursorPos Y="188"/> + <UsageCount Value="29"/> + <Loaded Value="True"/> + </Unit1> + <Unit2> <Filename Value="/usr/lib/fpc/src/packages/fcl-base/src/custapp.pp"/> <UnitName Value="CustApp"/> <EditorIndex Value="-1"/> <TopLine Value="348"/> <CursorPos X="44" Y="351"/> <UsageCount Value="9"/> - </Unit1> - <Unit2> + </Unit2> + <Unit3> <Filename Value="optionunit.pas"/> <EditorIndex Value="-1"/> <UsageCount Value="19"/> - </Unit2> - <Unit3> - <Filename Value="valuesunit.pas"/> - <IsPartOfProject Value="True"/> - <IsVisibleTab Value="True"/> - <EditorIndex Value="1"/> - <TopLine Value="151"/> - <CursorPos X="6" Y="180"/> - <UsageCount Value="28"/> - <Loaded Value="True"/> </Unit3> <Unit4> <Filename Value="../units/mystringlistunit.pas"/> @@ -42,127 +42,129 @@ <CursorPos X="7" Y="52"/> <UsageCount Value="9"/> </Unit4> + <Unit5> + <Filename Value="../units/lowlevelunit.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="105"/> + <CursorPos X="26" Y="130"/> + <UsageCount Value="10"/> + </Unit5> </Units> - <JumpHistory Count="30" HistoryIndex="29"> + <JumpHistory Count="29" HistoryIndex="28"> <Position1> <Filename Value="valuesunit.pas"/> - <Caret Line="8" Column="34" TopLine="2"/> + <Caret Line="25" Column="26"/> </Position1> <Position2> <Filename Value="valuesunit.pas"/> - <Caret Line="92" TopLine="68"/> + <Caret Line="69" Column="21" TopLine="45"/> </Position2> <Position3> - <Filename Value="analyzer.lpr"/> - <Caret Line="99" Column="61" TopLine="78"/> + <Filename Value="valuesunit.pas"/> + <Caret Line="212" Column="30" TopLine="176"/> </Position3> <Position4> <Filename Value="valuesunit.pas"/> - <Caret Line="91" Column="52" TopLine="73"/> + <Caret Line="38"/> </Position4> <Position5> - <Filename Value="valuesunit.pas"/> - <Caret Line="22" Column="28"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="58" Column="3" TopLine="46"/> </Position5> <Position6> <Filename Value="valuesunit.pas"/> - <Caret Line="23" Column="36"/> + <Caret Line="226" Column="67" TopLine="187"/> </Position6> <Position7> <Filename Value="valuesunit.pas"/> - <Caret Line="94" Column="40" TopLine="70"/> + <Caret Line="47" Column="30" TopLine="22"/> </Position7> <Position8> - <Filename Value="valuesunit.pas"/> - <Caret Line="102" TopLine="72"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="47" Column="30" TopLine="33"/> </Position8> <Position9> - <Filename Value="valuesunit.pas"/> - <Caret Line="24" Column="72"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="97" Column="98" TopLine="66"/> </Position9> <Position10> - <Filename Value="valuesunit.pas"/> - <Caret Line="95" Column="34" TopLine="73"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="9" Column="66" TopLine="3"/> </Position10> <Position11> - <Filename Value="analyzer.lpr"/> - <Caret Line="98" Column="40" TopLine="77"/> + <Filename Value="valuesunit.pas"/> + <Caret Line="176" Column="28" TopLine="151"/> </Position11> <Position12> <Filename Value="valuesunit.pas"/> - <Caret Line="12" Column="16" TopLine="52"/> + <Caret Line="186" Column="30" TopLine="165"/> </Position12> <Position13> <Filename Value="valuesunit.pas"/> - <Caret Line="57" Column="15" TopLine="49"/> + <Caret Line="188" Column="63" TopLine="162"/> </Position13> <Position14> <Filename Value="valuesunit.pas"/> - <Caret Line="58" Column="15" TopLine="49"/> + <Caret Line="190" Column="32" TopLine="168"/> </Position14> <Position15> <Filename Value="valuesunit.pas"/> - <Caret Line="59" Column="15" TopLine="49"/> </Position15> <Position16> <Filename Value="valuesunit.pas"/> - <Caret Line="62" Column="15" TopLine="49"/> + <Caret Line="26" Column="28" TopLine="4"/> </Position16> <Position17> <Filename Value="valuesunit.pas"/> - <Caret Line="63" Column="15" TopLine="49"/> + <Caret Line="172" Column="38" TopLine="150"/> </Position17> <Position18> <Filename Value="valuesunit.pas"/> - <Caret Line="64" Column="15" TopLine="49"/> + <Caret Line="176" Column="28" TopLine="153"/> </Position18> <Position19> <Filename Value="valuesunit.pas"/> - <Caret Line="110" Column="21" TopLine="95"/> + <Caret Line="188" Column="47" TopLine="121"/> </Position19> <Position20> <Filename Value="valuesunit.pas"/> + <Caret Line="23"/> </Position20> <Position21> - <Filename Value="valuesunit.pas"/> - <Caret Line="25" Column="26"/> + <Filename Value="analyzer.lpr"/> + <Caret Line="99" Column="47" TopLine="75"/> </Position21> <Position22> <Filename Value="valuesunit.pas"/> - <Caret Line="69" Column="21" TopLine="45"/> + <Caret Line="23" Column="43"/> </Position22> <Position23> <Filename Value="valuesunit.pas"/> - <Caret Line="212" Column="30" TopLine="176"/> + <Caret Line="53" Column="38" TopLine="31"/> </Position23> <Position24> <Filename Value="valuesunit.pas"/> - <Caret Line="38"/> + <Caret Line="56" Column="42" TopLine="34"/> </Position24> <Position25> - <Filename Value="analyzer.lpr"/> - <Caret Line="58" Column="3" TopLine="46"/> + <Filename Value="valuesunit.pas"/> + <Caret Line="204" Column="21" TopLine="172"/> </Position25> <Position26> <Filename Value="valuesunit.pas"/> - <Caret Line="226" Column="67" TopLine="187"/> </Position26> <Position27> <Filename Value="valuesunit.pas"/> - <Caret Line="47" Column="30" TopLine="22"/> + <Caret Line="214" Column="10" TopLine="178"/> </Position27> <Position28> - <Filename Value="analyzer.lpr"/> - <Caret Line="47" Column="30" TopLine="33"/> + <Filename Value="valuesunit.pas"/> + <Caret Line="217" Column="36" TopLine="181"/> </Position28> <Position29> <Filename Value="analyzer.lpr"/> - <Caret Line="97" Column="98" TopLine="66"/> + <Caret Line="100" Column="147" TopLine="79"/> </Position29> - <Position30> - <Filename Value="analyzer.lpr"/> - <Caret Line="9" Column="66" TopLine="3"/> - </Position30> </JumpHistory> </ProjectSession> </CONFIG> diff --git a/valuesunit.pas b/valuesunit.pas index 97d960f..a571955 100644 --- a/valuesunit.pas +++ b/valuesunit.pas @@ -20,10 +20,10 @@ type constructor create; destructor destroy; override; procedure readFromFile(dat: string); overload; - procedure readFromFile(ti: tExtPoint; dat: string); overload; - procedure readFromFile(minT,maxT: extended; dat: string); overload; + procedure readFromFile(ti: tInt64Point; dat: string); overload; + procedure readFromFile(minT,maxT: int64; dat: string); overload; function count: int64; - function timeInterval: tExtPoint; + function timeInterval: tInt64Point; procedure intersect(v: tValues); end; @@ -34,7 +34,7 @@ function timeToInt64(s: string): int64; implementation uses - math, dateutils; + dateutils; constructor tValues.create; begin @@ -50,15 +50,15 @@ end; procedure tValues.readFromFile(dat: string); begin - readFromFile(-infinity,infinity,dat); + readFromFile(low(int64),high(int64),dat); end; -procedure tValues.readFromFile(ti: tExtPoint; dat: string); +procedure tValues.readFromFile(ti: tInt64Point; dat: string); begin readFromFile(ti['x'],ti['y'],dat); end; -procedure tValues.readFromFile(minT,maxT: extended; dat: string); +procedure tValues.readFromFile(minT,maxT: int64; dat: string); var f: textfile; s: string; @@ -169,15 +169,39 @@ begin result:=length(werte); end; -function tValues.timeInterval: tExtPoint; +function tValues.timeInterval: tInt64Point; begin - result['x']:=werte[0].time; - result['y']:=werte[count-1].time; + if count=0 then begin + result['x']:=high(int64); + result['y']:=low(int64); + end + else begin + result['x']:=werte[0].time; + result['y']:=werte[count-1].time; + end; end; procedure tValues.intersect(v: tValues); +var + i,t: int64; begin - if + if (count=0) or (v.count=0) or (timeInterval=v.timeInterval) then + exit; + t:=v.timeInterval['x']; + i:=0; + while (i<count) and (werte[i].time<t) do + inc(i); + if i>0 then begin + for t:=i to count-1 do + werte[t-i]:=werte[t]; + setlength(werte,count-i); + end; + + t:=v.timeInterval['y']; + while (count>0) and (werte[count-1].time>t) do + setlength(werte,length(werte)-1); + + v.intersect(self); end; // general functions *********************************************************** @@ -190,7 +214,7 @@ begin round(w1.time*(1-x) + w2.time*x); for c:='x' to 'z' do begin result.vec[c]:= - round(w1.vec[c]*(1-x) + w2.vec[c]*x); + w1.vec[c]*(1-x) + w2.vec[c]*x; end; end; |