From 78a65fbc6f871cc2ff67c9f919d0a48a6fde5469 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 5 Dec 2018 10:46:49 +0100 Subject: fertig --- terminer.lpi | 5 ++- terminer.lps | 105 +++++++++++++++++++++++++++++++++++++++++++++++++---------- unit1.lfm | 2 +- unit1.pas | 64 +++++++++++++++++++++++++++++++----- 4 files changed, 148 insertions(+), 28 deletions(-) diff --git a/terminer.lpi b/terminer.lpi index 3b5ced3..1edb792 100644 --- a/terminer.lpi +++ b/terminer.lpi @@ -62,7 +62,7 @@ - + @@ -72,6 +72,9 @@ + + + diff --git a/terminer.lps b/terminer.lps index e8daf48..81955c7 100644 --- a/terminer.lps +++ b/terminer.lps @@ -20,72 +20,141 @@ - - + + - - - + + + + - + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unit1.lfm b/unit1.lfm index bb60d3d..f0867c0 100644 --- a/unit1.lfm +++ b/unit1.lfm @@ -3,7 +3,7 @@ object Form1: TForm1 Height = 543 Top = 283 Width = 728 - Caption = 'Form1' + Caption = 'terminer' ClientHeight = 543 ClientWidth = 728 OnActivate = FormActivate diff --git a/unit1.pas b/unit1.pas index 962682c..c8682e6 100644 --- a/unit1.pas +++ b/unit1.pas @@ -43,7 +43,7 @@ implementation {$R *.lfm} uses - math; + math, lowlevelunit; { TForm1 } @@ -122,6 +122,7 @@ begin if not inhaltOk then exit; image1.canvas.brush.color:=$ffffff; + image1.canvas.pen.color:=$000000; image1.canvas.rectangle(-1,-1,image1.width+1,image1.height+1); ma:=-1; mi:=-1; @@ -161,27 +162,74 @@ end; procedure tForm1.interpretiereInhalt; var - i,j,k: longint; + i,j,k,knTag: longint; + s,knZeit,t: string; begin inhaltOk:=false; + image1.canvas.pen.color:=$0000ff; + image1.canvas.pen.width:=5; + image1.canvas.moveTo(0,0); + image1.canvas.lineTo(image1.width,image1.height); + image1.canvas.moveTo(image1.width,0); + image1.canvas.lineTo(0,image1.height); + image1.canvas.pen.color:=$000000; + image1.canvas.pen.width:=1; clearArrays; setLength(zeiten,spinEdit2.value - spinEdit1.value); for i:=spinEdit1.value to spinEdit2.value-1 do zeiten[i-spinEdit1.value]:=i; tage.text:=memo1.lines.text; tage.grep('^$',true); - personen.add('EE'); setLength(kannNicht,length(zeiten)); for i:=0 to length(kannNicht)-1 do begin setLength(kannNicht[i],tage.count); - for j:=0 to length(kannNicht[i])-1 do begin - setLength(kannNicht[i,j],round(5*random)); - for k:=0 to length(kannNicht[i,j])-1 do - kannNicht[i,j,k]:=0; + for j:=0 to length(kannNicht[i])-1 do + setLength(kannNicht[i,j],0); + end; + for i:=0 to memo2.lines.count-1 do begin + s:=memo2.lines[i]; + if s='' then + continue; + personen.add(erstesArgument(s,':')); + while s<>'' do begin + knTag:=tage.findeZeile(erstesArgument(s)); + if knTag<0 then + exit; + knZeit:=erstesArgument(s); + while pos(',',knZeit)>0 do + knZeit[pos(',',knZeit)]:=' '; + while pos('-',knZeit)>0 do begin + t:=knZeit; + knZeit:=''; + while pos(' ',t+' ') < pos('-',t) do + knZeit:=knZeit+' '+erstesArgument(t); + try + j:=strToInt(erstesArgument(t,'-')); + k:=strToInt(erstesArgument(t)); + except + exit; + end; + while j'' do begin + try + j:=strToInt(erstesArgument(knZeit)) - spinEdit1.value; + except + exit; + end; + if (j<0) or (j>=length(kannNicht)) then + exit; + setLength(kannNicht[j][knTag],length(kannNicht[j][knTag])+1); + kannNicht[j][knTag][length(kannNicht[j][knTag])-1]:=personen.count-1; + end; end; end; inhaltOk:= - (personen.count>0) and (tage.count>0) and (length(zeiten)>0); end; -- cgit v1.2.3-70-g09d2