From ef7ababd7906921194e248ad7bc7b35f7711be8c Mon Sep 17 00:00:00 2001 From: Benjamin Linnik Date: Mon, 7 Oct 2013 09:05:41 +0200 Subject: [PATCH] bugfixes --- bot/Functions/Header.au3 | 4 ++-- bot/Functions/PrintSucessMessage.au3 | 8 ++++---- bot/Functions/ReadAndSaveExcelParameters.au3 | 6 ++---- bot/Functions/SaveToExcel.au3 | 1 + bot/Functions/WaitForTemperature.au3 | 11 ++++++----- bot/Mimosa_Autorun_PXI.au3 | 4 ++-- bot/Mimosa_Autorun_USB.au3 | 4 ++-- bot/config_USB.ini | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bot/Functions/Header.au3 b/bot/Functions/Header.au3 index 1b51e1e..879ca4e 100755 --- a/bot/Functions/Header.au3 +++ b/bot/Functions/Header.au3 @@ -7,11 +7,11 @@ #include #include "BinaryIntegerConvert.au3" #include "EpochConvert.au3" -$programversion = "0.99" +$programversion = "0.99.1" $excelLineBegin = "1100" ; Change this to the range of cells you want to be processed $excelLineEnd = "4000" Global $completelog = "" -$CellRange = "A" & $excelLineBegin & ":P" & $excelLineEnd +$CellRange = "A" & $excelLineBegin & ":Q" & $excelLineEnd $cellSystem = 0 $cellDate = 1 $cellChipV = 3 diff --git a/bot/Functions/PrintSucessMessage.au3 b/bot/Functions/PrintSucessMessage.au3 index db651c9..950e1e7 100755 --- a/bot/Functions/PrintSucessMessage.au3 +++ b/bot/Functions/PrintSucessMessage.au3 @@ -1,7 +1,7 @@ -$calcmin = _DateDiff('s', $starttimetotal, _NowCalc()) ; n for minites, s for seconds -$calcmin = Round($calcmin / 60, 2) ; Minutes -$calchours= Round($calcmin / 3600, 2) ; Hoours -$calcdays= Round($calcmin / 86400, 2) ; Days +$calcsec = _DateDiff('s', $starttimetotal, _NowCalc()) ; n for minites, s for seconds +$calcmin = Round($calcsec / 60, 2) ; Minutes +$calchours= Round($calcsec / 3600, 2) ; Hoours +$calcdays= Round($calcsec / 86400, 2) ; Days RefreshGUISendNtfct("All runs (" & $totalrealruns & ") ended in " & $calcmin & " minutes (" & $calchours &" hours).") ;Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUISendNtfct.au3" "' & $system & '" "All runs (' & $totalrealruns & ') ended in ' & $calcmin & ' minutes (' & $calchours &' hours)."') Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Sucess!'', ''All runs (' & $totalrealruns & ') ended in ' & $calcmin & ' minutes (' & $calchours &' hours, ' & $calcdays & ' days).' & @CRLF & 'Please check the Excel sheet and the results for errors.'')"') diff --git a/bot/Functions/ReadAndSaveExcelParameters.au3 b/bot/Functions/ReadAndSaveExcelParameters.au3 index 3ee8ee6..c68eff4 100755 --- a/bot/Functions/ReadAndSaveExcelParameters.au3 +++ b/bot/Functions/ReadAndSaveExcelParameters.au3 @@ -1,8 +1,6 @@ - -$temperaturebefore = $currentline[$cellTemp][0] $waitfortemp = $currentline[$cellTempWait][0] If $waitfortemp == "" Then - $waitfortemp = "0" + $waitfortemp = 0 $currentline[$cellTempWait][0] = "0" EndIf $clock = $currentline[$cellClock][0] ; save needed clock @@ -16,4 +14,4 @@ $eventnum = $currentline[$cellEventsN][0] ; save number of events to save If $eventnum == "" Then $eventnum = 100000 $currentline[$cellEventsN][0] = "100000" -EndIf \ No newline at end of file +EndIf diff --git a/bot/Functions/SaveToExcel.au3 b/bot/Functions/SaveToExcel.au3 index be7492d..e520798 100755 --- a/bot/Functions/SaveToExcel.au3 +++ b/bot/Functions/SaveToExcel.au3 @@ -1,4 +1,5 @@ $currentline[$cellDate][0] = @MDAY & "." & @MON & "." & @YEAR +If $currenttempchip == 100000 Then $currenttempchip = "?" $currentline[$cellTChip][0] = $currenttempchip $currentline[$cellVRef][0] = $vref $calcsec = _DateDiff('s', $starttime, _NowCalc()) ; n for minites, s for seconds diff --git a/bot/Functions/WaitForTemperature.au3 b/bot/Functions/WaitForTemperature.au3 index 8c40b9b..be82489 100755 --- a/bot/Functions/WaitForTemperature.au3 +++ b/bot/Functions/WaitForTemperature.au3 @@ -3,7 +3,7 @@ If $currentline[$cellTemp][0] == $temperaturebefore Then Else $tempcorrent = False EndIf -$tempwaiti = 0 +$tempwaiti = 0 ; set the 5 minutes wait counter to zero if it reaches 6 -> 30 minutes passed While Not $tempcorrent $currenttemp = GetTemperatureForSure($system) If $currenttemp == 100000 Then @@ -14,7 +14,7 @@ While Not $tempcorrent If ($currentline[$cellTemp][0] < $currenttemp + 0.5 And $currentline[$cellTemp][0] > $currenttemp - 0.5) Then $tempcorrent = True Else - If $tempwaiti > 5 Then + If $tempwaiti > 5 Then ; after 30 minutes give up waiting $currenttempchip = GetTemperatureForSure("Chip" & $system) RefreshGUISendNtfct("Cooling could not reach needed temperature of " & $currentline[$cellTemp][0] & " °C within 30 minutes. Current cooling temperature is " & $currenttemp & ", chip temperature is " & $currenttempchip & ". Will proceed anyway.") $tempcorrent = True @@ -24,7 +24,7 @@ While Not $tempcorrent Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"') $tempseti = 0 Do - If $tempseti > 10 Then + If $tempseti > 10 Then ; after 10 failed attempts $currenttempchip = GetTemperatureForSure("Chip" & $system) RefreshGUISendNtfct("Could not set temperature to " & $currentline[$cellTemp][0] & ". Current cooling temperature is " & $currenttemp & " °C, chip temperature is " & $currenttempchip & ". Will proceed anyway.") $tempcorrent = True @@ -32,10 +32,11 @@ While Not $tempcorrent EndIf $settemp = RunWait(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\TemperatureControl.au3" "' & $system & '" "' & $currentline[$cellTemp][0] & '"', @ScriptDir) $tempseti = $tempseti + 1 - Until $settemp == 0 + Until $settemp == 0 ; until temperature could be set succesfully $tempwaiti= $tempwaiti + 1 - Sleep(1000 * 60 * 5) + Sleep(1000 * 60 * 5) ; wait 5 minutes between checks and sets of temperature EndIf WEnd Sleep($waitfortemp * 60 * 1000) ; wait for user specified minutes $currenttempchip = GetTemperatureForSure("Chip" & $system) ; get chip temperature before measurement start +$temperaturebefore = $currentline[$cellTemp][0] ; 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 diff --git a/bot/Mimosa_Autorun_PXI.au3 b/bot/Mimosa_Autorun_PXI.au3 index 7ae9680..0135a9b 100755 --- a/bot/Mimosa_Autorun_PXI.au3 +++ b/bot/Mimosa_Autorun_PXI.au3 @@ -51,13 +51,13 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well $totalrealruns = 0 $starttimetotal = _NowCalc() For $run = 0 To $totallexcelines - 1 - $currentrange = "A" & $excelLineBegin + $run & ":P" & $excelLineBegin + $run + $currentrange = "A" & $excelLineBegin + $run & ":Q" & $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[$cellChipN][0] == $chipinstalled And "Mi" & $currentline[$cellChipV][0] == $chipversion And $currentline[$cellRadSrc][0] == $radSource And $currentline[$cellRad][0] == $radiated And $currentline[$cellDate][0] == "" And $currentline[$cellSystem][0] == "PXI" And ($currentline[$cellClock][0] == "100" Or $currentline[$cellClock][0] == "")) Then - #include "Functions\WaitForTemperature.au3" #include "Functions\ReadAndSaveExcelParameters.au3" + #include "Functions\WaitForTemperature.au3" SetMiParameter($matrix, $vref) ProgramMi() Sleep(200) diff --git a/bot/Mimosa_Autorun_USB.au3 b/bot/Mimosa_Autorun_USB.au3 index a0badf4..6eafaba 100755 --- a/bot/Mimosa_Autorun_USB.au3 +++ b/bot/Mimosa_Autorun_USB.au3 @@ -73,13 +73,13 @@ If (Not @error) And IsObj($oExcelDoc) Then ; Check again if everything went well $totalrealruns = 0 $starttimetotal = _NowCalc() For $run = 0 To $totallexcelines - 1 - $currentrange = "A" & $excelLineBegin + $run & ":P" & $excelLineBegin + $run + $currentrange = "A" & $excelLineBegin + $run & ":Q" & $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[$cellChipN][0] == $chipinstalled And "Mi" & $currentline[$cellChipV][0] == $chipversion And $currentline[$cellRadSrc][0] == $radSource And $currentline[$cellRad][0] == $radiated And $currentline[$cellDate][0] == "" And $currentline[$cellSystem][0] == "USB") Then - #include "Functions\WaitForTemperature.au3" #include "Functions\ReadAndSaveExcelParameters.au3" + #include "Functions\WaitForTemperature.au3" CheckWindowExist() SelectBoard() CheckIfBoardOK() diff --git a/bot/config_USB.ini b/bot/config_USB.ini index 1cb190c..214239f 100755 --- a/bot/config_USB.ini +++ b/bot/config_USB.ini @@ -1,6 +1,6 @@ [experimental setup] -ChipVersion = Mi34 -ChipInstalled = 4 +ChipVersion = Mi32Ter +ChipInstalled = 5d ExcelPath = H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34 - Neu.xls RadSource = none Radiated = 0 -- 2.43.0