]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Run analyzer/Bot: Updated Bot for Pegasus, added better documentation implementation...
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Wed, 29 Jul 2015 12:58:00 +0000 (14:58 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Wed, 29 Jul 2015 12:58:00 +0000 (14:58 +0200)
17 files changed:
MABS_run_analyzer/ChargeSpektrum.c
MABS_run_analyzer/MAPS.h
MABS_run_analyzer/Run.h
MABS_run_analyzer/Run_analyzer.c [deleted file]
MABS_run_analyzer/Run_analyzer.h [deleted file]
MABS_run_analyzer/doxygenconfig.cfg
bot/Functions/Checkdata.au3
bot/Functions/CommonFunctions.au3
bot/Functions/Header.au3
bot/Functions/SendNtfctn.au3
bot/Functions/TemperatureControl.au3
bot/Functions/WaitForTemperature.au3
bot/Functions/Watchrun.au3
bot/Functions/mysql_functions.au3
bot/GUI/MABS.au3
bot/Mimosa_Autorun_PXI.au3
bot/Mimosa_Autorun_USB.au3

index bf8ded8ccdc117a9350ff4d04dbe8051902a7d9f..6f941176addd8f53e01596d194ae9866342a9ce0 100644 (file)
@@ -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(); 
                 }
             }
         }
index 97182ba2f40d10068270ea2c999b90e8693e2880..876c85cc0727733b87c547adee1ce3d1359729f6 100644 (file)
@@ -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
index 8b0230a749dbbc3f51234c32deb33192be87f44d..5c48ec3f325e323d796c4086655ed4c99cb3923e 100644 (file)
@@ -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 (file)
index e69de29..0000000
diff --git a/MABS_run_analyzer/Run_analyzer.h b/MABS_run_analyzer/Run_analyzer.h
deleted file mode 100644 (file)
index 0049ae0..0000000
+++ /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
index f79afb2a9a663bb4252fc837b9d50aefd2972925..e8e10bbac89b52fdd1e4bf847c146bfdd24d2adb 100644 (file)
@@ -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
index 2d2cd969d1d8bd17677c60c13ea10eb7d892c28e..c6dd5d4ffdcd2749631c60f44378fc940093db11 100755 (executable)
@@ -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 & _
 
index 8044c35a76eec9b2cfe8d1fbbf3aa47fdca9350b..5ceaf992d91847a612e1d5d1d491758c13237c20 100755 (executable)
@@ -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
index 9a7a26f1782170b9171395d34d815495f5fabd43..4064df34f2219438852818190bf61b2606210e80 100755 (executable)
@@ -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()
 
index 8f5d9e8eee2bf4fdd69279c8013ade0344e796d8..2ed142b1d3adca589d7999d38acf7d7e7239f65b 100755 (executable)
@@ -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)
 
index 7f82355c0de3026a1cb4d558b543e9ebb346aedc..b5a25c589c13d719bbaa75dc8045e4237cff109a 100755 (executable)
@@ -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
index 8e5cfc181775d23fca086886ac81a5f49aa33df8..48c9a38c73af1da277bb511912345d5e718884fd 100755 (executable)
@@ -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
index 3c39d01b676ecba7949c3b679de5a05c4faa87bf..60642d6c08afe8583fec1c5be5e04ca43e8a9e84 100755 (executable)
@@ -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.'')"')
index 5455d554135022349e9dc6cb3f9df4975c83abec..0da8e901a3e946f8acd6a85b4fc325b7f8dfc25e 100755 (executable)
@@ -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 "
index a80323b13f3cf3b9de8791a1527b05520c9f53a3..7ba652927817a358cb1333fef3da476259cf4d64 100755 (executable)
@@ -1,4 +1,5 @@
 #include <ButtonConstants.au3>
+#include <ButtonConstants.au3>
 #include <ComboConstants.au3>
 #include <EditConstants.au3>
 #include <GUIConstantsEx.au3>
@@ -6,67 +7,61 @@
 #include <StaticConstants.au3>
 #include <WindowsConstants.au3>
 #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.
index 9084ef1acd664540695f6f5517870e5583ba23ad..2f3e41998bfb37f409086570007fe1c974e76d06 100755 (executable)
@@ -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
index f37c8477130f2a46b8cfcd51f491eabe4918091a..9959375e030040ef2ae1a2e9d595f9f4c71ada05 100755 (executable)
@@ -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")