diff options
Diffstat (limited to 'romunit.pas')
-rw-r--r-- | romunit.pas | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/romunit.pas b/romunit.pas index 7782814..a3289c5 100644 --- a/romunit.pas +++ b/romunit.pas @@ -594,29 +594,18 @@ end; procedure gesamtverschiebung(var inPuls,outPuls: tExtPointArray; var absShift: extended); var - iMax,oMax,i: longint; + oMin,i: longint; begin - iMax:=0; - for i:=1 to length(inPuls)-1 do - if inPuls[i]['y']>inPuls[iMax]['y'] then - iMax:=i; - oMax:=0; - for i:=1 to length(outPuls)-1 do - if outPuls[i]['y']>outPuls[oMax]['y'] then - oMax:=i; - if absShift<-0.9e9 then - absShift:=outPuls[oMax]['x']-inPuls[iMax]['x'] - else - absShift:=(outPuls[oMax]['x']-inPuls[iMax]['x'])-round((outPuls[oMax]['x']-inPuls[iMax]['x'])-absShift); - for i:=0 to length(outPuls)-1 do outPuls[i]['x']:=outPuls[i]['x']-absShift; - oMax:=0; - while (oMax<length(outPuls)) and (outPuls[oMax]['x']<inPuls[0]['x']) do - inc(oMax); - for i:=oMax to length(outPuls)-1 do - outPuls[i-oMax]:=outPuls[i]; - setlength(outPuls,length(outPuls)-oMax); + oMin:=0; + while (oMin<length(outPuls)) and (outPuls[oMin]['x']<inPuls[0]['x']) do + inc(oMin); + if oMin>0 then + dec(oMin); + for i:=oMin to length(outPuls)-1 do + outPuls[i-oMin]:=outPuls[i]; + setlength(outPuls,length(outPuls)-oMin); cut(inPuls,outPuls[length(outPuls)-1]['x']); writeln(stderr,'Die konstante Verschiebung wurde auf '+floattostr(absShift)+' T optimiert.'); end; |