summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-26 08:39:14 +0200
committerErich Eckner <git@eckner.net>2018-06-26 08:39:14 +0200
commit081856dfb6daa79cc02b8c502ece88d7d535f0e7 (patch)
treedbc7bf327093d59ed2beeb27a13cfbd5e3fb0589
parent542c630eabc49c0f6d3d06c02ab617b0e7f81da7 (diff)
downloadepost-081856dfb6daa79cc02b8c502ece88d7d535f0e7.tar.xz
werteunit.pas: tLLWerte.findeSchwellwerte: interpolieren für weichere Konturen
-rw-r--r--epost.lps74
-rw-r--r--werteunit.pas33
2 files changed, 61 insertions, 46 deletions
diff --git a/epost.lps b/epost.lps
index f3bc1b7..c1f2145 100644
--- a/epost.lps
+++ b/epost.lps
@@ -22,19 +22,19 @@
<Unit2>
<Filename Value="epostunit.pas"/>
<IsPartOfProject Value="True"/>
- <IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
- <TopLine Value="5847"/>
- <CursorPos X="88" Y="5857"/>
+ <TopLine Value="8141"/>
+ <CursorPos X="33" Y="8161"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="werteunit.pas"/>
<IsPartOfProject Value="True"/>
+ <IsVisibleTab Value="True"/>
<EditorIndex Value="9"/>
- <TopLine Value="1381"/>
- <CursorPos X="52" Y="1403"/>
+ <TopLine Value="1372"/>
+ <CursorPos X="40" Y="1402"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit3>
@@ -79,7 +79,7 @@
<EditorIndex Value="10"/>
<TopLine Value="211"/>
<CursorPos X="32" Y="211"/>
- <UsageCount Value="181"/>
+ <UsageCount Value="182"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
@@ -202,123 +202,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="epostunit.pas"/>
- <Caret Line="231" Column="53" TopLine="208"/>
+ <Caret Line="226" Column="22" TopLine="208"/>
</Position1>
<Position2>
<Filename Value="epostunit.pas"/>
- <Caret Line="5479" Column="70" TopLine="5456"/>
+ <Caret Line="231" Column="53" TopLine="208"/>
</Position2>
<Position3>
<Filename Value="epostunit.pas"/>
- <Caret Line="5480" Column="61" TopLine="5456"/>
+ <Caret Line="5478" Column="70" TopLine="5450"/>
</Position3>
<Position4>
<Filename Value="epostunit.pas"/>
- <Caret Line="5534" Column="36" TopLine="5506"/>
+ <Caret Line="5479" Column="15" TopLine="5450"/>
</Position4>
<Position5>
<Filename Value="epostunit.pas"/>
- <Caret Line="5699" Column="68" TopLine="5671"/>
+ <Caret Line="5504" Column="35" TopLine="5476"/>
</Position5>
<Position6>
<Filename Value="epostunit.pas"/>
- <Caret Line="6781" Column="23" TopLine="6752"/>
+ <Caret Line="5505" Column="17" TopLine="5477"/>
</Position6>
<Position7>
<Filename Value="epostunit.pas"/>
- <Caret Line="6783" Column="32" TopLine="6754"/>
+ <Caret Line="5506" Column="25" TopLine="5478"/>
</Position7>
<Position8>
<Filename Value="epostunit.pas"/>
- <Caret Line="6792" Column="69" TopLine="6784"/>
+ <Caret Line="5533" Column="25" TopLine="5505"/>
</Position8>
<Position9>
<Filename Value="epostunit.pas"/>
- <Caret Line="6801" Column="31" TopLine="6784"/>
+ <Caret Line="5691" Column="53" TopLine="5675"/>
</Position9>
<Position10>
<Filename Value="epostunit.pas"/>
- <Caret Line="226" Column="22" TopLine="208"/>
+ <Caret Line="5699" Column="43" TopLine="5675"/>
</Position10>
<Position11>
<Filename Value="epostunit.pas"/>
- <Caret Line="231" Column="53" TopLine="208"/>
+ <Caret Line="5856" Column="18" TopLine="5841"/>
</Position11>
<Position12>
<Filename Value="epostunit.pas"/>
- <Caret Line="5478" Column="70" TopLine="5450"/>
+ <Caret Line="131" Column="23" TopLine="115"/>
</Position12>
<Position13>
<Filename Value="epostunit.pas"/>
- <Caret Line="5479" Column="15" TopLine="5450"/>
+ <Caret Line="132" Column="23" TopLine="115"/>
</Position13>
<Position14>
<Filename Value="epostunit.pas"/>
- <Caret Line="5504" Column="35" TopLine="5476"/>
+ <Caret Line="2198" Column="26" TopLine="2169"/>
</Position14>
<Position15>
<Filename Value="epostunit.pas"/>
- <Caret Line="5505" Column="17" TopLine="5477"/>
+ <Caret Line="2200" Column="20" TopLine="2183"/>
</Position15>
<Position16>
<Filename Value="epostunit.pas"/>
- <Caret Line="5506" Column="25" TopLine="5478"/>
+ <Caret Line="5563" Column="138" TopLine="5544"/>
</Position16>
<Position17>
<Filename Value="epostunit.pas"/>
- <Caret Line="5533" Column="25" TopLine="5505"/>
+ <Caret Line="5567" Column="22" TopLine="5544"/>
</Position17>
<Position18>
<Filename Value="epostunit.pas"/>
- <Caret Line="5691" Column="53" TopLine="5675"/>
+ <Caret Line="5571" Column="22" TopLine="5544"/>
</Position18>
<Position19>
<Filename Value="epostunit.pas"/>
- <Caret Line="5699" Column="43" TopLine="5675"/>
+ <Caret Line="5575" Column="22" TopLine="5547"/>
</Position19>
<Position20>
<Filename Value="epostunit.pas"/>
- <Caret Line="5856" Column="18" TopLine="5841"/>
+ <Caret Line="5579" Column="22" TopLine="5551"/>
</Position20>
<Position21>
<Filename Value="epostunit.pas"/>
- <Caret Line="131" Column="23" TopLine="115"/>
+ <Caret Line="5856" Column="22" TopLine="5828"/>
</Position21>
<Position22>
<Filename Value="epostunit.pas"/>
- <Caret Line="132" Column="23" TopLine="115"/>
+ <Caret Line="5857" Column="88" TopLine="5847"/>
</Position22>
<Position23>
<Filename Value="epostunit.pas"/>
- <Caret Line="2198" Column="26" TopLine="2169"/>
+ <Caret Line="343" Column="25" TopLine="325"/>
</Position23>
<Position24>
<Filename Value="epostunit.pas"/>
- <Caret Line="2200" Column="20" TopLine="2183"/>
+ <Caret Line="7842" Column="59" TopLine="7837"/>
</Position24>
<Position25>
<Filename Value="epostunit.pas"/>
- <Caret Line="5563" Column="138" TopLine="5544"/>
+ <Caret Line="7875" Column="29" TopLine="7862"/>
</Position25>
<Position26>
<Filename Value="epostunit.pas"/>
- <Caret Line="5567" Column="22" TopLine="5544"/>
+ <Caret Line="8140" Column="26" TopLine="8129"/>
</Position26>
<Position27>
<Filename Value="epostunit.pas"/>
- <Caret Line="5571" Column="22" TopLine="5544"/>
+ <Caret Line="8142" Column="35" TopLine="8129"/>
</Position27>
<Position28>
<Filename Value="epostunit.pas"/>
- <Caret Line="5575" Column="22" TopLine="5547"/>
+ <Caret Line="8155" Column="34" TopLine="8129"/>
</Position28>
<Position29>
<Filename Value="epostunit.pas"/>
- <Caret Line="5579" Column="22" TopLine="5551"/>
+ <Caret Line="8161" Column="33" TopLine="8141"/>
</Position29>
<Position30>
- <Filename Value="epostunit.pas"/>
- <Caret Line="5856" Column="22" TopLine="5828"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="75" Column="31" TopLine="59"/>
</Position30>
</JumpHistory>
</ProjectSession>
diff --git a/werteunit.pas b/werteunit.pas
index e2055eb..1b40471 100644
--- a/werteunit.pas
+++ b/werteunit.pas
@@ -1356,8 +1356,8 @@ end;
function tLLWerte.findeSchwellwerte(xMi,xMa,tMi,tMa: longint; Schw: extended): tExtPointArray;
var
- i,j,k,l,m,vz: longint;
- dX,dY,x0,y0: extended;
+ i,j,k,l,m,vz: longint;
+ dX,dY,x0,y0,anteil,w1,w2: extended;
begin
setLength(result,0);
gibAus('Schwellwerte finden ('+intToStr(xMi)+'-'+intToStr(xMa)+' x '+intToStr(tMi)+'-'+intToStr(tMa)+') '+floatToStr(Schw)+' ...',1);
@@ -1374,19 +1374,34 @@ begin
y0:=params.tStart;
for j:=xMi to xMa do begin
for k:=tMi to tMa do begin
- vz:=0;
- for l:=0 to 1 do
- for m:=0 to 1 do
- vz:=
- vz or (byte(werte[j-l+(k-m)*params.xSteps]>=Schw) shl 1) or
- byte(werte[j-l+(k-m)*params.xSteps]<=Schw);
- if vz=3 then begin
+ if werte[j+k*params.xSteps]=Schw then begin
if i>=length(result) then
setLength(result,length(result)+speicherHappen);
result[i]['x']:=j*dX+x0;
result[i]['y']:=k*dY+y0;
inc(i);
+ continue;
end;
+ if (j=0) or (k=0) then
+ continue;
+ for l:=0 to 1 do
+ for m:=0 to 1 do begin
+ w1:=werte[j-l+(k-m)*params.xSteps];
+ w2:=werte[j-m+(k-1+l)*params.xSteps];
+ if (w1=Schw) or (w2=Schw) then
+ continue;
+ if (werte[j-l+(k-m)*params.xSteps]>Schw) xor
+ (werte[j-m+(k-1+l)*params.xSteps]>Schw) then begin
+ // j-l;k-m -> werte[j-l+(k-m)*params.xSteps]
+ // j-m;k-1+l -> werte[j-m+(k-1+l)*params.xSteps]
+ anteil:= (Schw-werte[j-l+(k-m)*params.xSteps])/(werte[j-m+(k-1+l)*params.xSteps]-werte[j-l+(k-m)*params.xSteps]);
+ if i>=length(result) then
+ setLength(result,length(result)+speicherHappen);
+ result[i]['x']:=(j-l+(l-m)*anteil)*dX+x0;
+ result[i]['y']:=(k-m+(m-1+l)*anteil)*dY+y0;
+ inc(i);
+ end;
+ end;
end;
if (xMa-j) and $ff = 0 then
gibAus('x = '+intToStr(j)+' ('+intToStr(xMi)+'-'+intToStr(xMa)+')',1);