]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Added estimated time, radiation status foild to GUI, notification for Dennis (Android...
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Fri, 16 Aug 2013 13:46:26 +0000 (15:46 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Fri, 16 Aug 2013 13:46:26 +0000 (15:46 +0200)
bot/Functions/RefreshGUI.au3
bot/Functions/SendNtfctn.au3
bot/GUI/MAB.kxf
bot/GUI/MABS.au3
bot/MABS.lnk [new file with mode: 0755]
bot/Mimosa_Autorun.au3
bot/bot backup.rar [new file with mode: 0755]
bot/config.ini

index bcbcbee29758fdec410fe0e76a7e94420b35afc9..e389e0f177c09eb9540534ba127364ad55ba3604 100644 (file)
@@ -23,9 +23,9 @@ EndFunc   ;==>RefreshPercent
 
 Func RefreshLog($log)
        $return = 0
-       $hLog = ControlGetHandle("MABS (Mimosa Automation Bot System)", "", "Edit6")
+       $hLog = ControlGetHandle("MABS (Mimosa Automation Bot System)", "", "Edit1")
        $iEnd = StringLen($log)
-       ControlSetText("MABS (Mimosa Automation Bot System)", "", "Edit6", $log)
+       ControlSetText("MABS (Mimosa Automation Bot System)", "", "Edit1", $log)
        _GUICtrlEdit_SetSel($hLog, $iEnd, $iEnd)
        _GUICtrlEdit_Scroll($hLog, $SB_SCROLLCARET )
        Return $return
index 318ac8fcdd9aaa55bf278bfe88cb4cba713dfd3d..ac9847ef53eb97050a56dec8314285a5f37dc0a8 100644 (file)
@@ -1,4 +1,6 @@
 #include <String.au3>
+$notify = IniRead("config.ini", "various", "Notify", "1") ; notifycode
+$notifycustom = IniRead("config.ini", "various", "NotifyCustom", "") ; chip number currently mounted into the system
 
 $error = 1
 If ($CmdLine[0] > 0) Then
@@ -7,16 +9,36 @@ If ($CmdLine[0] > 0) Then
 EndIf
 ConsoleWrite($error)
 
-Func SendNtfctn($text, $notify, $notifycustom)
-       $notifyBenny=BitAND($notify, 1)
+Func SendNtfctn($text)
+       $notify = IniRead("config.ini", "various", "Notify", "1") ; notifycode
+       $notifycustom = IniRead("config.ini", "various", "NotifyCustom", "") ; chip number currently mounted into the system
+
+       $notifyBenny =BitAND($notify, 1)
        $notifyDennis=BitAND($notify, 2)
-        $notifyStefan=BitAND($notify, 4)
-        
+       $notifyStefan=BitAND($notify, 4)
+
        $text = urlencode($text)
        $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
-       $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bEejQPoLUIipcNpfeDvNoa5Bd48AASVBHRphY4ySu8U2FSfuDym2iHdkC_YJ2zyhhbVXVB0oRacd_QmDFsrNRATF0rT4b7pqIHj8EeUrOdq0s_gQq7BE0ERaUfHHikhet06D8ff8BUXe8uVZ5RqoI2ygWc48Q&message=RadHard:%20" & $text & "&password=TannenbaumSaftSchorle")
-       $oHTTP.Send()
+
+       If $notifyBenny Then
+          $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bEejQPoLUIipcNpfeDvNoa5Bd48AASVBHRphY4ySu8U2FSfuDym2iHdkC_YJ2zyhhbVXVB0oRacd_QmDFsrNRATF0rT4b7pqIHj8EeUrOdq0s_gQq7BE0ERaUfHHikhet06D8ff8BUXe8uVZ5RqoI2ygWc48Q&message=RadHard:%20" & $text & "&password=TannenbaumSaftSchorle")
+          $oHTTP.Send()
+       EndIf
+
+       If $notifyDennis Then
+          ;$oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bEejQPoLUIipcNpfeDvNoa5Bd48AASVBHRphY4ySu8U2FSfuDym2iHdkC_YJ2zyhhbVXVB0oRacd_QmDFsrNRATF0rT4b7pqIHj8EeUrOdq0s_gQq7BE0ERaUfHHikhet06D8ff8BUXe8uVZ5RqoI2ygWc48Q&message=RadHard:%20" & $text & "&password=TannenbaumSaftSchorle")
+          ;$oHTTP.Send()
+       EndIf
+
+       If $notifyStefan Then
+          If Not StringInStr ( $text, "Percent%20done" ) Then
+             $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bEejQPoLUIipcNpfeDvNoa5Bd48AASVBHRphY4ySu8U2FSfuDym2iHdkC_YJ2zyhhbVXVB0oRacd_QmDFsrNRATF0rT4b7pqIHj8EeUrOdq0s_gQq7BE0ERaUfHHikhet06D8ff8BUXe8uVZ5RqoI2ygWc48Q&message=RadHardSMS015787957348:%20" & $text & "&password=TannenbaumSaftSchorle")
+             $oHTTP.Send()
+           EndIf
+       EndIf
+
        $oHTTP = 0
+
 EndFunc   ;==>SendNtfctn
 
 Func urlencode($str, $plus = False)
index 70ac9a1557447ce1d2c0666df400a154054e3543..bad5538406321e01fd9a2363395b9e3ab7b1eebd 100755 (executable)
@@ -3,7 +3,7 @@
        <properties>
                <property name="Left" vt="Int16">395</property>
                <property name="Top" vt="Int16">335</property>
-               <property name="Width" vt="Int16">423</property>
+               <property name="Width" vt="Int16">484</property>
                <property name="Height" vt="Int16">394</property>
                <property name="Caption" vt="String">MABS (Mimosa Automation Bot System)</property>
                <property name="Color" vt="Ident">clBtnFace</property>
                        <properties>
                                <property name="Left" vt="Int16">160</property>
                                <property name="Top" vt="Int8">74</property>
-                               <property name="Width" vt="Int16">241</property>
+                               <property name="Width" vt="Int16">306</property>
                                <property name="Height" vt="Int16">261</property>
                                <property name="Lines.Strings" vt="List">
                                        <list>
                                <property name="TabOrder" vt="Int8">14</property>
                                <property name="CtrlStyle" vt="Int32">1344477252</property>
                                <property name="CtrlExStyle" vt="Int16">512</property>
-                               <property name="Resizing" vt="Set"/>
+                               <property name="Resizing" vt="Set">DockRight, DockBottom</property>
                        </properties>
                        <components/>
                </object>
                        <properties>
                                <property name="Left" vt="Int8">11</property>
                                <property name="Top" vt="Int8">27</property>
-                               <property name="Width" vt="Int16">316</property>
+                               <property name="Width" vt="Int16">311</property>
                                <property name="Height" vt="Int8">21</property>
                                <property name="TabOrder" vt="Int8">20</property>
                                <property name="Text" vt="String">ExcelPath</property>
                </object>
                <object type="TAButton" name="LoadExcel">
                        <properties>
-                               <property name="Left" vt="Int16">330</property>
+                               <property name="Left" vt="Int16">325</property>
                                <property name="Top" vt="Int8">25</property>
-                               <property name="Width" vt="Int8">70</property>
+                               <property name="Width" vt="Int8">65</property>
                                <property name="Height" vt="Int8">25</property>
                                <property name="Caption" vt="String">Load file</property>
                                <property name="TabOrder" vt="Int8">22</property>
                        </properties>
                        <components/>
                </object>
+               <object type="TAButton" name="Button1">
+                       <properties>
+                               <property name="Left" vt="Int16">395</property>
+                               <property name="Top" vt="Int8">25</property>
+                               <property name="Width" vt="Int8">75</property>
+                               <property name="Height" vt="Int8">25</property>
+                               <property name="Caption" vt="String">Open in Excel</property>
+                               <property name="TabOrder" vt="Int8">25</property>
+                               <property name="Color" vt="Ident">clBtnFace</property>
+                               <property name="CtrlStyle" vt="Int32">1342373888</property>
+                               <property name="CtrlExStyle" vt="Int8">0</property>
+                               <property name="Resizing" vt="Set">DockWidth, DockHeight</property>
+                       </properties>
+                       <components/>
+               </object>
                <object type="TMainMenu" name="MainMenu1">
                        <properties/>
                        <components>
index 4c7566ddedecf0c06a75f710ec954e4fb5063a46..35f95e13dd8c449a43d45e891515234e44e9f882 100755 (executable)
@@ -9,9 +9,10 @@
 Global $programversion = "1.0"
 #include "About.au3"
 #Region ### START Koda GUI section ### Form=f:\eigene dateien\downloads\dropbox\new\gui\mab.kxf
-$Form1_1 = GUICreate("MABS (Mimosa Automation Bot System)", 414, 365, 395, 335)
+$Form1_1 = GUICreate("MABS (Mimosa Automation Bot System)", 477, 412, 395, 335)
 $ProgressPercent1 = GUICtrlCreateLabel("0", -40, -40, 21, 17)
 $ProgressPercent2 = GUICtrlCreateLabel("0", -40, -40, 21, 17)
+$LogEdit = GUICtrlCreateEdit("", 155, 74, 316, 311, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY))
 $MenuItem1 = GUICtrlCreateMenu("&File")
 $MenuItem2 = GUICtrlCreateMenuItem("&Save"&@TAB&"Ctrl+S", $MenuItem1)
 $MenuItem3 = GUICtrlCreateMenuItem("&Load"&@TAB&"Ctrl+L", $MenuItem1)
@@ -24,33 +25,36 @@ $ChipCombo = GUICtrlCreateCombo("", 11, 74, 89, 25, BitOR($CBS_DROPDOWN,$CBS_AUT
 GUICtrlSetData(-1, "Mi32|Mi32Ter|Mi34", "Mi34")
 $ChipNumInput = GUICtrlCreateInput("1", 107, 74, 41, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
 $Label2 = GUICtrlCreateLabel("Number", 107, 55, 41, 17)
-$TempInput = GUICtrlCreateInput("20", 11, 125, 57, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT))
-$Label3 = GUICtrlCreateLabel("Temperature", 11, 106, 64, 17)
-$Label4 = GUICtrlCreateLabel("° C", 75, 130, 18, 17)
-$Label5 = GUICtrlCreateLabel("Rad source", 95, 106, 59, 17)
-$RadInput = GUICtrlCreateInput("none", 97, 124, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT))
-$Start = GUICtrlCreateButton("Start", 10, 268, 135, 30)
-$NotifyCustom = GUICtrlCreateInput("(Optional)", 11, 233, 136, 21)
+$TempInput = GUICtrlCreateInput("20", 11, 175, 57, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT))
+$Label3 = GUICtrlCreateLabel("Temperature", 11, 156, 64, 17)
+$Label4 = GUICtrlCreateLabel("° C", 72, 178, 18, 17)
+$Label5 = GUICtrlCreateLabel("Rad source", 95, 110, 59, 17)
+$RadInput = GUICtrlCreateInput("none", 97, 129, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT))
+$Label10 = GUICtrlCreateLabel("Chip Radiation", 11, 110, 74, 17)
+$RadiatedInput = GUICtrlCreateInput("", 11, 129, 76, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT))
+$Start = GUICtrlCreateButton("Start", 10, 318, 135, 30)
+$NotifyCustom = GUICtrlCreateInput("(Optional)", 11, 283, 136, 21)
 GUICtrlSetColor(-1, 0xC0C0C0)
-$Label6 = GUICtrlCreateLabel("E-Mail or mobile phone:", 11, 212, 114, 17)
-$Progress1 = GUICtrlCreateProgress(10, 305, 135, 16, $PBS_SMOOTH)
+$Label6 = GUICtrlCreateLabel("E-Mail or mobile phone:", 11, 262, 114, 17)
+$Progress1 = GUICtrlCreateProgress(10, 355, 135, 16, $PBS_SMOOTH)
 GUICtrlSetColor(-1, 0x000080)
-$Progress2 = GUICtrlCreateProgress(10, 324, 135, 10, $PBS_SMOOTH)
+$Progress2 = GUICtrlCreateProgress(10, 374, 135, 10, $PBS_SMOOTH)
 GUICtrlSetColor(-1, 0x000080)
-$LogEdit = GUICtrlCreateEdit("", 160, 74, 241, 261, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
 $Label7 = GUICtrlCreateLabel("Log", 160, 54, 22, 17)
-$CheckboxBenny = GUICtrlCreateCheckbox("Benny", 11, 171, 52, 17)
+$CheckboxBenny = GUICtrlCreateCheckbox("Benny", 11, 221, 52, 17)
 GUICtrlSetState(-1, $GUI_CHECKED)
-$Label8 = GUICtrlCreateLabel("Notify:", 11, 154, 34, 17)
-$CheckboxDennis = GUICtrlCreateCheckbox("Dennis", 81, 171, 52, 17)
-$CheckboxStefan = GUICtrlCreateCheckbox("Stefan", 11, 191, 52, 17)
-$ExcelPath = GUICtrlCreateInput("", 11, 27, 316, 21)
+$Label8 = GUICtrlCreateLabel("Notify:", 11, 204, 34, 17)
+$CheckboxDennis = GUICtrlCreateCheckbox("Dennis", 81, 221, 52, 17)
+$CheckboxStefan = GUICtrlCreateCheckbox("Stefan", 11, 241, 52, 17)
+$ExcelPath = GUICtrlCreateInput("", 11, 27, 311, 21)
 $Label9 = GUICtrlCreateLabel("Lab book as an Excel file", 11, 9, 123, 17)
-$LoadExcel = GUICtrlCreateButton("Load file", 330, 25, 70, 25)
+$LoadExcel = GUICtrlCreateButton("Load file", 325, 25, 65, 25)
+$ExcelOpen = GUICtrlCreateButton("Open in Excel", 395, 25, 75, 25)
 Dim $Form1_1_AccelTable[2][2] = [["^s", $MenuItem2],["^l", $MenuItem3]]
 GUISetAccelerators($Form1_1_AccelTable)
 #EndRegion ### END Koda GUI section ###
 $hNotifyCustom = ControlGetHandle ($Form1_1, "", $NotifyCustom)
+
 $hExcelPath = ControlGetHandle ($Form1_1, "", $ExcelPath)
 Global $Checkboxes[3] = [ $CheckboxStefan, $CheckboxDennis, $CheckboxBenny]
 Loadini("../config.ini")
@@ -70,7 +74,7 @@ While 1
                                        Exit
                                Case $Start
                                        If (NOT SaveIni("../config.ini")) Then
-                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript ../Mimosa_Autorun.au3 "' & $Form1_1 & '"', "")
+                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript ../Mimosa_Autorun.au3 "' & $Form1_1 & '"', @ScriptDir)
                                        EndIf
                                Case $MenuItem2
                                        Local $file = FileSaveDialog ( "Select a location to save the configuration", "../", "Configurations (*.ini)" , "" , "config.ini")
@@ -81,6 +85,11 @@ While 1
                                Case $LoadExcel
                                        Local $file = FileOpenDialog ( "Select a loab book to work on", "../", "Excel file (*.xls;*.xlsx)")
                                        ControlSetText($Form1_1, "", $hExcelPath, $file)
+                               Case $ExcelOpen
+                                       $file = GUICtrlRead($ExcelPath)
+                                       If ($file) Then
+                                               ShellExecute ( $file )
+                                       EndIf
                        EndSwitch
                        if ( ControlGetHandle ($Form1_1,"",ControlGetFocus($Form1_1)) == $hNotifyCustom) Then
                                If ( ControlGetText ($Form1_1, "", $hNotifyCustom) == "(Optional)") Then
@@ -113,7 +122,8 @@ Func SaveIni($file)
                                                                        "ChipInstalled = " & GUICtrlRead ($ChipNumInput) & @LF & _
                                                                        "ExcelPath = " & GUICtrlRead ($ExcelPath) & @LF & _
                                                                        "SystemTemperature = " & GUICtrlRead($TempInput) & @LF & _
-                                                                       "RadSource = " & GUICtrlRead($RadInput) & @LF
+                                                                       "RadSource = " & GUICtrlRead($RadInput) & @LF & _
+                                                                       "Radiated = " & GUICtrlRead($RadiatedInput) & @LF
        If ( NOT IniWriteSection ( $file, "experimental setup", $config )) Then
                MsgBox(16, "Saving configuration", "Could not save to file " & @CRLF  & $file)
                Return 1
@@ -149,6 +159,7 @@ Func Loadini($file)
        ControlSetText($Form1_1, "", $ChipNumInput, IniRead($file, "experimental setup", "ChipInstalled", "5")); chip number currently mounted into the system
        ControlSetText($Form1_1, "", $TempInput, IniRead($file, "experimental setup", "SystemTemperature", "20")) ; current temperatur of the system
        ControlSetText($Form1_1, "", $RadInput, IniRead($file, "experimental setup", "RadSource", "none")) ; current radioactive source of the system
+       ControlSetText($Form1_1, "", $RadiatedInput, IniRead($file, "experimental setup", "Radiated", "")) ; current radioactive source of the system
        ControlSetText($Form1_1, "", $notifycustom, IniRead ( $file, "various",  "NotifyCustom", "(Optional)")); current chip generation in the system$PathExcel
        $notify = IniRead ( $file, "various",  "Notify", "1")
        $notify = _StringReverse(Integer2Binary(BitXOR($notify, 7))*4  + Integer2Binary ($notify)) ; 100 must be represented as 144 because of autoit convention. 4 means off for the checkboxes.
diff --git a/bot/MABS.lnk b/bot/MABS.lnk
new file mode 100755 (executable)
index 0000000..776d90a
Binary files /dev/null and b/bot/MABS.lnk differ
index 2d80b8cacfb1c0e1e99dc56450cb11c80c927323..1c58ae841359604aa89fbbd5154f073ebf68f8f4 100644 (file)
 #include "Chips/Mimosa32Ter.au3"
 #include "Chips/Mimosa34.au3"
 #include "Functions/BinaryIntegerConvert.au3"
-$programversion = "0.91"
+#include "Functions/EpochConvert.au3"
+$programversion = "0.94"
 
 $FileName = IniRead(@ScriptDir&"\config.ini", "experimental setup", "ExcelPath", "H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34.xls") ; read path to Excel file
 $systemtemp = IniRead(@ScriptDir&"\config.ini", "experimental setup", "SystemTemperature", "20") ; current temperatur of the system
 $chipversion = IniRead(@ScriptDir&"\config.ini", "experimental setup", "ChipVersion", "Mi34") ; current chip generation in the system
 $chipinstalled = IniRead(@ScriptDir&"\config.ini", "experimental setup", "ChipInstalled", "5") ; chip number currently mounted into the system
 $radSource = IniRead(@ScriptDir&"\config.ini", "experimental setup", "RadSource", "none") ; current radioactive source of the system
-
-$notify = IniRead(@ScriptDir&"\config.ini", "various", "Notify", "1") ; notifycode
-$notifycustom = IniRead(@ScriptDir&"\config.ini", "various", "NotifyCustom", "") ; chip number currently mounted into the system
+$radiated = IniRead(@ScriptDir&"\config.ini", "experimental setup", "Radiated", "") ; radiated chip
 
 $excelLineBegin = "46" ; Change this to the range of cells you want to be processed
 $excelLineEnd = "700"
@@ -59,7 +58,8 @@ Local $answer = MsgBox(4, "Run script?", "Preparing to do all runs in range " &
                "of file " & $FileName & " with " & @CRLF & _
                "Temperatur: " & $systemtemp & " C" & @CRLF & _
                "Radioactive source: " & $radSource & @CRLF & _
-               "Chip: " & $chipversion & " (" & $chipinstalled & ")" & @CRLF & _
+               "Chip: " & $chipversion & " (#" & $chipinstalled & ")" & @CRLF & _
+               "Radiated: " & $radiated & @CRLF & _
                "If you run this script, daq.exe will be closed and the current run aborted, proceed?")
 
 
@@ -84,7 +84,7 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                $totallexcelines = UBound($aArray, 2)
                $totalruns = 0
                For $run = 0 To UBound($aArray, 2) - 1
-                       If ($aArray[4][$run] == $systemtemp And $aArray[6][$run] == $chipinstalled And "Mi" & $aArray[2][$run] == $chipversion And $aArray[10][$run] == $radSource And $aArray[0][$run] == "") Then
+                       If ($aArray[4][$run] == $systemtemp And $aArray[6][$run] == $chipinstalled And "Mi" & $aArray[2][$run] == $chipversion And $aArray[10][$run] == $radSource And $aArray[12][$run] == $radiated And $aArray[0][$run] == "") Then
                                $totalruns = $totalruns + 1
                        EndIf
                Next
@@ -92,7 +92,7 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                If $answer = 7 Then
                        Exit
                EndIf
-               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Starting with ' & $totalruns & ' runs." "' & $notify & '" "' & $notifycustom & '"')
+               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Starting with ' & $totalruns & ' runs."', @ScriptDir)
                $completelog &= _NowCalc() & " Starting with " & $totalruns & " runs" & @CRLF
                Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
                If ProcessExists("daq.exe") = True Then
@@ -120,13 +120,13 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                        Sleep(500)
                        $i = $i + 1
                        If ($i > 20) Then
-                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3' & @ScriptDir & '\Functions\SendNtfctn.au3" "USB Boards could be not OK!" "' & $notify & '" "' & $notifycustom & '"')
+                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3' & @ScriptDir & '\Functions\SendNtfctn.au3" "USB Boards could be not OK!"', @ScriptDir)
                                MsgBox(16, "Message", "USB Boards could be not OK! Please check the Debug output.")
                                Exit
                        EndIf
                Until 0
                If StringRegExp($text, "[1-9]+ Errors") Then ; double check, will remove it later
-                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "USB Boards could be not OK!" "' & $notify & '" "' & $notifycustom & '"')
+                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "USB Boards could be not OK!"', @ScriptDir)
                        MsgBox(16, "Message", "USB Boards could be not OK! Please check the Debug output.")
                        Exit
                EndIf
@@ -137,14 +137,16 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                $hTab = ControlGetHandle($hWnd, "", "TPageControl1")
                $hCounter = ControlGetHandle($hWnd, "", "TEdit25")
                $aArray = 0
+               $estimate = 0
                $totalrealruns = 0
                $starttimetotal = _NowCalc()
+               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "0" "0"')
                For $run = 0 To $totallexcelines - 1
                        $currentrange = "A" & $excelLineBegin + $run & ":N" & $excelLineBegin + $run
                        $oExcelDoc = ObjGet($FileName) ; if doc was closed and object destroyed -> reopen it. A possibility to check if object exists would come handy here....
                        $oDocument = $oExcelDoc.Worksheets(1) ; We use the 'Default' worksheet
                        $currentline = $oDocument.range($currentrange).value
-                       If ($currentline[4][0] == $systemtemp And $currentline[6][0] == $chipinstalled And "Mi" & $currentline[2][0] == $chipversion And $currentline[10][0] == $radSource And $currentline[0][0] == "") Then
+                       If ($currentline[4][0] == $systemtemp And $currentline[6][0] == $chipinstalled And "Mi" & $currentline[2][0] == $chipversion And $currentline[10][0] == $radSource And $currentline[12][0] == $radiated And $currentline[0][0] == "") Then
                                $clock = $currentline[11][0] ; save needed clock
                                If $clock == "" Then
                                        $clock = "100"
@@ -200,7 +202,7 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                                Sleep(1000)
                                If (WinExists("Avertissement")) Then
                                        ;ControlClick("Avertissement", "", "TButton2")
-                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Skipped run ' & $runnum & ' could overwrite data." "' & $notify & '" "' & $notifycustom & '"')
+                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Skipped run ' & $runnum & ' could overwrite data."', @ScriptDir)
                                        $completelog &= _NowCalc() & " Skipped run " & $runnum & ", could overwrite data!" & @CRLF
                                        Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
                                        Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnum & ', could overwrite data!'')"')
@@ -229,7 +231,7 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                                                                $vref = $vref + SGN($diff) * 50
                                                EndSelect
                                                If ($vref > 1000 Or $vref < 300) Then
-                                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Fuctions\SendNtfctn.au3" "Skipped run ' & $runnum & ', vref value could not be set properly. Frequency: ' & $clock & '" "' & $notify & '" "' & $notifycustom & '"')
+                                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Fuctions\SendNtfctn.au3" "Skipped run ' & $runnum & ', vref value could not be set properly. Frequency: ' & $clock & '"', @ScriptDir)
                                                        $completelog &= _NowCalc() & " Skipped run " & $runnum & ", vref value could not be set properly. Frequency: " & $clock & @CRLF
                                                        Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
                                                        Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnum & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
@@ -254,7 +256,7 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                                                If ($j > 7) Then
                                                        ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
                                                        MsgBox(0, "Message", "VRef could not be set properly")
-                                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "VRef could not be set properly" "' & $notify & '" "' & $notifycustom & '"')
+                                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "VRef could not be set properly"', @ScriptDir)
                                                        $completelog &= _NowCalc() & " Skipped run " & $runnum & ", vref value could not be set properly. Frequency: " & $clock & @CRLF
                                                        Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
                                                        Exit
@@ -266,14 +268,26 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                                        $oldcounter = ControlGetText($hWnd, "", $hCounter)
                                        $percentCurrent = Round($oldcounter / $eventnum * 100, 2)
                                        $percentoverall = Round(($oldcounter / $eventnum / $totalruns + $totalrealruns / $totalruns) * 100, 2)
+                                       If Not $estimate And $percentoverall > 1 Then
+                                               $calcsecestimate = _DateDiff('s', $starttime, _NowCalc()) ; n for minites, s for seconds
+                                               $calcsecestimate = $calcsecestimate * 100 / $percentoverall
+                                               $calcmin = Int($calcsecestimate/60)
+                                               $calcsecestimate = Int($calcsecestimate)
+                                               $timeend = _Epoch_encrypt(_NowCalc()) + $calcsecestimate
+                                               $timeend = _Epoch_decrypt($timeend)
+                                               $completelog &= _NowCalc() & " Estimated runtime: " & $calcmin & " minutes. Estimated endtime: " & $timeend & @CRLF
+                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Estimated runtime: ' & $calcmin & ' minutes.  Will end at ' & $timeend & '"', @ScriptDir)
+                                               $estimate = 1
+                                       EndIf
                                        Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $percentoverall & '" "' & $percentCurrent & '"')
+                                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
                                        If Not Mod($i, 30) Then
-                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Percent done: ' & $percentoverall & ' (' & $totalrealruns & '/' & $totalruns & ')" "' & $notify & '" "' & $notifycustom & '"')
+                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Percent done: ' & $percentoverall & ' (' & $totalrealruns & '/' & $totalruns & ')"', @ScriptDir)
                                        EndIf
                                        Sleep(10000)
                                        If ($oldcounter == ControlGetText($hWnd, "", $hCounter)) Then
                                                ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
-                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Skipped run ' & $runnum & ', event counter froze." "' & $notify & '" "' & $notifycustom & '"')
+                                               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Skipped run ' & $runnum & ', event counter froze."', @ScriptDir)
                                                Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnum & ', event counter froze.'')"')
                                                $completelog &= _NowCalc() & " Skipped run " & $runnum & ", event counter froze." & @CRLF
                                                Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
@@ -308,17 +322,17 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well
                ShellExecuteWait("C:\Programme\PuTTY\plink.exe", "-ssh cerberus /home/maps/bin/vxi11_cmd 192.168.10.152 'OUTPut1:STATe Off'", "", "", @SW_HIDE)
                $calcmin = _DateDiff('s', $starttimetotal, _NowCalc()) ; n for minites, s for seconds
                $calcmin = Round($calcmin / 60, 2)
-               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "All runs (' & $totalrealruns & ') ended without errors in ' & $calcmin & ' minutes." "' & $notify & '" "' & $notifycustom & '"')
+               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "All runs (' & $totalrealruns & ') ended without errors in ' & $calcmin & ' minutes."', @ScriptDir)
                Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Sucess!'', ''All runs (' & $totalrealruns & ') ended without errors in ' & $calcmin & ' minutes.' & @CRLF & 'Please check the Excel sheet and the results for errors.'')"')
                $completelog &= _NowCalc() & " All runs (" & $totalrealruns & ") ended without errors in " & $calcmin & " minutes (" & Round($calcmin,2) & " hours)" & @CRLF
                Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
        Else
                MsgBox(16, "Excel Data Test", "Error: Could not retrieve data from cell range: " & $CellRange)
-               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not retrieve data from cell range" "' & $notify & '" "' & $notifycustom & '"')
+               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not retrieve data from cell range"', @ScriptDir)
        EndIf
 Else
        MsgBox(16, "Excel Data Test", "Error: Could not open " & $FileName & " as an Excel Object.")
-       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not open ' & $FileName & ' as an Excel Object." "' & $notify & '" "' & $notifycustom & '"')
+       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not open ' & $FileName & ' as an Excel Object."', @ScriptDir)
 EndIf
 $oExcelDoc = 0
 Func SGN($i)
diff --git a/bot/bot backup.rar b/bot/bot backup.rar
new file mode 100755 (executable)
index 0000000..60f624f
Binary files /dev/null and b/bot/bot backup.rar differ
index a6c0d455e831123a4d108f4ce99574ecb28684a6..2343493eb03604f1a408d95d5372cf7f6807b3b2 100755 (executable)
@@ -1,9 +1,10 @@
 [experimental setup]
 ChipVersion = Mi34
-ChipInstalled = 4
+ChipInstalled = 1
 ExcelPath = H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34.xls
-SystemTemperature = 20
+SystemTemperature = -20
 RadSource = Fe55
+Radiated = 1Mrad
 [various]
 Notify = 1
 NotifyCustom = (Optional)