mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
removed online flags, apiversion in shm, ret for ok and fail, bind socket help in exception message (#43)
* removed online flag, removed rxronline flag, added useReceier flag that is set only when rxr hostname is set, removed setonline, setreceiveronline flag, removed ret for ok or fail, using exceptions for this, changed cannot bind socket printout * fixed python
This commit is contained in:
@ -115,12 +115,6 @@ class Detector {
|
||||
|
||||
std::string checkOnline() { return det.checkOnline(); }
|
||||
|
||||
bool getReceiverOnline() { return det.setReceiverOnline(); }
|
||||
void setReceiverOnline(const bool status) { det.setReceiverOnline(status); }
|
||||
|
||||
bool getOnline() { return det.setOnline(); }
|
||||
void setOnline(const bool status) { det.setOnline(status); }
|
||||
|
||||
bool isChipPowered() { return det.powerChip(); }
|
||||
void powerChip(const bool value) { det.powerChip(value); }
|
||||
|
||||
@ -355,19 +349,11 @@ class Detector {
|
||||
return mp;
|
||||
}
|
||||
|
||||
bool isClientAndDetectorCompatible() {
|
||||
auto r = det.checkDetectorVersionCompatibility();
|
||||
if (r == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
void checkDetectorVersionCompatibility() {
|
||||
det.checkDetectorVersionCompatibility();
|
||||
}
|
||||
bool isClientAndReceiverCompatible() {
|
||||
auto r = det.checkReceiverVersionCompatibility();
|
||||
if (r == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
bool checkReceiverVersionCompatibility() {
|
||||
det.checkReceiverVersionCompatibility();
|
||||
}
|
||||
|
||||
/*** END Frame and file settings ***/
|
||||
|
@ -32,11 +32,8 @@ PYBIND11_MODULE(_sls_detector, m) {
|
||||
d = Eiger()
|
||||
d._api.getThresholdEnergy()
|
||||
|
||||
#creating a DetectorApi object (remember to set online flags)
|
||||
from _sls_detector import DetectorApi
|
||||
api = DetectorApi(0)
|
||||
api.setOnline(True)
|
||||
api.setReceiverOnline(True)
|
||||
api.getNumberOfFrames()
|
||||
|
||||
#But the Pythonic way is almost alway simpler
|
||||
@ -97,11 +94,6 @@ PYBIND11_MODULE(_sls_detector, m) {
|
||||
.def("getHostname", &Detector::getHostname)
|
||||
.def("setHostname", &Detector::setHostname)
|
||||
|
||||
.def("getOnline", &Detector::getOnline)
|
||||
.def("setOnline", &Detector::setOnline)
|
||||
.def("getReceiverOnline", &Detector::getReceiverOnline)
|
||||
.def("setReceiverOnline", &Detector::setReceiverOnline)
|
||||
|
||||
.def("getReceiverPort", &Detector::getReceiverPort)
|
||||
.def("setReceiverPort", &Detector::setReceiverPort)
|
||||
|
||||
@ -224,10 +216,10 @@ PYBIND11_MODULE(_sls_detector, m) {
|
||||
.def("getPartialFramesPadding", &Detector::getPartialFramesPadding)
|
||||
|
||||
.def("getUserDetails", &Detector::getUserDetails)
|
||||
.def("isClientAndDetectorCompatible",
|
||||
&Detector::isClientAndDetectorCompatible)
|
||||
.def("isClientAndReceiverCompatible",
|
||||
&Detector::isClientAndReceiverCompatible)
|
||||
.def("checkDetectorVersionCompatibility",
|
||||
&Detector::checkDetectorVersionCompatibility)
|
||||
.def("checkReceiverVersionCompatibility",
|
||||
&Detector::checkReceiverVersionCompatibility)
|
||||
.def("getMeasuredPeriod", &Detector::getMeasuredPeriod)
|
||||
.def("getMeasuredSubPeriod", &Detector::getMeasuredSubPeriod)
|
||||
|
||||
@ -310,11 +302,6 @@ PYBIND11_MODULE(_sls_detector, m) {
|
||||
multiDetectorApi.def(py::init<int>())
|
||||
.def("acquire", &multiSlsDetector::acquire)
|
||||
|
||||
.def_property("online",
|
||||
py::cpp_function(&multiSlsDetector::setOnline, py::arg(),
|
||||
py::arg() = -1, py::arg("det_id") = -1),
|
||||
py::cpp_function(&multiSlsDetector::setOnline, py::arg(),
|
||||
py::arg("flag"), py::arg("det_id") = -1))
|
||||
.def_property("exptime",
|
||||
py::cpp_function(&multiSlsDetector::setExposureTime,
|
||||
py::arg(), py::arg() = -1, py::arg() = 0,
|
||||
|
Reference in New Issue
Block a user