瀏覽代碼

replace all 184 by bunches_per_turns from the config file

Miriam Brosi 7 年之前
父節點
當前提交
a05e83f3a5
共有 3 個文件被更改,包括 4 次插入2 次删除
  1. 1 1
      KCG/base/backend/dataset.py
  2. 1 1
      KCG/base/backend/io.py
  3. 2 0
      KCG/widgets/timingWidget.py

+ 1 - 1
KCG/base/backend/dataset.py

@@ -58,7 +58,7 @@ except ImportError:
         return freqs
 
 
-BUNCHES_PER_TURN = 184
+BUNCHES_PER_TURN = config.bunches_per_turn
 HEADER_SIZE_BYTES = 32
 
 

+ 1 - 1
KCG/base/backend/io.py

@@ -57,7 +57,7 @@ def decode_data(data):
         result[0::2, 4] = bunch_number[::4]
         result[1::2, 4] = bunch_number[::4] + 1
 
-        result = result[:184 * (math.floor(result.shape[0] / 184)), :]
+        result = result[:BUNCHES_PER_TURN * (math.floor(result.shape[0] / BUNCHES_PER_TURN)), :]
         return result
 
 def data_has_header(data):

+ 2 - 0
KCG/widgets/timingWidget.py

@@ -21,6 +21,8 @@ __widget_id__ = None
 __timing_plot_widget_id__ = {}
 __timing_plot_widget__ = None
 
+BUNCHES_PER_TURN = config.bunches_per_turn
+
 class timingPlotWidget(kcgw.KCGWidgets):
     """
     The Timescan result plot subwindow.