Dev/remove gotthard i (#1108)

* slsSupportLib done, at receiver rooting out in implementation

* removed from receiver and client

* removed everywhere except gui, python and client(commands.yaml and Detector.h)

* updated python

* fixed autocomplete to print what the issue is if there is one with ToString when running the autocomplete script to generate fixed.json. updated readme.md in generator folder

* formatting

* removed enums for dacs

* udpating autocomplete and generating commands

* removed gotthard from docs and release notes

* removed dac test

* bug from removing g1

* fixed virtual test for xilinx, was minor. so in this PR

* gui done

* binary in merge fix

* formatting and removing enums

* updated fixed and dump.json

* bash autocomplete

* updated doc on command line generation

* removing increments in dac enums for backward compatibility. Not required

* removed ROI from rxParameters  (only in g1), not needed to be backward compatible

* removed the phase shift option from det server staruip
This commit is contained in:
2025-03-10 14:24:33 +01:00
committed by GitHub
parent fa504e6675
commit 297c3752e3
103 changed files with 20090 additions and 27262 deletions

View File

@ -37,7 +37,6 @@ set( PYTHON_FILES
slsdet/enums.py
slsdet/errors.py
slsdet/gaincaps.py
slsdet/gotthard.py
slsdet/pattern.py
slsdet/gotthard2.py
slsdet/moench.py

View File

@ -55,7 +55,6 @@ servers = [
# "jungfrauDetectorServer",
"mythen3DetectorServer",
# "gotthard2DetectorServer",
# "gotthardDetectorServer",
# "ctbDetectorServer",
# "moenchDetectorServer",
]

View File

@ -9,7 +9,6 @@ from .detector import Detector
from .jungfrau import Jungfrau
from .mythen3 import Mythen3
from .gotthard2 import Gotthard2
from .gotthard import Gotthard
from .moench import Moench
from .pattern import Pattern, patternParameters
from .gaincaps import Mythen3GainCapsWrapper

View File

@ -274,7 +274,7 @@ class Detector(CppDetectorApi):
@property
@element
def serialnumber(self):
"""Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench] Serial number of detector """
"""Jungfrau][Mythen3][Gotthard2][CTB][Moench] Serial number of detector """
return ut.lhex(self.getSerialNumber())
@property
@ -312,7 +312,7 @@ class Detector(CppDetectorApi):
-----
[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2 (quarter speed), else to 0 (full speed)\n
[Mythen3] Options: 8, 16, 32 \n
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16
[Jungfrau][Moench][Ctb][Mythen3][Gotthard2][Xilinx Ctb] 16
"""
return self.getDynamicRange()
@ -372,7 +372,6 @@ class Detector(CppDetectorApi):
[Eiger] Use threshold command to load settings
[Jungfrau] GAIN0, HIGHGAIN0 \n
[Gotthard] DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n
[Gotthard2] DYNAMICGAIN, FIXGAIN1, FIXGAIN2 \n
[Eiger] settings loaded from file found in settingspath
[Moench] G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN
@ -404,7 +403,7 @@ class Detector(CppDetectorApi):
@element
def framesl(self):
"""
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of frames left in acquisition.\n
[Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of frames left in acquisition.\n
Note
----
@ -635,7 +634,7 @@ class Detector(CppDetectorApi):
@element
def periodl(self):
"""
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Period left for current frame.
[Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Period left for current frame.
Note
-----
@ -657,7 +656,7 @@ class Detector(CppDetectorApi):
@element
def delay(self):
"""
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Delay after trigger, accepts either a value in seconds, DurationWrapper or datetime.timedelta
[Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Delay after trigger, accepts either a value in seconds, DurationWrapper or datetime.timedelta
:getter: always returns in seconds. To get in DurationWrapper, use getDelayAfterTrigger
@ -699,7 +698,7 @@ class Detector(CppDetectorApi):
@element
def delayl(self):
"""
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Delay left after trigger during acquisition, accepts either a value in seconds, datetime.timedelta or DurationWrapper
[Jungfrau][Moench][CTB][Mythen3][Gotthard2][Xilinx Ctb] Delay left after trigger during acquisition, accepts either a value in seconds, datetime.timedelta or DurationWrapper
Note
-----
@ -1444,8 +1443,6 @@ class Detector(CppDetectorApi):
@udp_srcip.setter
def udp_srcip(self, ip):
if ip == "auto":
if self.type == detectorType.GOTTHARD:
raise NotImplementedError('Auto for udp_srcip cannot be used for GotthardI')
ip = socket.gethostbyname(self.hostname[0])
ip = ut.make_ip(ip)
ut.set_using_dict(self.setSourceUDPIP, ip)
@ -1526,7 +1523,6 @@ class Detector(CppDetectorApi):
Note
-----
[Gotthard] 0, 90, 110, 120, 150, 180, 200 \n
[Eiger][Mythen3][Gotthard2] 0 - 200 \n
[Jungfrau][Moench][Ctb] 0, 60 - 200
"""
@ -1654,7 +1650,7 @@ class Detector(CppDetectorApi):
def master(self):
"""
[Eiger][Gotthard2][Jungfrau][Moench] Sets (half) module to master and other(s) to slaves.\n
[Gotthard][Gotthard2][Mythen3][Eiger][Jungfrau][Moench] Gets if the current (half) module is master.
[Gotthard2][Mythen3][Eiger][Jungfrau][Moench] Gets if the current (half) module is master.
"""
return self.getMaster()
@ -1912,7 +1908,7 @@ class Detector(CppDetectorApi):
@property
def adcreg(self):
"""[Jungfrau][Moench][Ctb][Gotthard] Writes to an adc register
"""[Jungfrau][Moench][Ctb] Writes to an adc register
Note
-----
@ -1941,7 +1937,7 @@ class Detector(CppDetectorApi):
@element
def triggersl(self):
"""
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of triggers left in acquisition.\n
[Jungfrau][Moench][Mythen3][Gotthard2][CTB][Xilinx CTB] Number of triggers left in acquisition.\n
Note
----
@ -2206,7 +2202,7 @@ class Detector(CppDetectorApi):
Note
-----
Default: AUTO_TIMING \n
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2][Xilinx Ctb] AUTO_TIMING, TRIGGER_EXPOSURE \n
[Jungfrau][Moench][Ctb][Gotthard2][Xilinx Ctb] AUTO_TIMING, TRIGGER_EXPOSURE \n
[Mythen3] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
[Eiger] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
"""
@ -2263,7 +2259,7 @@ class Detector(CppDetectorApi):
def type(self):
""" Returns detector type.
Enum: detectorType
[EIGER, JUNGFRAU, GOTTHARD, MOENCH, MYTHEN3, GOTTHARD2, CHIPTESTBOARD]
[EIGER, JUNGFRAU, MOENCH, MYTHEN3, GOTTHARD2, CHIPTESTBOARD]
:setter: Not implemented
"""
@ -3479,15 +3475,13 @@ class Detector(CppDetectorApi):
@property
@element
def adcphase(self):
"""[Gotthard][Jungfrau][Moench][CTB] Sets phase shift of ADC clock.
"""[Jungfrau][Moench][CTB] Sets phase shift of ADC clock.
Note
-----
[Jungfrau][Moench] Absolute phase shift. Changing Speed also resets adcphase to recommended defaults.\n
[Ctb] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values.\n
[Gotthard] Relative phase shift.
[Ctb] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values.
:getter: Not implemented for Gotthard
"""
return self.getADCPhase()
@ -4088,27 +4082,6 @@ class Detector(CppDetectorApi):
return ClkDivProxy(self)
"""
---------------------------<<<Gotthard specific>>>---------------------------
"""
@property
def exptimel(self):
"""[Gotthard] Exposure time left for current frame.
:getter: always returns in seconds. To get in DurationWrapper, use getExptimeLeft
:setter: Not Implemented
Example
-----------
>>> d.exptimel
181.23
>>> d.getExptimeLeft()
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
"""
t = self.getExptimeLeft()
return reduce_time(t)
"""
---------------------------<<<Mythen3 specific>>>---------------------------

View File

@ -1,53 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file contains the specialization for the Moench detector
"""
from .detector import Detector, freeze
from .dacs import DetectorDacs
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# @freeze
# vref_ds, vcascn_pb, vcascp_pb, vout_cm, vcasc_out, vin_cm, vref_comp, ib_test_c
class GotthardDacs(DetectorDacs):
_dacs = [('vref_ds', dacIndex.VREF_DS, 0, 4000, 660),
('vcascn_pb', dacIndex.VCASCN_PB, 0, 4000, 650),
('vcascp_pb,', dacIndex.VCASCP_PB, 0, 4000, 1480),
('vout_cm', dacIndex.VOUT_CM, 0, 4000, 1520),
('vcasc_out', dacIndex.VCASC_OUT, 0, 4000, 1320),
('vin_cm', dacIndex.VIN_CM, 0, 4000, 1350),
('vref_comp', dacIndex.VREF_COMP, 0, 4000, 350),
('ib_test_c', dacIndex.IB_TESTC, 0, 4000, 2001),
]
_dacnames = [_d[0] for _d in _dacs]
#vthreshold??
@freeze
class Gotthard(Detector):
"""
Subclassing Detector to set up correct dacs and detector specific
functions.
"""
_detector_dynamic_range = [16]
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
"""available settings for Eiger, note almost always standard"""
def __init__(self, id=0):
super().__init__(id)
self._frozen = False
self._dacs = GotthardDacs(self)
@property
def dacs(self):
return self._dacs

View File

@ -1293,20 +1293,6 @@ void init_det(py::module &m) {
(void (Detector::*)(defs::collectionMode, sls::Positions)) &
Detector::setCollectionMode,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getROI",
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
Detector::getROI,
py::arg() = Positions{});
CppDetectorApi.def("setROI",
(void (Detector::*)(defs::ROI, int)) & Detector::setROI,
py::arg(), py::arg());
CppDetectorApi.def(
"clearROI", (void (Detector::*)(sls::Positions)) & Detector::clearROI,
py::arg() = Positions{});
CppDetectorApi.def("getExptimeLeft",
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
Detector::getExptimeLeft,
py::arg() = Positions{});
CppDetectorApi.def("getNumberOfBursts",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getNumberOfBursts,

View File

@ -121,13 +121,9 @@ void init_enums(py::module &m) {
.value("VTHRESHOLD", slsDetectorDefs::dacIndex::VTHRESHOLD)
.value("IO_DELAY", slsDetectorDefs::dacIndex::IO_DELAY)
.value("VREF_DS", slsDetectorDefs::dacIndex::VREF_DS)
.value("VCASCN_PB", slsDetectorDefs::dacIndex::VCASCN_PB)
.value("VCASCP_PB", slsDetectorDefs::dacIndex::VCASCP_PB)
.value("VOUT_CM", slsDetectorDefs::dacIndex::VOUT_CM)
.value("VCASC_OUT", slsDetectorDefs::dacIndex::VCASC_OUT)
.value("VIN_CM", slsDetectorDefs::dacIndex::VIN_CM)
.value("VREF_COMP", slsDetectorDefs::dacIndex::VREF_COMP)
.value("IB_TESTC", slsDetectorDefs::dacIndex::IB_TESTC)
.value("VB_COMP", slsDetectorDefs::dacIndex::VB_COMP)
.value("VDD_PROT", slsDetectorDefs::dacIndex::VDD_PROT)
.value("VIN_COM", slsDetectorDefs::dacIndex::VIN_COM)