merge from 7.0.0.rc

This commit is contained in:
maliakal_d 2023-01-17 09:48:59 +01:00
commit 3bf6be41b4
11 changed files with 21 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 299 KiB

View File

@ -31,7 +31,7 @@ alpha_wait = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
alpha_wait_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2] alpha_wait_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
# Loop colors and line styles (6 needed from 0 to 5) # Loop colors and line styles (6 needed from 0 to 5)
colors_loop = ['tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:ping', 'tab:grey'] colors_loop = ['tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:grey']
linestyles_loop = ['-.', '-.', '-.', '-.', '-.', '-.'] linestyles_loop = ['-.', '-.', '-.', '-.', '-.', '-.']
alpha_loop = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5] alpha_loop = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
alpha_loop_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2] alpha_loop_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2]

View File

@ -12,6 +12,7 @@ void init_duration(py::module &m) {
.def("total_seconds", &DurationWrapper::total_seconds) .def("total_seconds", &DurationWrapper::total_seconds)
.def("count", &DurationWrapper::count) .def("count", &DurationWrapper::count)
.def("set_count", &DurationWrapper::set_count) .def("set_count", &DurationWrapper::set_count)
.def("__eq__", &DurationWrapper::operator==)
.def("__repr__", [](const DurationWrapper &self) { .def("__repr__", [](const DurationWrapper &self) {
std::stringstream ss; std::stringstream ss;
ss << "sls::DurationWrapper(total_seconds: " << self.total_seconds() ss << "sls::DurationWrapper(total_seconds: " << self.total_seconds()

View File

@ -8,7 +8,7 @@ Testing functions from utils.py
import pytest import pytest
from slsdet.utils import * from slsdet.utils import *
from slsdet import IpAddr, MacAddr from slsdet import IpAddr, MacAddr, DurationWrapper
import datetime as dt import datetime as dt
import pathlib import pathlib
from pathlib import Path from pathlib import Path
@ -22,7 +22,11 @@ def test_iterable():
def test_reduce_time_to_single_value_from_list(): def test_reduce_time_to_single_value_from_list():
t = 3 * [dt.timedelta(seconds=1)] t = [dt.timedelta(seconds=1) for i in range(3)]
assert reduce_time(t) == 1
def test_reduce_time_to_single_value_from_list_DurationWrapper():
t = [DurationWrapper(1) for i in range(3)]
assert reduce_time(t) == 1 assert reduce_time(t) == 1
@ -83,6 +87,12 @@ def test_all_equal_str_fails():
assert all_equal('aaab') == False assert all_equal('aaab') == False
def test_all_equal_DurationWrapper():
assert all_equal([DurationWrapper(1), DurationWrapper(1)])
def test_all_equal_DurationWrapper_fail():
assert not all_equal([DurationWrapper(1), DurationWrapper(2)])
def test_element_if_equal_int(): def test_element_if_equal_int():
assert element_if_equal([5, 5]) == 5 assert element_if_equal([5, 5]) == 5

View File

@ -1007,7 +1007,9 @@ int setDelayAfterTrigger(int64_t val) {
// validate for tolerance // validate for tolerance
int64_t retval = getDelayAfterTrigger(); int64_t retval = getDelayAfterTrigger();
val /= (1E-9 * CLK_FREQ); val /= (1E-9 * CLK_FREQ);
val -= masterdefaultdelay; if (master) {
val -= masterdefaultdelay;
}
if (val != retval) { if (val != retval) {
return FAIL; return FAIL;
} }

View File

@ -313,7 +313,7 @@ patternParameters *setChannelRegisterChip(int ichip, char *mask,
chanReg, ichip * NCHAN + ich * NCOUNTERS, chanReg, ichip * NCHAN + ich * NCOUNTERS,
ichip * NCHAN_1_COUNTER + ich, ichip, ich)); ichip * NCHAN_1_COUNTER + ich, ichip, ich));
} }
for (int i = 0; i < 24; i++) { for (int i = 0; i < 23; i++) {
patword = clearBit(SIGNAL_clk, patword); patword = clearBit(SIGNAL_clk, patword);
pat->word[iaddr++] = patword; pat->word[iaddr++] = patword;

View File

@ -4,11 +4,11 @@
#define RELEASE "developer" #define RELEASE "developer"
#define APILIB "developer 0x221213" #define APILIB "developer 0x221213"
#define APIRECEIVER "developer 0x221213" #define APIRECEIVER "developer 0x221213"
#define APICTB "developer 0x221213" #define APICTB "developer 0x221213"
#define APIGOTTHARD "developer 0x221213"
#define APIGOTTHARD2 "developer 0x221213" #define APIGOTTHARD2 "developer 0x221213"
#define APIJUNGFRAU "developer 0x221213" #define APIJUNGFRAU "developer 0x221213"
#define APIMYTHEN3 "developer 0x221213"
#define APIMOENCH "developer 0x221213" #define APIMOENCH "developer 0x221213"
#define APIEIGER "developer 0x221213" #define APIEIGER "developer 0x221213"
#define APIGOTTHARD "developer 0x230117"
#define APIMYTHEN3 "developer 0x230117"