From e76fc83959686d0a77343dd29371a232d1973a1e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 17 Nov 2015 16:00:49 +0100 Subject: lauffähig mit trayIcon und trayIconHint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Regen.ico | Bin 0 -> 318 bytes Regen_Sturm.ico | Bin 0 -> 318 bytes Sonne.ico | Bin 0 -> 318 bytes Sturm.ico | Bin 0 -> 318 bytes Wolke.ico | Bin 0 -> 318 bytes fhunit.pas | 91 +++++++++++++++++++++++++++++++++++--- pegelunit.pas | 6 +++ unit1.lfm | 104 +++++++++++++++++++++++++++++++++++++++++++ unit1.pas | 59 +++++++++++++++++++++++++ wetter.lps | 134 +++++++++++++++++++++++++++++--------------------------- 10 files changed, 324 insertions(+), 70 deletions(-) create mode 100644 Regen.ico create mode 100644 Regen_Sturm.ico create mode 100644 Sonne.ico create mode 100644 Sturm.ico create mode 100644 Wolke.ico diff --git a/Regen.ico b/Regen.ico new file mode 100644 index 0000000..924f46a Binary files /dev/null and b/Regen.ico differ diff --git a/Regen_Sturm.ico b/Regen_Sturm.ico new file mode 100644 index 0000000..c3993b2 Binary files /dev/null and b/Regen_Sturm.ico differ diff --git a/Sonne.ico b/Sonne.ico new file mode 100644 index 0000000..3528859 Binary files /dev/null and b/Sonne.ico differ diff --git a/Sturm.ico b/Sturm.ico new file mode 100644 index 0000000..c064e1e Binary files /dev/null and b/Sturm.ico differ diff --git a/Wolke.ico b/Wolke.ico new file mode 100644 index 0000000..8a4879f Binary files /dev/null and b/Wolke.ico differ diff --git a/fhunit.pas b/fhunit.pas index fcfa1b6..bfd6899 100644 --- a/fhunit.pas +++ b/fhunit.pas @@ -85,21 +85,27 @@ type procedure achsenZeichnen(zuZeichnen: tMessGroeszenSet; startZeit,stopZeit: extended); procedure graphenZeichnen(zuZeichnen: tMessGroeszenSet; startZeit,stopZeit: extended); procedure mutBeenden; + function sonnigkeit: extended; + function maxWind: extended; + function gesRegen: extended; + function hintInfo: string; + function mehrInfos(was: tMessGroeszenSet): string; end; procedure uZeit2mZeit(uZ: extended; out mZ: tZeit); inline; +procedure mZeit2uZeit(mZ: tZeit; out uZ: extended); inline; function strZuMZeit(s: string; out mZ: tZeit): boolean; const - messNamen: array[tMessgroesze] of string = + messNamen: array[tMessGroesze] of string = ('Temperatur','Luftfeuchte','Windgeschwindigkeit','Windrichtung', 'Niederschlag','Globalstrahlung','Luftdruck'); - maszEinheit: array[tMessgroesze] of string = + maszEinheit: array[tMessGroesze] of string = ('°C','%','m/s','°','mm','W/m²','mbar'); monatsNamen: array[1..12] of string = ('Januar','Februar','M'#$e4'rz','April','Mai','Juni','Juli', 'August','September','Oktober','November','Dezember'); - farben: array[tMessgroesze] of tColor = + farben: array[tMessGroesze] of tColor = ($0000DF,$CFAF7F,$007FFF,$FF00FF,$FFAF3F,$3FAFAF,$AFAFAF); implementation @@ -128,9 +134,7 @@ end; procedure tMessPunkt.setzeUZeit; begin - _uZeit:= - encodeDate(_mZeit[zgJahr],_mZeit[zgMonat],_mZeit[zgTag])+ - encodeTime(_mZeit[zgStunde],_mZeit[zgMin10]*10,0,0) + mZeit2uZeit(_mZeit,_uZeit); end; procedure tMessPunkt.setzeZeit; @@ -549,6 +553,74 @@ begin muts[i].beenden:=true; end; +function tMessPunkte.sonnigkeit: extended; +var + i: longint; + a,e,fA: extended; + fAZ: tZeit; +begin + result:=0; + i:=werte.bisekt(werte.last.zeit-1); + while i 0.25) or + (byte(wetter.maxWind > 2.5)*2) or + (byte(wetter.gesRegen > 0)*4) of + $00: trayIcon1.Icon:=WolkeIco.Picture.Icon; + $01: trayIcon1.Icon:=SonneIco.Picture.Icon; + $02,$03: trayIcon1.Icon:=SturmIco.Picture.Icon; + $04,$05: trayIcon1.Icon:=RegenIco.Picture.Icon; + $06,$07: trayIcon1.Icon:=RegenSturmIco.Picture.Icon; + end{of Case}; + + s:=wetter.hintInfo+' '+pegel.hintInfo; + image1.canvas.font.color:=$000000; + image1.canvas.textOut((image1.width-image1.canvas.textWidth(s)) div 2,1,s); + s[pos(',',s)-3]:=#13; + s[pos('%',s)+1]:=#13; + s:=s+wetter.mehrInfos([mgTemperatur,mgLuftfeuchte,mgWindgeschwindigkeit,//mgWindrichtung, + mgNiederschlag,//mgGlobalstrahlung, + mgLuftdruck]); + trayIcon1.hint:=s; + + trayIcon1.visible:=true; fehler:=false; end; diff --git a/wetter.lps b/wetter.lps index b89aa0e..9effad0 100644 --- a/wetter.lps +++ b/wetter.lps @@ -9,7 +9,7 @@ - + @@ -18,10 +18,9 @@ - - - - + + + @@ -29,29 +28,32 @@ - + - + + + - - - + + + + - - - + + + @@ -65,7 +67,7 @@ - + @@ -106,123 +108,127 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - + - + - - + + - - + + - - + + - + - + - + - + - + + + + + -- cgit v1.2.3-70-g09d2