From 4aaf7caf77a926f5f78494797df3b09c5b144f18 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 19 Jun 2018 09:36:02 +0200 Subject: do not fail on empty data at several points --- epostunit.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'epostunit.pas') diff --git a/epostunit.pas b/epostunit.pas index b98a661..4ae54c1 100644 --- a/epostunit.pas +++ b/epostunit.pas @@ -6881,7 +6881,7 @@ begin case liKo^[0].werte.genauigkeit of //<> gSingle: for j:=tMi to tMa do begin - if (tMa-j) mod ((tMa-tMi) div 10) = 0 then + if (tMa-j) mod max((tMa-tMi) div 10,1) = 0 then gibAus('LiKo-Berechnungsthread: '+intToStr(j)+'/'+intToStr(tMi)+'..'+intToStr(tMa)+' ('+intToStr(xMi)+'..'+intToStr(xMa)+')',1); for i:=xMi to xMa do begin pW.eWerte.werte[i+j*pW._xSteps]:=0; @@ -6896,7 +6896,7 @@ begin end; gDouble: for j:=tMi to tMa do begin - if (tMa-j) mod ((tMa-tMi) div 10) = 0 then + if (tMa-j) mod max((tMa-tMi) div 10,1) = 0 then gibAus('LiKo-Berechnungsthread: '+intToStr(j)+'/'+intToStr(tMi)+'..'+intToStr(tMa)+' ('+intToStr(xMi)+'..'+intToStr(xMa)+')',1); for i:=xMi to xMa do begin pW.eWerte.werte[i+j*pW._xSteps]:=0; @@ -6911,7 +6911,7 @@ begin end; gExtended: for j:=tMi to tMa do begin - if (tMa-j) mod ((tMa-tMi) div 10) = 0 then + if (tMa-j) mod max((tMa-tMi) div 10,1) = 0 then gibAus('LiKo-Berechnungsthread: '+intToStr(j)+'/'+intToStr(tMi)+'..'+intToStr(tMa)+' ('+intToStr(xMi)+'..'+intToStr(xMa)+')',1); for i:=xMi to xMa do begin pW.eWerte.werte[i+j*pW._xSteps]:=0; @@ -7860,6 +7860,10 @@ begin result:=true; exit; end; + if (tMi>=tMa) or (xMi>=xMa) then begin + gibAus('Kaum Werte in '''+w^[i].bezeichner+''' um Kontur '''+bezeichner+''' daraus zu erzeugen ('+intToStr(xMi)+'-'+intToStr(xMa)+' x '+intToStr(tMi)+'-'+intToStr(tMa)+') von maximal '+intToStr(w^[i]._xSteps)+' x '+intToStr(w^[i]._tSiz),3); + exit; + end; setLength(konturThreads,mT); for j:=0 to length(konturThreads)-1 do konturThreads[j]:= -- cgit v1.2.3-70-g09d2