summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-24 15:45:23 +0100
committerErich Eckner <git@eckner.net>2019-01-24 15:45:23 +0100
commit591b6d542b52951c10f94749d48c9b2207c12159 (patch)
tree3d9621a8713eedf1c1ab32dad38b432cf7cb2d6c
parentd24c1a7fc56d261e5fec8baf082a3e53eaf2d266 (diff)
downloadepost-591b6d542b52951c10f94749d48c9b2207c12159.tar.xz
Töpfe speicher- und ladebar, Spektrometerverzerrung beachtbar
-rw-r--r--epost.lps122
-rw-r--r--epostunit.pas128
2 files changed, 149 insertions, 101 deletions
diff --git a/epost.lps b/epost.lps
index befd5cf..a6a9aea 100644
--- a/epost.lps
+++ b/epost.lps
@@ -22,10 +22,9 @@
<Unit2>
<Filename Value="epostunit.pas"/>
<IsPartOfProject Value="True"/>
- <IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
- <TopLine Value="4014"/>
- <CursorPos X="69" Y="4035"/>
+ <TopLine Value="3966"/>
+ <CursorPos X="45" Y="3982"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit2>
@@ -112,16 +111,17 @@
<Unit13>
<Filename Value="../units/lowlevelunit.pas"/>
<EditorIndex Value="1"/>
- <TopLine Value="838"/>
- <CursorPos X="21" Y="873"/>
+ <TopLine Value="121"/>
+ <CursorPos X="46" Y="139"/>
<UsageCount Value="97"/>
<Loaded Value="True"/>
</Unit13>
<Unit14>
<Filename Value="../units/matheunit.pas"/>
+ <IsVisibleTab Value="True"/>
<EditorIndex Value="3"/>
- <TopLine Value="1130"/>
- <CursorPos X="60" Y="1147"/>
+ <TopLine Value="1194"/>
+ <CursorPos X="106" Y="1213"/>
<UsageCount Value="99"/>
<Loaded Value="True"/>
</Unit14>
@@ -211,120 +211,120 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="epostunit.pas"/>
- <Caret Line="4040" Column="11" TopLine="4038"/>
+ <Caret Line="2349" Column="21" TopLine="2292"/>
</Position1>
<Position2>
- <Filename Value="../units/matheunit.pas"/>
- <Caret Line="70" Column="11" TopLine="52"/>
+ <Filename Value="epostunit.pas"/>
+ <Caret Line="4089" Column="24" TopLine="4078"/>
</Position2>
<Position3>
<Filename Value="epostunit.pas"/>
- <Caret Line="4040" Column="11" TopLine="4038"/>
+ <Caret Line="5817" Column="10" TopLine="5789"/>
</Position3>
<Position4>
<Filename Value="epostunit.pas"/>
- <Caret Line="4102" Column="27" TopLine="4074"/>
+ <Caret Line="169" Column="26" TopLine="153"/>
</Position4>
<Position5>
- <Filename Value="typenunit.pas"/>
- <Caret Line="20" TopLine="4"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="360" Column="69" TopLine="348"/>
</Position5>
<Position6>
- <Filename Value="epostunit.pas"/>
- <Caret Line="4124" Column="27" TopLine="4096"/>
+ <Filename Value="epost.lpr"/>
</Position6>
<Position7>
- <Filename Value="epostunit.pas"/>
- <Caret Line="2349" Column="21" TopLine="2292"/>
+ <Filename Value="epost.lpr"/>
</Position7>
<Position8>
- <Filename Value="epostunit.pas"/>
- <Caret Line="4089" Column="24" TopLine="4078"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="698" Column="6" TopLine="666"/>
</Position8>
<Position9>
- <Filename Value="epostunit.pas"/>
- <Caret Line="5817" Column="10" TopLine="5789"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="38" Column="21" TopLine="35"/>
</Position9>
<Position10>
- <Filename Value="epostunit.pas"/>
- <Caret Line="169" Column="26" TopLine="153"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="112" Column="17" TopLine="94"/>
</Position10>
<Position11>
- <Filename Value="epost.lpr"/>
- <Caret Line="360" Column="69" TopLine="348"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="720" Column="66" TopLine="701"/>
</Position11>
<Position12>
- <Filename Value="epost.lpr"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="860" Column="15" TopLine="832"/>
</Position12>
<Position13>
- <Filename Value="epost.lpr"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="124" Column="22" TopLine="106"/>
</Position13>
<Position14>
- <Filename Value="epost.lpr"/>
- <Caret Line="698" Column="6" TopLine="666"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="860" Column="22" TopLine="831"/>
</Position14>
<Position15>
- <Filename Value="epost.lpr"/>
- <Caret Line="38" Column="21" TopLine="35"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="125" Column="17" TopLine="106"/>
</Position15>
<Position16>
- <Filename Value="../units/lowlevelunit.pas"/>
- <Caret Line="112" Column="17" TopLine="94"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="47" Column="22" TopLine="41"/>
</Position16>
<Position17>
- <Filename Value="../units/lowlevelunit.pas"/>
- <Caret Line="720" Column="66" TopLine="701"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="53" Column="59" TopLine="31"/>
</Position17>
<Position18>
- <Filename Value="../units/lowlevelunit.pas"/>
- <Caret Line="860" Column="15" TopLine="832"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="57" TopLine="28"/>
</Position18>
<Position19>
- <Filename Value="../units/lowlevelunit.pas"/>
- <Caret Line="124" Column="22" TopLine="106"/>
+ <Filename Value="epost.lpr"/>
+ <Caret Line="702" Column="15" TopLine="669"/>
</Position19>
<Position20>
- <Filename Value="../units/lowlevelunit.pas"/>
- <Caret Line="860" Column="22" TopLine="831"/>
+ <Filename Value="epost.lpr"/>
</Position20>
<Position21>
- <Filename Value="../units/lowlevelunit.pas"/>
- <Caret Line="125" Column="17" TopLine="106"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="1471" Column="70" TopLine="1439"/>
</Position21>
<Position22>
- <Filename Value="epost.lpr"/>
- <Caret Line="47" Column="22" TopLine="41"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="80" Column="19" TopLine="65"/>
</Position22>
<Position23>
- <Filename Value="epost.lpr"/>
- <Caret Line="53" Column="59" TopLine="31"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="1505" Column="62" TopLine="1455"/>
</Position23>
<Position24>
- <Filename Value="epost.lpr"/>
- <Caret Line="57" TopLine="28"/>
+ <Filename Value="epostunit.pas"/>
+ <Caret Line="4096" Column="49" TopLine="4075"/>
</Position24>
<Position25>
- <Filename Value="epost.lpr"/>
- <Caret Line="702" Column="15" TopLine="669"/>
+ <Filename Value="epostunit.pas"/>
+ <Caret Line="4107" Column="20" TopLine="4090"/>
</Position25>
<Position26>
- <Filename Value="epost.lpr"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="138" Column="11" TopLine="121"/>
</Position26>
<Position27>
- <Filename Value="epostunit.pas"/>
- <Caret Line="505" Column="33" TopLine="552"/>
+ <Filename Value="../units/lowlevelunit.pas"/>
+ <Caret Line="1029" Column="28" TopLine="1003"/>
</Position27>
<Position28>
- <Filename Value="werteunit.pas"/>
- <Caret Line="1471" Column="70" TopLine="1439"/>
+ <Filename Value="epostunit.pas"/>
+ <Caret Line="4077" Column="41" TopLine="4066"/>
</Position28>
<Position29>
- <Filename Value="werteunit.pas"/>
- <Caret Line="80" Column="19" TopLine="65"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="70" Column="12" TopLine="53"/>
</Position29>
<Position30>
- <Filename Value="werteunit.pas"/>
- <Caret Line="1505" Column="62" TopLine="1455"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="1224" Column="45" TopLine="1194"/>
</Position30>
</JumpHistory>
</ProjectSession>
diff --git a/epostunit.pas b/epostunit.pas
index eba3ee1..a4e797b 100644
--- a/epostunit.pas
+++ b/epostunit.pas
@@ -3944,9 +3944,9 @@ end;
function tWerte.faktorisiere(sT: boolean; f: tMyStringList): boolean;
var
bekannteBefehle: tMyStringList;
- Zeit,tmpE: extended;
+ Zeit,tmpE,nullteSpektrometerordnung: extended;
anzahl,i,j: longint;
- s,aDatei,iDatei: string;
+ s,aDatei,iDatei,tDatei: string;
pDatei: textFile;
lineOut,tmpEA: tExtendedArray;
maxima,maxima2: tLongintArray;
@@ -3959,22 +3959,43 @@ begin
gibAus('faktorisiere ...',3);
bekannteBefehle:=tMyStringList.create;
Zeit:=now;
- anzahl:=1;
+ anzahl:=-1;
aDatei:='';
iDatei:='';
+ tDatei:='';
residuenBerechnen:=false;
auszenHorizontal:=false;
+ nullteSpektrometerordnung:=nan;
repeat
if not f.metaReadln(s,true) then begin
gibAus('Unerwartetes Dateiende!',3);
exit;
end;
bekannteBefehle.clear;
- if istDasBefehl('Ende',s,bekannteBefehle,false) then break;
+ if istDasBefehl('Ende',s,bekannteBefehle,false) then
+ break;
if istDasBefehl('Anzahl:',s,bekannteBefehle,true) then begin
anzahl:=round(exprToFloat(sT,s));
continue;
end;
+ if istDasBefehl('nullte Spektrometerordnung:',s,bekannteBefehle,true) then begin
+ if not isNaN(nullteSpektrometerordnung) then begin
+ gibAus('Habe bereits eine nullte Spektrometerordnung beim Faktorisieren!',3);
+ bekannteBefehle.free;
+ exit;
+ end;
+ nullteSpektrometerordnung:=exprToFloat(sT,s);
+ continue;
+ end;
+ if istDasBefehl('Topf-Datei:',s,bekannteBefehle,true) then begin
+ if tDatei<>'' then begin
+ gibAus('Habe bereits eine Datei mit den Töpfen beim Faktorisieren!',3);
+ bekannteBefehle.free;
+ exit;
+ end;
+ tDatei:=s;
+ continue;
+ end;
if istDasBefehl('Residuen berechnen',s,bekannteBefehle,false) then begin
residuenBerechnen:=true;
continue;
@@ -4021,6 +4042,11 @@ begin
exit;
end;
+ if (anzahl=-1) and (tDatei='') then begin
+ gibAus('Keine Anzahl und keine Datei mit Töpfen beim Faktorisieren!',3);
+ exit;
+ end;
+
if sT then begin
result:=true;
exit;
@@ -4035,43 +4061,65 @@ begin
lineOut:=eWerte.integriereZuLineOut(not auszenHorizontal,true);
end{of case};
- setLength(maxima,0);
- i:=0;
- for j:=0 to length(lineOut)-1 do
- if ((j=0) or (lineOut[j]>lineOut[j-1])) and
- ((j=length(lineOut)-1) or (lineOut[j]>lineOut[j+1])) then begin
- if length(maxima)<=i then
- setLength(maxima,i+128);
- maxima[i]:=j;
- inc(i);
+ if anzahl<>-1 then begin
+ setLength(maxima,0);
+ i:=0;
+ for j:=0 to length(lineOut)-1 do
+ if ((j=0) or (lineOut[j]>lineOut[j-1])) and
+ ((j=length(lineOut)-1) or (lineOut[j]>lineOut[j+1])) then begin
+ if length(maxima)<=i then
+ setLength(maxima,i+128);
+ maxima[i]:=j;
+ inc(i);
+ end;
+ setLength(maxima,i);
+
+ sortiereNachDominanz(maxima,lineOut,nullteSpektrometerordnung);
+ setLength(maxima,anzahl);
+
+ setLength(maxima2,anzahl);
+ setLength(tmpEA,anzahl);
+ for i:=0 to length(tmpEA)-1 do begin
+ tmpEA[i]:=maxima[i];
+ maxima2[i]:=maxima[i];
+ maxima[i]:=i;
+ end;
+ sortiereNachWert(maxima,tmpEA,false);
+ setLength(tmpEA,0);
+ setLength(toepfe,anzahl);
+ for i:=0 to length(toepfe)-1 do begin
+ if i>0 then
+ toepfe[length(toepfe)-1-i]['y']:=(maxima2[maxima[i-1]]+maxima2[maxima[i]]) div 2
+ else if auszenHorizontal then
+ toepfe[length(toepfe)-1-i]['y']:=_xSteps-1
+ else
+ toepfe[length(toepfe)-1-i]['y']:=_tSiz-1;
+ if i<length(toepfe)-1 then
+ toepfe[length(toepfe)-1-i]['x']:=(maxima2[maxima[i]]+maxima2[maxima[i+1]]) div 2 + 1
+ else
+ toepfe[length(toepfe)-1-i]['x']:=0;
+ end;
+ if tDatei<>'' then begin
+ assignFile(pDatei,tDatei);
+ rewrite(pDatei);
+ writeln(pDatei,length(toepfe));
+ for i:=0 to length(toepfe)-1 do
+ writeln(pDatei,tIntPointToStr(toepfe[i]));
+ closeFile(pDatei);
+ end;
+ end
+ else
+ if tDatei<>'' then begin
+ assignFile(pDatei,tDatei);
+ reset(pDatei);
+ readln(pDatei,i);
+ setLength(toepfe,i);
+ for i:=0 to length(toepfe)-1 do begin
+ readln(pDatei,s);
+ toepfe[i]:=strToTIntPoint(s);
+ end;
+ closeFile(pDatei);
end;
- setLength(maxima,i);
-
- sortiereNachDominanz(maxima,lineOut);
- setLength(maxima,anzahl);
-
- setLength(maxima2,anzahl);
- setLength(tmpEA,anzahl);
- for i:=0 to length(tmpEA)-1 do begin
- tmpEA[i]:=maxima[i];
- maxima2[i]:=maxima[i];
- maxima[i]:=i;
- end;
- sortiereNachWert(maxima,tmpEA,false);
- setLength(tmpEA,0);
- setLength(toepfe,anzahl);
- for i:=0 to length(toepfe)-1 do begin
- if i>0 then
- toepfe[length(toepfe)-1-i]['y']:=(maxima2[maxima[i-1]]+maxima2[maxima[i]]) div 2
- else if auszenHorizontal then
- toepfe[length(toepfe)-1-i]['y']:=_xSteps-1
- else
- toepfe[length(toepfe)-1-i]['y']:=_tSiz-1;
- if i<length(toepfe)-1 then
- toepfe[length(toepfe)-1-i]['x']:=(maxima2[maxima[i]]+maxima2[maxima[i+1]]) div 2 + 1
- else
- toepfe[length(toepfe)-1-i]['x']:=0;
- end;
case genauigkeit of
gSingle: