#include "Chips/Mimosa34.au3"
#include "Functions/BinaryIntegerConvert.au3"
#include "Functions/EpochConvert.au3"
-#include "Functions/TemperatureControl.au3"
-$programversion = "0.95"
+$programversion = "0.96"
-$FileName = IniRead(@ScriptDir&"\config.ini", "experimental setup", "ExcelPath", "H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34.xls") ; read path to Excel file
-$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
-$radiated = IniRead(@ScriptDir&"\config.ini", "experimental setup", "Radiated", "") ; radiated chip
+$FileName = IniRead(@ScriptDir & "\config.ini", "experimental setup", "ExcelPath", "H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34.xls") ; read path to Excel file
+$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
+$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 = "1000"
+$excelLineBegin = "600" ; Change this to the range of cells you want to be processed
+$excelLineEnd = "2000"
Global $vref = 650 ; Initial vref, will be adjusted during runtime
$completelog = ""
$i = $i + 1
If ($i > 20) Then
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "USB Boards could be not OK!"', @ScriptDir)
+ $completelog &= _NowCalc() & " USB Boards could be not OK! Please check the Debug output." & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
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!"', @ScriptDir)
+ $completelog &= _NowCalc() & " USB Boards could be not OK! Please check the Debug output." & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
MsgBox(16, "Message", "USB Boards could be not OK! Please check the Debug output.")
Exit
EndIf
$oDocument = $oExcelDoc.Worksheets(1) ; We use the 'Default' worksheet
$currentline = $oDocument.range($currentrange).value
- ;TODO
- $tempcorrent = False
- While Not $tempcorrent
- $currenttemp = GetTemperature()
- If ($currentline[4][0] < $currenttemp + 0.5 And $currentline[4][0] > $currenttemp - 0.5) Then
- $tempcorrent = True
- Else
- If Not SetTemperature($currentline[4][0]) Then
- Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not set temperature to "' & $currentline[4][0] & '". Will try again in 10 minutes."', @ScriptDir)
+ If ($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
+ ;TODO
+ $tempcorrent = False
+ While Not $tempcorrent
+ $tempgeti = 0
+ Do
+ If $tempgeti > 10 Then
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not get temperature. Will assume it is set correctly. Please check manually later."', @ScriptDir)
+ $completelog &= _NowCalc() & " Could not get temperature. Will assume it is set correctly." & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
+ ;$tempcorrent = True
+ ExitLoop 2
+ EndIf
+ $currenttemp = RunWait(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\TemperatureControl.au3"', @ScriptDir)
+ $tempgeti = $tempgeti + 1
+ Until $currenttemp < 100000
+ $currenttemp = $currenttemp / 100
+ If ($currentline[4][0] < $currenttemp + 0.5 And $currentline[4][0] > $currenttemp - 0.5) Then
+ $tempcorrent = True
+ Else
+ $completelog &= _NowCalc() & " Current temperature is " & $currenttemp & "." & @CRLF & "Will set it to " & $currentline[4][0] & " and wait for 10 minutes." & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
+ $tempseti = 0
+ Do
+ If $tempseti > 10 Then
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "Could not set temperature to "' & $currentline[4][0] & '". Current system temperature is "' & $currenttemp & '". Will proceed anyway."', @ScriptDir)
+ $completelog &= _NowCalc() & " Could not set temperature to " & $currentline[4][0] & "." & @CRLF & "Current system temperature is " & $currenttemp & ". Will proceed." & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
+ ;$tempcorrent = True
+ ExitLoop 2
+ EndIf
+ $settemp = RunWait(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\TemperatureControl.au3" "' & $currentline[4][0] & '"', @ScriptDir)
+ $tempseti = $tempseti + 1
+ Until $settemp == 0
+ Sleep(1000 * 60 * 10)
EndIf
- Sleep(1000 * 60 * 10)
- EndIf
- WEnd
-
- If ($tempcorrent 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
+ WEnd
$clock = $currentline[11][0] ; save needed clock
If $clock == "" Then
$clock = "100"
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnum & ', could overwrite data!'')"')
ControlClick("Avertissement", "", "TButton1")
- FileDelete($savedir & "/" & $runnum & "/*")
+ ;FileDelete($savedir & "/" & $runnum & "/*")
ContinueLoop
EndIf
;_GUICtrlTab_SetCurFocus($hTab, 4) ; Go to "Local monitoring" tab ; not needed
$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 & '"', @ScriptDir)
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\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!'')"')
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)
+ $calcmin = Int($calcsecestimate / 60)
$calcsecestimate = Int($calcsecestimate)
$timeend = _Epoch_encrypt(_NowCalc()) + $calcsecestimate
$timeend = _Epoch_decrypt($timeend)
$calcmin = Round($calcmin / 60, 2)
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
+ $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)