Patrick Schreiber 8 gadi atpakaļ
vecāks
revīzija
1b9f468bb8

+ 93 - 0
KCG/Documentation/source/Dev/code/base/bitsTable.rst

@@ -21,3 +21,96 @@ This defines the Tables used as Bits display
     .. py:method:: __init__(self, value, parent=None, optimalSize=True)
 
 
+    .. py:method:: do_style(self)
+
+
+    .. py:method:: width(self)
+
+
+    .. py:method:: height(self)
+
+
+    .. py:method:: do_optimal_size(self)
+
+
+    .. py:method:: stretch_to_width(self, width_in)
+
+
+    .. py:method:: set_item(self, row, col, value)
+
+
+    .. py:method:: set_numbers(self, value)
+
+
+    .. py:method:: set_label(self, start, end, label, color=None)
+
+
+    .. py:method:: grey_out_column(self, column)
+
+
+    .. py:method:: undo_grey_out_column(self, column)
+
+
+    .. py:method:: _get_table_item_width(self, item)
+
+
+.. py:class:: BitsEditTable(BitsDisplayTable)
+
+
+    .. py:method:: __init__(self, value, parent=None, optimalSize=True)
+
+
+    .. py:method:: populate_checkboxes(self)
+
+
+    .. py:method:: set_numbers(self, value)
+
+
+    .. py:method:: get_bits(self)
+
+
+    .. py:method:: get_bit(self, bit)
+
+
+    .. py:method:: clear_all_bits(self)
+
+
+.. py:class:: AdvancedBoardInterface(QtGui.QWidget)
+
+
+    .. py:method:: __init__(self, parent=None, board_id=None)
+
+
+    .. py:method:: do_layout(self)
+
+
+    .. py:method:: send_control_to_board(self)
+
+
+    .. py:method:: do_status1_table_layout(self, table)
+
+
+    .. py:method:: do_status2_table_layout(self, table)
+
+
+    .. py:method:: do_status3_table_layout(self, table)
+
+
+    .. py:method:: do_control_table_layout(self, table)
+
+
+    .. py:method:: update_status(self, registers)
+
+
+    .. py:method:: do_status_update(self)
+
+
+.. py:class:: AdvanceControlView(kcgw.KCGWidgets)
+
+
+    .. py:method:: __init__(self)
+
+
+    .. py:method:: pages_update_function(self)
+
+

+ 1 - 1
KCG/VERSION

@@ -1 +1 @@
-0.3.2.178.0412-beta
+0.3.2.179.0413-beta

+ 0 - 1
KCG/base/backend/board/actions.py

@@ -47,7 +47,6 @@ def flush_dma(board_id, dma='dma0'):
     """
     log.vinfo('Flushing DMA Pipeline')
     pci.write(board_id, '03f0', hex_mask='CF0')
-    # TODO: implement identifier usage
     pci.read(board_id, dma=dma, destination='/dev/null')
 
 

+ 0 - 2
KCG/base/backend/board/communication.py

@@ -170,7 +170,6 @@ class PCI(object):
         :param dma: the dma to use
         :return:
         """
-        # TODO: implement identifier usage
         log.vinfo('Start DMA')
         cmd = ['pci', '-d', available_boards.get_device_file(board_id), '--start-dma', dma]
         self._safe_call(cmd)
@@ -184,7 +183,6 @@ class PCI(object):
         :param dma: the dma to use
         :return:
         """
-        # TODO: implement identifier usage
         log.vinfo('Stop DMA')
         cmd = ['pci', '-d', available_boards.get_device_file(board_id), '--stop-dma', dma]
         self._safe_call(cmd)

+ 1 - 3
KCG/base/backendinterface.py

@@ -921,7 +921,7 @@ def _bif_read_data(board_id):
         data_raw = board.pci.read_data_to_variable(board_id)
         _bif_read_and_update_data_from_string(board_id, data_raw)
     except board.BoardError as e:
-        logging.error("Reading failed: {}".format(str(e)))  # TODO: board id
+        logging.error("Reading failed for board {}: {}".format(str(board_id), str(e)))
 
 
 def bk_board_connected(board_id):
@@ -1121,7 +1121,6 @@ def _bif_start_time_scan(board_id, c_frm, c_to, f_frm, f_to, timescan_progressba
                         # This information has to be removed here.
                         # To do so we split the output string from PCI at "Writting" (Note: Writting is correct as
                         # this is a typo in the PCI driver)
-                        # TODO: does this need board_id? (was there)
                         data = io.read_from_string(data_raw, force=True, cache=False)
                     except board.BoardError as e:
                         self.stopSignal.emit()
@@ -1368,7 +1367,6 @@ def _bif_start_wait_on_trigger(board_id, num_of_acquisitions=None, skip=None, ti
                 filename = self.path +'/{:0.3f}.out'.format(time.time())
                 board.pci.read_data_to_file(board_id, filename=filename, timeout=(self.timeout*1000000))
                 # rename with correct timestamp - last modified time
-                # TODO: Exception handling when pci does not create file
                 self.countUpdate.emit(num_of_acq + 1)
                 if self._quit:
                     break

+ 1 - 2
KCG/base/kcg.py

@@ -228,7 +228,6 @@ class Gui(QtGui.QMainWindow):
         for e in config.default_log_entries:  # for every entry:
             if e in logStrings:
                 self.measurementLogger.register_parameter(e, functionAndParameter[logStrings.index(e)][0], functionAndParameter[logStrings.index(e)][1])
-        # self.measurementLogger.register_dumper(board.config.dump)  # TODO: register dumper for all boards
         if log.no_epics and log.epics_reachable:
             logging.error("Epics installation not found. Logfiles will not contain information that is to be "
                          "obtained via epics.")
@@ -338,7 +337,7 @@ class Gui(QtGui.QMainWindow):
         :return: -
         """
         version = open(config.install_path+"VERSION").read()
-        about = QtGui.QDialog(self) # TODO: read about text externally? read version externally?
+        about = QtGui.QDialog(self)
         about.setWindowTitle("KCG - About")
         about_label = QtGui.QLabel(tr("About", "KAPTURE Control Gui\n"
                                       "KCG is a graphical control interface to the KAPTURE board\n\n"

+ 6 - 7
KCG/base/kcgwidget.py

@@ -228,7 +228,7 @@ class KCGWidgets(QtGui.QWidget):
         Setter for the type of this widget
         :param t: (int) type
         """
-        self._type = t # TODO: ??
+        self._type = t
 
     @theId.setter
     def theId(self, i):
@@ -236,7 +236,7 @@ class KCGWidgets(QtGui.QWidget):
         Setter for the id of this widget
         :param i: (int) id
         """
-        self._id = i # TODO: ??
+        self._id = i
 
     @theName.setter
     def theName(self, n):
@@ -244,7 +244,7 @@ class KCGWidgets(QtGui.QWidget):
         Setter for the name of this widget
         :param n: (str) name
         """
-        self._name = n # TODO: ??
+        self._name = n
 
     def createButton(self, text="", x=None, y=None, dimensions=None, tooltip="", connect=False, icon=None):
         """
@@ -418,7 +418,7 @@ class KCGSubWidget(QtGui.QMdiSubWindow):
         Setter for the type of this widget
         :param t: (int) type
         """
-        self._type = t # TODO: ??
+        self._type = t
 
     @theId.setter
     def theId(self, i):
@@ -426,7 +426,7 @@ class KCGSubWidget(QtGui.QMdiSubWindow):
         Setter for the id of this widget
         :param i: (int) id
         """
-        self._id = i # TODO: ??
+        self._id = i
 
     @theName.setter
     def theName(self, n):
@@ -434,7 +434,7 @@ class KCGSubWidget(QtGui.QMdiSubWindow):
         Setter for the name of this widget
         :param n: (str) name
         """
-        self._name = n # TODO: ??
+        self._name = n
 
 
 class AccordionClickLine(QtGui.QWidget):
@@ -709,7 +709,6 @@ def error(code, text, severe=False):
     :param severe: if it is a severe error that has to quit the program
     :return:
     """
-    # TODO: implement error logging to file
     if isinstance(code, str) and code[0:2] == '0x':
         cde = code
     elif isinstance(code, str):

+ 1 - 1
KCG/base/leftbar.py

@@ -86,7 +86,7 @@ class BoardSpecificInformation(kcgw.KCGWidgets):
 
         self.boardSpecificLayout = QtGui.QVBoxLayout()
         self.setLayout(self.boardSpecificLayout)
-        self.layout = QtGui.QGridLayout()  # TODO: add text for build_spectrograms ? was???
+        self.layout = QtGui.QGridLayout()
         self.layout.addWidget(self.temperature, 0, 0)
         self.layout.addWidget(self.skipturns, 1, 1)
         self.layout.addWidget(self.orbitsobserved, 1, 0)

+ 5 - 9
KCG/widgets/acquiresettings.py

@@ -48,17 +48,13 @@ class AcquireSettingsTab(kcgw.KCGWidgets):
             self.sameAsLabel.hide()
 
         # ---------[ 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 of orbits to skip"))  # TODO: Better Text
-        # TODO: does 10000000 as max make sense?
+        self.numOfOrbitsLabel = self.createLabel(tr("Label", "Number of orbits to observe"))
+        self.numOfSkipOrbitsLabel = self.createLabel(tr("Label", "Number of orbits to skip"))
         self.numOfOrbitsSpinbox = self.createSpinbox(1, 10000000, connect=self.on_number_of_orbits_changed)
-        # TODO: 100 as max make sense?
         self.numOfSkipOrbitsSpinbox = self.createSpinbox(0, 100, connect=self.on_number_of_skipped_orbits_changed)
         self.countLabel = self.createLabel(tr("Label", "Number of acquisitions"))
-        # TODO: does 10000000 as max make sense?
         self.countSpinbox = self.createSpinbox(1, 10000000, start_value=10, connect=self.on_count_changed)
         self.waitLabel = self.createLabel(tr("Label", "Wait(s)"))
-        # TODO: does 60 as max and default as 15 make sense?
         self.waitSpinbox = self.createSpinbox(0, 60, start_value=15, connect=self.on_wait_changed)
         self.simulatePilotBunch = self.createCheckbox(tr("Button", "Simulate Pilot Bunch"),
                                                       connect=self.on_simulate_pilot_bunch_changed)
@@ -164,7 +160,7 @@ class AcquireSettingsTab(kcgw.KCGWidgets):
             self.available_for_same_as[self.board_id] = False
             self.sameAsCombo.setEnabled(False)
             board.get_board_config(c_t).observe_all(
-                board.get_board_config(self.board_id).update)  # TODO: in zukunft ist die id kein int mehr
+                board.get_board_config(self.board_id).update)
             self.widgets[c_t].sameAsTick.setEnabled(False)
             self.widgets[c_t].sameAsCombo.setEnabled(False)
             Elements.setEnabled('acquire_{}'.format(self.board_id), False)
@@ -174,7 +170,7 @@ class AcquireSettingsTab(kcgw.KCGWidgets):
             self.available_for_same_as[self.board_id] = True
             self.sameAsCombo.setEnabled(True)
             board.get_board_config(c_t).unobserve_all_observer(
-                board.get_board_config(self.board_id).update)  # TODO: in zukunft ist die id kein int mehr
+                board.get_board_config(self.board_id).update)
             self.widgets[c_t].sameAsTick.setEnabled(True)
             self.widgets[c_t].sameAsCombo.setEnabled(True)
             Elements.setEnabled('acquire_{}'.format(self.board_id), True)
@@ -275,7 +271,7 @@ class AcquireSettingsTab(kcgw.KCGWidgets):
         This will read the appropriate Values from the base.backend.board.BoardConfiguration instance used in the gui.
         :return: -
         """
-        # TODO: bk_get_config has to be done for each widget seperately (get dientifier by widget.board_id)
+        # bk_get_config has to be done for each widget seperately (get dientifier by widget.board_id)
         self.set_value_silent(self.numOfOrbitsSpinbox, bif.bk_get_config(self.board_id, 'orbits_observe'))
         self.set_value_silent(self.numOfSkipOrbitsSpinbox, bif.bk_get_config(self.board_id, 'orbits_skip'))
         self.set_value_silent(self.countSpinbox, bif.bk_get_config(self.board_id, 'acquisition_count'))

+ 1 - 1
setup.py

@@ -5,7 +5,7 @@ DESCRIPTION = "KCG KAPTURE Control Gui"
 
 setup(
     name='KCG',
-    version='0.3.2.178.0412-beta',
+    version='0.3.2.179.0413-beta',
     author='Patrick Schreiber',
     author_email='uldfk@student.kit.edu',
 #    license='GPL',