]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
bot: updated bot software
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Wed, 25 Feb 2015 17:03:08 +0000 (18:03 +0100)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Wed, 25 Feb 2015 17:03:08 +0000 (18:03 +0100)
15 files changed:
bot/Chips/I2C_control_Mim32.au3
bot/Chips/daq_mi32a_v32(Host).vi.au3
bot/Functions/Header.au3
bot/Functions/MoveFolder.au3
bot/Functions/SaveToSQL.au3
bot/Functions/SendNtfctn.au3
bot/Functions/TemperatureControl.au3
bot/Functions/WaitForTemperature.au3
bot/Functions/Watchrun.au3
bot/Functions/mysql_functions.au3
bot/MABS.lnk
bot/Mimosa_Autorun_PXI.au3
bot/Mimosa_Autorun_USB.au3
bot/config_PXI.ini
bot/config_USB.ini

index 3c9cd82bef1b7a33f7e12ea4bb12f00782018acf..96dd3a7fda3778ba48b7e4dcbd13a8cb0e1632ff 100755 (executable)
@@ -3,7 +3,7 @@ Global $chipsoftware[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
 Global $system = "USB"
 Global $hWnd
 Global $hCounter
-$savedir = "F:\Mi32"
+$savedir = "O:\Mi34"
 Global $vref = 650 ; Initial vref, will be adjusted during runtime
 $temperaturebefore = -10000
 
@@ -90,3 +90,7 @@ Func TestSystem()
        WinWaitClose("Debug", 1000)
        Return 0
 EndFunc
+
+Func GetAverage()
+       Return ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
+EndFunc
index 41093df64d4095a0a1cd7f46fcdef853e4d91e7e..920d589d7b3b67e52407fb2e667bc06ab6648ee6 100755 (executable)
@@ -3,7 +3,7 @@ Global $chipsoftware[1] = ["daq_mi32a_v32(Host).vi"]
 Global $vi
 Global $system = "PXI"
 $savedir = "C:\data\currentrun"
-$storedir = "K:\Mi32"
+$storedir = "H:\Mi34"
 Global $vref = 1000 ; Initial vref, will be adjusted during runtime
 $temperaturebefore = -10000
 
@@ -30,6 +30,7 @@ Func ProgramMi()
        $vi.SetControlValue("Auto update", "1")
        Sleep(1000)
        $vi.SetControlValue(" Load conf file" & @LF & "Upd clk shift", "1")
+       Sleep(1000)
 EndFunc   ;==>ProgramMi
 
 Func SetMiParameter($matrix, $vref)
@@ -48,7 +49,11 @@ EndFunc   ;==>GetCounter
 
 Func StopRun()
     $vi.SetControlValue("Stop Run DUT", "1")
-    Sleep(100)
+    Sleep(200)
+    $vi.SetControlValue("Stop Run DUT", "0")
+    Sleep(1000)
+    $vi.SetControlValue("Stop Run DUT", "1")
+    Sleep(200)
     $vi.SetControlValue("Stop Run DUT", "0")
 EndFunc
 
index 3d9361c0e91d52ef7a0b5a2d2a99a5ca4d219475..5ad6aec56d86f7b8d824384b8b337628c05479f9 100755 (executable)
@@ -14,6 +14,7 @@ $programversion = "1.0"
 $excelLineBegin = "1100" ; Change this to the range of cells you want to be processed
 $excelLineEnd = "4000"
 Global $completelog = ""
+Global $comment = ""
 
 $lastexcelcell = "Q"
 $CellRange = "A" & $excelLineBegin & ":" & $lastexcelcell & $excelLineEnd
index 9ac589a9360235e4969676c977eceaa0e8510924..9e7962195b04c039eb70af3fdff2b432c598db80 100755 (executable)
@@ -4,7 +4,7 @@ If ($CmdLine[0] = 2) Then
        $returnval = MoveFolder($CmdLine[1], $CmdLine[2])
 ElseIf ($CmdLine[0] = 3) Then
        $returnval = MoveFolders($CmdLine[1], $CmdLine[2], $CmdLine[3])
-EndIf
+       EndIf
 ConsoleWrite($returnval) ;### Debug Console
 Exit $returnval
 
@@ -19,9 +19,8 @@ EndFunc   ;==>MoveFolder
 
 Func MoveFolders($src, $dst, $runnumber)
        For $i = 0 To 2
-               DirCopy ( $src  & $runnumber-$i, $dst & $runnumber-$i )
-               FileDelete($src & $runnumber-$i & "\*")
-               DirRemove( $src & $runnumber-$i )
+               DirCopy ( $src  & "\" & $runnumber-$i, $dst & "\" & $runnumber-$i )
+               DirRemove( $src & "\" & $runnumber-$i "\", 1)
        Next
        Return 0
 EndFunc   ;==>MoveFolder
\ No newline at end of file
index 10626fd55f5ede416abfcee7067ed2f710048737..381fe40c8b1d457f49125536ba39b1f528297658 100755 (executable)
@@ -4,11 +4,17 @@ $calchours = Round($calcsec / 3600, 2)
 If $temperaturechipstart = 100000 Then $temperaturechipstart = "NULL"
 If $temperaturechipend = 100000 Then $temperaturechipstart = "NULL"
 $datetime = @YEAR & "-" & @MON  & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC
-if (IsDeclared($storedir)) Then
-       $path = $storedir & "\\" & $runnumber
+if (IsDeclared("storedir")) Then
+       $path = StringReplace ( $storedir, "\", "\\") & "\\" & $runnumber
 Else
-       $path = $savedir & "\\" & $runnumber
+       $path = StringReplace ( $savedir, "\", "\\") & "\\" & $runnumber
+EndIf
+$path = StringReplace ( $path, "/", "//")
+If StringLen($comment) > 0 Then
+       UpdateDBwithErrorRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path, $comment)
+       $comment = ""
+Else
+       UpdateDBwithRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path)
 EndIf
 
-UpdateDBwithRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path)
 
index 400c3cc1845d5d5a1e3ef571374aa59c0bc586a2..8f5d9e8eee2bf4fdd69279c8013ade0344e796d8 100755 (executable)
@@ -31,7 +31,7 @@ Func SendNtfctn($text, $system)
        EndIf
 
        If $notifyDennis Then
-               $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bHCZjLkmISyt3lHjn-ym1Md9SymV5hKq05gxuPKXSMVm6e1rphU55sjiQNfQOIUpzoNqCU8kGXLwDJTRksMBRgk62dW5N_Go69dchFvfYqNIKKrvG26FGBPjKea06PU6IPxLPm0WWSM53k7QIQj0EZtMSNxpg&message=RadHard:%20System-" & $system & ":%20" & $text & "&password=mimosa")
+               $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bE1HCR2s8feQdqsd627pLSiuEAYdDd6iqJdopTdGm06cs45P5f6_Z6lh_ody3zUmm9saW77jUwXLNTwlpEQHT3oUyh-vHfZmKptg3wdBMtYUr4kWqXhRbs3g0i36Y33-m4LFZb_toVrOn90J0Dkes5eMUTXaHu9Ko1pIUZgsqQ48whM3dY&message=RadHard:%20System-" & $system & ":%20" & $text & "&password=Mimosasasa")
                $oHTTP.Send()
        EndIf
 
index f882ae8a4e2ed413417bd1d0792b467e591f6ed9..7f82355c0de3026a1cb4d558b543e9ebb346aedc 100755 (executable)
@@ -21,7 +21,8 @@ Func GetTemperatureCooling($system)
        WITH $oHTTP
                Switch $system
                        Case "USB"
-            .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling")
+            ;.Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling")
+            .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling")
                        Case "PXI"
             .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling")
                EndSwitch
@@ -87,7 +88,8 @@ Func SetTemperature($system, $temperature)
                WITH $oHTTP
                        Switch $system
                        Case "USB"
-            .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling&" & $command)
+            ;.Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling&" & $command)
+            .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling&" & $command)
                        Case "PXI"
             .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling&" & $command)
                        EndSwitch
index f3f7b89703414df86e8c6d4c1bb6dcb6e0705f57..8bc911fceefa950cb8dc4559f0a9a5f63c254497 100755 (executable)
@@ -6,6 +6,7 @@ EndIf
 $tempwaiti = 0 ; set the 5 minutes wait counter to zero if it reaches 6 -> 30 minutes passed
 While Not $tempcorrent
        $currenttemp = GetTemperatureForSure($system)
+       ;$currenttemp = 100000 ; delete me TODO
        If $currenttemp == 100000 Then
                RefreshGUISendNtfct("Could not get temperature. Will assume it is set correctly. Please check manually later.")
                $tempcorrent = True
@@ -43,4 +44,5 @@ If $TempWaitFor > 0 Then
        Sleep($TempWaitFor * 60 * 1000) ; wait for user specified minutes
 EndIf
 $temperaturebefore = $TempCooling ; if next run has the same needed temperature as this run, dont check for cooling water temperature, see the first lines of this file for details
-$temperaturechipstart = GetTemperatureForSure("Chip" & $system)
\ No newline at end of file
+$temperaturechipstart = GetTemperatureForSure("Chip" & $system)
+$temperaturechipend = $temperaturechipstart
\ No newline at end of file
index 66c091fec917b8d853778bd3ff4a7ecc3c8ba01a..3c39d01b676ecba7949c3b679de5a05c4faa87bf 100755 (executable)
@@ -24,14 +24,20 @@ Do
        EndIf
        Sleep(10000)
        If ($oldcounter == GetCounter()) Then
-               StopRun()
-               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Skipped run ' & $runnumber & ', event counter froze."', @ScriptDir)
-               Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', event counter froze.'')"')
-               $completelog &= _NowCalc() & " Skipped run " & $runnumber & ", event counter froze." & @CRLF
-               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
-               FileDelete($savedir & "\" & $runnumber & "\*")
-               DirRemove($savedir & "\" & $runnumber)
-               ContinueLoop 2
+               Sleep(10000)
+               If ($oldcounter == GetCounter()) Then
+                       StopRun()
+                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Skipped run ' & $runnumber & ', event counter froze."', @ScriptDir)
+                       Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', event counter froze.'')"')
+                       $completelog &= _NowCalc() & " Skipped run " & $runnumber & ", event counter froze." & @CRLF
+                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
+                       $comment = "Event counter froze"
+                       #include "SaveToSQL.au3"
+;~                     UpdateDBwithErrorRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path, "Event counter froze")
+;~                     FileDelete($savedir & "\" & $runnumber & "\*")
+;~                     DirRemove($savedir & "\" & $runnumber)
+                       ContinueLoop 2
+               EndIf
        EndIf
        $i = $i + 1
 Until (GetCounter() > $events)
index 8eeafbfd18a31c4ff1f6ae544a42b02b67c06f84..08d996a0df3364fc6756e8240ff35a8d281a7568 100755 (executable)
@@ -43,6 +43,26 @@ Func UpdateDBwithRun($id, $datetime, $temperaturechipstart, $temperaturechipend,
        _MySQLEnd($sql)
 EndFunc
 
+Func UpdateDBwithErrorRun($id, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path, $comment)
+       $sql = GetSQLConnection()
+
+       $sqlstring = "UPDATE labbook SET " & _
+                                               "datetime='" & $datetime & "', " & _
+                                               "TempChipStart=" & $temperaturechipstart & ", " & _
+                                               "TempChipEnd=" & $temperaturechipend & ", " & _
+                                               "VRef=" & $vref & ", " & _
+                                               "Runtime=" & $calcsec & ", " & _
+                                               "MABSV='" & $programversion & "', " & _
+                                               "StorePath='" & $path & "', " & _
+                                               "MABS_comment='" & $comment & "' " & _
+                                               "WHERE id=" & $id
+
+       ConsoleWrite($sqlstring)
+       _Query($sql, $sqlstring)
+
+       _MySQLEnd($sql)
+EndFunc
+
 Func ReturnNumSuitRuns($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $System, $Clock=0)
        $sql = GetSQLConnection()
 
@@ -50,8 +70,8 @@ Func ReturnNumSuitRuns($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $Sy
        $sqlstring = "ChipGen='" & $ChipGen     & "' AND " & _
                              "ChipNum='" & $ChipNum    & "' AND " & _
                              "RadiationSource='" & $RadiationSource    & "' AND " & _
-                             "ChipRadiation=" & $ChipRadiation & " AND " & _
                              "System='" & $System & "' AND " & _
+                             "MABS_comment IS NULL AND " & _
                              "(datetime='1970-01-01 00:00:00' OR datetime IS NULL OR datetime='0000-00-00 00:00:00')"
        If $clock <> 0 Then $sqlstring = $sqlstring & " AND Clock=" & $Clock
 
@@ -59,6 +79,7 @@ Func ReturnNumSuitRuns($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $Sy
        _MySQLEnd($sql)
        ConsoleWrite("ReturnNumSuitRuns: " & $number & @CRLF)
        Return $number
+;                            "'ChipRadiation Ion'=" & $ChipRadiation   & " AND " & _
 EndFunc
 
 
@@ -70,8 +91,9 @@ Func ReturnSuitRun($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $System
        $sqlstring = $sqlstring & "ChipGen='" & $ChipGen        & "' AND "
        $sqlstring = $sqlstring & "ChipNum='" & $ChipNum        & "' AND "
        $sqlstring = $sqlstring & "RadiationSource='" & $RadiationSource        & "' AND "
-       $sqlstring = $sqlstring & "ChipRadiation=" & $ChipRadiation     & " AND "
+       ;$sqlstring = $sqlstring & "'ChipRadiation Ion'=" & $ChipRadiation      & " AND "
        $sqlstring = $sqlstring & "System='" & $System & "' AND "
+       $sqlstring = $sqlstring & "MABS_comment IS NULL AND "
        $sqlstring = $sqlstring & "(datetime='1970-01-01 00:00:00' OR datetime IS NULL OR datetime='0000-00-00 00:00:00')"
        If $clock <> 0 Then $sqlstring = $sqlstring & " AND Clock=" & $Clock
        $sqlstring = $sqlstring & " LIMIT 1"
index 776d90af6f2d5f4ae5b43d4ef3800af3cb711f86..96f43e763df3f356b12a469a1184fe6a2f6c2412 100755 (executable)
Binary files a/bot/MABS.lnk and b/bot/MABS.lnk differ
index b83eb6b43919a555b6fe57d353aeb0d77c7487df..9084ef1acd664540695f6f5517870e5583ba23ad 100755 (executable)
@@ -46,7 +46,6 @@ If (Not @error) Then ; Check again if everything went well
                        #include "Functions\WaitForTemperature.au3"
                        SetMiParameter($matrix, $vref)
                        ProgramMi()
-                       Sleep(200)
                        $vi.SetControlValue("Run directory", $savedir) ; get directorys to save file to
                        $vi.SetControlValue("Run Number", $runnumber)
                        $vi.SetControlValue("Events number in run", $events)
@@ -80,7 +79,7 @@ If (Not @error) Then ; Check again if everything went well
                                                Case Else
                                                        $vref = $vref + SGN($diff) * 5
                                        EndSelect
-                                       If ($vref > 1500 Or $vref < 300) Then
+                                       If ($vref > 1500 Or $vref < 0) Then
                                                StopRun()
                                                RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Frequency: " & $clock)
                                                Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1500), please check manually!'')"')
index 4a841bbfe1923ebe276814c0047ba8407e684d6b..e9e14c58c4bc50276c16d9d0e7d6b97d74477a91 100755 (executable)
@@ -61,14 +61,14 @@ EndFunc   ;==>_ProgramMi
 Func _TestSystem()
        If $chipversion <> "Mi29" Then
                TestSystem()
-       Else ; mimosa 20 ausnahme
+       Else ; mimosa 29 ausnahme
                Call($chipversion & "_TestSystem")
        EndIf
 EndFunc   ;==>_TestSystem
 Func _GetAverage($hWnd)
        If $chipversion <> "Mi29" Then
-               Return GetAverage($hWnd)
-       Else ; mimosa 20 ausnahme
+               Return GetAverage()
+       Else ; mimosa 29 ausnahme
                Return Call($chipversion & "_GetAverage", $hWnd)
        EndIf
 EndFunc   ;==>_GetAverage
@@ -116,7 +116,13 @@ If (Not @error) Then ; Check again if everything went well
                        ProgramMi()
                        _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
                        Sleep(200)
-                       $savedir = ControlGetText($hWnd, "", "TEdit24") ; get directorys to save file to
+                       ;$savedir = ControlGetText($hWnd, "", "TEdit24") ; get directorys to save file to
+                       ;GUICtrlSetState($hWnd, "", "TCheckBox6", "")
+                       ControlSetText($hWnd, "", "TEdit24", "")
+                       Sleep(100)
+                       ControlFocus($hWnd, "", "TEdit24")
+                       ControlSend($hWnd, "", "TEdit24", $savedir)
+                       Sleep(100)
                        ControlSetText($hWnd, "", "TEdit23", "")
                        Sleep(100)
                        ControlFocus($hWnd, "", "TEdit23")
@@ -134,6 +140,8 @@ If (Not @error) Then ; Check again if everything went well
                        Sleep(1000)
                        If (WinExists("Avertissement")) Then
                                RefreshGUISendNtfct("Skipped run " & $runnumber & " could overwrite data.")
+                               $comment = "Skipped: Could overwrite data."
+                               #include "Functions/SaveToSQL.au3"
                                Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', could overwrite data!'')"')
                                ControlClick("Avertissement", "", "TButton1")
                                ContinueLoop
index 936fa7d1181329da287fc0cb46d2f44f85ff4a83..36d77a0ede0a8fb4dcea5404ceb892ebdef4ca8b 100755 (executable)
@@ -1,9 +1,9 @@
 [experimental setup]
 ChipVersion = Mi34
-ChipInstalled = 3
+ChipInstalled = 5
 ExcelPath = H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34 - Neu2.xls
 RadSource = Fe55
-Radiated = 3
+Radiated = 0
 [various]
-Notify = 3
+Notify = 1
 NotifyCustom = (Optional)
index 214239faee568e0e5b53179132eec53f51dceacf..7d8e38835694a678505734627be134653387104a 100755 (executable)
@@ -1,9 +1,9 @@
 [experimental setup]
-ChipVersion = Mi32Ter
-ChipInstalled = 5d
+ChipVersion = Mi34
+ChipInstalled = 23
 ExcelPath = H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34 - Neu.xls
-RadSource = none
-Radiated = 0
+RadSource = Sr90
+Radiated = 
 [various]
 Notify = 3
-NotifyCustom = (Optional)
+NotifyCustom = doering@physik.uni-frankfurt.de