Jump to content

Timerdif


asmazh
 Share

Recommended Posts

Selamlar arkadaşlar!
Görşmeyli baya oldu nasılsınız ? :)
Uzatmadan konuya geleyim. Şimdi böyle bir guim var;

[code]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("TimerDiff", 261, 71, 192, 124)
$Label1 = GUICtrlCreateLabel("00", 8, 8, 16, 17)
$Label2 = GUICtrlCreateLabel(":", 32, 7, 7, 17)
$Label3 = GUICtrlCreateLabel("00", 40, 8, 16, 17)
$Label4 = GUICtrlCreateLabel(":", 64, 7, 7, 17)
$Label5 = GUICtrlCreateLabel("00", 72, 8, 16, 17)
$Button1 = GUICtrlCreateButton("Başla!", 8, 32, 75, 25)
$Button2 = GUICtrlCreateButton("Dur!", 96, 32, 75, 25)
$Button3 = GUICtrlCreateButton("EXİT", 176, 32, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
[/code]
Şimdi buradaki "Başla!" butonuna bastığımda süre tutmaya başlayacak. "Dur" dediğimde duracak bunun Timer lerle olduğunu biliyorum ama ne yaptımsa yapamadım
Yardımlarınızı bekliyorum!

Link to comment
Share on other sites

[font="Georgia"]A.s iyiyiz Allah şükür. Soruna gelirsek bu gibi örneklerde [size=2]_[/size][size=4]timer[/size][size=2]_init[/size][size=2]() ve [/size][size=2]_[/size][size=4]timer[/size][size=2]_Diff fonksiyonlarını kullanırız en iyisi bunlardır..Farklı şekillerde de yapılabilir tabi.Fakat timer yaparken eğer başlatıp sonra isteğine göre durdurup tekrar durdurduğun yerden devam etmesini istiyorsan bunu bi yerde kaydetmen gerekir.Bu .ini veya kayıt girdisi olabilir.[/size][/font]

Link to comment
Share on other sites

@asmazh

Elektrik gitti burda. :{
Neyse aşağıdaki gibi bir şeymi istiyorsun?

[codebox]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("TimerDiff", 261, 71, 192, 124)
$Label1 = GUICtrlCreateLabel("00", 8, 8, 16, 17)
$Label2 = GUICtrlCreateLabel(":", 32, 7, 7, 17)
$Label3 = GUICtrlCreateLabel("00", 40, 8, 16, 17)
$Label4 = GUICtrlCreateLabel(":", 64, 7, 7, 17)
$Label5 = GUICtrlCreateLabel("00", 72, 8, 16, 17)
$Button1 = GUICtrlCreateButton("Başla!", 8, 32, 75, 25)
$Button2 = GUICtrlCreateButton("Dur!", 96, 32, 75, 25)
$Button3 = GUICtrlCreateButton("EXİT", 176, 32, 75, 25)
GUISetState(@SW_SHOW)

Local $TimerInit
Local $TimerStart = 0

Local $iSec_Temp
Local $iTime,$iHour,$iMin,$iSec

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$TimerInit = TimerInit()
$TimerStart = 1
Case $Button2
$TimerInit = 0
$TimerStart = 0
EndSwitch

If $TimerStart = 1 Then
$iTime = Int(TimerDiff($TimerInit)/100)/10
$iHour=Int($iTime/3600)
$iMin = Int(($iTime-$iHour*3600)/60)
$iSec = Int($iTime)-$iHour*3600-$iMin*60

If $iHour < 10 Then $iHour='0'&$iHour
If $iMin < 10 Then $iMin='0'&$iMin
If $iSec < 10 Then $iSec='0'&$iSec

If $iSec_Temp <> $iSec Then
$iSec_Temp = $iSec

GUICtrlSetData($Label5,$iSec)
GUICtrlSetData($Label3,$iMin)
GUICtrlSetData($Label1,$iHour)
EndIf
EndIf
WEnd[/codebox]

Link to comment
Share on other sites

@BlueLife
Evet hocam istediğim tamda bu. Bu arada çok güzel mantık kuruyorsunuz! Kodları bilmeme rağmen bu mantığı kuramadım.
@SimpsoN_Bart
Teşekkürler kayıt girdisini kullanmak en iyisi olur. Hızlı bir veri alıp işimi gördükten sonra silerim.

Edited by asmazh
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...