浏览代码

Tab Order + Small Docu Improvements

fixes #14
Patrick Schreiber 8 年之前
父节点
当前提交
1e720f2f7c

二进制
Documentation/source/Man/_static/folder.png


+ 22 - 6
Documentation/source/Man/plots.rst

@@ -5,24 +5,40 @@ Plots
 
 KCG supports two types of plots - live data and saved data read from disk.
 
-To open a plot window either select Windows -> New Plot in the Menu, press the first Toolbar button or press Ctrl+N.
+To open a plot window select Windows -> New Plot in the Menu.
 
-Toolbar Symbol for new Plots:
-
-.. image:: _static/graph.png
 
 You will be asked what type of data to open. The choices are: Live Data and Data read from disk.
 
+.. note::
+    You can open each of those data types directly as described in the corresponding section below.
+
 Live Data
 ---------
 
 If you choose Live Data you can go on with :ref:`openingplotwindows`
 
+To directly open a Live Data Plot press the first toolbar button or press Ctrl+L.
+
+Toolbar Symbol for new Live Plots:
+
+.. image:: _static/graph.png
+
+
+
 Data from disk
 --------------
 
 If you choose to read data from disk, you have to specify the file to read.
 
+To directly open a Data-from-disk Plot press the second toolbar button or press Ctrl+D.
+
+Toolbar Symbol for new Data Plots:
+
+.. image:: _static/folder.png
+
+
+
 .. _openingplotwindows:
 
 Opening Plot Windows
@@ -36,7 +52,7 @@ it is ready (that is when you acquire, when continuous read is enabled or when y
     When you performed an acquisition and after that you open a live plot window, the last saved file
     will be read and plotted in this live plot window
 
-You can then choose the plot Window as seen in the next image (It is shown for saved data, but analogous for live data):
+You can choose the plot type as seen in the image below (It is shown for saved data, but analogous for live data):
 
 .. image:: _static/MultiViewFilePlot.png
 
@@ -53,5 +69,5 @@ Combined means to plot #TODO: was ???
     part of the Multi View comes in handy: Simply click on the desired plot and it will be brought to focus.
 
 .. note::
-    You can close both, the windows and the data source, by right clicking on the correspondenting entry in the left
+    You can close both, the windows and the data source, by right clicking on the corresponding entry in the left
     part of the Multi View

+ 1 - 0
Documentation/svg_png.sh

@@ -0,0 +1 @@
+nkscape -z -e $2 -w 64 -h 64 $1

+ 1 - 1
base/backendinterface.py

@@ -258,7 +258,7 @@ class _bif_ProgressBar(QtGui.QProgressBar):
 
 thread = None
 cal = None
-def bk_calibrate(do_the_rest=None): # TODO: Wie zeitkritisch ist dies, setValue braucht sicher etwas zeit
+def bk_calibrate(do_the_rest=None):
     log(additional="Calibrate")
     global thread
     global cal

+ 15 - 17
base/controlwidget.py

@@ -2,7 +2,7 @@ from PyQt4 import QtGui, QtCore
 import logging
 
 import kcgwidget as kcgw
-from backend import board  # TODO: remove direct dependency on board
+from backend import board
 from groupedelements import Checkboxes, Buttons, Elements
 import backendinterface as bif
 import storage
@@ -193,17 +193,19 @@ class ControlWidget(kcgw.KCGWidgets):
         self.gridLayout.addWidget(self.pll_ld_led, 6, 1)
 
         # -----------[ Buttons ]--------------
+        self.all_in_one_button = self.createButton(text=tr("Button", "Prepare Board"), connect=self.all_in_one,
+                                                   tooltip=tr("Tooltip", "Start, Calibrate, Synchronize and set Defaults\nCtrl+A"))
+        self.all_in_one_button.setShortcut("Ctrl+A")
+        self.all_in_one_button.setObjectName("all_in_one")
+
         self.start_button = self.createButton(text=tr("Button", "Start Board"), connect=bif.bk_start_board)
         self.calibrate_button = self.createButton(text=tr("Button", "Calibrate"), connect=bif.bk_calibrate)
         self.syncronize_button = self.createButton(text=tr("Button", "Synchronize"), connect=bif.bk_sync_board)
         self.set_default_button = self.createButton(text=tr("Button", "Set Defaults"), connect=bif.bk_set_defaults)
         self.soft_reset_button = self.createButton(text=tr("Button", "Soft Reset"), connect=bif.bk_soft_reset)
         self.off_button = self.createButton(text=tr("Button", "Board Off"), connect=bif.bk_stop_board)
-        self.all_in_one_button = self.createButton(text=tr("Button", "Prepare Board"), connect=self.all_in_one,
-                                                   tooltip=tr("Tooltip", "Start, Calibrate, Synchronize and set Defaults\nCtrl+A"))
-        self.all_in_one_button.setShortcut("Ctrl+A")
-        self.all_in_one_button.setObjectName("all_in_one")
         self.off_button.setObjectName("off")
+        self.check_status_button = self.createButton(text=tr("Button", "Check Status"), connect=bif._bif_status_readout)
 
         Buttons.addButton("start_board", self.start_button)
         Buttons.addButton(["calibrate", "after_start"], self.calibrate_button)
@@ -221,6 +223,7 @@ class ControlWidget(kcgw.KCGWidgets):
                          ])
 
         # -----------[ Add to grid ]---------------
+        self.gridLayout.addWidget(self.all_in_one_button, 1, 0)
         self.gridLayout.addWidget(self.start_button, 3, 0)
         self.gridLayout.addWidget(self.calibrate_button, 4, 0)
         self.gridLayout.addWidget(self.syncronize_button, 5, 0)
@@ -228,8 +231,7 @@ class ControlWidget(kcgw.KCGWidgets):
         self.gridLayout.addWidget(self.soft_reset_button, 7, 0)
         self.gridLayout.addItem(QtGui.QSpacerItem(10, 50), 8, 0)
         self.gridLayout.addWidget(self.off_button, 9, 0)
-        self.gridLayout.addWidget(self.all_in_one_button, 1, 0)
-        self.gridLayout.addWidget(self.createButton(text=tr("Button", "Check Status"), connect=bif._bif_status_readout), 7, 1)
+        self.gridLayout.addWidget(self.check_status_button, 7, 1)
 
 
         self.layout.addLayout(self.gridLayout)
@@ -239,6 +241,9 @@ class ControlWidget(kcgw.KCGWidgets):
         self.log_area.setReadOnly(True)
         self.overlayout.addWidget(self.log_area)
 
+        self.setTabOrder(self.soft_reset_button, self.check_status_button)
+        self.setTabOrder(self.check_status_button, self.off_button)
+
         # ------------------[ Logging ]----------------------
         log_handler = LogHandler(self.log_area)
         self.logger = logging.getLogger()
@@ -246,6 +251,8 @@ class ControlWidget(kcgw.KCGWidgets):
         self.logger.addHandler(log_handler)
         self.logger.setLevel(logging.INFO)
         logging.logger = self.logger
+        self.gridLayout.addWidget(self.all_in_one_button, 1, 0)
+
 
     def all_in_one(self):
         bif.bk_start_board()
@@ -254,16 +261,7 @@ class ControlWidget(kcgw.KCGWidgets):
             bif.bk_set_defaults()
         bif.bk_calibrate(do_the_rest)
 
-    def on_check(self, registers): # TODO: remove dependency on board
-        # import random
-        # r = [random.random()+0.5 for i in range(4)]
-        # ledlist = [self.pipeline_led, self.master_control_led, self.data_check_led, self.pll_ld_led]
-        # for i, led in enumerate(ledlist):
-        #     if int(r[i]) == 1:
-        #         led.set_on()
-        #     else:
-        #         led.set_off()
-        # logging.info("Checked: {}".format(str([int(i) for i in r])))
+    def on_check(self, registers):
         try:
             bits = []
             bits += ['{0:032b}'.format(registers[0])]

+ 1 - 2
base/kcg.py

@@ -288,7 +288,7 @@ class Gui(QtGui.QMainWindow):
         :return: -
         """
         for f in kcgw.get_registered_widgets():
-            self.multiMenu.addAction(*f[:3]) # TODO: icon
+            self.multiMenu.addAction(*f[:3]) # TODO: icon - ???
 
 
     def showSettings(self):
@@ -322,7 +322,6 @@ class Gui(QtGui.QMainWindow):
                 self.showAdvancedControl(getattr(self.storage, setting))
             if bif.bk_get_config(setting) != None:
                 bif.bk_update_config(setting, getattr(self.storage, setting))
-        # TODO: implement settings updater
 
     def showAdvancedControl(self, value):
         """

+ 2 - 2
base/kcgwidget.py

@@ -68,8 +68,8 @@ class KCGWidgets(QtGui.QWidget):
     closeSignal = QtCore.pyqtSignal()
     def __init__(self, name=None, parent=None):
         super(KCGWidgets, self).__init__(parent)
-        self._id = None # TODO: get or generate id
-        self._type = None # TODO: get or generate id
+        self._id = None
+        self._type = None
         self._name = None
         if name:
             self.theName = name

+ 2 - 3
base/leftbar.py

@@ -178,7 +178,7 @@ class LeftBar(kcgw.KCGWidgets):
         self.treeWidget.contextMenuEvent = self.contextMenuEventListView
         self.rootItem = self.treeWidget.invisibleRootItem()
 
-        self.info = AcquisitionAndInfo() # TODO: info bad variable name
+        self.info = AcquisitionAndInfo() # TODO: info bad/unclear variable name
 
         # self.layout.addWidget(self.createLabel("Plots"))
         self.layout.addWidget(self.treeWidget)
@@ -289,7 +289,7 @@ class LeftBar(kcgw.KCGWidgets):
         :return: -
         """
         if type == FILE:
-            self.Data[uid] = io.read_from_file(fName, header=storage.storage.header) # TODO: get header from file????
+            self.Data[uid] = io.read_from_file(fName, header=storage.storage.header)
         else:
             self.Data[uid] = bif.livePlotData
 
@@ -358,7 +358,6 @@ class LeftBar(kcgw.KCGWidgets):
         :param silent: (bool) ask to close even if corresponding plot windows are open
         :return: -
         """
-        # TODO: ask if open plots exist?
         if self.openData[unique_id].childCount() != 0 and not silent:
             reply = QtGui.QMessageBox.question(self, tr("Heading", 'Close Data Source'), tr("Dialog", "There are open plot windows.\n"
                                                "Close this plot source and all corresponding plot windows?"),

+ 7 - 1
style/blue.css

@@ -41,15 +41,21 @@ QScrollBar
     border-radius: 2px;
 }
 #all_in_one {
-    border: 3px solid #00aa00;
+    border: 3px solid #008800;
     border-radius: 5px;
     padding: 3px;
 }
+#all_in_one:focus {
+    border-color: #00aa00;
+}
 #off {
     border: 3px solid #aa0000;
     border-radius: 5px;
     padding: 3px;
 }
+#off:focus {
+    border-color: #00aa00;
+}
 /*QPushButton:!enabled
 {
     background-color:lightgrey;

+ 1 - 1
widgets/__init__.py

@@ -1 +1 @@
-__all__ = ['acquiresettings', 'singleread', 'timingWidget', 'remote'] #, 'example_widget']
+__all__ = ['acquiresettings', 'singleread', 'timingWidget'] #, 'remote'] #, 'example_widget']

+ 5 - 6
widgets/acquiresettings.py

@@ -26,14 +26,14 @@ class acquireSettings(kcgw.KCGWidgets):
         #---------[ Create Labels and corresponding Fields ]---------
         self.numOfOrbitsLabel = self.createLabel(tr("Label", "Number of orbits to observe")) # TODO: Better Text
         self.numOfSkipOrbitsLabel = self.createLabel(tr("Label", "Number os orbits to skip")) # TODO: Better Text
-        self.numOfOrbitsSpinbox = self.createSpinbox(1, 10000000, connect=self.on_number_of_orbits_changed) # TODO: connect and does 10000000 as max make sense?
-        self.numOfSkipOrbitsSpinbox = self.createSpinbox(1, 100, connect=self.on_number_of_skipped_orbits_changed) # TODO: connect and does 100 as max make sense?
+        self.numOfOrbitsSpinbox = self.createSpinbox(1, 10000000, connect=self.on_number_of_orbits_changed) # TODO: does 10000000 as max make sense?
+        self.numOfSkipOrbitsSpinbox = self.createSpinbox(1, 100, connect=self.on_number_of_skipped_orbits_changed) # TODO: 100 as max make sense?
         self.countLabel = self.createLabel(tr("Label", "Count"))
-        self.countSpinbox = self.createSpinbox(1, 10000000, start_value=10, connect=self.on_count_changed) # TODO: connect and does 10000000 as max make sense?
+        self.countSpinbox = self.createSpinbox(1, 10000000, start_value=10, connect=self.on_count_changed) # TODO: does 10000000 as max make sense?
         self.waitLabel = self.createLabel(tr("Label", "Wait(s)"))
-        self.waitSpinbox = self.createSpinbox(1, 60, start_value=15, connect=self.on_wait_changed) # TODO: connect and does 60 as max and default as 15 make sense?
+        self.waitSpinbox = self.createSpinbox(1, 60, start_value=15, connect=self.on_wait_changed) # TODO: does 60 as max and default as 15 make sense?
         self.simulatePilotBunch = self.createCheckbox(tr("Button", "Simulate Pilot Bunch"), connect=self.on_simulate_pilot_bunch_changed)
-        self.buildSpectrogrammTickbox = self.createCheckbox(tr("Button", "Build Spectograms"), connect=self.on_build_spectrograms_changed) # TODO: connect
+        self.buildSpectrogrammTickbox = self.createCheckbox(tr("Button", "Build Spectograms"), connect=self.on_build_spectrograms_changed)
         # -------[ register observers ]------
         board.config.observe(self.numOfOrbitsSpinbox, lambda x: self.setValueSilent(self.numOfOrbitsSpinbox, x), 'orbits_observe')
         board.config.observe(self.numOfSkipOrbitsSpinbox, lambda x: self.setValueSilent(self.numOfSkipOrbitsSpinbox, x), 'orbits_skip')
@@ -67,7 +67,6 @@ class acquireSettings(kcgw.KCGWidgets):
         self.setWindowTitle(tr("Heading", "Acquire Settings"))
         self.setValues()
 
-        # TODO: Add elements to correspondenting groups
 
     def setValueSilent(self, element, value):
         element.blockSignals(True)

+ 0 - 1
widgets/singleread.py

@@ -24,7 +24,6 @@ class singleReadWidget(kcgw.KCGWidgets):
         self.continuous_read = False
 
         #---------[ Create Labels and corresponding Fields ]---------
-        # TODO: plot after single read
         self.single_read_button = self.createButton(tr("Button", "Single Read"), connect=bif.bk_single_read)
         self.continuous_read_button = self.createButton(tr("Button", "Start Continuous Read"), connect=self.on_continuous_read)
         self.interval_spinbox = self.createSpinbox(0, 100000, start_value=1000)

+ 14 - 5
widgets/timingWidget.py

@@ -326,7 +326,8 @@ class timingWidget(kcgw.KCGWidgets):
         self.timeScanLayout.addWidget(self.fine_scan_range_label, 2, 0)
         self.timeScanLayout.addWidget(self.fine_scan_min_spinbox, 3, 0)
         self.timeScanLayout.addWidget(self.fine_scan_max_spinbox, 3, 1)
-        self.timeScanLayout.addWidget(self.time_scan_button, 5, 0)
+        self.timeScanLayout.addWidget(self.time_scan_button, 4, 0)
+        self.setTabOrder(self.fine_scan_max_spinbox, self.time_scan_button)
         # --------[ Create Labels and corresponding Fields ]---------
         def update_delay(which, spinbox):
             board.config.update(which, getattr(self, spinbox).value())
@@ -340,10 +341,10 @@ class timingWidget(kcgw.KCGWidgets):
 
         self.fineLabel = self.createLabel(tr("Label", "Fine Delay"))
 
-        self.fineAdc1Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed) #TODO: connect
-        self.fineAdc2Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed) #TODO: connect
-        self.fineAdc3Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed) #TODO: connect
-        self.fineAdc4Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed) #TODO: connect
+        self.fineAdc1Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed)
+        self.fineAdc2Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed)
+        self.fineAdc3Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed)
+        self.fineAdc4Input = self.createSpinbox(0, 31, connect=self.on_adc_delay_changed)
 
         self.toggleTimeScanCheckbox = self.createCheckbox(tr("Button", "Time Scan"), tr("Tooltip", "Show time scan part"),
                                                           connect=self.showTimeScan)
@@ -423,6 +424,14 @@ class timingWidget(kcgw.KCGWidgets):
         self.layout.addWidget(self.totalAdc4Box, 4, 4)
         self.layout.addWidget(self.toggleTimeScanCheckbox, 5, 0)
 
+        #  ------[ Exclude Total Delay Boxes from Tab Order ]--------
+        self.totalAdc1Box.setFocusPolicy(QtCore.Qt.ClickFocus)
+        self.totalAdc2Box.setFocusPolicy(QtCore.Qt.ClickFocus)
+        self.totalAdc3Box.setFocusPolicy(QtCore.Qt.ClickFocus)
+        self.totalAdc4Box.setFocusPolicy(QtCore.Qt.ClickFocus)
+
+        self.setTabOrder(self.fineAdc4Input, self.toggleTimeScanCheckbox)
+
         self.setValues()
         self.setWindowTitle(tr("Heading", "Timing"))
     def toggleAdc1IndividualDelay(self):