Hallo zusammen,
ich möchte gerne einen Zeitrechner erstellen. Was ich noch nicht weiß ist, wie ich die Berechnungen mit der Zeit machen kann.
Folgendes habe ich bis jetzt geschafft:
C
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#Region ### START Koda GUI section ### Form=c:\users\wkivag15\documents\zeitrechner.kxf
$Form1_1 = GUICreate("Zeitrechner", 664, 413, 617, 296)
$ankunft_btn = GUICtrlCreateButton("Ankunft", 16, 24, 107, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$pause_bgn_btn = GUICtrlCreateButton("Pause Begin", 16, 64, 107, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$pause_end_btn = GUICtrlCreateButton("Pause Ende", 16, 104, 107, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$ankunft_inp = GUICtrlCreateInput("00:00", 128, 24, 89, 29, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$pause_bgn_inp = GUICtrlCreateInput("00:00", 128, 63, 89, 29, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER))
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$pause_end_inp = GUICtrlCreateInput("00:00", 128, 103, 89, 29, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER))
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$laenge_der_pause_inp = GUICtrlCreateInput("", 192, 168, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$laenge_pause_lbl = GUICtrlCreateLabel("Länge der Pause", 16, 168, 125, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$feierabend_lbl = GUICtrlCreateLabel("Feierabend", 16, 208, 88, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
GUICtrlSetTip(-1, "16")
$Label3 = GUICtrlCreateLabel("Überstunden vorher", 14, 246, 151, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label4 = GUICtrlCreateLabel("Überstunden heute", 14, 286, 146, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label5 = GUICtrlCreateLabel("Überstunden gesamt", 14, 326, 159, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label6 = GUICtrlCreateLabel("Soll-Arbeitzeit", 374, 168, 110, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label7 = GUICtrlCreateLabel("Tatsächliche Arbeitzeit", 374, 208, 174, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label8 = GUICtrlCreateLabel("Frühester Feierabend", 374, 246, 163, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label9 = GUICtrlCreateLabel("Spätester Feierabend", 374, 286, 164, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$Label10 = GUICtrlCreateLabel("Pause nach 6 Stunden", 374, 326, 167, 25)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$feierabend_inp = GUICtrlCreateInput("", 192, 208, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$ueberstunden_inp = GUICtrlCreateInput("", 192, 246, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$ueberstunden_heute_inp = GUICtrlCreateInput("", 192, 286, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$ueberstunden_ges_inp = GUICtrlCreateInput("", 192, 326, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$pause_6std_inp = GUICtrlCreateInput("", 556, 322, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$spaet_zeit_inp = GUICtrlCreateInput("", 556, 282, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$frue_zeit_inp = GUICtrlCreateInput("", 556, 242, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$tats_zeit_inp = GUICtrlCreateInput("", 556, 202, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
$soll_zeit_inp = GUICtrlCreateInput("", 556, 162, 89, 29)
GUICtrlSetFont(-1, 12, 400, 0, "DM Sans")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ankunft_btn
$ankunftzeit = (_NowTime(4))
GUICtrlSetData($ankunft_inp, $ankunftzeit)
Case $pause_bgn_btn
$pause_bgn_zeit = (_NowTime(4))
GUICtrlSetData ($pause_bgn_inp, $pause_bgn_zeit)
Case $pause_end_btn
$pause_end_zeit = (_NowTime(4))
GUICtrlSetData ($pause_end_inp, $pause_end_zeit)
EndSwitch
WEnd
Alles anzeigen
Ich will das so machen: sobald "Pause Ende" da ist, wird alles berechnet und alle Felder sind gefüllt.
Und noch etwas: die Zeit wird auch in Dezimalzahlen berechnet. Pro Tag muss man 07,48 Stunden arbeiten oder 07,80 Stunden in Dezimalzahlen.
So sieht das in Excel aus:
Ich freue mich sehr auf eure Erläuterungen.
Vielen Dank und viele Grüße
Chris