Verfasst: 27.02.2009 22:24
				
				http://www.corner-shop.de/junghans/cgi- ... =014404100
Das ist meine, nur ist die grad in Reparatur... Das Glas ist gebrochen
			Das ist meine, nur ist die grad in Reparatur... Das Glas ist gebrochen
Ja nun ist auch egal, PMV...Sie haben es gerade geschaft Ihren eigenen Thread zu "Offtopicen" mit
einer beschwerde über angeblichen Offtopic. Muss man auch erst mal
ungewollt schaffen Laughing
Code: Alles auswählen
Declare StartWertesetzen() 
Declare SchreibeDaten() 
;***************************************** 
;*           Programm: BinaryLedUhr      * 
;*      Programmautor: Wolfgang Drescher * 
;*            Version: 1.0               * 
;*              Datum: 02.04.2009        * 
;***************************************** 
Structure Uhr 
binh$
binm$
bins$
hh.w 
ii.w 
ss.w 
aus.l
ein.l
hh$
ii$
ss$
sr$
butimgbr.l 
butimghh.l 
windowbr.l 
windowhh.l 
infimgbr.l 
infimghh.l 
backcolor.l 
frontcolor.l 
time$ 
EndStructure 
Global wd.Uhr 
LoadFont(0,"Arial",10,#PB_Font_Bold ) 
StartWertesetzen() 
titel$ = "Binary LED  Uhr" 
OpenWindow(0, 0, 0, wd\windowbr, wd\windowhh, titel$, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget ) 
  SetWindowColor(0, wd\backcolor) 
  
  schreibedaten() 
  ImageGadget(1, 0, 0, 0, 0,ImageID(0)) 
Repeat 
 With wd.Uhr 
  
 Delay(1) 
  
    EventID = WindowEvent() 
     SchreibeDaten() 
     SetGadgetState(1,ImageID(0)) 
      
 EndWith  
      
Until EventID = #PB_Event_CloseWindow  ; Wenn das Schliessen Button gedrückt wird, Programm beenden. 
End   ; Programm ende 
Procedure StartWertesetzen() 
With wd.Uhr 
\binh$="0"
\bins$="0"
\binm$="0"
\sr$="0"
\hh=0 
\ii=0 
\ss=0 
\hh$="00"
\ii$="00"
\ss$="00"
\windowbr = 310 
\windowhh = 230 
\infimgbr = 300 
\infimghh = 220 
\butimgbr = 100 
\butimghh = 100 
\time$="00:00:00" 
\backcolor= RGB(20,10,100) 
\frontcolor = #Yellow 
\aus=RGB(130,130,150)
\ein=RGB(255,30,0)
EndWith 
EndProcedure 
Procedure SchreibeDaten() 
With wd.Uhr 
CreateImage(0, \infimgbr, \infimghh) 
StartDrawing(ImageOutput(0)) 
  Box(10, 10, \infimgbr, \infimghh, RGB(100,100,180))
   
  se=100
  For x=1 To 5
  Circle(se,60,10,\aus) 
  se+25
  Next x
  
  se=90
  For x=1 To 6
  Circle(se,120,10,\aus)
  se+25
  Next x
  
  se=90
  For x=1 To 6
  Circle(se,180,10,\aus)
  se+25
  Next x
  
  DrawingFont(FontID(0))
  
  FrontColor(#Yellow) 
  DrawingMode(#PB_2DDrawing_Transparent) 
    
 \time$=FormatDate("%hh:%ii:%ss", Date())  ; zeigt die aktuelle Zeit mittels dem 00:00:00 Format 
  
  se=195
  t=1
  For x=5 To 1 Step -1
  \sr$=Str(t)
  DrawText(se,30, \sr$)
  se-25
  t*2
  Next x
  DrawText(30,50, "Std.")
    
  se=210
  t=1
  For x=6 To 1 Step -1
  \sr$=Str(t)
  DrawText(se,90, \sr$)
  se-25
  t*2
  Next x
  DrawText(30,110, "Min.")
  
  se=210
  t=1
  For x=6 To 1 Step -1
  \sr$=Str(t)
  DrawText(se,150, \sr$)
  se-25
  t*2
  Next x
  DrawText(30,170,"Sek.")
  
  \hh$=(Left(\time$,2))
  \ii$=(Mid(\time$,4,2))
  \ss$=(Mid(\time$,7,2))
  
  
  ;DrawText(30,140, \hh$) 
  ;DrawText(60,140,\ii$)
  ;DrawText(90,140,\ss$)
  
  \hh=Val(\hh$)
  \hh$=RSet(Bin(\hh),6,"0")
  
  \ii=Val(\ii$)
  \ii$=RSet(Bin(\ii),6,"0")
  
  \ss=Val(\ss$)
  \ss$=RSet(Bin(\ss),6,"0")
  
  
  ;DrawText(30,170, \hh$)
  ;DrawText(30,190, \ii$)
  ;DrawText(30,210, \ss$)
 
  se=75
  For x=1 To 6 
  \binh$=Mid(\hh$,x,1)
   If \binh$="1" 
   Circle(se,60,10,\ein)
   EndIf
   se+25
  Next x
  
  se=90
  For x=1 To 6 
  \binm$=Mid(\ii$,x,1)
   If \binm$="1" 
   Circle(se,120,10,\ein)
   EndIf
   se+25
  Next x
  
  se=90
  For x=1 To 6 
  \bins$=Mid(\ss$,x,1)
   If \bins$="1" 
   ;DrawText(30*x,240, \bins$)
   Circle(se,180,10,\ein)
   EndIf
   se+25
  Next x
  
  
  
  
  
    
  StopDrawing() 
  
  
  
  EndWith 
  
  EndProcedure