]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Analyzer: Share before Tobis checkout
authorBenjamin Linnik <blinnik@jspc61.x-matter.uni-frankfurt.de>
Fri, 7 Oct 2016 13:50:14 +0000 (15:50 +0200)
committerBenjamin Linnik <blinnik@jspc61.x-matter.uni-frankfurt.de>
Fri, 7 Oct 2016 13:50:14 +0000 (15:50 +0200)
16 files changed:
bot/Chips/FSBB.au3
bot/Chips/I2C_control_FSBB.au3
bot/Chips/I2C_control_Mim32.au3
bot/Chips/Mimosa19.au3
bot/Chips/Mimosa29.au3
bot/Chips/Mimosa32.au3
bot/Chips/Mimosa32Ter.au3
bot/Chips/Mimosa34.au3
bot/Chips/Pegasus.au3
bot/Functions/Header.au3
bot/Functions/ReadAndSaveSQLParameters.au3
bot/Functions/Watchrun.au3
bot/Mimosa_Autorun_Pegasus.au3 [deleted file]
bot/Mimosa_Autorun_USB.au3
bot/config_PXI.ini
bot/config_USB.ini

index ef4f48f8718f2651e42eaaab2891d473d7c34ef4..9aecf73db3baaf106fac089d45e648244aa42cd5 100755 (executable)
@@ -1,40 +1,84 @@
 #include <I2C_control_FSBB.au3>
-Global $Mi34_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
+Global $FSBB_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
 
-Func Mi34_GotoMiTab()
-       GotoTab(7) ; Go to "Mi34" tab
+Func FSBB_GotoMiTab()
+       _GotoTab(7) ; Go to "Mi34" tab
 EndFunc   ;==>Mi34_GotoMiTab
 
-Func Mi34_SelectBoard()
-       GotoTab(0) ; Go to first tab
+Func FSBB_SelectBoard()
+       _GotoTab(0) ; Go to first tab
        ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa34]", "Check")
 EndFunc   ;==>Mi34_SelectBoard
 
-Func Mi34_GetVref()
-       return ControlGetText($chipsoftware[0], "", $Mi34_buttons[2])
+Func FSBB_GetVref()
+       return ControlGetText($chipsoftware[0], "", $FSBB_buttons[2])
 EndFunc   ;==>Mi34_GetVref
 
-Func Mi34_SetVref($vref)
-       ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
+Func FSBB_SetVref($vref)
+       ControlSetText($chipsoftware[0], "", $FSBB_buttons[2], $vref)
 EndFunc   ;==>Mi34_SetVref
 
-Func Mi34_SetMiParameter($matrix, $vref)
-       ControlFocus($chipsoftware[0], "", $Mi34_buttons[0])
-       ControlSetText($chipsoftware[0], "", $Mi34_buttons[0], "")
+Func FSBB_SetMiParameter($matrix, $vref)
+       ControlFocus($chipsoftware[0], "", $FSBB_buttons[0])
+       ControlSetText($chipsoftware[0], "", $FSBB_buttons[0], "")
        Sleep(100)
-       ControlSend($chipsoftware[0], "", $Mi34_buttons[0], $matrix)
+       ControlSend($chipsoftware[0], "", $FSBB_buttons[0], $matrix)
        Sleep(100)
        ;Send($matrix)
        ;ControlCommand($chipsoftware[0], "", "[TEXT:Clamp Enabled]", "Uncheck")
        ;ControlCommand($chipsoftware[0], "", "[TEXT:High (Default)]", "Check")
-       ControlFocus($chipsoftware[0], "", $Mi34_buttons[1])
-       ControlSetText($chipsoftware[0], "", $Mi34_buttons[1], "")
+       ControlFocus($chipsoftware[0], "", $FSBB_buttons[1])
+       ControlSetText($chipsoftware[0], "", $FSBB_buttons[1], "")
        Sleep(100)
-       ControlSetText($chipsoftware[0], "", $Mi34_buttons[1], "1")
+       ControlSetText($chipsoftware[0], "", $FSBB_buttons[1], "1")
        Sleep(100)
-       ControlFocus($chipsoftware[0], "", $Mi34_buttons[2])
-       ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], "")
+       ControlFocus($chipsoftware[0], "", $FSBB_buttons[2])
+       ControlSetText($chipsoftware[0], "", $FSBB_buttons[2], "")
        Sleep(100)
-       ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
+       ControlSetText($chipsoftware[0], "", $FSBB_buttons[2], $vref)
        Sleep(100)
 EndFunc   ;==>Mi34_SetMiParameter
+
+Func FSBB_CheckWindowExist() ; Check if Mimosa window exists
+       CheckWindowExist_I2CFSBB()
+EndFunc   ;==>CheckWindowExist
+
+Func FSBB_CheckIfBoardOK()
+       CheckIfBoardOK_I2CFSBB()
+EndFunc   ;==>CheckIfBoardOK
+
+Func FSBB_GotoTab($tabnum)
+       GotoTab_I2CFSBB($tabnum)
+EndFunc   ;==>GotoTab
+
+Func FSBB_GotoDebugTab()
+       GotoDebugTab_I2CFSBB()
+EndFunc   ;==>GotoDebugTab
+
+Func FSBB_ProgramMi()
+       ProgramMi_I2CFSBB()
+EndFunc   ;==>ProgramMi
+
+Func FSBB_GetCounter()
+       GetCounter_I2CFSBB()
+EndFunc   ;==>GetCounter
+
+Func FSBB_StopRun()
+       StopRun_I2CFSBB()
+EndFunc
+
+Func FSBB_StartRun()
+       StartRun_I2CFSBB()
+EndFunc
+
+Func FSBB_TestSystem()
+       TestSystem_I2CFSBB()
+EndFunc
+
+Func FSBB_GetAverage($hWnd)
+       GetAverage_I2CFSBB($hWnd)
+EndFunc
+
+Func Pegasus_SetClockType($clock)
+       SetClockType_I2CFSBB($clock)
+EndFunc
\ No newline at end of file
index d4ea35d9a616bc6b68de08bcdbd4ef6909fc7c26..7235aa85542960d4fd60e0da2dccfc6b0a891fb2 100755 (executable)
@@ -1,24 +1,18 @@
 #include-once
-Global $chipsoftware[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-$savedir = "O:\FSBB"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
+Global $chipsoftware_I2CFSBB[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
 
-Func CheckWindowExist() ; Check if Mimosa window exists
-       If WinExists($chipsoftware[0]) = False Then
+Func CheckWindowExist_I2CFSBB() ; Check if Mimosa window exists
+       If WinExists($chipsoftware_I2CFSBB[0]) = False Then
                Run("C:\CCMOS_SCTRL\MIMOSA34\I2C_ms_gui_labo_Debug.bat", "C:\CCMOS_SCTRL\MIMOSA34\")
-               WinWait($chipsoftware[0])
+               WinWait($chipsoftware_I2CFSBB[0])
        EndIf
        WinWait("I2C control Software for Mimosa32")
 EndFunc   ;==>CheckWindowExist
 
-Func CheckIfBoardOK()
-       ControlClick($chipsoftware[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
+Func CheckIfBoardOK_I2CFSBB()
+       ControlClick($chipsoftware_I2CFSBB[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
        Local $i = 0
-       While(ControlGetText($chipsoftware[0], "", "TEdit6") <> "Target Board OK")
+       While(ControlGetText($chipsoftware_I2CFSBB[0], "", "TEdit6") <> "Target Board OK")
                If($i > 20) Then
                        MsgBox(16, "Message", "Mimosa board could not be polled, please check if board is connected properly.")
                        Exit
@@ -26,39 +20,39 @@ Func CheckIfBoardOK()
                $i = $i + 1
                Sleep(500)
        WEnd
-       ControlClick($chipsoftware[0], "", "[TEXT:Active;CLASS:TButton]")
+       ControlClick($chipsoftware_I2CFSBB[0], "", "[TEXT:Active;CLASS:TButton]")
 EndFunc   ;==>CheckIfBoardOK
 
-Func GotoTab($tabnum)
-       WinWait($chipsoftware[0])
-       Local $hWnd = WinGetHandle($chipsoftware[0])
-       Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware[1])
+Func GotoTab_I2CFSBB($tabnum)
+       WinWait($chipsoftware_I2CFSBB[0])
+       Local $hWnd = WinGetHandle($chipsoftware_I2CFSBB[0])
+       Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware_I2CFSBB[1])
        _GUICtrlTab_SetCurFocus($hTab, $tabnum) ; Go to "$tabnum" tab
        Sleep(100)
 EndFunc   ;==>GotoTab
 
-Func GotoDebugTab()
-       GotoTab(9)
+Func GotoDebugTab_I2CFSBB()
+       _GotoTab(9)
 EndFunc   ;==>GotoDebugTab
 
-Func ProgramMi()
-       ControlClick($chipsoftware[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
+Func ProgramMi_I2CFSBB()
+       ControlClick($chipsoftware_I2CFSBB[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
        Sleep(1000)
 EndFunc   ;==>ProgramMi
 
-Func GetCounter()
+Func GetCounter_I2CFSBB()
    Return ControlGetText($hWnd, "", $hCounter)
 EndFunc   ;==>GetCounter
 
-Func StopRun()
+Func StopRun_I2CFSBB()
        ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
 EndFunc
 
-Func StartRun()
+Func StartRun_I2CFSBB()
        ControlClick($hWnd, "", "[TEXT:Start Run;CLASS:TButton]")
 EndFunc
 
-Func TestSystem()
+Func TestSystem_I2CFSBB()
        WinWait("Debug")
        ControlClick("Debug", "", "[TEXT:Messages Clear]")
        Sleep(100)
@@ -91,6 +85,6 @@ Func TestSystem()
        Return 0
 EndFunc
 
-Func GetAverage()
+Func GetAverage_I2CFSBB()
        Return ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
 EndFunc
index 0808dff4066777a7c09f62e1cf45482a7f6e537f..32a0fec97d705e4f4972aae2d763780a418fd8f8 100755 (executable)
@@ -1,25 +1,17 @@
 #include-once
-Global $chipsoftware[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-$savedir = "F:\currentrun"
-$storedir = "O:\Mi34"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
+Global $chipsoftware_I2CMi32[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
 
-Func CheckWindowExist() ; Check if Mimosa window exists
-       If WinExists($chipsoftware[0]) = False Then
+Func CheckWindowExist_I2CMi32() ; Check if Mimosa window exists
+       If WinExists($chipsoftware_I2CMi32[0]) = False Then
                Run("C:\CCMOS_SCTRL\MIMOSA34\I2C_ms_gui_labo_Debug.bat", "C:\CCMOS_SCTRL\MIMOSA34\")
-               WinWait($chipsoftware[0])
+               WinWait($chipsoftware_I2CMi32[0])
        EndIf
-       WinWait("I2C control Software for Mimosa32")
 EndFunc   ;==>CheckWindowExist
 
-Func CheckIfBoardOK()
-       ControlClick($chipsoftware[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
+Func CheckIfBoardOK_I2CMi32()
+       ControlClick($chipsoftware_I2CMi32[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
        Local $i = 0
-       While(ControlGetText($chipsoftware[0], "", "TEdit6") <> "Target Board OK")
+       While(ControlGetText($chipsoftware_I2CMi32[0], "", "TEdit6") <> "Target Board OK")
                If($i > 20) Then
                        MsgBox(16, "Message", "Mimosa board could not be polled, please check if board is connected properly.")
                        Exit
@@ -27,39 +19,39 @@ Func CheckIfBoardOK()
                $i = $i + 1
                Sleep(500)
        WEnd
-       ControlClick($chipsoftware[0], "", "[TEXT:Active;CLASS:TButton]")
+       ControlClick($chipsoftware_I2CMi32[0], "", "[TEXT:Active;CLASS:TButton]")
 EndFunc   ;==>CheckIfBoardOK
 
-Func GotoTab($tabnum)
-       WinWait($chipsoftware[0])
-       Local $hWnd = WinGetHandle($chipsoftware[0])
-       Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware[1])
+Func GotoTab_I2CMi32($tabnum)
+       WinWait($chipsoftware_I2CMi32[0])
+       Local $hWnd = WinGetHandle($chipsoftware_I2CMi32[0])
+       Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware_I2CMi32[1])
        _GUICtrlTab_SetCurFocus($hTab, $tabnum) ; Go to "$tabnum" tab
        Sleep(100)
 EndFunc   ;==>GotoTab
 
-Func GotoDebugTab()
-       GotoTab(9)
+Func GotoDebugTab_I2CMi32()
+       _GotoTab(9)
 EndFunc   ;==>GotoDebugTab
 
-Func ProgramMi()
-       ControlClick($chipsoftware[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
+Func ProgramMi_I2CMi32()
+       ControlClick($chipsoftware_I2CMi32[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
        Sleep(1000)
 EndFunc   ;==>ProgramMi
 
-Func GetCounter()
+Func GetCounter_I2CMi32()
    Return ControlGetText($hWnd, "", $hCounter)
 EndFunc   ;==>GetCounter
 
-Func StopRun()
+Func StopRun_I2CMi32()
        ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
 EndFunc
 
-Func StartRun()
+Func StartRun_I2CMi32()
        ControlClick($hWnd, "", "[TEXT:Start Run;CLASS:TButton]")
 EndFunc
 
-Func TestSystem()
+Func TestSystem_I2CMi32()
        WinWait("Debug")
        ControlClick("Debug", "", "[TEXT:Messages Clear]")
        Sleep(100)
@@ -92,6 +84,14 @@ Func TestSystem()
        Return 0
 EndFunc
 
-Func GetAverage()
+Func GetAverage_I2CMi32($hWnd)
        Return ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
 EndFunc
+
+Func SetClockType_I2CMi32($clock)
+       ControlCommand($chipsoftware_I2CMi32[0], "", "[TEXT:Intern]", "Check")
+       If ($clock <> "100") Then
+               SetChipClock($clock)
+               ControlCommand($chipsoftware_I2CMi32[0], "", "[TEXT:Extern]", "Check")
+       EndIf
+EndFunc
index fd3c12659cf172f3a7a4abce0f1dfa555bde7929..af6605a9af80a4a0c1bdc83a47c2110949e3e1dd 100755 (executable)
@@ -1,14 +1,13 @@
 #include-once
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-Global $vref = -1 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
 
 Func Mi19_SelectBoard()
 
 EndFunc   ;==>Mi34_SelectBoard
 
+Func Mi19_GotoMiTab()
+
+EndFunc   ;==>Mi34_GotoMiTab
+
 Func Mi19_SetMiParameter($matrix, $vref)
        Sleep(1000)
 ;~     $savedir = "F:\currentrun" ; overwrite store path set in other Mimosa files read in by include
@@ -58,3 +57,47 @@ EndFunc   ;==>Mi19_GetVref
 Func Mi19_SetVref($vref)
 
 EndFunc   ;==>Mi19_SetVref
+
+Func Mi19_GetAverage($hWnd)
+       Return 2000 ; fake a good vref
+EndFunc
+
+Func Mi19_CheckWindowExist() ; Check if Mimosa window exists
+
+EndFunc   ;==>CheckWindowExist
+
+Func Mi19_CheckIfBoardOK()
+
+EndFunc   ;==>CheckIfBoardOK
+
+Func Mi19_GotoTab($tabnum)
+
+EndFunc   ;==>GotoTab
+
+Func Mi19_GotoDebugTab()
+
+EndFunc   ;==>GotoDebugTab
+
+Func Mi19_ProgramMi()
+
+EndFunc   ;==>ProgramMi
+
+Func Mi19_GetCounter()
+       Return GetCounter_I2CMi32()
+EndFunc   ;==>GetCounter
+
+Func Mi19_StopRun()
+
+EndFunc
+
+Func Mi19_StartRun()
+
+EndFunc
+
+Func Mi19_SetClockType($clock)
+
+EndFunc
+
+Func Mi19_GetVrefDelta()
+       Return 50 ; not used, Mi19 has no DAQ control of Vref, use screwdiver
+EndFunc
\ No newline at end of file
index 91a2f1aceade10d18eb07aa7d16fa073e9dc3129..0330f71f8cbd462cb5a92a2f4e9d7a19a5efd512 100755 (executable)
@@ -1,9 +1,3 @@
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-$savedir = "F:\Mi29"
-Global $vref = -1 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
 
 Func Mi29_GotoMiTab()
 
@@ -71,3 +65,44 @@ EndFunc
 Func Mi29_GetAverage($hWnd)
        Return 2000 ; fake a good vref
 EndFunc
+
+Func Mi29_CheckWindowExist() ; Check if Mimosa window exists
+
+EndFunc   ;==>CheckWindowExist
+
+Func Mi29_CheckIfBoardOK()
+
+EndFunc   ;==>CheckIfBoardOK
+
+Func Mi29_GotoTab($tabnum)
+
+EndFunc   ;==>GotoTab
+
+Func Mi29_GotoDebugTab()
+
+EndFunc   ;==>GotoDebugTab
+
+Func Mi29_ProgramMi()
+
+EndFunc   ;==>ProgramMi
+
+Func Mi29_GetCounter()
+       Return GetCounter_I2CMi32()
+EndFunc   ;==>GetCounter
+
+Func Mi29_StopRun()
+
+EndFunc
+
+Func Mi29_StartRun()
+
+EndFunc
+
+Func Mi29_SetClockType($clock)
+
+EndFunc
+
+Func Mi29_GetVrefDelta()
+       Return 50
+EndFunc
+
index 4001396255ffb47ec3078e5b1669be2a2f2927bf..d3aa8a2a36b36b9242c90c112fac75380afa292f 100755 (executable)
@@ -2,11 +2,11 @@
 Global $Mi32_buttons[3] = ["Edit2", "TCSpinEdit4", "TEdit15"]
 
 Func Mi32_GotoMiTab()
-       GotoTab(1) ; Go to "Mi32 A" tab
+       _GotoTab(1) ; Go to "Mi32 A" tab
 EndFunc   ;==>Mi32_GotoMiTab
 
 Func Mi32_SelectBoard()
-       GotoTab(0) ; Go to first tab
+       _GotoTab(0) ; Go to first tab
        ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa32]", "Check")
 EndFunc   ;==>Mi32_SelectBoard
 
@@ -38,3 +38,51 @@ Func Mi32_SetMiParameter($matrix, $vref)
        ControlSetText($chipsoftware[0], "", $Mi32_buttons[2], $vref)
        Sleep(100)
 EndFunc   ;==>Mi32_SetMiParameter
+
+Func Mi32_CheckWindowExist() ; Check if Mimosa window exists
+       CheckWindowExist_I2CMi32()
+EndFunc   ;==>CheckWindowExist
+
+Func Mi32_CheckIfBoardOK()
+       CheckIfBoardOK_I2CMi32()
+EndFunc   ;==>CheckIfBoardOK
+
+Func Mi32_GotoTab($tabnum)
+       GotoTab_I2CMi32($tabnum)
+EndFunc   ;==>GotoTab
+
+Func Mi32_GotoDebugTab()
+       GotoDebugTab_I2CMi32()
+EndFunc   ;==>GotoDebugTab
+
+Func Mi32_ProgramMi()
+       ProgramMi_I2CMi32()
+EndFunc   ;==>ProgramMi
+
+Func Mi32_GetCounter()
+       Return GetCounter_I2CMi32()
+EndFunc   ;==>GetCounter
+
+Func Mi32_StopRun()
+       StopRun_I2CMi32()
+EndFunc
+
+Func Mi32_StartRun()
+       StartRun_I2CMi32()
+EndFunc
+
+Func Mi32_TestSystem()
+       TestSystem_I2CMi32()
+EndFunc
+
+Func Mi32_GetAverage($hWnd)
+       Return GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Mi32_SetClockType($clock)
+       SetClockType_I2CMi32($hWnd)
+EndFunc
+
+Func Mi32_GetVrefDelta()
+       Return 50
+EndFunc
\ No newline at end of file
index f6aef6930aeed7891db8f8cd1227a5aa12d1108f..8497e35d261748d2b7095a4f2466eefce35705da 100755 (executable)
@@ -2,11 +2,11 @@
 Global $Mi32Ter_buttons[3] = ["Edit2", "TCSpinEdit4", "TEdit27"]
 
 Func Mi32Ter_GotoMiTab()
-       GotoTab(3) ; Go to "Mi32 Ter A" tab
+       _GotoTab(3) ; Go to "Mi32 Ter A" tab
 EndFunc   ;==>Mi32Ter_GotoMiTab
 
 Func Mi32Ter_SelectBoard()
-       GotoTab(0) ; Go to first tab
+       _GotoTab(0) ; Go to first tab
        ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa32Ter]", "Check")
 EndFunc   ;==>Mi32Ter_SelectBoard
 
@@ -38,3 +38,52 @@ Func Mi32Ter_SetMiParameter($matrix, $vref)
        ControlSetText($chipsoftware[0], "", $Mi32Ter_buttons[2], $vref)
        Sleep(100)
 EndFunc   ;==>Mi32Ter_SetMiParameter
+
+Func Mi32Ter_CheckWindowExist_I2CMi32() ; Check if Mimosa window exists
+       CheckWindowExist_I2CMi32()
+EndFunc   ;==>CheckWindowExist
+
+Func Mi32Ter_CheckIfBoardOK_I2CMi32()
+        CheckIfBoardOK_I2CMi32()
+EndFunc   ;==>CheckIfBoardOK
+
+Func Mi32Ter_GotoTab_I2CMi32($tabnum)
+       GotoTab_I2CMi32($tabnum)
+EndFunc   ;==>GotoTab
+
+Func Mi32Ter_GotoDebugTab_I2CMi32()
+       GotoDebugTab_I2CMi32()
+EndFunc   ;==>GotoDebugTab
+
+Func Mi32Ter_ProgramMi_I2CMi32()
+       ProgramMi_I2CMi32()
+EndFunc   ;==>ProgramMi
+
+Func Mi32Ter_GetCounter_I2CMi32()
+       GetCounter_I2CMi32()
+EndFunc   ;==>GetCounter
+
+Func Mi32Ter_StopRun_I2CMi32()
+       StopRun_I2CMi32()
+EndFunc
+
+Func Mi32Ter_StartRun_I2CMi32()
+       StartRun_I2CMi32()
+EndFunc
+
+Func Mi32Ter_TestSystem_I2CMi32()
+       TestSystem_I2CMi32()
+EndFunc
+
+Func Mi32Ter_GetAverage_I2CMi32($hWnd)
+       Return GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Mi32Ter_SetClockType($clock)
+       SetClockType_I2CMi32($clock)
+EndFunc
+
+
+Func Mi32Ter_GetVrefDelta()
+       Return 50
+EndFunc
\ No newline at end of file
index cc9d54d4d98cd3af8b10378458bb913fd969a2f0..3fed52261555e998765b15727f423f134153ad9f 100755 (executable)
@@ -2,11 +2,11 @@
 Global $Mi34_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
 
 Func Mi34_GotoMiTab()
-       GotoTab(7) ; Go to "Mi34" tab
+       _GotoTab(7) ; Go to "Mi34" tab
 EndFunc   ;==>Mi34_GotoMiTab
 
 Func Mi34_SelectBoard()
-       GotoTab(0) ; Go to first tab
+       _GotoTab(0) ; Go to first tab
        ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa34]", "Check")
 EndFunc   ;==>Mi34_SelectBoard
 
@@ -38,3 +38,51 @@ Func Mi34_SetMiParameter($matrix, $vref)
        ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
        Sleep(100)
 EndFunc   ;==>Mi34_SetMiParameter
+
+Func Mi34_CheckWindowExist() ; Check if Mimosa window exists
+       CheckWindowExist_I2CMi32()
+EndFunc   ;==>CheckWindowExist
+
+Func Mi34_CheckIfBoardOK()
+       CheckIfBoardOK_I2CMi32()
+EndFunc   ;==>CheckIfBoardOK
+
+Func Mi34_GotoTab($tabnum)
+       GotoTab_I2CMi32($tabnum)
+EndFunc   ;==>GotoTab
+
+Func Mi34_GotoDebugTab()
+       GotoDebugTab_I2CMi32()
+EndFunc   ;==>GotoDebugTab
+
+Func Mi34_ProgramMi()
+       ProgramMi_I2CMi32()
+EndFunc   ;==>ProgramMi
+
+Func Mi34_GetCounter()
+       GetCounter_I2CMi32()
+EndFunc   ;==>GetCounter
+
+Func Mi34_StopRun()
+       StopRun_I2CMi32()
+EndFunc
+
+Func Mi34_StartRun()
+       StartRun_I2CMi32()
+EndFunc
+
+Func Mi34_TestSystem()
+       TestSystem_I2CMi32()
+EndFunc
+
+Func Mi34_GetAverage($hWnd)
+       Return GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Mi34_SetClockType($clock)
+       SetClockType_I2CMi32($hWnd)
+EndFunc
+
+Func Mi34_GetVrefDelta()
+       Return 50
+EndFunc
index 5651782910023fb880ce0a712c97c4a59c2b8ee4..23a6b95c8d848e89c20f3e9638017fd1a741f8b1 100755 (executable)
@@ -1,10 +1,4 @@
 #include-once
-Global $system = "Pegasus"
-Global $hWnd
-Global $hCounter
-$savedir = "O:\pegasus"
-$temperaturebefore = -10000
-
 Func GetCounter()
    Return ControlGetText($hWnd, "", $hCounter)
 EndFunc   ;==>GetCounter
@@ -17,7 +11,7 @@ Func StartRun()
        ControlClick($hWnd, "", "[TEXT:Start Run;CLASS:TButton]")
 EndFunc
 
-Func TestSystem()
+Func Pegasus_TestSystem()
        WinWait("Debug")
        ControlClick("Debug", "", "[TEXT:Messages Clear]")
        Sleep(100)
@@ -62,3 +56,51 @@ Func Pegasus_SetVref($vref)
 
 EndFunc   ;==>Mi34_SetVref
 
+
+Func Pegasus_CheckWindowExist() ; Check if Mimosa window exists
+       CheckWindowExist_I2CMi32()
+EndFunc   ;==>CheckWindowExist
+
+Func Pegasus_CheckIfBoardOK()
+       CheckIfBoardOK_I2CMi32()
+EndFunc   ;==>CheckIfBoardOK
+
+Func Pegasus_GotoTab($tabnum)
+       GotoTab_I2CMi32($tabnum)
+EndFunc   ;==>GotoTab
+
+Func Pegasus_GotoDebugTab()
+       GotoDebugTab_I2CMi32()
+EndFunc   ;==>GotoDebugTab
+
+Func Pegasus_ProgramMi()
+       ProgramMi_I2CMi32()
+EndFunc   ;==>ProgramMi
+
+Func Pegasus_GetCounter()
+       GetCounter_I2CMi32()
+EndFunc   ;==>GetCounter
+
+Func Pegasus_StopRun()
+       StopRun_I2CMi32()
+EndFunc
+
+Func Pegasus_StartRun()
+       StartRun_I2CMi32()
+EndFunc
+
+Func Pegasus_TestSystem()
+       TestSystem_I2CMi32()
+EndFunc
+
+Func Pegasus_GetAverage($hWnd)
+       GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Pegasus_SetClockType($clock)
+       SetClockType_I2CMi32($clock)
+EndFunc
+
+Func Pegasus_GetVrefDelta()
+       Return 50 ; not used, use skrediver
+EndFunc
index 5a49d28b364e89520c7fb39c857193f26a88078d..93b2b5eeee4115de223f4dbd55b50cfe8c3a6696 100755 (executable)
 #include "mysql_functions.au3"
 $objErr = ObjEvent("AutoIt.Error","MyErrFunc")
 
-$programversion = "1.2"
-$excelLineBegin = "1100" ; Change this to the range of cells you want to be processed
-$excelLineEnd = "4000"
+$programversion = "1.3"
 Global $completelog = ""
 Global $comment = ""
 
-$lastexcelcell = "Q"
-$CellRange = "A" & $excelLineBegin & ":" & $lastexcelcell & $excelLineEnd
-$cellSystem = 0
-$cellDate = 1
-$cellChipV = 3
-$cellRunNum = 4
-$cellTemp = 5
-$cellTempWait = 6
-$cellEventsN = 7
-$cellChipN = 8
-$cellVRef = 10
-$cellMatrix = 11
-$cellRadSrc = 12
-$cellClock = 13
-$cellRad = 14
-$cellTChip = 15
-$cellNote = 16
-
 $estimate = 0
 $totalrealruns = 0
 $temperaturebefore = -10000
-Global $skippedruns[1] ; TODO fix skipping runs
+Global $skippedruns[1]
 
 ; set external parameters
 $FileName = IniRead($configfile, "experimental setup", "ExcelPath", "H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34_PXI.xls") ; read path to Excel file
index 960ad8daf5b8472b7b2b8f2fb94477efd0788c3f..b69076b14f4c4dfcccfdff015629ec0b53ab79f0 100755 (executable)
@@ -1,3 +1,4 @@
+
 $runid = $suitrun[0]
 $TempCooling =  $suitrun[1]
 $TempWaitFor = $suitrun[2]
@@ -14,4 +15,4 @@ If IsDeclared("runnumber") Then
 EndIf
 Global $runnumber = $suitrun[4]
 $matrix =  $suitrun[5]
-$events = $suitrun[6]
\ No newline at end of file
+$events = $suitrun[6]
index 2d486efcadd10de2c1f0b6cf46a303107f0860be..3121d9b46775f4926ab3fb4b21c999761ff14f1f 100755 (executable)
@@ -1,6 +1,6 @@
 $i = 0
 Do
-       $oldcounter = GetCounter()
+       $oldcounter = _GetCounter()
        $percentCurrent = Round($oldcounter / $events * 100, 3)
        $percentoverall = Round(($oldcounter / $events / $totalruns + $totalrealruns / $totalruns) * 100, 3)
        If Not $estimate And $percentCurrent > 5 Then
@@ -24,9 +24,9 @@ Do
                Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Percent done: ' & $percentoverall & ' (' & $totalrealruns & '/' & $totalruns & ')  TempChip: ' & $currenttempchip & '"', @ScriptDir)
        EndIf
        Sleep(10000)
-       If ($oldcounter + 100  > GetCounter()) Then
+       If ($oldcounter + 100  > _GetCounter() And _GetCounter() < $events) Then
                Sleep(50000)
-               If ($oldcounter + 100 > GetCounter()) Then
+               If ($oldcounter + 100 > _GetCounter() And _GetCounter() < $events) 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.'')"')
@@ -41,6 +41,6 @@ Do
                EndIf
        EndIf
        $i = $i + 1
-Until (GetCounter() > $events)
+Until (_GetCounter() >= $events)
 
 $temperaturechipend = GetTemperatureForSure("Chip" & $system)
\ No newline at end of file
diff --git a/bot/Mimosa_Autorun_Pegasus.au3 b/bot/Mimosa_Autorun_Pegasus.au3
deleted file mode 100755 (executable)
index 4c62f85..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-;
-; AutoIt Version: 3.0
-; Language:    English
-; Platform:       Win9x/NT
-; Author:         Benny Linnik (b.linnik@gsi.de)
-;
-; Script Function:
-;   Automatically runs the USB or PXI system with data gathered from an Excel sheet
-$configfile = @ScriptDir & "\config_Pegasus.ini"
-#include "Functions\Header.au3"
-#include "Chips\Pegasus.au3"
-#include "Functions\SetChipClock.au3"
-#include "Functions\CommonFunctions.au3"
-#include "Functions\Checkdata.au3"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
-
-;create virtual functions
-Func GetVref()
-       Return Call($chipversion & "_GetVref")
-EndFunc   ;==>GetVref
-Func SetVref($vref)
-       Call($chipversion & "_SetVref", $vref)
-EndFunc   ;==>SetVref
-Func _GetAverage($hWnd)
-       If $chipversion <> "Mi29" Then
-               Return GetAverage()
-       Else ; mimosa 29 ausnahme
-               Return Call($chipversion & "_GetAverage", $hWnd)
-       EndIf
-EndFunc   ;==>_GetAverage
-Func _TestSystem()
-       TestSystem()
-EndFunc   ;==>_TestSystem
-
-If (Not @error) Then ; Check again if everything went well
-       $totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus")
-;      ReturnSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus",$totalruns)
-
-
-       If $totalruns > 0 Then ; Check if we retrieved any data
-               Local $answer = MsgBox(4, "Total runs", "Number of suitable runs found at the moment: " & $totalruns)
-               If $answer = 7 Then
-                       Exit
-                EndIf
-               RefreshGUISendNtfct("Starting with " & $totalruns & " runs.")
-               Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
-               If ProcessExists("daq.exe") = True Then
-                       ProcessClose("daq.exe")
-                       ProcessWaitClose("daq.exe")
-               EndIf
-               Local $sTitle = "CMOS USB DAQ V3.5.8"
-               Run("C:\ccmos_daq\v3.5.7__5_boards\daq_v3.5.7__5_boards.bat", "C:\ccmos_daq\v3.5.7__5_boards\")
-               If _TestSystem() Then Exit
-               WinWait($sTitle)
-               $hWnd = WinGetHandle($sTitle)
-               $hTab = ControlGetHandle($hWnd, "", "TPageControl1")
-               $hCounter = ControlGetHandle($hWnd, "", "TEdit42")
-               $starttimetotal = _NowCalc()
-               $suitrun = ReturnSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus")
-               While Not $suitrun[0] = "" ; Do runs, until no new run found
-                       #include "Functions\ReadAndSaveSQLParameters.au3"
-                       #include "Functions\WaitForTemperature.au3"
-                       _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
-                       Sleep(200)
-                       ControlSetText($hWnd, "", "TEdit16", "")
-                       Sleep(100)
-                       ControlFocus($hWnd, "", "TEdit16")
-                       ControlSend($hWnd, "", "TEdit16", $savedir)
-                       Sleep(100)
-                       ControlSetText($hWnd, "", "TEdit15", "")
-                       Sleep(100)
-                       ControlFocus($hWnd, "", "TEdit15")
-                       ControlSend($hWnd, "", "TEdit15", $runnumber)
-                       Sleep(100)
-                       ControlSetText($hWnd, "", "TEdit14", "")
-                       Sleep(100)
-                       ControlFocus($hWnd, "", "TEdit14")
-                       ControlSend($hWnd, "", "TEdit14", $events)
-                       Sleep(100)
-                       ControlFocus($hWnd, "", "TEdit15")
-                       Sleep(1000)
-                       $starttime = _NowCalc()
-                       StartRun()
-                       Sleep(1000)
-                       If (WinExists("Avertissement")) Then
-                               RefreshGUISendNtfct("Skipped run " & $runnumber & " could overwrite data.")
-                               _ArrayAdd($skippedruns, $runnumber)
-                               $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
-                       EndIf
-                       $avg = _GetAverage($hWnd)
-
-;~                     Sleep(200)
-;~                     $j = 0
-;~                     If ($avg > 2300 Or $avg < 1700) Then
-;~                             Do
-;~                                     ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
-;~                                     $vref = GetVref()
-;~                                     $diff = $avg - 2000
-;~                                     Select
-;~                                             Case Abs($diff) > 600
-;~                                                     $vref = $vref + SGN($diff) * 100
-;~                                             Case Else
-;~                                                     $vref = $vref + SGN($diff) * 50
-;~                                     EndSelect
-;~                                     If ($vref > 1000 Or $vref < 300) Then
-;~                                             StopRun()
-;~                                             RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Frequency: " & $clock)
-;~                                             _ArrayAdd($skippedruns, $runnumber)
-;~                                             Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
-;~                                             FileDelete($savedir & "/" & $runnumber & "/*")
-;~                                             $vref = 650
-;~                                             ContinueLoop 2
-;~                                     EndIf
-;~                                     SetVref($vref)
-;~                                     _ProgramMi()
-;~                                     WinWait($hWnd)
-;~                                     ;_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
-;~                                     StartRun()
-;~                                     WinWait("Avertissement")
-;~                                     ControlClick("Avertissement", "", "TButton2")
-;~                                     Sleep(1000)
-;~                                     $avg = ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
-;~                                     Sleep(100)
-;~                                     $j = $j + 1
-;~                                     If ($j > 10) Then
-;~                                             StopRun()
-;~                                             RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Clock: " & $clock & " Mhz")
-;~                                             _ArrayAdd($skippedruns, $runnumber)
-;~                                             Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
-;~                                             FileDelete($savedir & "/" & $runnumber & "/*")
-;~                                             $vref = 650
-;~                                             ContinueLoop 2
-;~                                     EndIf
-;~                             Until ($avg < 2300 And $avg > 1700)
-;~                     EndIf
-                       #include "Functions\Watchrun.au3"
-                       _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
-                       Sleep(100)
-                       StopRun()
-                       #include "Functions\SaveToSQL.au3"
-                       $totalrealruns = $totalrealruns + 1
-                       $completelog &= _NowCalc() & " Completed run " & $runnumber & ", " & $percentoverall & "% (" & $totalrealruns & "/" & $totalruns & ")" & @CRLF
-                       Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
-                       $suitrun = ReturnSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus")
-                       ConsoleWrite($suitrun[0])
-               WEnd
-               #include "Functions\PrintSucessMessage.au3"
-       Else
-               MsgBox(16, "SQL Data Test", "No suitable runs found")
-       EndIf
-Else
-       MsgBox(16, "Server fail", "Error: Could not open connection to mySQL server.")
-EndIf
-Func SGN($i)
-       Return ($i > 0) - ($i < 0)
-EndFunc   ;==>SGN
-Func CheckValues($vref, $matrix, $runnumber, $events, $clock)
-       Return 0
-EndFunc   ;==>CheckValues
index 6d7c9fd5f47747ec7b39da888c93f445e41657d1..dac2849cef2daff2381e1bbcb1525aed92889f6a 100755 (executable)
@@ -5,81 +5,96 @@
 ; Author:         Benny Linnik (b.linnik@gsi.de)
 ;
 ; Script Function:
-;   Automatically runs the USB or PXI system with data gathered from an Excel sheet
+;   Automatically runs the USB or PXI system with data gathered from an SQL database
+; System specific configuration, last run configuration
 $configfile = @ScriptDir & "\config_USB.ini"
-#include "Functions\Header.au3"
-#include "Chips\Mimosa19.au3"
-#include "Chips\Mimosa29.au3"
+
+Global $system = "USB"
+Global $hWnd
+Global $hCounter
+Global $vref = 650 ; Initial vref, will be adjusted during runtime, depricated
+$temperaturebefore = -10000
+
+#include "Functions\Header.au3" ; init global variables
+#include "Chips\Mimosa19.au3" ; declare Mi19 specific (virtual) functions
+#include "Chips\Mimosa29.au3" ; declare Mi29 specific (virtual) functions
 #include "Chips\Mimosa32.au3"
 #include "Chips\Mimosa32Ter.au3"
 #include "Chips\Mimosa34.au3"
-#include "Functions\SetChipClock.au3"
-#include "Functions\CommonFunctions.au3"
-#include "Functions\Checkdata.au3"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
+#include "Chips\Pipper2.au3"
+#include "Functions\SetChipClock.au3" ; SetChipClock() is defined here
+#include "Functions\CommonFunctions.au3" ; some common global functions which should be able to be called from everywhere
+#include "Functions\Checkdata.au3" ; Ask the user to run with given configuration
+
+$savedir = "F:\currentrun"
+$storedir = "O:\" & $chipversion
+If DirGetSize($storedir) == -1 Then
+       DirCreate ( $storedir )
+EndIf
 
-;create virtual functions
-Func GotoMiTab()
+; create virtual functions
+; chip specific functions
+Func _GotoMiTab() ; go to Mimosa
        Call($chipversion & "_GotoMiTab")
 EndFunc   ;==>GotoMiTab
-Func GetVref()
+Func _GetVref()
        Return Call($chipversion & "_GetVref")
 EndFunc   ;==>GetVref
-Func SetVref($vref)
+Func _SetVref($vref)
        Call($chipversion & "_SetVref", $vref)
 EndFunc   ;==>SetVref
-Func SetMiParameter($matrix, $vref)
+Func _SetMiParameter($matrix, $vref)
        Call($chipversion & "_SetMiParameter", $matrix, $vref)
 EndFunc   ;==>SetMiParameter
-Func SelectBoard()
+Func _SelectBoard()
        Call($chipversion & "_SelectBoard")
 EndFunc   ;==>SelectBoard
 Func _CheckWindowExist() ; Check if Mimosa window exists
-       If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
-               CheckWindowExist()
-       EndIf
+       Call($chipversion & "_CheckWindowExist")
 EndFunc   ;==>_CheckWindowExist
 Func _CheckIfBoardOK()
-       If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
-               CheckIfBoardOK()
-       EndIf
+       Call($chipversion & "_CheckIfBoardOK")
 EndFunc   ;==>_CheckIfBoardOK
 Func _GotoTab($tabnum)
-       If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
-               GotoTab($tabnum)
-       EndIf
+       Call($chipversion & "_GotoTab", $tabnum)
 EndFunc   ;==>_GotoTab
 Func _GotoDebugTab()
-       If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
-               GotoDebugTab()
-       EndIf
+       Call($chipversion & "_GotoDebugTab")
 EndFunc   ;==>_GotoDebugTab
 Func _ProgramMi()
-       If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
-               ProgramMi()
-       EndIf
+       Call($chipversion & "_ProgramMi")
 EndFunc   ;==>_ProgramMi
 Func _TestSystem()
-       If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
-               TestSystem()
-       Else ; mimosa 29 und 19 ausnahme
-               Call($chipversion & "_TestSystem")
-       EndIf
-EndFunc   ;==>_TestSystem
+       Call($chipversion & "_TestSystem")
+EndFunc   ;==>_TestSystems
 Func _GetAverage($hWnd)
-       If $chipversion <> "Mi29" Then
-               Return GetAverage()
-       Else ; mimosa 29 ausnahme
-               Return Call($chipversion & "_GetAverage", $hWnd)
-       EndIf
+       Return Call($chipversion & "_GetAverage", $hWnd)
 EndFunc   ;==>_GetAverage
+Func _GetCounter()
+;~     not chip specific
+;~     Return ControlGetText($hWnd, "", $hCounter)
+       Return Call($chipversion & "_GetCounter")
+EndFunc   ;==>__GetCounter
+Func _StartRun()
+       Call($chipversion & "_StartRun")
+EndFunc
+Func _StopRun()
+       Call($chipversion & "_StopRun")
+EndFunc
+Func _SetClockType($clock)
+       Call($chipversion & "_SetClockType", $clock)
+EndFunc
+Func _GetVrefDelta()
+       Return Call($chipversion & "_GetVrefDelta")
+EndFunc
+
 
 
 If (Not @error) Then ; Check again if everything went well
        $totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radSource, "USB")
        If $totalruns > 0 Then ; Check if we retrieved any data
                Local $answer = MsgBox(4, "Total runs", "Number of suitable runs found at the moment: " & $totalruns)
-               If $answer = 7 Then
+               If $answer = 7 Then ; Cancel
                        Exit
                EndIf
                RefreshGUISendNtfct("Starting with " & $totalruns & " runs.")
@@ -105,16 +120,12 @@ If (Not @error) Then ; Check again if everything went well
                        #include "Functions\ReadAndSaveSQLParameters.au3"
                        #include "Functions\WaitForTemperature.au3"
                        _CheckWindowExist()
-                       SelectBoard()
+                       _SelectBoard()
                        _CheckIfBoardOK()
-                       ControlCommand("I2C control Software for Mimosa32", "", "[TEXT:Intern]", "Check")
-                       If ($clock <> "100") Then
-                               SetChipClock($clock)
-                               ControlCommand("I2C control Software for Mimosa32", "", "[TEXT:Extern]", "Check")
-                       EndIf
-                       GotoMiTab()
-                       SetMiParameter($matrix, $vref)
-                       ProgramMi()
+                       _SetClockType($clock)
+                       _GotoMiTab()
+                       _SetMiParameter($matrix, $vref)
+                       _ProgramMi()
                        _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
                        Sleep(200)
                        ;$savedir = ControlGetText($hWnd, "", "TEdit24") ; get directorys to save file to
@@ -138,7 +149,7 @@ If (Not @error) Then ; Check again if everything went well
                        Sleep(1000)
                        RefreshGUISendNtfct("Begin with runnumber " & $runnumber & ".")
                        $starttime = _NowCalc()
-                       StartRun()
+                       _StartRun()
                        Sleep(1000)
                        If (WinExists("Avertissement")) Then
                                RefreshGUISendNtfct("Skipped run " & $runnumber & " could overwrite data.")
@@ -154,19 +165,19 @@ If (Not @error) Then ; Check again if everything went well
 
                        Sleep(200)
                        $j = 0
-                       If ($avg > 2150 Or $avg < 1500) Then ; change 1400 back to 1700
+                       If ($avg > 1100 Or $avg < 900) Then ; change 1400 back to 1700; was 2150 and 1750 at 4.10.2016
                                Do
                                        ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
-                                       $vref = GetVref()
-                                       $diff = $avg - 2000
+                                       $vref = _GetVref()
+                                       $diff = $avg - 1000 ; was 2000 at 4.10.2016
                                        Select
-                                               Case Abs($diff) > 600
-                                                       $vref = $vref + SGN($diff) * 100
+                                               Case Abs($diff) > 500
+                                                       $vref = $vref + SGN($diff) * Number(_GetVrefDelta()*2)
                                                Case Else
-                                                       $vref = $vref + SGN($diff) * 50
+                                                       $vref = $vref + SGN($diff) * Number(_GetVrefDelta())
                                        EndSelect
-                                       If ($vref > 1000 Or $vref < 300) Then
-                                               StopRun()
+                                       If ($vref > 1000 Or $vref < 200) Then
+                                               _StopRun()
                                                RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Frequency: " & $clock)
                                                _ArrayAdd($skippedruns, $runnumber)
                                                Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
@@ -175,11 +186,11 @@ If (Not @error) Then ; Check again if everything went well
                                                $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB")
                                                ContinueLoop 2
                                        EndIf
-                                       SetVref($vref)
+                                       _SetVref($vref)
                                        _ProgramMi()
                                        WinWait($hWnd)
                                        ;_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
-                                       StartRun()
+                                       _StartRun()
                                        WinWait("Avertissement")
                                        ControlClick("Avertissement", "", "TButton2")
                                        Sleep(1000)
@@ -187,7 +198,7 @@ If (Not @error) Then ; Check again if everything went well
                                        Sleep(100)
                                        $j = $j + 1
                                        If ($j > 10) Then
-                                               StopRun()
+                                               _StopRun()
                                                RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Clock: " & $clock & " Mhz")
                                                _ArrayAdd($skippedruns, $runnumber)
                                                Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
@@ -196,12 +207,12 @@ If (Not @error) Then ; Check again if everything went well
                                                $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB")
                                                ContinueLoop 2
                                        EndIf
-                               Until ($avg < 2300 And $avg > 1700)
+                               Until ($avg < 1100 And $avg > 900)
                        EndIf
                        #include "Functions\Watchrun.au3"
                        _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
                        Sleep(100)
-                       StopRun()
+                       _StopRun()
                        Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\MoveFolder.au3" "' & $savedir & '" "' & $storedir & '" "' & $runnumber & '"')
                        #include "Functions\SaveToSQL.au3"
                        $totalrealruns = $totalrealruns + 1
index 1b7cf61a8fd9a0c43ffb489f4e981874b64001c5..39352932b041531c7561ea625af63673db8082fa 100755 (executable)
@@ -1,7 +1,7 @@
 [experimental setup]
-ChipVersion = Mi34
-ChipInstalled = 20
-RadSource = Sr90
+ChipVersion = Pipper2
+ChipInstalled = 1
+RadSource = Fe55
 [various]
-Notify = 0
+Notify = 1
 NotifyCustom = (Optional)
index 6a4897bc546c18b52ee27489f4f1ad4cf33d957d..39352932b041531c7561ea625af63673db8082fa 100755 (executable)
@@ -1,7 +1,7 @@
 [experimental setup]
-ChipVersion = Mi19
-ChipInstalled = 10
-RadSource = none
+ChipVersion = Pipper2
+ChipInstalled = 1
+RadSource = Fe55
 [various]
-Notify = 0
+Notify = 1
 NotifyCustom = (Optional)