summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-12-13 14:13:01 +0100
committerErich Eckner <git@eckner.net>2017-12-13 14:13:01 +0100
commit9edcb215f29d19b26f99d17e456f638e70fc9777 (patch)
tree75c32d2bc8c179dafb3ca0d7bc961c37146efe85
parent7dc5be9cc445dec7dd7d3242642b77caf90c9527 (diff)
downloadepost-9edcb215f29d19b26f99d17e456f638e70fc9777.tar.xz
es gibt nun einen globalen Vorrat an Werten, der z.B. durch "ermittleAnstieg" gefüllt werden kann
-rw-r--r--epost.lpr2
-rw-r--r--epost.lps192
-rw-r--r--epostunit.pas27
-rw-r--r--typenunit.pas8
-rw-r--r--werteunit.pas6
5 files changed, 109 insertions, 126 deletions
diff --git a/epost.lpr b/epost.lpr
index 15e6851..6fb8a6b 100644
--- a/epost.lpr
+++ b/epost.lpr
@@ -419,7 +419,7 @@ begin
halt(1);
end;
if istDasBefehl('ermittle Anstieg',s,bekannteBefehle,true) then begin
- if not ermittleAnstieg(syntaxTest,s,@wertes) then begin
+ if not ermittleAnstieg(syntaxTest,s) then begin
aufraeumen;
halt(1);
end;
diff --git a/epost.lps b/epost.lps
index 28bd621..33b0577 100644
--- a/epost.lps
+++ b/epost.lps
@@ -3,12 +3,12 @@
<ProjectSession>
<Version Value="10"/>
<BuildModes Active="Default"/>
- <Units Count="27">
+ <Units Count="23">
<Unit0>
<Filename Value="epost.lpr"/>
<IsPartOfProject Value="True"/>
- <TopLine Value="410"/>
- <CursorPos X="37" Y="439"/>
+ <TopLine Value="167"/>
+ <CursorPos Y="185"/>
<UsageCount Value="202"/>
<Loaded Value="True"/>
</Unit0>
@@ -22,10 +22,9 @@
<Unit2>
<Filename Value="epostunit.pas"/>
<IsPartOfProject Value="True"/>
- <IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
- <TopLine Value="4850"/>
- <CursorPos Y="4853"/>
+ <TopLine Value="3018"/>
+ <CursorPos X="39" Y="3036"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit2>
@@ -40,8 +39,8 @@
<Filename Value="werteunit.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="8"/>
- <TopLine Value="972"/>
- <CursorPos X="41" Y="973"/>
+ <TopLine Value="2063"/>
+ <CursorPos X="55" Y="2091"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit4>
@@ -49,8 +48,8 @@
<Filename Value="typenunit.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="11"/>
- <TopLine Value="336"/>
- <CursorPos X="49" Y="345"/>
+ <TopLine Value="1398"/>
+ <CursorPos Y="1416"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit5>
@@ -86,7 +85,7 @@
<EditorIndex Value="9"/>
<TopLine Value="407"/>
<CursorPos X="114" Y="425"/>
- <UsageCount Value="91"/>
+ <UsageCount Value="104"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
@@ -94,7 +93,7 @@
<EditorIndex Value="7"/>
<TopLine Value="542"/>
<CursorPos X="49" Y="566"/>
- <UsageCount Value="47"/>
+ <UsageCount Value="52"/>
<Loaded Value="True"/>
</Unit10>
<Unit11>
@@ -107,9 +106,10 @@
</Unit11>
<Unit12>
<Filename Value="../units/matheunit.pas"/>
+ <IsVisibleTab Value="True"/>
<EditorIndex Value="5"/>
- <TopLine Value="863"/>
- <CursorPos X="47" Y="870"/>
+ <TopLine Value="79"/>
+ <CursorPos X="25" Y="105"/>
<UsageCount Value="101"/>
<Loaded Value="True"/>
</Unit12>
@@ -118,14 +118,14 @@
<EditorIndex Value="2"/>
<TopLine Value="126"/>
<CursorPos X="7" Y="147"/>
- <UsageCount Value="61"/>
+ <UsageCount Value="66"/>
<Loaded Value="True"/>
</Unit13>
<Unit14>
<Filename Value="/usr/lib/fpc/src/rtl/inc/objpash.inc"/>
<EditorIndex Value="-1"/>
- <TopLine Value="182"/>
- <CursorPos X="21" Y="202"/>
+ <TopLine Value="176"/>
+ <CursorPos X="23" Y="194"/>
<UsageCount Value="10"/>
</Unit14>
<Unit15>
@@ -133,34 +133,34 @@
<EditorIndex Value="-1"/>
<TopLine Value="61"/>
<CursorPos X="10" Y="99"/>
- <UsageCount Value="8"/>
+ <UsageCount Value="7"/>
</Unit15>
<Unit16>
<Filename Value="/usr/lib/fpc/src/rtl/unix/baseunix.pp"/>
<UnitName Value="BaseUnix"/>
<EditorIndex Value="-1"/>
<TopLine Value="61"/>
- <UsageCount Value="8"/>
+ <UsageCount Value="7"/>
</Unit16>
<Unit17>
<Filename Value="/usr/lib/fpc/src/rtl/unix/bunxovl.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="414"/>
<CursorPos X="20" Y="434"/>
- <UsageCount Value="8"/>
+ <UsageCount Value="7"/>
</Unit17>
<Unit18>
<Filename Value="/usr/lib/fpc/src/rtl/linux/bunxsysc.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="16"/>
- <UsageCount Value="8"/>
+ <UsageCount Value="7"/>
</Unit18>
<Unit19>
<Filename Value="/usr/lib/fpc/src/rtl/unix/bunxh.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="74"/>
<CursorPos X="15" Y="102"/>
- <UsageCount Value="8"/>
+ <UsageCount Value="7"/>
</Unit19>
<Unit20>
<Filename Value="/usr/lib/fpc/src/packages/fcl-image/src/fpimage.pp"/>
@@ -168,170 +168,142 @@
<EditorIndex Value="-1"/>
<TopLine Value="10"/>
<CursorPos X="3" Y="30"/>
- <UsageCount Value="8"/>
+ <UsageCount Value="7"/>
</Unit20>
<Unit21>
- <Filename Value="../fpGUI/src/corelib/render/software/agg_basics.pas"/>
- <EditorIndex Value="-1"/>
- <TopLine Value="327"/>
- <CursorPos X="12" Y="347"/>
- <UsageCount Value="1"/>
- </Unit21>
- <Unit22>
- <Filename Value="/usr/lib/fpc/src/rtl/objpas/classes/classesh.inc"/>
- <EditorIndex Value="-1"/>
- <TopLine Value="673"/>
- <CursorPos X="42" Y="705"/>
- <UsageCount Value="1"/>
- </Unit22>
- <Unit23>
<Filename Value="/usr/lib/fpc/src/rtl/objpas/math.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="351"/>
<CursorPos X="10" Y="368"/>
- <UsageCount Value="9"/>
- </Unit23>
- <Unit24>
+ <UsageCount Value="8"/>
+ </Unit21>
+ <Unit22>
<Filename Value="GTIWebServerTestAggActionHandlerUnit.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="53"/>
<CursorPos X="49" Y="82"/>
- <UsageCount Value="9"/>
- </Unit24>
- <Unit25>
- <Filename Value="/usr/lib/fpc/src/rtl/objpas/sysutils/sysstrh.inc"/>
- <EditorIndex Value="-1"/>
- <TopLine Value="204"/>
- <CursorPos X="18" Y="222"/>
- <UsageCount Value="1"/>
- </Unit25>
- <Unit26>
- <Filename Value="/usr/lib/fpc/src/rtl/objpas/sysutils/osutilsh.inc"/>
- <EditorIndex Value="-1"/>
- <TopLine Value="9"/>
- <CursorPos X="10" Y="26"/>
- <UsageCount Value="1"/>
- </Unit26>
+ <UsageCount Value="8"/>
+ </Unit22>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="epostunit.pas"/>
- <Caret Line="8553" Column="16" TopLine="8540"/>
+ <Caret Line="489" Column="19" TopLine="460"/>
</Position1>
<Position2>
<Filename Value="epostunit.pas"/>
- <Caret Line="8575" Column="35" TopLine="8551"/>
+ <Caret Line="617" Column="10" TopLine="606"/>
</Position2>
<Position3>
- <Filename Value="epost.lpr"/>
- <Caret Line="428" TopLine="418"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="698" Column="95" TopLine="680"/>
</Position3>
<Position4>
- <Filename Value="epostunit.pas"/>
- <Caret Line="8575" Column="30" TopLine="8549"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="29" Column="61" TopLine="11"/>
</Position4>
<Position5>
- <Filename Value="../units/matheunit.pas"/>
- <Caret Line="875" Column="71" TopLine="863"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="30" Column="39" TopLine="11"/>
</Position5>
<Position6>
- <Filename Value="epost.lpr"/>
- <Caret Line="18" Column="7" TopLine="3"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="31" Column="66" TopLine="11"/>
</Position6>
<Position7>
- <Filename Value="epostunit.pas"/>
- <Caret Line="8567" Column="42" TopLine="8550"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="32" Column="66" TopLine="11"/>
</Position7>
<Position8>
- <Filename Value="epostunit.pas"/>
- <Caret Line="2247" TopLine="2230"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="33" Column="68" TopLine="11"/>
</Position8>
<Position9>
- <Filename Value="../units/mystringlistunit.pas"/>
- <Caret Line="40" Column="26" TopLine="14"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="261" Column="44" TopLine="232"/>
</Position9>
<Position10>
- <Filename Value="epostunit.pas"/>
- <Caret Line="1348" Column="12" TopLine="1333"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="269" Column="71" TopLine="240"/>
</Position10>
<Position11>
- <Filename Value="epostunit.pas"/>
- <Caret Line="5345" Column="43" TopLine="5329"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="271" Column="71" TopLine="242"/>
</Position11>
<Position12>
- <Filename Value="typenunit.pas"/>
- <Caret Line="345" Column="14" TopLine="329"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="273" Column="73" TopLine="244"/>
</Position12>
<Position13>
- <Filename Value="typenunit.pas"/>
- <Caret Line="283" Column="23" TopLine="275"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="2093" Column="18" TopLine="2065"/>
</Position13>
<Position14>
- <Filename Value="epostunit.pas"/>
- <Caret Line="5348" Column="17" TopLine="5333"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="2091" Column="28" TopLine="2073"/>
</Position14>
<Position15>
<Filename Value="epostunit.pas"/>
- <Caret Line="457" Column="25" TopLine="439"/>
+ <Caret Line="626" Column="88" TopLine="606"/>
</Position15>
<Position16>
<Filename Value="epostunit.pas"/>
- <Caret Line="8588" TopLine="8561"/>
+ <Caret Line="2091" Column="2" TopLine="2073"/>
</Position16>
<Position17>
- <Filename Value="epostunit.pas"/>
- <Caret Line="174" Column="22" TopLine="158"/>
+ <Filename Value="werteunit.pas"/>
+ <Caret Line="118" Column="50" TopLine="99"/>
</Position17>
<Position18>
- <Filename Value="epostunit.pas"/>
- <Caret Line="4601" Column="43" TopLine="4584"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="127" Column="28" TopLine="102"/>
</Position18>
<Position19>
- <Filename Value="epostunit.pas"/>
- <Caret Line="457" Column="25" TopLine="439"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="136" Column="22" TopLine="107"/>
</Position19>
<Position20>
<Filename Value="../units/matheunit.pas"/>
- <Caret Line="56" Column="25" TopLine="38"/>
</Position20>
<Position21>
- <Filename Value="epost.lpr"/>
- <Caret Line="428" Column="32" TopLine="399"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="17" Column="15"/>
</Position21>
<Position22>
- <Filename Value="epost.lpr"/>
- <Caret Line="439" Column="37" TopLine="410"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="19" Column="26"/>
</Position22>
<Position23>
- <Filename Value="epostunit.pas"/>
- <Caret Line="191" Column="26" TopLine="175"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="20" Column="35"/>
</Position23>
<Position24>
- <Filename Value="epostunit.pas"/>
- <Caret Line="6105" Column="69" TopLine="6076"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="24" Column="41"/>
</Position24>
<Position25>
- <Filename Value="epostunit.pas"/>
- <Caret Line="6093" Column="35" TopLine="6080"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="25" Column="58"/>
</Position25>
<Position26>
- <Filename Value="epostunit.pas"/>
- <Caret Line="177" Column="25" TopLine="161"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="32" Column="47" TopLine="3"/>
</Position26>
<Position27>
- <Filename Value="werteunit.pas"/>
- <Caret Line="58" Column="36" TopLine="50"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="33" Column="50" TopLine="4"/>
</Position27>
<Position28>
- <Filename Value="epostunit.pas"/>
- <Caret Line="4973" Column="58" TopLine="4964"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="54" Column="63" TopLine="25"/>
</Position28>
<Position29>
- <Filename Value="epostunit.pas"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="55" Column="62" TopLine="26"/>
</Position29>
<Position30>
- <Filename Value="epostunit.pas"/>
- <Caret Line="177" Column="25" TopLine="149"/>
+ <Filename Value="../units/matheunit.pas"/>
+ <Caret Line="56" Column="55" TopLine="27"/>
</Position30>
</JumpHistory>
</ProjectSession>
diff --git a/epostunit.pas b/epostunit.pas
index 390da27..3a1b6e2 100644
--- a/epostunit.pas
+++ b/epostunit.pas
@@ -454,10 +454,11 @@ function findeKontur(s: string; f: tMyStringList; pws: pTWerteArray; pks: pTKont
function externerBefehl(sT: boolean; s: string): boolean;
procedure warteAufExterneBefehle;
procedure beendeExterneBefehleWennFertig;
-function ermittleAnstieg(sT: boolean; s: string; pws: pTWerteArray): boolean;
+function ermittleAnstieg(sT: boolean; s: string): boolean;
var
allePaletten: tPalettenArray;
+ globaleWerte: tKnownValues;
behalteLogs: boolean;
externeBefehle: array of tBefehlThread;
@@ -620,7 +621,7 @@ var
ps: tExtraInfos;
begin
inherited create(kont,wert);
- ps:=tExtraInfos.create;
+ ps:=tExtraInfos.create(globaleWerte);
genauigkeit:=gSingle;
leseThread:=nil;
sWerte:=tLLWerteSingle.create(ps);
@@ -3032,7 +3033,7 @@ begin
result:=false;
warteAufBeendigungDesLeseThreads;
genauigkeit:=gExtended;
- wavelet:=tWavelet.create;
+ wavelet:=tWavelet.create(knownValues);
wavelet.mitFFT:=false;
Zeit:=now;
@@ -7281,7 +7282,7 @@ begin
xf:=erstesArgument(s,';');
yf:=erstesArgument(s,';');
- kvs:=tKnownValues.create;
+ kvs:=tKnownValues.create(globaleWerte);
lenPO:=1;
setLength(pOrte,speicherHappen);
@@ -8584,7 +8585,7 @@ begin
end;
end;
-function ermittleAnstieg(sT: boolean; s: string; pws: pTWerteArray): boolean;
+function ermittleAnstieg(sT: boolean; s: string): boolean;
var
i,j: longint;
t: string;
@@ -8614,17 +8615,18 @@ begin
wert:=1
else
wert:=matheunit.ermittleAnstieg(shellExpand(s),i,j);
- for i:=0 to length(pws^)-1 do
- pws^[i].knownValues.add(t,wert);
+ globaleWerte.add(t,wert);
result:=true;
end;
var
i: longint;
-begin
+initialization
fileMode := fmOpenRead;
+ globaleWerte:=tKnownValues.create(nil);
+
setLength(externeBefehle,0);
setLength(allePaletten,9);
@@ -8692,5 +8694,14 @@ begin
allePaletten[8].neuerWert(rgb($ff,$00,$00),false);
allePaletten[8].neuerWert(rgb($ff,$00,$ff),false);
allePaletten[8].neuerWert(rgb($00,$00,$ff),false);
+
+finalization
+
+ globaleWerte.free;
+
+ for i:=0 to length(allePaletten)-1 do
+ allePaletten[i].free;
+ setLength(allePaletten,0);
+
end.
diff --git a/typenunit.pas b/typenunit.pas
index 2fd1bf6..e101d46 100644
--- a/typenunit.pas
+++ b/typenunit.pas
@@ -263,7 +263,7 @@ type
tSiz,xSteps,tSiz_,xSteps_: longint;
istKomplex: boolean;
knownValues: tKnownValues;
- constructor create; overload;
+ constructor create(globaleWerte: tKnownValues); overload;
constructor create(original: tExtraInfos);
destructor destroy; override;
function xStart: extended;
@@ -1334,7 +1334,7 @@ end;
// tExtraInfos *****************************************************************
-constructor tExtraInfos.create;
+constructor tExtraInfos.create(globaleWerte: tKnownValues);
begin
inherited create;
maxW:=1;
@@ -1350,7 +1350,7 @@ begin
tSiz_:=0;
xSteps_:=0;
istKomplex:=false;
- knownValues:=tKnownValues.create;
+ knownValues:=tKnownValues.create(globaleWerte);
end;
constructor tExtraInfos.create(original: tExtraInfos);
@@ -1368,7 +1368,7 @@ begin
tSiz_:=original.tSiz_;
xSteps_:=original.xSteps_;
istKomplex:=original.istKomplex;
- knownValues:=tKnownValues.create(original.knownValues);
+ knownValues:=tKnownValues.createFromOriginal(original.knownValues);
end;
destructor tExtraInfos.destroy;
diff --git a/werteunit.pas b/werteunit.pas
index 8bb5dca..271e77b 100644
--- a/werteunit.pas
+++ b/werteunit.pas
@@ -115,7 +115,7 @@ type
typ: tWaveletTyp;
werte: tLLWerteDouble;
mitFFT: boolean;
- constructor create;
+ constructor create(globaleWerte: tKnownValues);
destructor destroy; override;
function setzeTyp(s: string): boolean;
function berechneWerte: boolean;
@@ -2088,12 +2088,12 @@ begin
werte.params.refreshKnownValues;
end;
-constructor tWavelet.create;
+constructor tWavelet.create(globaleWerte: tKnownValues);
var
ps: tExtraInfos;
begin
inherited create;
- ps:=tExtraInfos.create;
+ ps:=tExtraInfos.create(globaleWerte);
werte:=tLLWerteDouble.create(ps);
pvFehler:=0;
end;