mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-05-08 19:32:03 +02:00
CTB frequency rounding, CTB frequency measurement, CTB frequency units (#1423)
* round CTB clocks to next closest possible value, added freq measurement * added time for firmware to measrue actual value after frequency change * add check for backwards compatibility * change CTB and XCTB clock values to MHz, TODO: units and validation errors * changed runclk command to use units and float, TODO: dbit, adcclk, why is everything called StringTo ? * do the same for dbit and adcclk * added tolerance to exptime, fixed test * update default values in server defs * added virtual check in Altera_PLL, update testcases * change python and pyctbgui to accept and return floating point MHz * update help and comments * Dev/ctb clocks fix (#1434) * introduced new type Hz, typetraits, String conversions, command generation (not yet generated) * incorrect unit typo * cmd generation and compiles * default to MHz, removed space between units for consistency with timers, min and max checks for clks * in python, but need to change the default to Hz again for clean code and intuition * allow ints, doubles, implicit conversions * dont allow raw ints, doubles and implicit conversions * fixed tests * added operators for Hz in python * fix test for min clk for xilinx ctb * fix test * fix python tests * fixed xilinx period and default clks * test fix * removed the 3 clock cycle check for ctb and implemented properly the max adc clk frq for altera ctb * removing 3 clock cycle code from xilinx as well * formatting * loadpattern before 3 clk cycles code * actualtime and measurement time to be implemented in 100ns already in fw * fix tests * pyzmq dependency forthe tests * fixed pyctbgui for freq * insert tolerance check again * also added tolerance check for patwaittime * formatting * minor: rounding test * removed Rep redundant in ToString for freq * intro frequency unit enums, removed unnecessary template behavior for ToString with freq unit, switching from parsing string unit argument to the enum argument for ToString, adding parsing string to unit at CLI boundary * minor, and binaries * minor, default clk vals are 0 but set up at detector setup * get frequency only for that unit * tolerance process * missed in previous commit * some more changes to exptime and validations * ctb is probably done * periodleft and delayleft * fixed xilinx freq conv as well * fixed m3 bug, binaries * xilinx: setup also done in stop server so that the clk is not 0 * missed a test marker * binaries in * review fixes, simpler validation of timers in ctb and xilinx ctb * typo fix * format * fix tests --------- Co-authored-by: Martin Mueller <martin.mueller@psi.ch> Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
@@ -34,6 +34,9 @@ scanParameters = _slsdet.scanParameters
|
||||
currentSrcParameters = _slsdet.currentSrcParameters
|
||||
DurationWrapper = _slsdet.DurationWrapper
|
||||
pedestalParameters = _slsdet.pedestalParameters
|
||||
Hz = _slsdet.Hz
|
||||
kHz = _slsdet.kHz
|
||||
MHz = _slsdet.MHz
|
||||
|
||||
import os
|
||||
def read_version():
|
||||
|
||||
+32
-13
@@ -14,11 +14,12 @@ powerIndex = slsDetectorDefs.powerIndex
|
||||
detectorType = slsDetectorDefs.detectorType
|
||||
streamingInterface = slsDetectorDefs.streamingInterface
|
||||
|
||||
|
||||
defs = slsDetectorDefs
|
||||
|
||||
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
||||
from .utils import Geometry, to_geo, element, reduce_time, is_iterable, hostname_list
|
||||
from ._slsdet import xy, freeSharedMemory, getUserDetails
|
||||
from ._slsdet import xy, Hz, freeSharedMemory, getUserDetails
|
||||
from .gaincaps import Mythen3GainCapsWrapper
|
||||
from . import utils as ut
|
||||
from .proxy import JsonProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy, PatLoopProxy, PatNLoopProxy, PatWaitProxy, PatWaitTimeProxy
|
||||
@@ -3441,15 +3442,21 @@ 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.
|
||||
|
||||
Example
|
||||
--------
|
||||
>>> d.runclk
|
||||
>>> 10MHz
|
||||
>>> d.runclk = MHz(5)
|
||||
>>> d.runclk = Hz(5 * 1000 * 1000)
|
||||
>>> d.runclk = kHz(2000)
|
||||
"""
|
||||
return self.getRUNClock()
|
||||
|
||||
@runclk.setter
|
||||
def runclk(self, freq):
|
||||
ut.set_using_dict(self.setRUNClock, freq)
|
||||
ut.set_using_dict(self.setRUNClock, freq)
|
||||
|
||||
@property
|
||||
@element
|
||||
@@ -3526,10 +3533,16 @@ 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.
|
||||
|
||||
Example
|
||||
--------
|
||||
>>> d.dbitclk
|
||||
>>> 10MHz
|
||||
>>> d.dbitclk = MHz(5)
|
||||
>>> d.dbitclk = Hz(5 * 1000 * 1000)
|
||||
>>> d.dbitclk = kHz(2000)
|
||||
"""
|
||||
return self.getDBITClock()
|
||||
|
||||
@dbitclk.setter
|
||||
@@ -3657,10 +3670,16 @@ 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.
|
||||
|
||||
Example
|
||||
--------
|
||||
>>> d.adcclk
|
||||
>>> 10MHz
|
||||
>>> d.adcclk = MHz(5)
|
||||
>>> d.adcclk = Hz(5 * 1000 * 1000)
|
||||
>>> d.adcclk = kHz(2000)
|
||||
"""
|
||||
return self.getADCClock()
|
||||
|
||||
@adcclk.setter
|
||||
@@ -3671,7 +3690,7 @@ class Detector(CppDetectorApi):
|
||||
@element
|
||||
def syncclk(self):
|
||||
"""
|
||||
[Ctb] Sync clock in MHz.
|
||||
[Ctb] Sync clock.
|
||||
|
||||
:setter: Not implemented
|
||||
"""
|
||||
@@ -3704,7 +3723,7 @@ class Detector(CppDetectorApi):
|
||||
[Ctb][Mythen3][Xilinx Ctb] Gets the pattern file name including path of the last pattern uploaded. Returns an empty if nothing was uploaded or via a server default
|
||||
file
|
||||
"""
|
||||
return self.getPatterFileName()
|
||||
return self.getPatternFileName()
|
||||
|
||||
def patternstart(self):
|
||||
"""[Ctb][Mythen3][Xilinx Ctb] Starts pattern. """
|
||||
|
||||
Reference in New Issue
Block a user