Sign in to follow this  
Followers 0

time progress bar

10 posts in this topic

Posted

have some problems with the time

progressbar is running faster the the time

#include <Excel.au3>

#include <Array.au3>

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ProgressConstants.au3>

#include <WindowsConstants.au3>

Local $time, $minlaufer

$Form2 = GUICreate("Hotline Bereitschaft für am "& 1,577, 50, 251, 326)

$progressbar1 = GUICtrlCreateProgress(0, 33, 577, 17)

GUICtrlSetColor(-1, 32250); not working with Windows XP Style

$time = ((@HOUR + @MIN) + $minlaufer)

GUICtrlSetData($progressbar1, $time)

GUISetState(@SW_SHOW, $Form2)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

$minlaufer = "9,6"

EndSwitch

WEnd

Share this post


Link to post
Share on other sites



Posted

christiancdj,

With that code the Progressbar will not run at all as you never update it. What exactly are you trying to do?

M23

Share this post


Link to post
Share on other sites

Posted (edited)

Im trying to make a work timer from 6 to 22 clock

then reading the working time from a exel an making the break time visible

each person has a differen break time so i want to make a progressbar

like

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

6 7 8 9 10 11 12 13 14 ...... 20 21 22

xxx ........ xxx

break ............ break ......

have you an idea?

Edited by christiancdj

Share this post


Link to post
Share on other sites

Posted

christiancdj,

Perhaps something like this might get you started: :bye:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$cProgress = GUICtrlCreateProgress(10, 10, 340, 20)
; Set the progress limit to move in 6 minute intervals
GUICtrlSetLimit(-1, 16 * 6)
For $i = 6 To 22
    GUICtrlCreateLabel("|", 10 + (($i - 6) * 20), 30, 20, 20)
    GUICtrlCreateLabel($i, 10 + (($i - 6) * 20), 50, 20, 20)
Next

GUISetState()

$iCurr_Min = -1

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    ; Has the minute value changed?
    If @MIN <> $iCurr_Min Then
        ; Calculate the total minutes since 6AM in 6 minute sections
        $iTime = Int ((((@HOUR - 6) * 60) + @MIN) / 10)
        ; Set the Progressbar
        GUICtrlSetData($cProgress, $iTime)
        $iCurr_Min = @MIN
    EndIf

WEnd

Please ask if anything is unclear. :oops:

M23

Share this post


Link to post
Share on other sites

Posted (edited)

#include <Excel.au3>
#include <Array.au3>
#include <SliderConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

Global $iStart = 6 * 60 ;6 Uhr
Global $iGesamt = 16 * 60 ;gesamte Bereitschaftszeit
Local $aArray1
$benutzer = "test"
$tagID = "MO"
#Region ### START Koda GUI section ### Form=c:dokumente und einstellungenadministratordesktophotline compakt.kxf
$Form2 = GUICreate("Hotline Bereitschaft für "& $benutzer &" am "& $tagID,577, 50, 251, 326)
;~ $Form2 = GUICreate("Hotline Bereitschaft für " & 1, 587, 50, 251, 326)
$idLblPer = GUICtrlCreateLabel("",550,10,30,17)
$progressbar1 = GUICtrlCreateProgress(5, 28, 560, 17, $WS_EX_OVERLAPPEDWINDOW,$WS_EX_TOPMOST)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
;~ AdlibRegister("_ShowProgress", 60000) ;show 60 sec

;~ $FS = GUICtrlCreateInput("FS", 392, 8, 20, 16)
$Checkbox1 = GUICtrlCreateInput("", 7, 8, 20, 17,"",$TBS_TOP)
$schicht = _ArrayToString($aArray1, "", 2,2)
;anzeige()
$Checkbox2 = GUICtrlCreateInput("", 25, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 3,3)
;anzeige()

$Checkbox3 = GUICtrlCreateInput("", 43, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 4,4)
;anzeige()
$Checkbox4 = GUICtrlCreateInput("", 61, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 5,5)
;anzeige()
$Checkbox5 = GUICtrlCreateInput("", 79, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 6,6)
;anzeige()
$Checkbox6 = GUICtrlCreateInput("", 97, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 7,7)
;anzeige()
$Checkbox7 = GUICtrlCreateInput("", 115, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 8,8)
;anzeige()
$Checkbox8 = GUICtrlCreateInput("", 133, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 9,9)
;anzeige()
$Checkbox9 = GUICtrlCreateInput("", 151, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 10,10)
;anzeige()
$Checkbox10 = GUICtrlCreateInput("", 169, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 11,11)
;anzeige()
$Checkbox11 = GUICtrlCreateInput("", 187, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 12,12)
;anzeige()
$Checkbox12 = GUICtrlCreateInput("", 205, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 20,13)
;anzeige()
$Checkbox13 = GUICtrlCreateInput("", 223, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 14,14)
;anzeige()
$Checkbox14 = GUICtrlCreateInput("", 241, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 15,15)
;anzeige()
$Checkbox15 = GUICtrlCreateInput("", 260, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 16,16)
;anzeige()
$Checkbox16 = GUICtrlCreateInput("", 278, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 17,17)
;anzeige()
$Checkbox17 = GUICtrlCreateInput("", 295, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 18,18)
;anzeige()
$Checkbox18 = GUICtrlCreateInput("", 313, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 19,19)
;anzeige()
$Checkbox19 = GUICtrlCreateInput("", 331, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 20,20)
;anzeige()
$Checkbox20 = GUICtrlCreateInput("", 349, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 21,21)
;anzeige()
$Checkbox21 = GUICtrlCreateInput("", 367, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 22,22)
;anzeige()
$Checkbox22 = GUICtrlCreateInput("", 385, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 23,23)
;anzeige()
$Checkbox23 = GUICtrlCreateInput("", 403, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 24,24)
;anzeige()
$Checkbox24 = GUICtrlCreateInput("", 421, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 25,25)
;anzeige()
$Checkbox25 = GUICtrlCreateInput("", 439, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 26,26)
;anzeige()
$Checkbox26 = GUICtrlCreateInput("", 457, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 27,27)
;anzeige()
$Checkbox27 = GUICtrlCreateInput("", 475, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 28,28)
;anzeige()
$Checkbox28 = GUICtrlCreateInput("", 493, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 29,29)
;anzeige()
$Checkbox29 = GUICtrlCreateInput("", 511, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 30,30)
;anzeige()
$Checkbox30 = GUICtrlCreateInput("", 529, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 31,31)
;anzeige()
$Checkbox31 = GUICtrlCreateInput("", 547, 8, 20, 17, $BS_3STATE)
$schicht = _ArrayToString($aArray1, "", 32,32)
;anzeige()
uhrzeit()
_ShowProgress()
uhrzeit()
GUISetState(@SW_SHOW)
;~ _ArrayDisplay($aArray1, "Horizontal",-1,1)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
;~   _ExcelBookClose($oExcel)

EndSwitch
;~ $working = "0,104"
WEnd
Func uhrzeit()
;~ GUICtrlCreateLabel("6.3", 5, 30,20)
GUICtrlCreateLabel("7", 22, 30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("8", 57, 30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("9", 93, 30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("10", 127,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("11", 164,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("12", 199,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GuICtrlCreateLabel("13", 235,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("14", 271,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("15", 307,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("16", 343,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("17", 379,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("18", 415,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("19", 451,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("20", 487,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("21", 523,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("22", 559,30,20,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
EndFunc

Func _ShowProgress()
    Local $iBereits = @HOUR * 60 + @MIN - $iStart
    $iPercent = (($iBereits / $iGesamt * 100 ))
    ConsoleWrite(@HOUR & ":" & @MIN & @TAB & $iPercent & @CRLF) ;zur Kontrolle
    GUICtrlSetData($progressbar1, $iPercent)
;~   GUICtrlSetData($idLblPer,GUICtrlRead($progressbar1) & " %")    ;zur Demo, dass die Progressbar nur ganze Werte annimmt
EndFunc   ;==>_ShowProgress

thats my code sorry thats not nice

Edited by christiancdj

Share this post


Link to post
Share on other sites

Posted

christiancdj,

So what is the problem you are having with the script? :oops:

M23

Share this post


Link to post
Share on other sites

Posted

The progressbar is running faster the it shoud - if its 12 its nearbly by 12.30 :oops: what do i wrong?

Share this post


Link to post
Share on other sites

Posted

I think we need to calculate the total time / 100 and use this time in AdlibRegister

Share this post


Link to post
Share on other sites

Posted

have some problems with the time

progressbar is running faster the the time

#include <Excel.au3>

#include <Array.au3>

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <ProgressConstants.au3>

#include <WindowsConstants.au3>

Local $time, $minlaufer

$Form2 = GUICreate("Hotline Bereitschaft für am "& 1,577, 50, 251, 326)

$progressbar1 = GUICtrlCreateProgress(0, 33, 577, 17)

GUICtrlSetColor(-1, 32250); not working with Windows XP Style

$time = ((@HOUR + @MIN) + $minlaufer)

GUICtrlSetData($progressbar1, $time)

GUISetState(@SW_SHOW, $Form2)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

$minlaufer = "9,6"

EndSwitch

WEnd

you should put in [ code ] and [ /code ] tags

Share this post


Link to post
Share on other sites

Posted

you should put in [ code ] and [ /code ] tags

You shouldn't quote the whole post just to tell him to add code tags either.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0