Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- SendMode Input
- SetWorkingDir %A_ScriptDir%
- #SingleInstance, force
- FileCounter := []
- Gui, 1: -Caption +AlwaysOnTop
- Drives := ["z","y","x","u","t","s","r","q","p","w","v","o","n","m","l","k","j"]
- Indexes := []
- Handles := []
- y := 50 , Index := 0 , y2 := 35
- Loop, 4 {
- x := 25 , x2 := 20
- Loop, 5 {
- if( ++Index > 17 )
- break, 2
- Gui, 1: Font, s30
- Gui, 1: Add, Button, % "x" x " y" y " w90 h80 gLaserCheck hwndhwnd" ,
- Handles[hwnd] := Index
- Indexes[Index] := hwnd
- Gui, 1: Font,
- Gui, 1: Add, GroupBox, % "x" x2 " y" y2 " w100 h100", % "MACHINE " Index
- x += 120 , x2 += 120
- }
- y += 120 , y2 += 120
- }
- Gui, Font
- gui, add, button, x595 y10 h20 w20 gcloseapp, X
- gui, add, button, x5 y10 h20 w20 gminimize, —
- Gui, Font, s10
- gui, add, text, x240 y7 , Laser Dashboard v1.1
- Gui, Font, s10
- Gui, Add, GroupBox, x400 y395 w200 h100, TOTAL CAD FILES
- Gui, Font, s28
- Gui, add, text, x460 y425 w90 h50 center vtot, %tot% ;-----TOTAL COUNT
- gui, add, text, x10 y520 w600 0x10 ;Horizontal Line
- ;********************************************************************
- ;************ Need this part to work **********************************************************************************************************************************************
- ;********************************************************************
- Gui, Font, s10
- Gui, Add, GroupBox, x400 y530 w200 h100, BURNED TODAY
- Gui, add, text, x460 y565 w90 h50 center vtot24burned, %tot24burned% ;-----TOTAL BURNED TODAY (24 hour period), it counts "scax" files on all machines created today.
- Gui, Font, s10
- Gui, Add, GroupBox, x25 y530 w130 h100, FIRST SHIFT
- Gui, add, text, x60 y565 w90 h50 center vfirst_shift, %first_shift% ; 1st Shift -->> 6:00AM - 5:30PM, counts "scax" files on all machines created between 6:00AM and 5:30PM
- Gui, Font, s10
- Gui, Add, GroupBox, x175 y530 w130 h100, SECOND SHIFT
- Gui, add, text, x210 y565 w90 h50 center vsecond_shift, %second_shift% ; 2nd Shift -->> 5:30PM - 5:59AM, counts "scax" files on all machines created between 5:30PM and 5:59AM
- ;************************************************************************************************************************************************************************************
- Gui, 1: Show, h640 w620, Laser Dashboard v1.1
- OnMessage(0x201, "WM_LBUTTONDOWN")
- gosub, Timer
- settimer, Timer, 5000
- return
- CloseApp:
- ESC::
- ExitApp
- Minimize:
- Gui, 1: Minimize
- return
- Refresh:
- reload
- return
- LaserCheck:
- MouseGetPos,,,,ctrl,2
- run, % Drives[Handles[ctrl]] ":\"
- return
- timer:
- CountIndex := 0 , total := 0
- loop, 17
- FileCounter[A_Index] := 0
- for, k, v in Drives {
- ++CountIndex
- Loop, Files, %v%:\*.cad
- total ++ , FileCounter[CountIndex] := A_Index
- }
- for, k, v in Handles
- GuiControl, 1: , % k , % FileCounter[A_Index]
- GuiControl,1:, tot, % total
- ;********************************************************
- count1 := 0 , count2 := 0
- for, k, v in Drives {
- Loop, Files, %v%:\*.scax
- {
- FileGetTime, Out , %A_LoopFileFullPath%
- FC := SplitTime(Out)
- YesterDay := SplitTime( A_Now , 1 )
- Today := SplitTime( A_Now )
- if( A_Hour < 02 ){
- if( ( FC.Year = Today.Year || FC.Year = YesterDay.Year ) && ( FC.Month = Today.Month || FC.Month = Yesterday.Month ) && ( ( FC.Day = Today.Day && FC.Hour < 02 )|| ( FC.Day = Yesterday.Day && FC.Hour >= 9 ) ) ){
- if( FC.Hour >= 17 && FC.Min <= 30){ ; made after 5:30
- Count1++
- }else
- Count2++
- }
- }else{
- if( FC.Year = Today.Year && FC.Month = Today.Month && FC.Day = Today.Day && FC.Hour >= 02 ){
- if( FC.Hour >= 17 && FC.Min <= 30){ ; made after 5:30
- Count2++
- }else
- Count1++
- }
- }
- }
- }
- GuiControl,1:, tot24burned , % Count1 + Count2
- GuiControl,1:, first_shift , % Count1
- GuiControl,1:, second_shift , % Count1 + Count2
- return
- SplitTime(out,yesterday:=0){
- if(yesterday){
- out += -1 , days
- FormatTime, out, %out%, yyyyMMddHHmmss
- }
- StringLeft, Year, Out, 4
- StringTrimleft, Out, Out, 4
- StringLeft, Month, Out, 2
- StringTrimleft, Out, Out, 2
- StringLeft, Day, Out, 2
- StringTrimleft, Out, Out, 2
- StringLeft, Hour, Out, 2
- StringTrimleft, Out, Out, 2
- StringLeft, Min, Out, 2
- StringTrimleft, Out, Out, 2
- return {Year: Year, Month: Month, Day: Day, Hour: Hour, Min: Min}
- }
- WM_LBUTTONDOWN(){
- PostMessage, 0xA1, 2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement