diff options
author | Erich Eckner <git@eckner.net> | 2019-09-26 16:28:15 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-09-26 16:28:15 +0200 |
commit | 5bd9b12d82526940b988a55f7a1dda4591685a29 (patch) | |
tree | 6c255e80c988e22756fada84a3619d6ca6aa15ee | |
parent | 047e7f0f160c469c7a3a719c4c006bdcedc5b45b (diff) | |
download | epost-5bd9b12d82526940b988a55f7a1dda4591685a29.tar.xz |
zweitdominantesten Punkt speichern und als Variable verfügbar machen
-rw-r--r-- | epost.lps | 116 | ||||
-rw-r--r-- | epostunit.pas | 98 | ||||
-rw-r--r-- | typenunit.pas | 38 |
3 files changed, 163 insertions, 89 deletions
@@ -7,8 +7,8 @@ <Unit0> <Filename Value="epost.lpr"/> <IsPartOfProject Value="True"/> - <TopLine Value="144"/> - <CursorPos X="67" Y="144"/> + <TopLine Value="521"/> + <CursorPos X="29" Y="544"/> <UsageCount Value="202"/> <Loaded Value="True"/> </Unit0> @@ -24,8 +24,8 @@ <IsPartOfProject Value="True"/> <IsVisibleTab Value="True"/> <EditorIndex Value="2"/> - <TopLine Value="5847"/> - <CursorPos Y="5864"/> + <TopLine Value="109"/> + <CursorPos X="16" Y="126"/> <UsageCount Value="201"/> <Loaded Value="True"/> </Unit2> @@ -33,8 +33,8 @@ <Filename Value="werteunit.pas"/> <IsPartOfProject Value="True"/> <EditorIndex Value="5"/> - <TopLine Value="5"/> - <CursorPos Y="22"/> + <TopLine Value="12"/> + <CursorPos X="5" Y="30"/> <UsageCount Value="200"/> <Loaded Value="True"/> </Unit3> @@ -42,8 +42,8 @@ <Filename Value="typenunit.pas"/> <IsPartOfProject Value="True"/> <EditorIndex Value="10"/> - <TopLine Value="2599"/> - <CursorPos X="11" Y="2616"/> + <TopLine Value="3525"/> + <CursorPos X="34" Y="3555"/> <UsageCount Value="200"/> <Loaded Value="True"/> </Unit4> @@ -86,7 +86,7 @@ <EditorIndex Value="7"/> <TopLine Value="86"/> <CursorPos X="26" Y="115"/> - <UsageCount Value="57"/> + <UsageCount Value="58"/> <Loaded Value="True"/> </Unit9> <Unit10> @@ -94,7 +94,7 @@ <IsPartOfProject Value="True"/> <EditorIndex Value="8"/> <CursorPos X="3" Y="2"/> - <UsageCount Value="53"/> + <UsageCount Value="54"/> <Loaded Value="True"/> </Unit10> <Unit11> @@ -212,121 +212,123 @@ <JumpHistory Count="30" HistoryIndex="29"> <Position1> <Filename Value="typenunit.pas"/> + <Caret Line="350" Column="18" TopLine="342"/> </Position1> <Position2> <Filename Value="typenunit.pas"/> - <Caret Line="280" Column="18" TopLine="251"/> + <Caret Line="2024" Column="31" TopLine="2002"/> </Position2> <Position3> <Filename Value="typenunit.pas"/> - <Caret Line="283" Column="65" TopLine="254"/> + <Caret Line="2021" Column="11" TopLine="2003"/> </Position3> <Position4> <Filename Value="typenunit.pas"/> - <Caret Line="284" Column="52" TopLine="255"/> + <Caret Line="310" Column="11" TopLine="292"/> </Position4> <Position5> <Filename Value="typenunit.pas"/> - <Caret Line="299" Column="47" TopLine="270"/> + <Caret Line="1875" Column="29" TopLine="1845"/> </Position5> <Position6> <Filename Value="typenunit.pas"/> - <Caret Line="301" Column="50" TopLine="272"/> + <Caret Line="1879" Column="36" TopLine="1849"/> </Position6> <Position7> <Filename Value="typenunit.pas"/> - <Caret Line="302" Column="18" TopLine="294"/> + <Caret Line="1899" Column="18" TopLine="1869"/> </Position7> <Position8> <Filename Value="typenunit.pas"/> - <Caret Line="358" Column="55" TopLine="330"/> + <Caret Line="3424" Column="11" TopLine="3406"/> </Position8> <Position9> <Filename Value="typenunit.pas"/> - <Caret Line="359" Column="52" TopLine="331"/> + <Caret Line="3428" Column="13" TopLine="3406"/> </Position9> <Position10> <Filename Value="typenunit.pas"/> - <Caret Line="360" Column="55" TopLine="332"/> + <Caret Line="3432" Column="13" TopLine="3406"/> </Position10> <Position11> - <Filename Value="typenunit.pas"/> - <Caret Line="361" Column="52" TopLine="333"/> + <Filename Value="epostunit.pas"/> + <Caret Line="1120" Column="23" TopLine="1103"/> </Position11> <Position12> - <Filename Value="typenunit.pas"/> - <Caret Line="364" Column="52" TopLine="336"/> + <Filename Value="epostunit.pas"/> + <Caret Line="185" Column="39" TopLine="169"/> </Position12> <Position13> - <Filename Value="typenunit.pas"/> - <Caret Line="365" Column="51" TopLine="337"/> + <Filename Value="epostunit.pas"/> + <Caret Line="201" Column="42" TopLine="173"/> </Position13> <Position14> - <Filename Value="typenunit.pas"/> - <Caret Line="433" Column="21" TopLine="426"/> + <Filename Value="epostunit.pas"/> + <Caret Line="7294" TopLine="7284"/> </Position14> <Position15> <Filename Value="epostunit.pas"/> - <Caret Line="5907" TopLine="5893"/> + <Caret Line="7432" TopLine="7406"/> </Position15> <Position16> - <Filename Value="typenunit.pas"/> - <Caret Line="2542" TopLine="2522"/> + <Filename Value="epost.lpr"/> + <Caret Line="144" Column="67" TopLine="105"/> </Position16> <Position17> - <Filename Value="typenunit.pas"/> - <Caret Line="2550" TopLine="2526"/> + <Filename Value="epost.lpr"/> + <Caret Line="533" Column="29" TopLine="504"/> </Position17> <Position18> - <Filename Value="typenunit.pas"/> - <Caret Line="2556" Column="17" TopLine="2541"/> + <Filename Value="epost.lpr"/> + <Caret Line="544" Column="29" TopLine="521"/> </Position18> <Position19> - <Filename Value="typenunit.pas"/> + <Filename Value="epostunit.pas"/> + <Caret Line="202" Column="26" TopLine="186"/> </Position19> <Position20> - <Filename Value="typenunit.pas"/> - <Caret Line="458" Column="34" TopLine="440"/> + <Filename Value="epostunit.pas"/> + <Caret Line="7524" Column="19" TopLine="7508"/> </Position20> <Position21> - <Filename Value="typenunit.pas"/> - <Caret Line="2539" Column="11" TopLine="2522"/> + <Filename Value="epostunit.pas"/> + <Caret Line="163" Column="36" TopLine="147"/> </Position21> <Position22> - <Filename Value="typenunit.pas"/> - <Caret Line="2550" Column="16" TopLine="2531"/> + <Filename Value="epostunit.pas"/> + <Caret Line="164" Column="35" TopLine="147"/> </Position22> <Position23> - <Filename Value="typenunit.pas"/> - <Caret Line="2567" TopLine="2547"/> + <Filename Value="epostunit.pas"/> + <Caret Line="165" Column="36" TopLine="147"/> </Position23> <Position24> - <Filename Value="typenunit.pas"/> - <Caret Line="2577" TopLine="2542"/> + <Filename Value="epostunit.pas"/> + <Caret Line="2262" Column="26" TopLine="2248"/> </Position24> <Position25> - <Filename Value="typenunit.pas"/> - <Caret Line="456" Column="22" TopLine="443"/> + <Filename Value="epostunit.pas"/> + <Caret Line="3389" Column="39" TopLine="3378"/> </Position25> <Position26> - <Filename Value="typenunit.pas"/> - <Caret Line="2582" Column="26" TopLine="2566"/> + <Filename Value="epostunit.pas"/> + <Caret Line="3391" Column="24" TopLine="3378"/> </Position26> <Position27> - <Filename Value="typenunit.pas"/> - <Caret Line="2568" TopLine="2549"/> + <Filename Value="epostunit.pas"/> + <Caret Line="3394" Column="38" TopLine="3459"/> </Position27> <Position28> - <Filename Value="typenunit.pas"/> - <Caret Line="2586" Column="3" TopLine="2566"/> + <Filename Value="epostunit.pas"/> + <Caret Line="7398" Column="4" TopLine="7380"/> </Position28> <Position29> - <Filename Value="typenunit.pas"/> - <Caret Line="2610" Column="3" TopLine="2585"/> + <Filename Value="epostunit.pas"/> + <Caret Line="7409" Column="56" TopLine="7392"/> </Position29> <Position30> - <Filename Value="typenunit.pas"/> - <Caret Line="2616" Column="11" TopLine="2599"/> + <Filename Value="epostunit.pas"/> + <Caret Line="221" Column="14" TopLine="205"/> </Position30> </JumpHistory> <RunParams> diff --git a/epostunit.pas b/epostunit.pas index 8a24fda..3247830 100644 --- a/epostunit.pas +++ b/epostunit.pas @@ -123,6 +123,8 @@ type procedure wMinP(miP: tInt64Point); function rMaxP: tInt64Point; procedure wMaxP(maP: tInt64Point); + function rZDP: tInt64Point; + procedure wZDP(zDP: tInt64Point); function rIstKomplex: boolean; procedure wIstKomplex(komplex: boolean); function xScale: extended; @@ -216,6 +218,7 @@ type property _maxW: extended read rMaxW write wMaxW; property _minP: tInt64Point read rMinP write wMinP; property _maxP: tInt64Point read rMaxP write wMaxP; + property _zDP: tInt64Point read rZDP write wZDP; property istKomplex: boolean read rIstKomplex write wIstKomplex; end; tAchse = record @@ -642,6 +645,8 @@ begin else if (s='pMaxX') or (s='maxPX') then result:=wertes^[i].disk2kont('x',wertes^[i]._maxP['x']) else if (s='pMinT') or (s='minPT') or (s='pMinY') or (s='minPY') then result:=wertes^[i].disk2kont('y',wertes^[i]._minP['y']) else if (s='pMaxT') or (s='maxPT') or (s='pMaxY') or (s='maxPY') then result:=wertes^[i].disk2kont('y',wertes^[i]._maxP['y']) + else if (s='pZDX') or (s='zDPX') then result:=wertes^[i].disk2kont('x',wertes^[i]._zDP['x']) + else if (s='pZDT') or (s='zDPT') or (s='pZDY') or (s='zDPY') then result:=wertes^[i].disk2kont('y',wertes^[i]._zDP['y']) else if s='np' then result:=wertes^[i]._np else if (s='beta') or (s='β') then result:=wertes^[i]._beta else if s='Breite' then result:=wertes^[i].transformationen.xStart-wertes^[i].transformationen.xStop @@ -664,6 +669,8 @@ begin '''minP[XYT]'''#10 + '''pMax[XYT]'''#10 + '''maxP[XYT]'''#10 + + '''pZD[XYT]'''#10 + + '''zDP[XYT]'''#10 + '''np'''#10 + '''beta'''#10 + '''β'''#10 + @@ -1101,6 +1108,34 @@ begin end{of case}; end; +function tWerte.rZDP: tInt64Point; +begin + case genauigkeit of + gSingle: result:=sWerte.params.zDP; + gDouble: result:=dWerte.params.zDP; + gExtended: result:=eWerte.params.zDP; + end{of case}; +end; + +procedure tWerte.wZDP(zDP: tInt64Point); +begin + transformationen.zDP:=zDP; + case genauigkeit of + gSingle: begin + sWerte.params.zDP:=zDP; + sWerte.params.refreshKnownValues; + end; + gDouble: begin + dWerte.params.zDP:=zDP; + dWerte.params.refreshKnownValues; + end; + gExtended: begin + eWerte.params.zDP:=zDP; + eWerte.params.refreshKnownValues; + end; + end{of case}; +end; + function tWerte.rIstKomplex: boolean; begin case genauigkeit of @@ -7362,38 +7397,41 @@ begin gExtended: eWerte.findeZweitdominantestenPunkt(xMin,xMax,tMin,tMax,xFak,tFak,p); end{of case}; - - outF:=tMyStringList.create; - if fileExists(datei) then - outF.loadFromFile(datei); - if ueberschreiben then - outF.grep('^'+escapeStringToRegex(identifizierer + separator,rtFpc),true); - s:=identifizierer + separator; - if indizes then - s:=s+ - intToStr(p['x']-_xSteps*byte(toroidal and (p['x']*2>=_xSteps))) + separator + - intToStr(p['y']-_tSiz*byte(toroidal and (p['y']*2>=_tSiz))) + separator + - intToStr(_xSteps) + separator + - intToStr(_tSiz) + separator - else - s:=s+ - myFloatToStr(transformationen.positionAufAchseZuWert(lUnten,p['x']/_xSteps) - (_xStop-_xStart) * (1 + 1/(_xSteps-1)) * byte(toroidal and (p['x']*2>=_xSteps)) ) + separator + - myFloatToStr(transformationen.positionAufAchseZuWert(lLinks,p['y']/_tSiz) - (_tStop-_tStart) * (1 + 1/(_tSiz-1)) * byte(toroidal and (p['y']*2>=_tSiz)) ) + separator + - myFloatToStr((_xStop-_xStart) * (1 + 1/(_xSteps-1))) + separator + - myFloatToStr((_tStop-_tStart) * (1 + 1/(_tSiz-1))) + separator; - case genauigkeit of - gSingle: - s:=s+ - myFloatToStr(sWerte.werte[p['x'] + p['y']*_xSteps]); - gDouble: + _zDP:=p; + + if datei<>'' then begin + outF:=tMyStringList.create; + if fileExists(datei) then + outF.loadFromFile(datei); + if ueberschreiben then + outF.grep('^'+escapeStringToRegex(identifizierer + separator,rtFpc),true); + s:=identifizierer + separator; + if indizes then s:=s+ - myFloatToStr(dWerte.werte[p['x'] + p['y']*_xSteps]); - gExtended: + intToStr(_zDP['x']-_xSteps*byte(toroidal and (_zDP['x']*2>=_xSteps))) + separator + + intToStr(_zDP['y']-_tSiz*byte(toroidal and (_zDP['y']*2>=_tSiz))) + separator + + intToStr(_xSteps) + separator + + intToStr(_tSiz) + separator + else s:=s+ - myFloatToStr(eWerte.werte[p['x'] + p['y']*_xSteps]); - end{of case}; - outF.add(s); - outF.saveToFile(datei); + myFloatToStr(transformationen.positionAufAchseZuWert(lUnten,_zDP['x']/_xSteps) - (_xStop-_xStart) * (1 + 1/(_xSteps-1)) * byte(toroidal and (_zDP['x']*2>=_xSteps)) ) + separator + + myFloatToStr(transformationen.positionAufAchseZuWert(lLinks,_zDP['y']/_tSiz) - (_tStop-_tStart) * (1 + 1/(_tSiz-1)) * byte(toroidal and (_zDP['y']*2>=_tSiz)) ) + separator + + myFloatToStr((_xStop-_xStart) * (1 + 1/(_xSteps-1))) + separator + + myFloatToStr((_tStop-_tStart) * (1 + 1/(_tSiz-1))) + separator; + case genauigkeit of + gSingle: + s:=s+ + myFloatToStr(sWerte.werte[_zDP['x'] + _zDP['y']*_xSteps]); + gDouble: + s:=s+ + myFloatToStr(dWerte.werte[_zDP['x'] + _zDP['y']*_xSteps]); + gExtended: + s:=s+ + myFloatToStr(eWerte.werte[_zDP['x'] + _zDP['y']*_xSteps]); + end{of case}; + outF.add(s); + outF.saveToFile(datei); + end; gibAus('... fertig '+timetostr(now-Zeit),3); result:=true; end; diff --git a/typenunit.pas b/typenunit.pas index a6e6fb8..01bca49 100644 --- a/typenunit.pas +++ b/typenunit.pas @@ -284,7 +284,7 @@ type procedure wTransformationen(tr: tTransformation); public maxW,minW,np,beta: extended; - maxP,minP: tInt64Point; + maxP,minP,zDP: tInt64Point; tSiz,xSteps,tSiz_,xSteps_: longint; istKomplex: boolean; knownValues: tKnownValues; @@ -308,6 +308,7 @@ type inAchsen,outAchsen: t2x2Extended; inWMia,outWMia: tExtPoint; inPMia,outPMia: t2x2Int64; + inZDP,outZDP: tInt64Point; wmiaExplizit: boolean; // wMia wurde explizit gesetzt _anzZugehoerigerDaten: longint; @@ -347,6 +348,8 @@ type procedure wPMin(p: tInt64Point); function rPMax: tInt64Point; procedure wPMax(p: tInt64Point); + function rZDP: tInt64Point; + procedure wZDP(p: tInt64Point); function rXSteps: longint; procedure wXSteps(x: longint); function rTSiz: longint; @@ -404,6 +407,9 @@ type property pMax: tInt64Point read rPMax write wPMax; + property zDP: tInt64Point + read rZDP + write wZDP; property xSteps: longint read rXSteps write wXSteps; @@ -1552,6 +1558,7 @@ begin minW:=0; maxP:=int64Point(-1,-1); minP:=int64Point(-1,-1); + zDP:=int64Point(-1,-1); transformationen:=tTransformation.create; transformationen.erhoeheZugehoerigkeitsanzahl; np:=1; @@ -1571,6 +1578,7 @@ begin minW:=original.minW; maxP:=original.maxP; minP:=original.minP; + zDP:=original.minP; transformationen:=tIdentitaet.create(original.transformationen); np:=original.np; beta:=original.beta; @@ -1630,18 +1638,22 @@ begin if xSteps>1 then begin knownValues.add(knownValue('maxPX', maxP['x']/(xSteps-1)*(xStop-xStart) + xStart)); knownValues.add(knownValue('minPX', minP['x']/(xSteps-1)*(xStop-xStart) + xStart)); + knownValues.add(knownValue('zDPX', zDP['x']/(xSteps-1)*(xStop-xStart) + xStart)); end else begin knownValues.add(knownValue('maxPX', xStart)); knownValues.add(knownValue('minPX', xStart)); + knownValues.add(knownValue('zDPX', xStart)); end; if tSiz>1 then begin knownValues.add(knownValue('maxPY', maxP['y']/(tSiz-1)*(tStop-tStart) + tStart)); knownValues.add(knownValue('minPY', minP['y']/(tSiz-1)*(tStop-tStart) + tStart)); + knownValues.add(knownValue('zDPY', maxP['y']/(tSiz-1)*(tStop-tStart) + tStart)); end else begin knownValues.add(knownValue('maxPY', tStart)); knownValues.add(knownValue('minPY', tStart)); + knownValues.add(knownValue('zDPY', tStart)); end; knownValues.add(knownValue('beta',beta)); knownValues.add(knownValue('xStart',xStart)); @@ -1860,9 +1872,11 @@ begin if not wmiaExplizit then begin inWMia:=vorgaenger[0].wMia; inPMia:=vorgaenger[0].pMia; + inZDP:=vorgaenger[0].zDP; for i:=1 to length(vorgaenger)-1 do if (inWMia <> vorgaenger[i].wMia) or - (inPMia <> vorgaenger[i].pMia) then + (inPMia <> vorgaenger[i].pMia) or + (inZDP <> vorgaenger[i].zDP) then fehler('Vorgänger haben verschiedene wmin, wmax, pmin oder pmax, was generisch nicht zu verstehen ist!'); end; end; @@ -1882,6 +1896,7 @@ begin if not wmiaExplizit then begin outWMia:=inWMia; outPMia:=inPMia; + outZDP:=inZDP; end; end; @@ -2005,6 +2020,23 @@ begin aktualisiereAlles; end; +function tTransformation.rZDP: tInt64Point; +begin + result:=outZDP; +end; + +procedure tTransformation.wZDP(p: tInt64Point); +begin + if (self is tAgglomeration) then begin + if zDP<>p then + fehler('Setzen von zDP für Agglomeration nicht erlaubt ( '+tInt64PointToStr(p)+' ≠ '+tInt64PointToStr(zDP)+' )!'); + exit; + end; + wmiaExplizit:=true; + outZDP:=p; + aktualisiereAlles; +end; + function tTransformation.rXSteps: longint; begin result:=outXSTS['x']; @@ -3389,6 +3421,7 @@ begin fehler('Vorgänger haben verschiedene xSteps oder tSiz, was bei Agglomeration nicht geht!'); inWMia:=vorgaenger[0].wMia; inPMia:=vorgaenger[0].pMia; + inZDP:=int64Point(-1,-1); for i:=1 to length(vorgaenger)-1 do begin if inWMia['x'] > vorgaenger[i].wMia['x'] then begin inWMia['x']:=vorgaenger[i].wMia['x']; @@ -3519,6 +3552,7 @@ begin inXSTS:=beliebigerVorgaenger.xStepsTSiz; inWMia:=beliebigerVorgaenger.wMia; inPMia:=beliebigerVorgaenger.pMia; + inZDP:=beliebigerVorgaenger.zDP; end; procedure tDiagonaleAgglomeration.aktualisiereXsTs; |