mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-05 20:30:03 +02:00
jf stuff
This commit is contained in:
parent
6c753f3b50
commit
e2eb1598d3
27
python/api-tests/test_jungfrau.py
Normal file
27
python/api-tests/test_jungfrau.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import pytest
|
||||||
|
import datetime as dt
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def jf():
|
||||||
|
from slsdet import Jungfrau
|
||||||
|
return Jungfrau()
|
||||||
|
|
||||||
|
|
||||||
|
def test_storagecells(jf):
|
||||||
|
for i in range(16):
|
||||||
|
jf.storagecells = i
|
||||||
|
assert jf.storagecells == i
|
||||||
|
jf.storagecells = 0 #default
|
||||||
|
|
||||||
|
def test_storagecell_start(jf):
|
||||||
|
for i in range(16):
|
||||||
|
jf.storagecell_start = i
|
||||||
|
assert jf.storagecell_start == i
|
||||||
|
jf.storagecells = 15 #default
|
||||||
|
|
||||||
|
|
||||||
|
def test_storagecell_delay(jf):
|
||||||
|
for t in [0.001, 0.0002, 0.0013]:
|
||||||
|
jf.storagecell_delay = t
|
||||||
|
assert jf.storagecell_delay == t
|
||||||
|
jf.storagecell_delay = 0 #default
|
@ -748,6 +748,38 @@ class Detector(CppDetectorApi):
|
|||||||
def storeinram(self, value):
|
def storeinram(self, value):
|
||||||
self.setStoreInRamMode(value)
|
self.setStoreInRamMode(value)
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Jungfrau specific
|
||||||
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecells(self):
|
||||||
|
return self.getNumberOfAdditionalStorageCells()
|
||||||
|
|
||||||
|
@storagecells.setter
|
||||||
|
def storagecells(self, n_cells):
|
||||||
|
self.setNumberOfAdditionalStorageCells(n_cells)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecell_start(self):
|
||||||
|
return self.getStorageCellStart()
|
||||||
|
|
||||||
|
@storagecell_start.setter
|
||||||
|
def storagecell_start(self, value):
|
||||||
|
self.setStorageCellStart(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecell_delay(self):
|
||||||
|
return ut.reduce_time(self.getStorageCellDelay())
|
||||||
|
|
||||||
|
@storagecell_delay.setter
|
||||||
|
def storagecell_delay(self, t):
|
||||||
|
self.setStorageCellDelay(ut.make_timedelta(t))
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Gotthard2
|
Gotthard2
|
||||||
"""
|
"""
|
||||||
|
@ -880,9 +880,9 @@ void init_det(py::module &m) {
|
|||||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getStorageCellStart,
|
Detector::getStorageCellStart,
|
||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
.def("setStoragecellStart",
|
.def("setStorageCellStart",
|
||||||
(void (Detector::*)(int, sls::Positions)) &
|
(void (Detector::*)(int, sls::Positions)) &
|
||||||
Detector::setStoragecellStart,
|
Detector::setStorageCellStart,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("getStorageCellDelay",
|
.def("getStorageCellDelay",
|
||||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||||
|
@ -884,7 +884,7 @@ class Detector {
|
|||||||
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
||||||
* of the series. Options: 0-15
|
* of the series. Options: 0-15
|
||||||
*/
|
*/
|
||||||
void setStoragecellStart(int cell, Positions pos = {});
|
void setStorageCellStart(int cell, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] Advanced*/
|
/** [Jungfrau] Advanced*/
|
||||||
Result<ns> getStorageCellDelay(Positions pos = {}) const;
|
Result<ns> getStorageCellDelay(Positions pos = {}) const;
|
||||||
|
@ -1844,7 +1844,7 @@ class CmdProxy {
|
|||||||
"(#storagecells + 1).");
|
"(#storagecells + 1).");
|
||||||
|
|
||||||
INTEGER_COMMAND(
|
INTEGER_COMMAND(
|
||||||
storagecell_start, getStorageCellStart, setStoragecellStart,
|
storagecell_start, getStorageCellStart, setStorageCellStart,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[0-15]\n\t[Jungfrau] Storage cell that stores the first acquisition "
|
"[0-15]\n\t[Jungfrau] Storage cell that stores the first acquisition "
|
||||||
"of the series. Default is 15. For advanced users only.");
|
"of the series. Default is 15. For advanced users only.");
|
||||||
|
@ -1132,11 +1132,11 @@ void Detector::setNumberOfAdditionalStorageCells(int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getStorageCellStart(Positions pos) const {
|
Result<int> Detector::getStorageCellStart(Positions pos) const {
|
||||||
return pimpl->Parallel(&Module::setStoragecellStart, pos, -1);
|
return pimpl->Parallel(&Module::setStorageCellStart, pos, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setStoragecellStart(int cell, Positions pos) {
|
void Detector::setStorageCellStart(int cell, Positions pos) {
|
||||||
pimpl->Parallel(&Module::setStoragecellStart, pos, cell);
|
pimpl->Parallel(&Module::setStorageCellStart, pos, cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getStorageCellDelay(Positions pos) const {
|
Result<ns> Detector::getStorageCellDelay(Positions pos) const {
|
||||||
|
@ -2355,7 +2355,7 @@ int Module::setTemperatureEvent(int val) {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Module::setStoragecellStart(int pos) {
|
int Module::setStorageCellStart(int pos) {
|
||||||
return sendToDetector<int>(F_STORAGE_CELL_START, pos);
|
return sendToDetector<int>(F_STORAGE_CELL_START, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1200,7 +1200,7 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
* @param value storage cell index. Value can be 0 to 15. (-1 gets)
|
* @param value storage cell index. Value can be 0 to 15. (-1 gets)
|
||||||
* @returns the storage cell that stores the first acquisition of the series
|
* @returns the storage cell that stores the first acquisition of the series
|
||||||
*/
|
*/
|
||||||
int setStoragecellStart(int pos = -1);
|
int setStorageCellStart(int pos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Jungfau][Ctb] Programs FPGA with raw file from pof file
|
* [Jungfau][Ctb] Programs FPGA with raw file from pof file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user