mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-06-07 19:58:40 +02:00
change python and pyctbgui to accept and return floating point MHz
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_19">
|
||||
<item row="1" column="5">
|
||||
<widget class="QSpinBox" name="spinBoxRunF">
|
||||
<widget class="QDoubleSpinBox" name="spinBoxRunF">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -61,11 +61,17 @@
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
<double>1000.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -285,7 +291,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxADCF">
|
||||
<widget class="QDoubleSpinBox" name="spinBoxADCF">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -307,8 +313,14 @@
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
<double>1000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -375,7 +387,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QSpinBox" name="spinBoxDBITF">
|
||||
<widget class="QDoubleSpinBox" name="spinBoxDBITF">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -397,8 +409,14 @@
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
<double>1000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
+33
-13
@@ -3520,15 +3520,22 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def runclk(self):
|
||||
"""
|
||||
[Ctb] Sets Run clock frequency in MHz. \n
|
||||
[Xilinx Ctb] Sets Run clock frequency in kHz.
|
||||
[Ctb][Xilinx Ctb] Sets Run clock frequency in MHz. \n
|
||||
Accepts floating point inputs
|
||||
"""
|
||||
|
||||
return self.getRUNClock()
|
||||
freq_hz = element_if_equal(self.getRUNClock())
|
||||
if isinstance(freq_hz, list):
|
||||
return [value / 1e6 for value in freq_hz]
|
||||
return freq_hz / 1e6
|
||||
|
||||
@runclk.setter
|
||||
def runclk(self, freq):
|
||||
ut.set_using_dict(self.setRUNClock, freq)
|
||||
if isinstance(freq, dict):
|
||||
freq_hz = {key: int(round(value * 1e6)) for key, value in freq.items()}
|
||||
else:
|
||||
freq_hz = int(round(freq * 1e6))
|
||||
ut.set_using_dict(self.setRUNClock, freq_hz)
|
||||
|
||||
@property
|
||||
@element
|
||||
@@ -3605,15 +3612,21 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def dbitclk(self):
|
||||
"""
|
||||
[Ctb] Sets clock for latching the digital bits in MHz. \n
|
||||
[Xilinx Ctb] clock for latching the digital bits in kHz.
|
||||
[Ctb][Xilinx Ctb] Sets clock for latching the digital bits in MHz. \n
|
||||
Accepts floating point inputs
|
||||
"""
|
||||
|
||||
return self.getDBITClock()
|
||||
freq_hz = element_if_equal(self.getDBITClock())
|
||||
if isinstance(freq_hz, list):
|
||||
return [value / 1e6 for value in freq_hz]
|
||||
return freq_hz / 1e6
|
||||
|
||||
@dbitclk.setter
|
||||
def dbitclk(self, value):
|
||||
ut.set_using_dict(self.setDBITClock, value)
|
||||
if isinstance(value, dict):
|
||||
value_hz = {key: int(round(item * 1e6)) for key, item in value.items()}
|
||||
else:
|
||||
value_hz = int(round(value * 1e6))
|
||||
ut.set_using_dict(self.setDBITClock, value_hz)
|
||||
|
||||
@property
|
||||
@element
|
||||
@@ -3736,15 +3749,22 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def adcclk(self):
|
||||
"""
|
||||
[Ctb] Sets ADC clock frequency in MHz. \n
|
||||
[Xilinx Ctb] Sets ADC clock frequency in kHz.
|
||||
[Ctb][Xilinx Ctb] Sets ADC clock frequency in MHz. \n
|
||||
Accepts floating point inputs
|
||||
"""
|
||||
|
||||
return self.getADCClock()
|
||||
freq_hz = element_if_equal(self.getADCClock())
|
||||
if isinstance(freq_hz, list):
|
||||
return [value / 1e6 for value in freq_hz]
|
||||
return freq_hz / 1e6
|
||||
|
||||
@adcclk.setter
|
||||
def adcclk(self, value):
|
||||
ut.set_using_dict(self.setADCClock, value)
|
||||
if isinstance(value, dict):
|
||||
value_hz = {key: int(round(item * 1e6)) for key, item in value.items()}
|
||||
else:
|
||||
value_hz = int(round(value * 1e6))
|
||||
ut.set_using_dict(self.setADCClock, value_hz)
|
||||
|
||||
@property
|
||||
@element
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
// clang-format on
|
||||
|
||||
// freq in kHz !!
|
||||
// freq in Hz !!
|
||||
int XILINX_PLL_setFrequency(uint32_t clk_index, uint32_t freq) {
|
||||
if (clk_index >= XILINX_PLL_NUM_CLKS) {
|
||||
LOG(logERROR, ("XILINX_PLL: Invalid clock index %d\n", clk_index));
|
||||
|
||||
Reference in New Issue
Block a user