From: Benjamin Linnik Date: Wed, 29 Jul 2015 12:58:00 +0000 (+0200) Subject: Run analyzer/Bot: Updated Bot for Pegasus, added better documentation implementation... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=f62330d062b7db862b64e6719674bd492f896618;p=radhard.git Run analyzer/Bot: Updated Bot for Pegasus, added better documentation implementation to Run analyzer --- diff --git a/MABS_run_analyzer/ChargeSpektrum.c b/MABS_run_analyzer/ChargeSpektrum.c index bf8ded8..6f94117 100644 --- a/MABS_run_analyzer/ChargeSpektrum.c +++ b/MABS_run_analyzer/ChargeSpektrum.c @@ -153,17 +153,17 @@ void ChargeSpektrum(TString runnumber = "") // runs[runi]->plotSeedThresholdCalibrated(); // runs[runi]->plotSeedThreshold(); - runs[runi]->plotSeed(); +// runs[runi]->plotSeed(); // runs[runi]->plotSum(); // runs[runi]->plotVeto(); // runs[runi]->plotNoise(); if (!isBatch) gROOT->SetBatch(kFALSE); - runs[runi]->plotAllHistograms(); -// runs[runi]->plotAllHistogramsThresholdCluster(); +// runs[runi]->plotAllHistograms(); + runs[runi]->plotAllHistogramsThresholdCluster(); runs[runi]->plotAllHistogramsThresholdClusterCalibrated(); - runs[runi]->plotAllHistogramsCalibrated(); - runs[runi]->writeAllHistogramsToFile(); +// runs[runi]->plotAllHistogramsCalibrated(); +// runs[runi]->writeAllHistogramsToFile(); } } } diff --git a/MABS_run_analyzer/MAPS.h b/MABS_run_analyzer/MAPS.h index 97182ba..876c85c 100644 --- a/MABS_run_analyzer/MAPS.h +++ b/MABS_run_analyzer/MAPS.h @@ -53,10 +53,9 @@ class Run; /** * @file MAPS.h - * @brief Use brief, otherwise the index won't have a brief explanation. + * @brief Class to process the RAW data * - * Detailed explanation. - * + * Fills the TTrees into a ROOT file * * */ class MAPS { @@ -408,7 +407,6 @@ public: * fPedestals[pixeli] = ( (Frames-1)*fPedestals[pixeli] + fCdsmatrix[pixeli] )/Frames; * fNoise[pixeli]= ( (Frames-1)*fNoise[pixeli] + TMath::Power(1.*fCdsmatrix[pixeli]-fPedestals[pixeli],2) )/Frames; * } - * * @endcode * @param Frames inverse of the weight the current frame has on the overall pedestrial and noise value * @see fNoise @@ -455,6 +453,7 @@ public: * loops over all pixel, compares * * @code if( (float)(1.*fCdsmatrix[i]-fPedestals[i]) > (5.*fNoise[i]) ) + * @endcode * * if true, saves pixel as seed pixel candidate, creates 5x5 cluster * around it. If cluster has biggest value in the middle, then count it as a valid @@ -486,8 +485,10 @@ public: Int_t* GetF1Frame() { return fF1matrix; } Float_t* GetNoise() { return fNoise; } - /// Output Directory, set and passed initMapsRun() to in the constructor - TString fOutDir;///< Some documentation for first. + // Output Directory, set and passed initMapsRun() to in the constructor + + /// Some documentation for first. + TString fOutDir; Run* run; /// Size of cluster. Don't change without code modification diff --git a/MABS_run_analyzer/Run.h b/MABS_run_analyzer/Run.h index 8b0230a..5c48ec3 100644 --- a/MABS_run_analyzer/Run.h +++ b/MABS_run_analyzer/Run.h @@ -172,7 +172,7 @@ private: /** * @brief find the border between the noise and the signal in Sr90 runs * - * writes the found threshold into the private variable #posNoiseThreshold + * writes the found threshold into the private variable @c Run::posNoiseThreshold * * @param histogrampointer pointer to the histogram structure, threshold will be searched in seed spectra * @return true if succesfull @@ -272,25 +272,25 @@ public: void setPlotStyle(Int_t); - /** @brief Plot all histograms from #histogram into one canvas */ + /** @brief Plot all histograms from @c Run::histogram into one canvas */ Bool_t plotAllHistograms(); - /** @brief Plot all histograms from #histogram into one canvas */ + /** @brief Plot all histograms from @c Run::histogram into one canvas */ Bool_t plotAllHistogramsCalibrated(); - /** @brief Plot all histograms from #histogramthreshold into one canvas */ + /** @brief Plot all histograms from @c Run::histogramthreshold into one canvas */ Bool_t plotAllHistogramsThresholdCluster(); - /** @brief Plot all histograms from #histogramthreshold into one canvas */ + /** @brief Plot all histograms from @c Run::histogramthreshold into one canvas */ Bool_t plotAllHistogramsThresholdClusterCalibrated(); /** @brief Writes a given histogram into a file */ Bool_t writeHistogramToFile(TH1F* onehistogram); - /** @brief Writes all histogram of #histogramsctruct into a file */ + /** @brief Writes all histogram of @c Run::histogramsctruct into a file */ Bool_t writeAllHistogramsToFile(); - /** @brief Makes a gnuplot file to plot the histogram data created in @c writeAllHistogramsToFile() */ + /** @brief Makes a gnuplot file to plot the histogram data created in @c Run::writeAllHistogramsToFile() */ void MakeGnuplotFile(); /// is set to true if an error occured @@ -428,7 +428,7 @@ public: TH1F* Seed; /// Sum spectrum, the charge of whole cluster is summed up in binned into this TH1F histogram TH1F* Sum; - /// Veto spectrum, used to find better calibration peak, only entries where Sum over not seed pixels is below #vetothreshold are binned into this histogram + /// Veto spectrum, used to find better calibration peak, only entries where Sum over not seed pixels is below @c Run::vetothreshold are binned into this histogram TH1F* Veto; /// Noise histogram TH1F* Noise; diff --git a/MABS_run_analyzer/Run_analyzer.c b/MABS_run_analyzer/Run_analyzer.c deleted file mode 100644 index e69de29..0000000 diff --git a/MABS_run_analyzer/Run_analyzer.h b/MABS_run_analyzer/Run_analyzer.h deleted file mode 100644 index 0049ae0..0000000 --- a/MABS_run_analyzer/Run_analyzer.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __RUN_ANALYZER__H -#define __RUN_ANALYZER__H - -#include "Run.h" -#include "MAPS.h" - -Int_t numberRuns=0; - - -/** - * @file Run_analyzer.h - * @brief Analyze and plot MABS runs - * - * Detailed explanation. - * - * - */ -// class Run_analyzer { - -// private: -// -// public: -// -// }; - -#endif \ No newline at end of file diff --git a/MABS_run_analyzer/doxygenconfig.cfg b/MABS_run_analyzer/doxygenconfig.cfg index f79afb2..e8e10bb 100644 --- a/MABS_run_analyzer/doxygenconfig.cfg +++ b/MABS_run_analyzer/doxygenconfig.cfg @@ -52,7 +52,7 @@ PROJECT_LOGO = # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = "/home/blinnik/mabs_web2/documentation/" # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output diff --git a/bot/Functions/Checkdata.au3 b/bot/Functions/Checkdata.au3 index 2d2cd96..c6dd5d4 100755 --- a/bot/Functions/Checkdata.au3 +++ b/bot/Functions/Checkdata.au3 @@ -3,7 +3,6 @@ Local $answer = MsgBox(4, "Run script?", "Preparing to do all runs with " & @CRLF & _ "Radioactive source: " & $radSource & @CRLF & _ "Chip: " & $chipversion & " (#" & $chipinstalled & ")" & @CRLF & _ - "Radiated: " & $radiated & @CRLF & _ "If you run this script, daq.exe will be closed and the current run aborted, proceed?") ;~ "of file " & $FileName & " with " & @CRLF & _ diff --git a/bot/Functions/CommonFunctions.au3 b/bot/Functions/CommonFunctions.au3 index 8044c35..5ceaf99 100755 --- a/bot/Functions/CommonFunctions.au3 +++ b/bot/Functions/CommonFunctions.au3 @@ -15,6 +15,16 @@ Func GetTemperatureForSure($whichone) Return $currenttemp / 100.0 EndFunc +Func GetTemperature($whichone) + $currenttemp = 100000; + 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 +EndFunc + Func RefreshGUISendNtfct( $msg ) Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "' & $msg & '"', @ScriptDir) $completelog &= _NowCalc() & " " & $msg & @CRLF diff --git a/bot/Functions/Header.au3 b/bot/Functions/Header.au3 index 9a7a26f..4064df3 100755 --- a/bot/Functions/Header.au3 +++ b/bot/Functions/Header.au3 @@ -11,7 +11,7 @@ #include "mysql_functions.au3" $objErr = ObjEvent("AutoIt.Error","MyErrFunc") -$programversion = "1.0" +$programversion = "1.1" $excelLineBegin = "1100" ; Change this to the range of cells you want to be processed $excelLineEnd = "4000" Global $completelog = "" @@ -45,7 +45,6 @@ $FileName = IniRead($configfile, "experimental setup", "ExcelPath", "H:\dennis d $chipversion = IniRead($configfile, "experimental setup", "ChipVersion", "Mi34") ; current chip generation in the system $chipinstalled = IniRead($configfile, "experimental setup", "ChipInstalled", "5") ; chip number currently mounted into the system $radSource = IniRead($configfile, "experimental setup", "RadSource", "none") ; current radioactive source of the system -$radiated = IniRead($configfile, "experimental setup", "Radiated", "") ; radiated chip Func MyErrFunc() diff --git a/bot/Functions/SendNtfctn.au3 b/bot/Functions/SendNtfctn.au3 index 8f5d9e8..2ed142b 100755 --- a/bot/Functions/SendNtfctn.au3 +++ b/bot/Functions/SendNtfctn.au3 @@ -4,13 +4,17 @@ $notifycustom = IniRead("config.ini", "various", "NotifyCustom", "") ; chip numb $error = 1 If $CmdLine[0] > 1 Then - If $CmdLine[1] == "USB" Then - SendNtfctn($CmdLine[2], "USB") - $error = 0 - ElseIf $CmdLine[1] == "PXI" Then - SendNtfctn($CmdLine[2], "PXI") - $error = 0 - EndIf + 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) diff --git a/bot/Functions/TemperatureControl.au3 b/bot/Functions/TemperatureControl.au3 index 7f82355..b5a25c5 100755 --- a/bot/Functions/TemperatureControl.au3 +++ b/bot/Functions/TemperatureControl.au3 @@ -24,7 +24,9 @@ Func GetTemperatureCooling($system) ;.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") + .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling") ; PXI cooling means big HUMBER cooling system + Case "Pegasus" + .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling") ; USB cooling means small HUMBER cooling system EndSwitch .Send() $HTMLSource = .Responsetext @@ -59,6 +61,8 @@ Func GetTemperatureChip($system) $curtemperaturmatch = StringRegExp ( $HTMLSource, "Sensor USB-System => (-)?[0-9]+\.[0-9]+", 2) Case "PXI" $curtemperaturmatch = StringRegExp ( $HTMLSource, "Sensor PXI-System => (-)?[0-9]+\.[0-9]+", 2) + Case "Pegasus" + $curtemperaturmatch = StringRegExp ( $HTMLSource, "Sensor PXI-System => (-)?[0-9]+\.[0-9]+", 2) EndSwitch If IsArray($curtemperaturmatch) Then If $curtemperaturmatch[0] <> "" Then @@ -92,6 +96,8 @@ Func SetTemperature($system, $temperature) .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" + .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling&" & $command) EndSwitch .Send() $HTMLSource = .Responsetext diff --git a/bot/Functions/WaitForTemperature.au3 b/bot/Functions/WaitForTemperature.au3 index 8e5cfc1..48c9a38 100755 --- a/bot/Functions/WaitForTemperature.au3 +++ b/bot/Functions/WaitForTemperature.au3 @@ -17,7 +17,7 @@ While Not $tempcorrent $tempcorrent = True Else ;If $tempwaiti > 5 Then ; after 30 minutes give up waiting - If $tempwaiti > 1 Then ; Dennis changed to 5 Minutes to accelerate noise-T-scan + 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 30 minutes. Current cooling temperature is " & $currenttemp & ", chip temperature is " & $currenttempchip & ". Will proceed anyway.") $tempcorrent = True diff --git a/bot/Functions/Watchrun.au3 b/bot/Functions/Watchrun.au3 index 3c39d01..60642d6 100755 --- a/bot/Functions/Watchrun.au3 +++ b/bot/Functions/Watchrun.au3 @@ -19,13 +19,14 @@ Do Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $percentoverall & '" "' & $percentCurrent & '"') Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"') If Not Mod($i, 30) 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 & ')"', @ScriptDir) + Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Percent done: ' & $percentoverall & ' (' & $totalrealruns & '/' & $totalruns & ') TempChip: ' & $currenttempchip & '"', @ScriptDir) EndIf Sleep(10000) - If ($oldcounter == GetCounter()) Then + If ($oldcounter + 100 > GetCounter()) Then Sleep(10000) - If ($oldcounter == GetCounter()) Then + If ($oldcounter + 100 > 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.'')"') diff --git a/bot/Functions/mysql_functions.au3 b/bot/Functions/mysql_functions.au3 index 5455d55..0da8e90 100755 --- a/bot/Functions/mysql_functions.au3 +++ b/bot/Functions/mysql_functions.au3 @@ -9,11 +9,13 @@ #ce ---------------------------------------------------------------------------- #include "mysql_header.au3" ;~ $objErr = ObjEvent("AutoIt.Error","MyErrFunc2") - -Global $sql= GetSQLConnection() +; Local $skippedruns[1] +;~ Global $sql= GetSQLConnection() ;~ MsgBox(0,"",$sql) +;~ $objTest=ObjCreate("ADODB.Connection") +;~ MsgBox(0,"",$objTest) -;$num = ReturnNumSuitRuns("34", 6, 0, "Fe55", "PXI") +;~ $num = ReturnNumSuitRuns("Pegasus", 8, "none", "Pegasus") ; ReturnSuitRun("34", 6, 0, "Fe55", "PXI") ;~ MsgBox(0,"",$num) ;~ $var= ReturnSuitRun("34", 3, 3, "Fe55", "USB") @@ -57,36 +59,68 @@ Func UpdateDBwithErrorRun($id, $datetime, $temperaturechipstart, $temperaturechi "MABS_comment='" & $comment & "' " & _ "WHERE id=" & $id + ConsoleWrite($sqlstring) _Query($sql, $sqlstring) _MySQLEnd($sql) EndFunc -Func ReturnNumSuitRuns($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $System, $Clock=0) +Func ReturnNumSuitRuns($ChipGen, $ChipNum, $RadiationSource, $System, $Clock=0) $sql = GetSQLConnection() - $ChipGen = StringReplace($ChipGen, "Mi", "", 1, 0) $sqlstring = "ChipGen='" & $ChipGen & "' AND " & _ "ChipNum='" & $ChipNum & "' AND " & _ "RadiationSource='" & $RadiationSource & "' 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 $number = _CountDifferentRecords($sql, "labbook", "id", $sqlstring) _MySQLEnd($sql) + ConsoleWrite($sqlstring & @CRLF) ConsoleWrite("ReturnNumSuitRuns: " & $number & @CRLF) Return $number ; "'ChipRadiation Ion'=" & $ChipRadiation & " AND " & _ EndFunc +Func ReturnSuitRuns($ChipGen, $ChipNum, $RadiationSource, $System, $Clock=0) + $sql = GetSQLConnection() + $runnumberLoop=0 + Local $runnumberArray[2] + Do + $sqlstring = "SELECT id, runnumber FROM labbook WHERE " + $sqlstring = $sqlstring & "ChipGen='" & $ChipGen & "' AND " + $sqlstring = $sqlstring & "ChipNum='" & $ChipNum & "' AND " + $sqlstring = $sqlstring & "RadiationSource='" & $RadiationSource & "' 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')" + ;ConsoleWrite($sqlstring & @CRLF) + ;ConsoleWrite("ReturnNumSuitRuns: " & $number & @CRLF) + $runcandidates = _Query($sql, $sqlstring) + + Local $runparam + If NOT $runcandidates.EOF Then + With $runcandidates + $runparam = .Fields("runnumber").value + + EndWith + EndIf + Local $answer2 = MsgBox(4, "Total runnumberss", "Suitable runs found at the momentsss: " & $runparam) + $runnumberLoop=$runnumberLoop+1 + Until $runnumberLoop=$totalruns + + + _MySQLEnd($sql) + Return +; "'ChipRadiation Ion'=" & $ChipRadiation & " AND " & _ +EndFunc -Func ReturnSuitRun($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $System, $Clock=0) +Func ReturnSuitRun($ChipGen, $ChipNum, $RadiationSource, $System, $Clock=0) $sql = GetSQLConnection() - $ChipGen = StringReplace($ChipGen, "Mi", "", 1, 0) $sqlstring = "SELECT id, TempCooling, TempWaitFor, Clock, runnumber, CAST(Matrix AS CHAR), Events FROM labbook WHERE " $sqlstring = $sqlstring & "ChipGen='" & $ChipGen & "' AND " $sqlstring = $sqlstring & "ChipNum='" & $ChipNum & "' AND " diff --git a/bot/GUI/MABS.au3 b/bot/GUI/MABS.au3 index a80323b..7ba6529 100755 --- a/bot/GUI/MABS.au3 +++ b/bot/GUI/MABS.au3 @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -6,67 +7,61 @@ #include #include #include "../Functions/BinaryIntegerConvert.au3" -Global $programversion = "1.0" +Global $programversion = "1.1" Global $computernameUSB = "JSPC12" Global $computernamePXI = "PXI" +Global $computernamePegasus = "SBGAT111" #include "About.au3" -#Region ### START Koda GUI section ### Form=f:\eigene dateien\downloads\dropbox\new\gui\mab.kxf -$Form1_1 = GUICreate("MABS (Mimosa Automation Bot System)", 477, 448, 275, 173) +#Region ### START Koda GUI section ### Form=c:\users\nantero\desktop\bot\gui\mab.kxf +$Form1_1 = GUICreate("MABS (Mimosa Automation Bot System)", 478, 400, 407, 127) $ProgressPercent1 = GUICtrlCreateLabel("0", -40, -40, 21, 17) $ProgressPercent2 = GUICtrlCreateLabel("0", -40, -40, 21, 17) -$LogEdit = GUICtrlCreateEdit("", 155, 74, 316, 343, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY)) -$lblTmpCooling = GUICtrlCreateLabel("-", 12, 202, 38, 17, $SS_RIGHT) -$lblTmpChip = GUICtrlCreateLabel("-", 84, 202, 38, 17, $SS_RIGHT) +$LogEdit = GUICtrlCreateEdit("", 155, 26, 316, 343, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY)) +GUICtrlSetData(-1, "") +$lblTmpCooling = GUICtrlCreateLabel("-", 12, 154, 38, 17, $SS_RIGHT) +$lblTmpChip = GUICtrlCreateLabel("-", 84, 154, 38, 17, $SS_RIGHT) $MenuItem1 = GUICtrlCreateMenu("&File") $MenuItem2 = GUICtrlCreateMenuItem("&Save"&@TAB&"Ctrl+S", $MenuItem1) $MenuItem3 = GUICtrlCreateMenuItem("&Load"&@TAB&"Ctrl+L", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("E&xit", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("&Help") $MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem5) -GUISetIcon("Rokey-The-Last-Order-Plus-Chip.ico", -1) -$Label1 = GUICtrlCreateLabel("Mimosa Chip", 11, 55, 64, 17) -$ChipCombo = GUICtrlCreateCombo("", 11, 74, 89, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) -GUICtrlSetData(-1, "Mi32|Mi32Ter|Mi34", "Mi34") -$ChipNumInput = GUICtrlCreateInput("1", 107, 74, 41, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) -$Label2 = GUICtrlCreateLabel("Number", 107, 55, 41, 17) -$Label3 = GUICtrlCreateLabel("Temperature", 11, 164, 64, 17) -$Label11 = GUICtrlCreateLabel("Cooling", 16, 184, 39, 17) -$Label4 = GUICtrlCreateLabel("° C", 56, 202, 18, 17) -$Label12 = GUICtrlCreateLabel("Chip", 96, 184, 25, 17) -$Label14 = GUICtrlCreateLabel("° C", 128, 202, 18, 17) -$Label5 = GUICtrlCreateLabel("Rad source", 95, 110, 59, 17) -$RadInput = GUICtrlCreateInput("none", 97, 129, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT)) -$Label10 = GUICtrlCreateLabel("Chip Radiation", 11, 110, 74, 17) -$RadiatedInput = GUICtrlCreateInput("", 11, 129, 76, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT)) -$Start = GUICtrlCreateButton("Start", 10, 350, 135, 30) -$NotifyCustom = GUICtrlCreateInput("(Optional)", 11, 315, 136, 21) -GUICtrlSetColor(-1, 0xC0C0C0) -$Label6 = GUICtrlCreateLabel("E-Mail or mobile phone:", 11, 294, 114, 17) -$Progress1 = GUICtrlCreateProgress(10, 387, 135, 16, $PBS_SMOOTH) +$Label1 = GUICtrlCreateLabel("Mimosa Chip", 11, 7, 64, 17) +$ChipCombo = GUICtrlCreateCombo("", 11, 26, 89, 25) +GUICtrlSetData(-1, "Mi32|Mi32Ter|Mi34|Pegasus") +$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) +$Label11 = GUICtrlCreateLabel("Cooling", 16, 136, 39, 17) +$Label4 = GUICtrlCreateLabel("° C", 56, 154, 18, 17) +$Label12 = GUICtrlCreateLabel("Chip", 96, 136, 25, 17) +$Label14 = GUICtrlCreateLabel("° C", 128, 154, 18, 17) +$Label5 = GUICtrlCreateLabel("Rad source", 15, 62, 59, 17) +$RadInput = GUICtrlCreateInput("none", 17, 81, 51, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT)) +$Start = GUICtrlCreateButton("Start", 10, 302, 135, 30) +$NotifyCustom = GUICtrlCreateInput("(Optional)", 11, 267, 136, 21) +GUICtrlSetColor(-1, 0x000000) +$Label6 = GUICtrlCreateLabel("E-Mail or mobile phone:", 11, 246, 114, 17) +$Progress1 = GUICtrlCreateProgress(10, 339, 135, 16, $PBS_SMOOTH) GUICtrlSetColor(-1, 0x000080) -$Progress2 = GUICtrlCreateProgress(10, 406, 135, 10, $PBS_SMOOTH) +$Progress2 = GUICtrlCreateProgress(10, 358, 135, 10, $PBS_SMOOTH) GUICtrlSetColor(-1, 0x000080) -$Label7 = GUICtrlCreateLabel("Log", 160, 54, 22, 17) -$CheckboxBenny = GUICtrlCreateCheckbox("Benny", 11, 253, 52, 17) +$Label7 = GUICtrlCreateLabel("Log", 160, 6, 22, 17) +$CheckboxBenny = GUICtrlCreateCheckbox("Benny", 11, 205, 52, 17) GUICtrlSetState(-1, $GUI_CHECKED) -$Label8 = GUICtrlCreateLabel("Notify:", 11, 236, 34, 17) -$CheckboxDennis = GUICtrlCreateCheckbox("Dennis", 81, 253, 52, 17) -$CheckboxStefan = GUICtrlCreateCheckbox("Stefan", 11, 273, 52, 17) -$ExcelPath = GUICtrlCreateInput("", 11, 27, 311, 21) -$Label9 = GUICtrlCreateLabel("Lab book as an Excel file", 11, 9, 123, 17) -$LoadExcel = GUICtrlCreateButton("Load file", 325, 25, 65, 25) -$ExcelOpen = GUICtrlCreateButton("Open in Excel", 395, 25, 75, 25) -Dim $Form1_1_AccelTable[2][2] = [["^s", $MenuItem2],["^l", $MenuItem3]] -GUISetAccelerators($Form1_1_AccelTable) +$Label8 = GUICtrlCreateLabel("Notify:", 11, 188, 34, 17) +$CheckboxDennis = GUICtrlCreateCheckbox("Dennis", 81, 205, 52, 17) +$CheckboxStefan = GUICtrlCreateCheckbox("Your name here", 11, 225, 124, 17) +GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $hNotifyCustom = ControlGetHandle ($Form1_1, "", $NotifyCustom) - -$hExcelPath = ControlGetHandle ($Form1_1, "", $ExcelPath) Global $Checkboxes[3] = [ $CheckboxStefan, $CheckboxDennis, $CheckboxBenny] AutoItSetOption("TrayIconHide", 1) GUISetState(@SW_SHOW) If @ComputerName == $computernamePXI Then $system = "PXI" +ElseIf @ComputerName == $computernamePegasus Then + $system = "Pegasus" Else $system = "USB" EndIf @@ -96,14 +91,6 @@ While 1 Case $MenuItem3 Local $file = FileOpenDialog ( "Select a configuration to load", "../", "Configurations (*.ini)" , "" , "config_" & $system & ".ini") If ($file) Then Loadini($file) - Case $LoadExcel - Local $file = FileOpenDialog ( "Select a loab book to work on", "../", "Excel file (*.xls;*.xlsx)") - ControlSetText($Form1_1, "", $hExcelPath, $file) - Case $ExcelOpen - $file = GUICtrlRead($ExcelPath) - If ($file) Then - ShellExecute ( $file ) - EndIf EndSwitch if ( ControlGetHandle ($Form1_1,"",ControlGetFocus($Form1_1)) == $hNotifyCustom) Then If ( ControlGetText ($Form1_1, "", $hNotifyCustom) == "(Optional)") Then @@ -144,9 +131,7 @@ Func SaveIni($file) FileDelete($file) Local $config = "ChipVersion = " & GUICtrlRead ($ChipCombo) & @LF & _ "ChipInstalled = " & GUICtrlRead ($ChipNumInput) & @LF & _ - "ExcelPath = " & GUICtrlRead ($ExcelPath) & @LF & _ - "RadSource = " & GUICtrlRead($RadInput) & @LF & _ - "Radiated = " & GUICtrlRead($RadiatedInput) & @LF + "RadSource = " & GUICtrlRead($RadInput) & @LF If ( NOT IniWriteSection ( $file, "experimental setup", $config )) Then MsgBox(16, "Saving configuration", "Could not save to file " & @CRLF & $file) Return 1 @@ -177,12 +162,10 @@ Func Loadini($file) ;~ ControlSetText($Form1_1, "", $TempInput, $ReadinArray[4][1]) ;~ ControlSetText($Form1_1, "", $RadInput, $ReadinArray[5][1]) ;~ EndIf - ControlSetText($Form1_1, "", $ExcelPath, IniRead ( $file, "experimental setup", "ExcelPath", "H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34 - Neu.xls")); current chip generation in the system$PathExcel ControlSetText($Form1_1, "", $ChipCombo, IniRead ( $file, "experimental setup", "ChipVersion", "Mi34")); current chip generation in the system ControlSetText($Form1_1, "", $ChipNumInput, IniRead($file, "experimental setup", "ChipInstalled", "5")); chip number currently mounted into the system ; ControlSetText($Form1_1, "", $TempInput, IniRead($file, "experimental setup", "SystemTemperature", "20")) ; current temperatur of the system ControlSetText($Form1_1, "", $RadInput, IniRead($file, "experimental setup", "RadSource", "none")) ; current radioactive source of the system - ControlSetText($Form1_1, "", $RadiatedInput, IniRead($file, "experimental setup", "Radiated", "")) ; current radioactive source of the system ControlSetText($Form1_1, "", $notifycustom, IniRead ( $file, "various", "NotifyCustom", "(Optional)")); current chip generation in the system$PathExcel $notify = IniRead ( $file, "various", "Notify", "1") $notify = _StringReverse(Integer2Binary(BitXOR($notify, 7))*4 + Integer2Binary ($notify)) ; 100 must be represented as 144 because of autoit convention. 4 means off for the checkboxes. diff --git a/bot/Mimosa_Autorun_PXI.au3 b/bot/Mimosa_Autorun_PXI.au3 index 9084ef1..2f3e419 100755 --- a/bot/Mimosa_Autorun_PXI.au3 +++ b/bot/Mimosa_Autorun_PXI.au3 @@ -15,7 +15,7 @@ Global $vref = 1000 ; Initial vref, will be adjusted during runtime If (Not @error) Then ; Check again if everything went well - $totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radiated, $radSource, "PXI", "100") + $totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radSource, "PXI", "100") 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 @@ -40,7 +40,7 @@ If (Not @error) Then ; Check again if everything went well $estimate = 0 $totalrealruns = 0 $starttimetotal = _NowCalc() - $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radiated, $radSource, "PXI", "100") + $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "PXI", "100") While Not $suitrun[0] = "" ; Do runs, until no new run found #include "Functions\ReadAndSaveSQLParameters.au3" #include "Functions\WaitForTemperature.au3" @@ -118,7 +118,7 @@ If (Not @error) Then ; Check again if everything went well $totalrealruns = $totalrealruns + 1 $completelog &= _NowCalc() & " Completed run " & $runnumber & ", " & $percentoverall & "% (" & $totalrealruns & "/" & $totalruns & ")" & @CRLF Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"') - $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radiated, $radSource, "PXI", "100") + $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "PXI", "100") WEnd #include "Functions\PrintSucessMessage.au3" Else diff --git a/bot/Mimosa_Autorun_USB.au3 b/bot/Mimosa_Autorun_USB.au3 index f37c847..9959375 100755 --- a/bot/Mimosa_Autorun_USB.au3 +++ b/bot/Mimosa_Autorun_USB.au3 @@ -75,7 +75,7 @@ EndFunc ;==>_GetAverage If (Not @error) Then ; Check again if everything went well - $totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radiated, $radSource, "USB") + $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 @@ -99,7 +99,7 @@ If (Not @error) Then ; Check again if everything went well $hTab = ControlGetHandle($hWnd, "", "TPageControl1") $hCounter = ControlGetHandle($hWnd, "", "TEdit25") $starttimetotal = _NowCalc() - $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radiated, $radSource, "USB") + $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB") While Not $suitrun[0] = "" ; Do runs, until no new run found #include "Functions\ReadAndSaveSQLParameters.au3" #include "Functions\WaitForTemperature.au3" @@ -201,7 +201,7 @@ If (Not @error) Then ; Check again if everything went well $totalrealruns = $totalrealruns + 1 $completelog &= _NowCalc() & " Completed run " & $runnumber & ", " & $percentoverall & "% (" & $totalrealruns & "/" & $totalruns & ")" & @CRLF Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"') - $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radiated, $radSource, "USB") + $suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB") ConsoleWrite($suitrun[0]) WEnd ControlCommand("I2C control Software for Mimosa32", "", "[TEXT:Intern]", "Check")