Matze há 4 anos atrás
pai
commit
7fe865fbd0
3 ficheiros alterados com 72 adições e 21 exclusões
  1. BIN
      Docu/Kapture2 Docu.pdf
  2. 52 8
      Docu/chapters/part02-develope.tex
  3. 20 13
      KCG/base/backendinterface.py

BIN
Docu/Kapture2 Docu.pdf


+ 52 - 8
Docu/chapters/part02-develope.tex

@@ -21,11 +21,9 @@ Before the Idea of KAPTURE2 came to live there was the idea to put multiple Kapt
 
 Also it should work also on the old KAPTURE-1 System but it has not been tested.
 
-\section{Design}
-\label{ch:dev:misc}
-From bottom to top.
+\section{Modules}
+This is a not a complete list of all the modules with more or less small informations. 
 
-\subsection{Modules}
 \subsubsection*{base/backend/board/communication}
 This contains the \code{class PCI}, witch wraps the system-calls for the pci communication to the FPGA.
 It also creates one instance of the class with the name \code{pci}. By using 
@@ -80,19 +78,65 @@ One example from acquiresettings widget
 
 \subsubsection*{base/backend/board/sequences} 
 The sequences are used to initialize the board. They are series of commands send to the FPGA. It is controlled by the \code{board_config} and from the backendinterface.
-The module contains to function:\\
+The module contains two function:\\
 \code{def read_sequence(board_version)}\\
 \code{def run_sequnce(board_id, sequence, progressbar=None)}
 
-The sequences are stored in json files in \textit{base/backend/board/sequences/sequence\_x.json} with x to be the board\_version. The board\_version is read by \code{board_config} from the FPGA. 
+The sequences are stored in json files in \textit{base/backend/board/sequences/sequence\_x.json} with x to be the \code{board_version}. The \code{board_version} is read by \code{board_config} from the FPGA. 
+
+All sequences in the \code{"sequence\_names"} list will have a Button.\\
+The \code{"initialization\_sequence\_order"} specifies which sequences will be run for \textit{Prepare Board} 
+
+One Sequence is represented like this
+\begin{lstlisting}
+	"demo_sequence": {
+        "Comment": "Text shown on Button",
+        "status_val": "", #some Sequences set these to enable functions inside the gui
+        "sequence": [
+            [
+                "value", "reg", 
+                "dialog text",  #If not an empty string a popup is shown before sending the command
+                "comment",      #Printed in Logfile
+                "key", "value", #Optional: used to update the board_config 
+                "key", "value"  #          It calls config.update(key, value, write=False)
+            ],
+            [
+                "value", "reg", 
+                "",             #No popup  
+                "another command without update the board_config"
+            ],
+            [
+                "value", "reg", 
+                "",               
+                "",
+                "key", "value", #only one update of board_config
+
+            ]           
+        ]
+    },
+\end{lstlisting}
 
 
 \subsubsection*{base/backend/DataSet} 
-Contains measured data. It has all the needed functions to open files, decode them and prepare them for plotting etc.
+Contains measured data. It has all the needed functions to open files, decode them and prepare them for plotting etc. 
+
+This Class is also used outside the KCG.
 
 \subsubsection*{base/backend/TimeScan} 
 Class to read and generate timescans files.
 
+This Class is also used outside the KCG.
+
+\subsubsection*{base/backend/CalibrationHandel} 
+This Class handels the Calibration Files and is used by the \code{DataSet} and \code{TimeScan}. 
+It contains also an instance of itself which should be used. So don't create a new one.
+\begin{ lstlisting}
+		theCalibration = CalibrationHandel()
+\end{ lstlisting}
+
+When ever one cals \code{theCalibration.openFile(...)} it returns a identifier. 
+
+
 \subsubsection*{base/backendinterface}
 The most messy module. It contains a vast amount of functions.
 Including:\\
@@ -118,7 +162,7 @@ there are by now:
 			from ..widgets import EpicsWidget
 			EpicsWidget.epicsConfig = EpicsWidget.EpicsConfig()
 	   \end{lstlisting}
-	\item AdcWidget
+	%\item AdcWidget
 	\item UpdateCalibrationWidget
 	\item CorrelationWidget
 \end{itemize}

+ 20 - 13
KCG/base/backendinterface.py

@@ -556,29 +556,36 @@ def _bif_read_and_update(board_id, read_type, dataOrName):
     else:
         data = DataSet(filename=dataOrName, delays=delays, tRev=config.tRev, bunchesPerTurn=config.bunches_per_turn, shiftFMC2=config.shiftFMC2)
 
+    ##############################
+    # Update Widgets with new Data
     if live_plot_windows.hasWindows(board_id):
-        
         for plotwin in live_plot_windows.getWindows(board_id):
             plotwin.plot_live(data=data)
-            QtGui.qApp.processEvents()
-
-    from ..widgets import AdcWidget
-    if AdcWidget.updateData is not None:
-        adc_widget.updateData(data)
 
+    #--
+    try:
+        from ..widgets import AdcWidget
+        if AdcWidget.updateData is not None:
+            adc_widget.updateData(data)
+    except:
+        pass
+    
+    #--
     try:
         from ..widgets import CorrelationWidget
         cw = global_objects.get_global('area').widgets[CorrelationWidget.__widget_id__]
         cw.updateDelay(data)
     except Exception as e:
         pass
-        
-
-
-    if cuda_windows is not None:
-        cuda_windows(board.get_board_status(board_id).last_file)
-
-
+    
+    #-- 
+    try:
+        if cuda_windows is not None:
+            cuda_windows(board.get_board_status(board_id).last_file)
+    except:
+        pass
+    ##############################
+    QtGui.qApp.processEvents()
 
     _bif_disable_wait_cursor()
     if PRINTDEBUG: print(time.time(), '_bif_read_and_update stop')