#include <Array.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>
#include<array.au3>
#include <Excel.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
$Form1 = GUICreate("Collect FIO Log Tool", 520, 540, -1, -1)
$Radio1 = GUICtrlCreateRadio("Collect1", 400, 50, 97, 25)
$Radio2 = GUICtrlCreateRadio("Collect2", 400, 80, 97, 25)
$Radio3 = GUICtrlCreateRadio("Collect3", 400, 110, 97, 25)
;$Button0 = GUICtrlCreateButton("Get BW/IOPS/CPU%", 5, 5, 140, 25, 0)
$Button1 = GUICtrlCreateButton("Analyze", 400, 150, 97, 50, 0)
$hLabel1 = GUICtrlCreateLabel("EventData", 30, 14, 97, 25, 0)
$hLabel2 = GUICtrlCreateLabel("EventData", 150, 14, 97, 25, 0)
$hLabel3 = GUICtrlCreateLabel("EventData", 270, 14, 97, 25, 0)
GUISetState(@SW_SHOW)
;######################################################################
Local $open, $exititem, $helpmenu, $aboutitem, $aboutitemRaw, $aboutitemFile;, $okbutton, $cancelbutton
Local $msg;, $file
$filemenu = GUICtrlCreateMenu("File")
$open = GUICtrlCreateMenuItem("Open", $filemenu)
$exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
;######################################################################
; HotKeySet("^c", "MyExit");設定中斷熱鍵
Local $var = FileOpenDialog("Please select which Log you want to sorting...", @ScriptDir, " Please Select File (*.txt)")
Local $file = FileOpen($var)
$Input1 = GUICtrlCreateEdit("", 30, 30, 100, 175)
$Input2 = GUICtrlCreateEdit("", 150, 30, 100, 175)
$Input3 = GUICtrlCreateEdit("", 270, 30, 100, 175)
;HotKeySet("{enter}","_F1")
GUICtrlCreateLabel("Data1", 35, 215, 50, 23)
GUICtrlCreateLabel("Data2", 105, 215, 50, 23)
GUICtrlCreateLabel("Data3", 180, 215, 50, 23)
$out_collect1 = GUICtrlCreateInput("", 30, 230, 50, 23)
$out_collect2 = GUICtrlCreateInput("", 100, 230, 50, 23)
$out_collect3 = GUICtrlCreateInput("", 175, 230, 50, 23)
$out_collect4 = GUICtrlCreateInput("", 30, 280, 50, 23)
$out_collect5 = GUICtrlCreateInput("", 100, 280, 50, 23)
$out_collect6 = GUICtrlCreateInput("", 175, 280, 50, 23)
$out_collect7 = GUICtrlCreateInput("", 30, 330, 50, 23)
$out_collect8 = GUICtrlCreateInput("", 100, 330, 50, 23)
$out_collect9 = GUICtrlCreateInput("", 175, 330, 50, 23)
Func _F1()
send("{Tab}")
EndFunc
;send("^z")
While 1
;read printer information
$line = FileRead($file)
$prn000 = StringRegExp($line, "0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) # Memory", 3)
$prn001 = StringRegExp($line, "0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) # Memory", 3)
$prn002 = StringRegExp($line, "0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) 0x(.*) # Memory", 3)
for $i = 0 to UBound($prn000) - 1
$CollectHDD1 = GUICtrlSetData ($Input1, $prn000[$i] &@CRLF,1)
$CollectHDD11 = ControlGetText("Collect1","",10)
Next
for $j = 0 to UBound($prn001) - 1
$CollectHDD2 = GUICtrlSetData ($Input2, $prn001[$j] &@CRLF,1)
$CollectHDD22 = ControlGetText("Collect2","",11)
Next
for $k = 0 to UBound($prn002) - 1
$CollectHDD3 = GUICtrlSetData ($Input3, $prn002[$k] &@CRLF,1)
$CollectHDD33 = ControlGetText("Collect3","",12)
Next
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
if BitAnd(GUICtrlRead($Radio1),$GUI_CHECKED)=1 Then
MsgBox(0,"123","123",1)
EndIf
if BitAnd(GUICtrlRead($Radio2),$GUI_CHECKED)=1 Then
MsgBox(0,"123","123",1)
EndIf
if BitAnd(GUICtrlRead($Radio3),$GUI_CHECKED)=1 Then
MsgBox(0,"123","123",1)
EndIf
EndSwitch
;######################################################################
Select
Case $msg = $exititem
ExitLoop
Case $msg = $open
Local $var = FileOpenDialog("Please select which Log you want to sorting...", "c:", " Please Select File (*.txt)")
Local $file = FileOpen($var)
;Case $msg = $okbutton
; MsgBox(0, "Click", "You clicked OK!")
EndSelect
;######################################################################
WEnd