Func Mi19_SetMiParameter($matrix, $vref)
Sleep(1000)
- $savedir = "F:\currentrun" ; overwrite store path set in other Mimosa files read in by include
- $storedir = "O:\Mi19"
+;~ $savedir = "F:\currentrun" ; overwrite store path set in other Mimosa files read in by include
+ $savedir = "O:\Mi19" ; overwrite store path set in other Mimosa files read in by include
+;~ For Mi19 use StoreDir == Savedir, no moving involved, too short runs
+ $storedir = ""
EndFunc ;==>Mi34_SetMiParameter
Func Mi19_TestSystem()
Global $hCounter
$savedir = "F:\Mi29"
Global $vref = -1 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = 600
+$temperaturebefore = -10000
Func Mi29_GotoMiTab()
--- /dev/null
+#include <I2C_control_Mim32.au3>
+Global $Mi34_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
+
+Func Mi34_GotoMiTab()
+ GotoTab(7) ; Go to "Mi34" tab
+EndFunc ;==>Mi34_GotoMiTab
+
+Func Mi34_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])
+EndFunc ;==>Mi34_GetVref
+
+Func Mi34_SetVref($vref)
+ ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
+EndFunc ;==>Mi34_SetVref
+
+Func Mi34_SetMiParameter($matrix, $vref)
+ ControlFocus($chipsoftware[0], "", $Mi34_buttons[0])
+ ControlSetText($chipsoftware[0], "", $Mi34_buttons[0], "")
+ Sleep(100)
+ ControlSend($chipsoftware[0], "", $Mi34_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], "")
+ Sleep(100)
+ ControlSetText($chipsoftware[0], "", $Mi34_buttons[1], "1")
+ Sleep(100)
+ ControlFocus($chipsoftware[0], "", $Mi34_buttons[2])
+ ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], "")
+ Sleep(100)
+ ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
+ Sleep(100)
+EndFunc ;==>Mi34_SetMiParameter
+;~ $currenttempchip = GetTemperatureForSure("ChipUSB")
+;~ MsgBox(0, "Debug", "Wieso nicht full precision " & $currenttempchip & " ?")
+;~ $currenttemp = GetTemperatureForSure("USB")
+;~ MsgBox(0, "Debug", "Wieso nicht full precision " & $currenttemp & " ?")
+;~ Exit
+
; $whichone can be set to ChipPXI, ChipUSB (chiptemperature) or PXI, USB for cooling temperature
Func GetTemperatureForSure($whichone)
$tempgeti = 0
$currenttemp = RunWait(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\TemperatureControl.au3" "' & $whichone & '"', @ScriptDir)
EndIf
$tempgeti = $tempgeti + 1
- Until $currenttemp < 100000
- Return $currenttemp / 100.0
+ Until $currenttemp < 100000.0
+ Return $currenttemp / 100
EndFunc
Func GetTemperature($whichone)
- $currenttemp = 100000;
+ $currenttemp = 100000.0;
If StringInStr(@ScriptDir, "\Functions") Then
$currenttemp = RunWait(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\TemperatureControl.au3" "' & $whichone & '"', @ScriptDir)
Else
$currenttemp = RunWait(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\TemperatureControl.au3" "' & $whichone & '"', @ScriptDir)
EndIf
- Return $currenttemp / 100.0
+ Return $currenttemp / 100
EndFunc
Func RefreshGUISendNtfct( $msg )
+Local $skippedruns
+#include "mysql_functions.au3"
$returnval = 10000
If ($CmdLine[0] = 2) Then
Func MoveFolders($src, $dst, $runnumber)
- For $i = -2 To 0
- DirCopy ( $src & "\" & $runnumber+$i, $dst & "\" & $runnumber+$i )
- ;FileDelete($src & "\" & $runnumber+$i & "\*")
- DirRemove( $src & "\" & $runnumber+$i, 1)
- Next
- ShellExecuteWait("C:\Programme\PuTTY\plink.exe", "-ssh -2 -l maps -i 'C:\Users\DAQ\Documents\Putty\save.ppk' jspc48.x-matter.uni-frankfurt.de /u/blinnik/radhard/MABS_run_analyzer/analyzerun.sh " & $runnumber, "", "", @SW_HIDE)
+ If StringLen($dst) > 1 Then
+ For $i = -2 To 0
+ DirCopy ( $src & "\" & $runnumber+$i, $dst & "\" & $runnumber+$i )
+ ;FileDelete($src & "\" & $runnumber+$i & "\*")
+ DirRemove( $src & "\" & $runnumber+$i, 1)
+ Next
+ EndIf
+ ShellExecuteWait("C:\Programme\PuTTY\plink.exe", "-ssh -2 -l maps -pw mimosa88 jspc48.x-matter.uni-frankfurt.de /u/blinnik/radhard/MABS_run_analyzer/analyzerun.sh " & $runnumber, "", "", @SW_SHOW)
+ $runcandidates = ReturnRunInfo($runnumber)
+ $msg = "Analysis of run " & $runnumber & " finished:" & @CRLF
+ $msg = $msg & GetValueFromRunInfo($runcandidates,"Comment") & @CRLF
+ $msg = $msg & "Average leakage current: " & GetValueFromRunInfo($runcandidates,"LeakageCurfA") & " fA" & @CRLF
+ $msg = $msg & "Average noise: " & GetValueFromRunInfo($runcandidates,"Avg.Noise") & " e" & @CRLF
+ $msg = $msg & "Average F0: " & GetValueFromRunInfo($runcandidates,"AvgF0") & " " & @CRLF
+ $msg = $msg & "Sigma of F0: " & GetValueFromRunInfo($runcandidates,"SigmaF0") & " " & @CRLF
+ $msg = $msg & "Temperature at start: " & GetValueFromRunInfo($runcandidates,"TempChipStart") & " °C" & @CRLF
+ $msg = $msg & "Temperature at end: " & GetValueFromRunInfo($runcandidates,"TempChipEnd") & " °C"
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Telegram.au3" "' & $msg & '"', @ScriptDir)
Return 0
-EndFunc ;==>MoveFolder
\ No newline at end of file
+EndFunc ;==>MoveFolder '
\ No newline at end of file
If $TempWaitFor == "" Then $TempWaitFor = 0
$clock = $suitrun[3]
If $clock == "" Then $clock = 100
+If IsDeclared("runnumber") Then
+ If $runnumber+1 <> $suitrun[4] Then
+ RefreshGUISendNtfct("No suitable and consecutive run found." & @CRLF & "Please change source.")
+ _ArrayAdd($skippedruns, $runnumber)
+ $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "Nothing")
+ ContinueLoop
+ EndIf
+EndIf
Global $runnumber = $suitrun[4]
$matrix = $suitrun[5]
$events = $suitrun[6]
\ No newline at end of file
If $temperaturechipend = 100000 Then $temperaturechipstart = "NULL"
$datetime = @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC
if (IsDeclared("storedir")) Then
- $path = StringReplace ( $storedir, "\", "\\") & "\\" & $runnumber
-Else
+ If StringLen($storedir) > 1 Then
+ $path = StringReplace ( $storedir, "\", "\\") & "\\" & $runnumber
+ EndIf
+EndIf
+if (Not IsDeclared("storedir")) Then
+ $path = StringReplace ( $savedir, "\", "\\") & "\\" & $runnumber
+ElseIf StringLen($storedir) <= 1 Then
$path = StringReplace ( $savedir, "\", "\\") & "\\" & $runnumber
EndIf
$path = StringReplace ( $path, "/", "//")
$notify = IniRead("config.ini", "various", "Notify", "1") ; notifycode
$notifycustom = IniRead("config.ini", "various", "NotifyCustom", "") ; chip number currently mounted into the system
+;~ $text = "Estimated runtime: sdfjaskdf askdfjkasdfj asdf aksjdfka sjdfkaj skdfa sdfas4df5as4df45 454:545"
+;~ $text = urlencode($text)
+;~ HttpPost("https://api.telegram.org/bot" & $telegramBotToken & "/sendmessage", "chat_id=" & $sendto & "&text=" & $text)
+;~ ConsoleWrite("https://api.telegram.org/bot" & $telegramBotToken & "/sendmessage?chat_id=" & $sendto & "&text=" & $text & @CRLF)
+
$error = 1
If $CmdLine[0] > 1 Then
SendNtfctn($CmdLine[2], $CmdLine[1])
-;~ If $CmdLine[1] == "USB" Then
-;~ SendNtfctn($CmdLine[2], "USB")
-;~ $error = 0
-;~ ElseIf $CmdLine[1] == "PXI" Then
-;~ SendNtfctn($CmdLine[2], "PXI")
-;~ $error = 0
-;~ ElseIf $CmdLine[1] == "Pegasus" Then
-;~ SendNtfctn($CmdLine[2], "Pegasus")
-;~ $error = 0
-;~ EndIf
EndIf
ConsoleWrite($error)
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:%20System-" & $system & ":%20" & $text & "&password=TannenbaumSaftSchorle")
+ $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bEejQPoLUIipcNpfeDvNoa5Bd48AASVBHRphY4ySu8U2FSfuDym2iHdkC_YJ2zyhhbVXVB0oRacd_QmDFsrNRATF0rT4b7pqIHj8EeUrOdq0s_gQq7BE0ERaUfHHikhet06D8ff8BUXe8uVZ5RqoI2ygWc48Q&message=RadHardSMS015735341144:%20System-" & $system & ":%20" & $text & "&password=TannenbaumSaftSchorle")
$oHTTP.Send()
EndIf
EndIf
+ If Not StringInStr($text, "Percent%20done") Then
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Telegram.au3" "' & $text & '"', @ScriptDir)
+;~ HttpPost("https://api.telegram.org/bot" & $telegramBotToken & "/sendmessage", "chat_id=" & $sendto & "&text=" & $text)
+ EndIf
+
$oHTTP = 0
EndFunc ;==>SendNtfctn
--- /dev/null
+#include "WinHttp.au3"
+$telegramBotToken = "229250039:AAE1ZLSaPlEYyLk8Az-uxaHUv2QUGy6CAqE"
+;~ $sendto = "@MABS_Updates" ; Old public channel
+;~ $sendto = "-1001070398675" ; Old channel
+$sendto = "-155736448" ; mew group chat
+
+$error = 1
+If $CmdLine[0] > 0 Then
+ SendTelegramNtfctn($CmdLine[1])
+EndIf
+ConsoleWrite($error)
+
+Func SendTelegramNtfctn($text)
+ ;$text = urlencode($text)
+ HttpPost("https://api.telegram.org/bot" & $telegramBotToken & "/sendmessage", "chat_id=" & $sendto & "&text=" & $text)
+ $error = 0
+EndFunc ;==>SendNtfctn
+
+Func urlencode($str, $plus = False)
+ Local $i, $return, $tmp, $exp
+ $return = ""
+ $exp = "[a-zA-Z0-9-._~]"
+ If $plus Then
+ $str = StringReplace($str, " ", "+")
+ $exp = "[a-zA-Z0-9-._~+]"
+ EndIf
+ For $i = 1 To StringLen($str)
+ $tmp = StringMid($str, $i, 1)
+ If StringRegExp($tmp, $exp, 0) = 1 Then
+ $return &= $tmp
+ Else
+ $return &= StringMid(StringRegExpReplace(StringToBinary($tmp, 4), "([0-9A-Fa-f]{2})", "%$1"), 3)
+ EndIf
+ Next
+ Return $return
+EndFunc ;==>urlencode
+
+
+;~ Func _Test1()
+;~ Global Const $fTestMode = false ; testmode will delete images after 15 minutes
+;~ Global Const $sAPIURL = "/bot1718sdfer7:AAGVRavnvnvnv/sendphoto?chat_id=183783345"
+;~ Global Const $sURL = "api.telegram.org"
+;~ Global $hOpen = _WinHttpOpen("")
+;~ Global $hConnect = _WinHttpConnect($hOpen, $sURL)
+;~ Global $hRequest = _WinHttpOpenRequest($hConnect, "POST", $sAPIURL)
+;~ Global $sData = ""
+;~ If $fTestMode Then
+;~ $sData &= '----------darker' & @CRLF
+;~ $sData &= 'Content-Disposition: multipart/form-data; name="testMode"' & @CRLF & @CRLF
+;~ $sData &= '1' & @CRLF
+;~ EndIf
+;~ $sData &= '----------darker' & @CRLF
+;~ $sData &= 'Content-Disposition: form-data; name="xmlOutput"' & @CRLF & @CRLF
+;~ $sData &= '1' & @CRLF
+;~ $sData &= '----------darker' & @CRLF
+;~ $sData &= 'Content-Disposition: multipart/form-data; name="imageMD5"' & @CRLF & @CRLF
+;~ $sData &= StringLower(Hex(_Crypt_HashFile("C:\Users\Pictures\342_640x960_net.jpg", $CALG_MD5))) & @CRLF
+;~ $sData &= '----------darker' & @CRLF
+;~ $sData &= 'Content-Disposition: multipart/form-data; name="photo"; filename="testimage.jpg"' & @CRLF
+;~ $sData &= 'Content-Type: image/jpg' & @CRLF & @CRLF
+;~ $sData &= FileRead("C:\Users\Pictures\342_640x960_net.jpg") & @CRLF
+;~ $sData &= '----------darker--'
+;~ _WinHttpSendRequest($hRequest, "Content-Type: multipart/form-data; boundary=--------darker", Binary($sData))
+;~ _WinHttpReceiveResponse($hRequest)
+;~ $sResult = _WinHttpReadData($hRequest)
+;~ MsgBox(0, "", $sResult)
+;~ ConsoleWrite($sResult & @CRLF)
+;~ _WinHttpCloseHandle($hRequest)
+;~ _WinHttpCloseHandle($hConnect)
+;~ _WinHttpCloseHandle($hOpen)
+;~ EndFunc
\ No newline at end of file
Else
If StringInStr($CmdLine[1], "Chip") Then
$parameter = StringRegExpReplace ($CmdLine[1], "Chip", "")
- $returnval = GetTemperatureChip($parameter) * 100
+ $returnval = GetTemperatureChip($parameter)
Else
- $returnval = GetTemperatureCooling($CmdLine[1]) * 100
+ $returnval = GetTemperatureCooling($CmdLine[1])
EndIf
EndIf
ConsoleWrite($returnval) ;### Debug Console
Exit $returnval
+
Func GetTemperatureCooling($system)
;ConsoleWrite('@@ (6) :(' & @MIN & ':' & @SEC & ') GetTemperature()' & @CR) ;### Function Trace
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$curtemperatur = StringReplace($curtemperaturmatch[0], "Internal Sensor: ", "")
;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $curtemperatur = ' & $curtemperatur & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ControlSetText("MABS (Mimosa Automation Bot System)", "", "Static3", $curtemperatur)
- Return $curtemperatur
+ Return $curtemperatur * 100.0
EndIf
EndIf
EndIf
$oHTTP = 0
- Return 1000
+ Return 100000
EndFunc ;==>GetTemperature
$curtemperatur = StringRegExpReplace ($curtemperaturmatch[0], "Sensor .+?-System => ", "")
;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $curtemperatur = ' & $curtemperatur & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ControlSetText("MABS (Mimosa Automation Bot System)", "", "Static4", $curtemperatur)
- Return $curtemperatur
+ Return $curtemperatur * 100.0
EndIf
EndIf
EndIf
$oHTTP = 0
- Return 1000
+ Return 100000
EndFunc ;==>GetTemperature
Func SetTemperature($system, $temperature)
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)
Case "Pegasus"
+
If $TempCooling == $temperaturebefore Then
$tempcorrent = True
Else
;If $tempwaiti > 5 Then ; after 30 minutes give up waiting
If $tempwaiti > 0 Then ; Dennis changed to 5 Minutes to accelerate noise-T-scan
$currenttempchip = GetTemperatureForSure("Chip" & $system)
- RefreshGUISendNtfct("Cooling could not reach needed temperature of " & $TempCooling & " °C within 5 minutes. Current cooling temperature is " & $currenttemp & ", chip temperature is " & $currenttempchip & ". Will proceed anyway.")
+ RefreshGUISendNtfct("Cooling could not reach needed temperature of " & String($TempCooling) & " °C within 5 minutes. Current cooling temperature is " & String($currenttemp) & ", chip temperature is " & String($currenttempchip) & ". Will proceed anyway.")
$tempcorrent = True
ExitLoop 1
EndIf
- $completelog &= _NowCalc() & " Current temperature is " & $currenttemp & "." & @CRLF & "Will set it to " & $TempCooling & " and wait for 5 minutes." & @CRLF
+ $texttosend = "Current temperature is " & $currenttemp & "." & @CRLF & "Will set it to " & $TempCooling & " and wait for 5 minutes."
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\Telegram.au3" "' & $texttosend & '"', @ScriptDir)
+ $completelog &= _NowCalc() & " " & $texttosend & @CRLF
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
$tempseti = 0
Do
If $tempseti > 10 Then ; after 10 failed attempts
$currenttempchip = GetTemperatureForSure("Chip" & $system)
- RefreshGUISendNtfct("Could not set temperature to " & $TempCooling & ". Current cooling temperature is " & $currenttemp & " °C, chip temperature is " & $currenttempchip & ". Will proceed anyway.")
+ RefreshGUISendNtfct("Could not set temperature to " & String($TempCooling) & ". Current cooling temperature is " & String($currenttemp) & " °C, chip temperature is " & String($currenttempchip) & ". Will proceed anyway.")
$tempcorrent = True
ExitLoop 2
EndIf
EndIf
WEnd
If $TempWaitFor > 0 Then
- $completelog &= _NowCalc() & " Found user defined waiting time, will wait for " & $TempWaitFor & " minutes before proceeding." & @CRLF
+ $texttosend = "Found user defined waiting time, will wait for " & $TempWaitFor & " minutes before proceeding."
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\Telegram.au3" "' & $texttosend & '"', @ScriptDir)
+ $completelog &= _NowCalc() & " " & $texttosend & @CRLF
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
Sleep($TempWaitFor * 60 * 1000) ; wait for user specified minutes
EndIf
$i = 0
Do
$oldcounter = GetCounter()
- $percentCurrent = Round($oldcounter / $events * 100, 2)
- $percentoverall = Round(($oldcounter / $events / $totalruns + $totalrealruns / $totalruns) * 100, 2)
- If Not $estimate And $percentoverall > 1 Then
+ $percentCurrent = Round($oldcounter / $events * 100, 3)
+ $percentoverall = Round(($oldcounter / $events / $totalruns + $totalrealruns / $totalruns) * 100, 3)
+ If Not $estimate And $percentCurrent > 5 Then
$calcsecestimate = _DateDiff('s', $starttime, _NowCalc()) ; n for minites, s for seconds
- $calcsecestimate = $calcsecestimate * 100 / $percentoverall
+ $calcsecestimate = $calcsecestimate * 100 / $percentCurrent
$calcmin = Int($calcsecestimate / 60)
$calchour = $calcsecestimate / 3600
$calchour = Round($calchour, 2)
$calcsecestimate = Int($calcsecestimate)
$timeend = _Epoch_encrypt(_NowCalc()) + $calcsecestimate
$timeend = _Epoch_decrypt($timeend)
- $completelog &= _NowCalc() & " Estimated runtime: " & $calchour & " hours." & @CRLF & "Estimated endtime: " & $timeend & @CRLF
- Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Estimated runtime: ' & $calchour & ' hours. Will end at ' & $timeend & '"', @ScriptDir)
+ $completelog &= _NowCalc() & " Estimated runtime of current run: " & $calcmin & " minutes." & @CRLF & "Estimated endtime: " & $timeend & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Estimated runtime of current run: ' & $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
+ If Not Mod($i, 10) Then
$currenttempchip = GetTemperature("Chip" & $system)
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\WriteTemperatureLog.au3" "' & $savedir & '\' & $runnumber & '\temperature.log" "' & $system & '"', @ScriptDir)
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Percent done: ' & $percentoverall & ' (' & $totalrealruns & '/' & $totalruns & ') TempChip: ' & $currenttempchip & '"', @ScriptDir)
--- /dev/null
+#include-once
+
+Global Const $HTTP_STATUS_OK = 200
+Global Const $WinHttpRequestOption_SslErrorIgnoreFlags = 4
+
+Func HttpPost($sURL, $sData = "")
+ Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
+
+ $oHTTP.Open("POST", $sURL, False)
+ If (@error) Then Return SetError(1, 0, 0)
+
+ $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
+
+;~ //ignore all SSL errors
+ $oHTTP.Option($WinHttpRequestOption_SslErrorIgnoreFlags) = 0x3300
+;~ //Unknown certification authority (CA) or untrusted root 0x0100
+;~ //Wrong usage 0x0200
+;~ //Invalid common name (CN) 0x1000
+;~ //Invalid date or certificate expired 0x2000
+
+ $oHTTP.Send($sData)
+ If (@error) Then Return SetError(2, 0, 0)
+
+ If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
+
+ Return SetError(0, 0, $oHTTP.ResponseText)
+EndFunc
+
+Func HttpGet($sURL, $sData = "")
+ Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
+
+ $oHTTP.Open("GET", $sURL & "?" & $sData, False)
+ If (@error) Then Return SetError(1, 0, 0)
+
+;~ //ignore all SSL errors
+ $oHTTP.Option($WinHttpRequestOption_SslErrorIgnoreFlags) = 0x3300
+;~ //Unknown certification authority (CA) or untrusted root 0x0100
+;~ //Wrong usage 0x0200
+;~ //Invalid common name (CN) 0x1000
+;~ //Invalid date or certificate expired 0x2000
+
+ $oHTTP.Send()
+ If (@error) Then Return SetError(2, 0, 0)
+
+ If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
+
+ Return SetError(0, 0, $oHTTP.ResponseText)
+EndFunc
;~ ; $suitrun = ReturnSuitRun("Mi34", "3", "3", "Fe55", "USB")
+;~ Local $skippedruns
+
+Func GetValueFromRunInfo($runcandidates, $name)
+ If IsArray($runcandidates) Then
+ $i = -1
+ Do
+ $i=$i+1
+ If $runcandidates[0][$i][0] == $name Then
+ Return $runcandidates[0][$i][1]
+ EndIf
+ Until $i == UBound($runcandidates, 2) - 1 Or $runcandidates[0][$i][0] == $name
+ Return "-"
+ EndIf
+EndFunc
+Func ReturnRunInfo($runnumber)
+ $sql = GetSQLConnection()
+ $sqlstring = "SELECT * FROM labbook WHERE runnumber='" & $runnumber & "' ORDER BY id DESC"
+ ConsoleWrite($sqlstring & @CRLF)
+ $runcandidates = mysql_fetch_array($sqlstring, $sql)
+ $number = _CountDifferentRecords($sql, "labbook", "runnumber", $runnumber)
+ _MySQLEnd($sql)
+ If $number > 0 Then
+ Return $runcandidates
+ Else
+ Return 0
+ EndIf
+EndFunc
Func UpdateDBwithRun($id, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path)
$sql = GetSQLConnection()
$sqlstring = $sqlstring & " AND runnumber != " & $skippedrun
EndIf
Next
+ $sqlstring = $sqlstring & " ORDER BY runnumber ASC"
$sqlstring = $sqlstring & " LIMIT 1"
ConsoleWrite($sqlstring & @CRLF)
-;~ MsgBox (0,"SQL", $sqlstring)
+;~ MsgBox (0,"SQL", $sqlstring)
$runcandidates = _Query($sql, $sqlstring)
$MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem5)
$Label1 = GUICtrlCreateLabel("Mimosa Chip", 11, 7, 64, 17)
$ChipCombo = GUICtrlCreateCombo("", 11, 26, 89, 25)
-GUICtrlSetData(-1, "FSBB|Mi32|Mi32Ter|Mi34|Pegasus")
+GUICtrlSetData(-1, "FSBB|Mi32|Mi32Ter|Mi34|Pegasus|Pipper2")
$ChipNumInput = GUICtrlCreateInput("1", 107, 26, 41, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
$Label2 = GUICtrlCreateLabel("Number", 107, 7, 41, 17)
$Label3 = GUICtrlCreateLabel("Temperature", 11, 116, 64, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Label8 = GUICtrlCreateLabel("Notify:", 11, 188, 34, 17)
$CheckboxDennis = GUICtrlCreateCheckbox("Dennis", 81, 205, 52, 17)
-$CheckboxStefan = GUICtrlCreateCheckbox("Your name here", 11, 225, 124, 17)
+$CheckboxStefan = GUICtrlCreateCheckbox("Ali", 11, 225, 124, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$hNotifyCustom = ControlGetHandle ($Form1_1, "", $NotifyCustom)
$suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB")
While Not $suitrun[0] = "" ; Do runs, until no new run found
#include "Functions\ReadAndSaveSQLParameters.au3"
- RefreshGUISendNtfct("Begin with runnumber " & $runnumber & ".")
#include "Functions\WaitForTemperature.au3"
_CheckWindowExist()
SelectBoard()
Sleep(100)
ControlFocus($hWnd, "", "TEdit23")
Sleep(1000)
+ RefreshGUISendNtfct("Begin with runnumber " & $runnumber & ".")
$starttime = _NowCalc()
StartRun()
Sleep(1000)
Sleep(200)
$j = 0
- If ($avg > 2300 Or $avg < 1700) Then
+ If ($avg > 2150 Or $avg < 1500) Then ; change 1400 back to 1700
Do
ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
$vref = GetVref()
[experimental setup]
ChipVersion = Mi19
ChipInstalled = 10
-RadSource = Fe55
+RadSource = none
[various]
-Notify = 1
-NotifyCustom = aliyazgili@yahoo.de
+Notify = 0
+NotifyCustom = (Optional)