Pārlūkot izejas kodu

code improvements

Patrick Schreiber 8 gadi atpakaļ
vecāks
revīzija
8718ec2ea7
4 mainītis faili ar 42 papildinājumiem un 44 dzēšanām
  1. 1 1
      KCG/VERSION
  2. 38 41
      KCG/base/backend/board/board_config.py
  3. 1 1
      KCG/kcg.py
  4. 2 1
      setup.py

+ 1 - 1
KCG/VERSION

@@ -1 +1 @@
-0.2.3.154.0304-beta
+0.2.3.155.0312-beta

+ 38 - 41
KCG/base/backend/board/board_config.py

@@ -28,47 +28,44 @@ class BoardConfiguration(QtGui.QWidget):
             self.load_config(config_file)
 
     def _set_defaults(self):
-        c = self._config
-        c['fpga_delay_max']       = 15
-        c['fpga_delay']           = 0
-        c['fpga_delay_factor']    = 150
-
-        c['chip_delay_max']       = 31
-        c['chip_1_delay']         = 4
-        c['chip_2_delay']         = 4
-        c['chip_3_delay']         = 4
-        c['chip_4_delay']         = 4
-        c['chip_delay_factor']    = 3
-
-        c['th_delay_max']         = 15
-        c['th_delay']             = 3
-        c['th_delay_factor']      = 150
-
-        c['adc_delay_max']        = 15
-        c['adc_1_delay']          = 4
-        c['adc_2_delay']          = 4
-        c['adc_3_delay']          = 4
-        c['adc_4_delay']          = 4
-        c['adc_delay_factor']     = 150
-
-        c['th_to_adc_cycles']     = 7
-        c['adc_1_delay_individual'] = -1  #      -1 = 'ADC 1 delay is the same as th_to_adc_cycles'
-                                          # 0 .. 16 = 'Use this offset instead'
-
-        c['orbits_observe']       = 100
-        c['orbits_skip']          = 2
-        c['acquisition_count']    = 10
-        c['orbits_wait_time']     = 15
-        c['trigger_skip']         = 0
-        c['trigger_timeout']      = 12
-        c['trigger_method']       = 1
-        c['use_trigger']          = False
-        c['build_spectrograms']   = False
-        c['pilot_bunch']          = False
-        if kcg_config.save_header == True:  # Do not write directly in case of damaged config file
-            c['header']           = True
-        else:
-            c['header']           = False
+        self._config ={
+            'fpga_delay_max': 15,
+            'fpga_delay': 0,
+            'fpga_delay_factor': 150,
+
+            'chip_delay_max': 31,
+            'chip_1_delay': 4,
+            'chip_2_delay': 4,
+            'chip_3_delay': 4,
+            'chip_4_delay': 4,
+            'chip_delay_factor': 3,
+
+            'th_delay_max': 15,
+            'th_delay': 3,
+            'th_delay_factor': 150,
+
+            'adc_delay_max': 15,
+            'adc_1_delay': 4,
+            'adc_2_delay': 4,
+            'adc_3_delay': 4,
+            'adc_4_delay': 4,
+            'adc_delay_factor': 150,
+
+            'th_to_adc_cycles': 7,
+            'adc_1_delay_individual': -1,
+
+            'orbits_observe': 100,
+            'orbits_skip': 2,
+            'acquisition_count': 10,
+            'orbits_wait_time': 15,
+            'trigger_skip': 0,
+            'trigger_timeout': 12,
+            'trigger_method': 1,
+            'use_trigger': False,
+            'build_spectrograms': False,
+            'pilot_bunch': False,
+            'header': True if kcg_config.save_header is True else False
+        }
 
     def set_default_observers(self):
         self.observe(None, self.update_header, 'header')

+ 1 - 1
KCG/kcg.py

@@ -82,7 +82,7 @@ def run():
 
     parser = ap.ArgumentParser("KCG - KAPTURE Control Gui")
     parser.add_argument('--config', type=str, default='', help='Override Configuration file settings.'
-                        'Format: "Section:setting=content;Section:setting2=content;Section2:setting3=content" etc.')
+                        'Format: "Section->setting=content;Section->setting2=content;Section2->setting3=content" etc.')
     parser.add_argument('--version', action='store_true', help="Print Version and exit")
     parser.add_argument('--vversion', action='store_true', help="Print Version verbose and exit")
     parser.add_argument('--fpga-detection', action='store_true', help="If Present, use 'dev' detection mode (detect"

+ 2 - 1
setup.py

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