Browse Source

Optionally include Singleread in LeftBar

Added Configuration Option to include the single read widget into left bar above acquisition stuff
Miriam Brosi 6 years ago
parent
commit
b0fab96da0
5 changed files with 14 additions and 3 deletions
  1. 8 1
      KCG/base/leftbar.py
  2. 3 0
      KCG/config.cfg
  3. 1 1
      KCG/config.py
  4. 1 0
      KCG/kcg.py
  5. 1 1
      KCG/widgets/singleread.py

+ 8 - 1
KCG/base/leftbar.py

@@ -10,6 +10,7 @@ import storage
 from ..widgets import acquiresettings as acqs
 from groupedelements import Elements
 import backendinterface as bif
+from ..widgets import singleread
 import log
 
 
@@ -335,7 +336,9 @@ class LeftBar(kcgw.KCGWidgets):
         Initialise the UI
         """
         self.layout = QtGui.QVBoxLayout()
-        self.layout.setContentsMargins(0, 0, 5, 0)
+        self.layout.setContentsMargins(0, 0, 0, 0)
+
+
         self.setMinimumWidth(230)
 
         self.treeWidget = QtGui.QTreeWidget()
@@ -349,8 +352,12 @@ class LeftBar(kcgw.KCGWidgets):
         self.rootItem = self.treeWidget.invisibleRootItem()
 
         self.infoAndAcquisitionWidget = AcquisitionAndInfo()
+        if config.integrate_single_read:
+            self.singleReadWidget = singleread.SingleReadWidget(0, self)
 
         self.layout.addWidget(self.treeWidget)
+        if config.integrate_single_read:
+            self.layout.addWidget(self.singleReadWidget)
         self.layout.addWidget(self.infoAndAcquisitionWidget)
 
         self.setLayout(self.layout)

+ 3 - 0
KCG/config.cfg

@@ -48,6 +48,9 @@ force_ask = False
 # Show advanced table view per default? (boolean value)
 show_advanced_control = False
 
+# Integrate the single read functionality into the left bar above the general acquisition widget
+integrate_single_read = False
+
 [Logging]
 # These are PVs that will be possible to insert into log files
 # This variable is to be a list consisting of touples of two entries,

+ 1 - 1
KCG/config.py

@@ -134,7 +134,7 @@ class Configuration(object):
         defaultConfig.read(os.path.join(os.path.dirname(__file__), "config.cfg"))
 
         Machine_conf = ["bunches_per_turn", "save_header", "tRev"]
-        Ui_conf = ["language", "default_save_location", "default_subdirectory_name", "force_ask", "show_advanced_control"]
+        Ui_conf = ["language", "default_save_location", "default_subdirectory_name", "force_ask", "show_advanced_control", "integrate_single_read"]
         Logging_conf = ["epics_test_pv", "epics_base_path", "epics_log_entry_pvs", "default_log_entries"]
         Misc_conf = ['newPlotLiveIcon', 'newPlotDataIcon', 'timingIcon', 'singleReadIcon',
                      'acquireSettingsIcon', 'startIcon', 'stopIcon', 'logIcon', 'logCommentIcon', 'guiIcon', 'style',

+ 1 - 0
KCG/kcg.py

@@ -139,6 +139,7 @@ def run():
         conf.doSetup()
     if args.testing:
         config.default_subdirectory_name = 't'
+        config.board_detection_method = 'dummy'
 
     import base.kcg as kcg
 

+ 1 - 1
KCG/widgets/singleread.py

@@ -87,7 +87,7 @@ class SingleReadWidget(kcgw.KCGWidgets):
         self.outerLayout.addLayout(self.tickLayoutContinuousRead)
         self.outerLayout.addLayout(self.tickLayout)
         self.outerLayout.addLayout(self.layout)
-        self.outerLayout.addStretch(1)
+#        self.outerLayout.addStretch(1)
 
         self.set_interval()