SHARE
TWEET

4alex

a guest Feb 21st, 2020 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. SendMode Input
  3. SetWorkingDir %A_ScriptDir%
  4. #SingleInstance, force
  5. FileCounter := []
  6. Gui, 1: -Caption +AlwaysOnTop
  7. Drives := ["z","y","x","u","t","s","r","q","p","w","v","o","n","m","l","k","j"]
  8. Indexes := []
  9. Handles := []
  10. y := 50 , Index := 0 , y2 := 35
  11. Loop, 4 {
  12.     x := 25 , x2 := 20
  13.     Loop, 5 {
  14.         if( ++Index > 17 )
  15.             break, 2
  16.         Gui, 1: Font, s30  
  17.         Gui, 1: Add, Button, % "x" x " y" y " w90 h80 gLaserCheck hwndhwnd" ,
  18.         Handles[hwnd] := Index
  19.         Indexes[Index] := hwnd
  20.         Gui, 1: Font,
  21.         Gui, 1: Add, GroupBox, % "x" x2 " y" y2 " w100 h100", % "MACHINE " Index
  22.         x += 120 , x2 += 120
  23.     }
  24.     y += 120 , y2 += 120
  25. }
  26.  
  27. Gui, Font
  28. gui, add, button, x595 y10 h20 w20 gcloseapp, X
  29. gui, add, button, x5  y10 h20 w20 gminimize, —
  30. Gui, Font, s10
  31. gui, add, text, x240 y7  , Laser Dashboard v1.1
  32.  
  33. Gui, Font, s10
  34. Gui, Add, GroupBox, x400 y395 w200 h100, TOTAL CAD FILES
  35. Gui, Font, s28
  36. Gui, add, text, x460 y425 w90 h50 center vtot, %tot%  ;-----TOTAL COUNT
  37.  
  38. gui, add, text, x10 y520 w600 0x10  ;Horizontal Line
  39.  
  40. ;********************************************************************
  41. ;************ Need this part to work **********************************************************************************************************************************************
  42. ;********************************************************************
  43.  
  44. Gui, Font, s10
  45. Gui, Add, GroupBox, x400 y530 w200 h100, BURNED TODAY
  46. 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.
  47.  
  48. Gui, Font, s10
  49. Gui, Add, GroupBox, x25 y530 w130 h100, FIRST SHIFT
  50. 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
  51.  
  52. Gui, Font, s10
  53. Gui, Add, GroupBox, x175 y530 w130 h100, SECOND SHIFT
  54. 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
  55.  
  56. ;************************************************************************************************************************************************************************************
  57. Gui, 1: Show, h640 w620, Laser Dashboard v1.1  
  58. OnMessage(0x201, "WM_LBUTTONDOWN")
  59. gosub, Timer               
  60. settimer, Timer, 5000
  61. return
  62. CloseApp:
  63. ESC::                                                              
  64.     ExitApp
  65.    
  66. Minimize:
  67.     Gui, 1: Minimize
  68.     return
  69.    
  70. Refresh:
  71.     reload
  72.     return
  73.  
  74. LaserCheck:
  75.     MouseGetPos,,,,ctrl,2
  76.     run, % Drives[Handles[ctrl]] ":\"
  77.     return
  78.  
  79. timer:
  80.     CountIndex := 0 , total := 0
  81.     loop, 17
  82.         FileCounter[A_Index] := 0
  83.     for, k, v in Drives {
  84.         ++CountIndex
  85.         Loop, Files, %v%:\*.cad
  86.             total ++ , FileCounter[CountIndex] := A_Index
  87.     }
  88.     for, k, v in Handles
  89.         GuiControl, 1: , % k , % FileCounter[A_Index]
  90.     GuiControl,1:, tot, % total
  91.     ;********************************************************
  92.     count1 := 0 , count2 := 0
  93.     for, k, v in Drives {
  94.         Loop, Files, %v%:\*.scax
  95.         {
  96.             FileGetTime, Out , %A_LoopFileFullPath%
  97.             FC := SplitTime(Out)
  98.             YesterDay := SplitTime( A_Now , 1 )
  99.             Today := SplitTime( A_Now )
  100.             if( A_Hour < 02  ){
  101.                 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 ) ) ){
  102.                     if( FC.Hour >= 17 && FC.Min <= 30){ ; made after 5:30
  103.                         Count1++
  104.                     }else
  105.                         Count2++
  106.                 }
  107.             }else{
  108.                 if( FC.Year = Today.Year && FC.Month = Today.Month && FC.Day = Today.Day && FC.Hour >= 02 ){
  109.                     if( FC.Hour >= 17 && FC.Min <= 30){ ; made after 5:30
  110.                         Count2++
  111.                     }else
  112.                         Count1++
  113.                 }
  114.             }
  115.         }
  116.     }
  117.     GuiControl,1:, tot24burned , % Count1 + Count2
  118.     GuiControl,1:, first_shift , % Count1
  119.     GuiControl,1:, second_shift , % Count1 + Count2
  120.     return
  121.    
  122. SplitTime(out,yesterday:=0){
  123.     if(yesterday){
  124.         out += -1 , days
  125.         FormatTime, out, %out%, yyyyMMddHHmmss
  126.     }
  127.     StringLeft, Year, Out, 4
  128.     StringTrimleft, Out, Out, 4
  129.     StringLeft, Month, Out, 2
  130.     StringTrimleft, Out, Out, 2
  131.     StringLeft, Day, Out, 2
  132.     StringTrimleft, Out, Out, 2
  133.     StringLeft, Hour, Out, 2
  134.     StringTrimleft, Out, Out, 2
  135.     StringLeft, Min, Out, 2
  136.     StringTrimleft, Out, Out, 2
  137.     return {Year: Year, Month: Month, Day: Day, Hour: Hour, Min: Min}
  138. }
  139. WM_LBUTTONDOWN(){
  140.    PostMessage, 0xA1, 2
  141. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top