mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +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:
parent
a487aabb6e
commit
b524e0c95f
@ -40,12 +40,6 @@ class Detector:
|
|||||||
self._api.setFlippedDataY,
|
self._api.setFlippedDataY,
|
||||||
self._api.getNumberOfDetectors,
|
self._api.getNumberOfDetectors,
|
||||||
'flippeddatay')
|
'flippeddatay')
|
||||||
try:
|
|
||||||
self.online = True
|
|
||||||
self.receiver_online = True
|
|
||||||
except DetectorError:
|
|
||||||
print('WARNING: Cannot connect to detector')
|
|
||||||
|
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return self._api.getNumberOfDetectors()
|
return self._api.getNumberOfDetectors()
|
||||||
@ -728,27 +722,6 @@ class Detector:
|
|||||||
"""
|
"""
|
||||||
return self._api.getNumberOfDetectors()
|
return self._api.getNumberOfDetectors()
|
||||||
|
|
||||||
@property
|
|
||||||
def online(self):
|
|
||||||
"""Online flag for the detector
|
|
||||||
|
|
||||||
Examples
|
|
||||||
----------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
d.online
|
|
||||||
>> False
|
|
||||||
|
|
||||||
d.online = True
|
|
||||||
|
|
||||||
"""
|
|
||||||
return self._api.getOnline()
|
|
||||||
|
|
||||||
@online.setter
|
|
||||||
def online(self, value):
|
|
||||||
self._api.setOnline(value)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def last_client_ip(self):
|
def last_client_ip(self):
|
||||||
@ -794,9 +767,6 @@ class Detector:
|
|||||||
"""
|
"""
|
||||||
return self._api.getReceiverOnline()
|
return self._api.getReceiverOnline()
|
||||||
|
|
||||||
@receiver_online.setter
|
|
||||||
def receiver_online(self, value):
|
|
||||||
self._api.setReceiverOnline(value)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def receiver_version(self):
|
def receiver_version(self):
|
||||||
|
@ -115,12 +115,6 @@ class Detector {
|
|||||||
|
|
||||||
std::string checkOnline() { return det.checkOnline(); }
|
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(); }
|
bool isChipPowered() { return det.powerChip(); }
|
||||||
void powerChip(const bool value) { det.powerChip(value); }
|
void powerChip(const bool value) { det.powerChip(value); }
|
||||||
|
|
||||||
@ -355,19 +349,11 @@ class Detector {
|
|||||||
return mp;
|
return mp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isClientAndDetectorCompatible() {
|
void checkDetectorVersionCompatibility() {
|
||||||
auto r = det.checkDetectorVersionCompatibility();
|
det.checkDetectorVersionCompatibility();
|
||||||
if (r == 0)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
bool isClientAndReceiverCompatible() {
|
bool checkReceiverVersionCompatibility() {
|
||||||
auto r = det.checkReceiverVersionCompatibility();
|
det.checkReceiverVersionCompatibility();
|
||||||
if (r == 0)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** END Frame and file settings ***/
|
/*** END Frame and file settings ***/
|
||||||
|
@ -32,11 +32,8 @@ PYBIND11_MODULE(_sls_detector, m) {
|
|||||||
d = Eiger()
|
d = Eiger()
|
||||||
d._api.getThresholdEnergy()
|
d._api.getThresholdEnergy()
|
||||||
|
|
||||||
#creating a DetectorApi object (remember to set online flags)
|
|
||||||
from _sls_detector import DetectorApi
|
from _sls_detector import DetectorApi
|
||||||
api = DetectorApi(0)
|
api = DetectorApi(0)
|
||||||
api.setOnline(True)
|
|
||||||
api.setReceiverOnline(True)
|
|
||||||
api.getNumberOfFrames()
|
api.getNumberOfFrames()
|
||||||
|
|
||||||
#But the Pythonic way is almost alway simpler
|
#But the Pythonic way is almost alway simpler
|
||||||
@ -97,11 +94,6 @@ PYBIND11_MODULE(_sls_detector, m) {
|
|||||||
.def("getHostname", &Detector::getHostname)
|
.def("getHostname", &Detector::getHostname)
|
||||||
.def("setHostname", &Detector::setHostname)
|
.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("getReceiverPort", &Detector::getReceiverPort)
|
||||||
.def("setReceiverPort", &Detector::setReceiverPort)
|
.def("setReceiverPort", &Detector::setReceiverPort)
|
||||||
|
|
||||||
@ -224,10 +216,10 @@ PYBIND11_MODULE(_sls_detector, m) {
|
|||||||
.def("getPartialFramesPadding", &Detector::getPartialFramesPadding)
|
.def("getPartialFramesPadding", &Detector::getPartialFramesPadding)
|
||||||
|
|
||||||
.def("getUserDetails", &Detector::getUserDetails)
|
.def("getUserDetails", &Detector::getUserDetails)
|
||||||
.def("isClientAndDetectorCompatible",
|
.def("checkDetectorVersionCompatibility",
|
||||||
&Detector::isClientAndDetectorCompatible)
|
&Detector::checkDetectorVersionCompatibility)
|
||||||
.def("isClientAndReceiverCompatible",
|
.def("checkReceiverVersionCompatibility",
|
||||||
&Detector::isClientAndReceiverCompatible)
|
&Detector::checkReceiverVersionCompatibility)
|
||||||
.def("getMeasuredPeriod", &Detector::getMeasuredPeriod)
|
.def("getMeasuredPeriod", &Detector::getMeasuredPeriod)
|
||||||
.def("getMeasuredSubPeriod", &Detector::getMeasuredSubPeriod)
|
.def("getMeasuredSubPeriod", &Detector::getMeasuredSubPeriod)
|
||||||
|
|
||||||
@ -310,11 +302,6 @@ PYBIND11_MODULE(_sls_detector, m) {
|
|||||||
multiDetectorApi.def(py::init<int>())
|
multiDetectorApi.def(py::init<int>())
|
||||||
.def("acquire", &multiSlsDetector::acquire)
|
.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",
|
.def_property("exptime",
|
||||||
py::cpp_function(&multiSlsDetector::setExposureTime,
|
py::cpp_function(&multiSlsDetector::setExposureTime,
|
||||||
py::arg(), py::arg() = -1, py::arg() = 0,
|
py::arg(), py::arg() = -1, py::arg() = 0,
|
||||||
|
@ -298,49 +298,7 @@
|
|||||||
<string>Network</string>
|
<string>Network</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<item row="0" column="4">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="dispRxrHostname">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>180</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Sets the Receiver Hostname, connects to it and gets the receiver mac address and eth. Sets some receiver parameters like file name, file dir, file index in receiver.
|
|
||||||
#rx_hostname#</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>none</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="3">
|
|
||||||
<widget class="QLabel" name="label_14">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Receiver UDP IP:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QSpinBox" name="spinControlPort">
|
<widget class="QSpinBox" name="spinControlPort">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -390,7 +348,62 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="4">
|
<item row="0" column="4">
|
||||||
|
<widget class="QLineEdit" name="dispRxrHostname">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>180</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>28</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sets the Receiver Hostname, connects to it and gets the receiver mac address and eth. Sets some receiver parameters like file name, file dir, file index in receiver.
|
||||||
|
#rx_hostname#</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>none</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<widget class="QLabel" name="label_14">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Receiver UDP IP:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Detector Control Port:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="4">
|
||||||
<widget class="QLineEdit" name="dispRxrUDPIP">
|
<widget class="QLineEdit" name="dispRxrUDPIP">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -419,7 +432,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="4">
|
<item row="4" column="4">
|
||||||
<widget class="QLineEdit" name="dispRxrUDPMAC">
|
<widget class="QLineEdit" name="dispRxrUDPMAC">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -448,26 +461,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="4" column="1">
|
||||||
<widget class="QLabel" name="lblOnline">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>108</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Detector Online Status: </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QLineEdit" name="dispDetectorUDPMAC">
|
<widget class="QLineEdit" name="dispDetectorUDPMAC">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -496,7 +490,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="4">
|
<item row="2" column="4">
|
||||||
<widget class="QSpinBox" name="spinRxrUDPPort">
|
<widget class="QSpinBox" name="spinRxrUDPPort">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -546,39 +540,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="4">
|
||||||
<widget class="QLineEdit" name="dispOnline">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>180</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Gets the detector online status
|
|
||||||
#online#</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Offline</string>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="4">
|
|
||||||
<widget class="QSpinBox" name="spinRxrTCPPort">
|
<widget class="QSpinBox" name="spinRxrTCPPort">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -628,7 +590,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="lblIP_2">
|
<widget class="QLabel" name="lblIP_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -641,20 +603,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="6" column="1">
|
||||||
<widget class="QLabel" name="lblRxrOnline">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Receiver Online Status: </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
|
||||||
<widget class="QLineEdit" name="dispZMQIP">
|
<widget class="QLineEdit" name="dispZMQIP">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -683,7 +632,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QSpinBox" name="spinZMQPort">
|
<widget class="QSpinBox" name="spinZMQPort">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -733,7 +682,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="3">
|
<item row="6" column="3">
|
||||||
<widget class="QLabel" name="label_16">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -746,7 +695,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="3">
|
<item row="1" column="3">
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -759,7 +708,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="spinStopPort">
|
<widget class="QSpinBox" name="spinStopPort">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -809,7 +758,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QLabel" name="label_10">
|
<widget class="QLabel" name="label_10">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -822,7 +771,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="4">
|
<item row="5" column="4">
|
||||||
<widget class="QSpinBox" name="spinRxrZMQPort">
|
<widget class="QSpinBox" name="spinRxrZMQPort">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -872,7 +821,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="4">
|
<item row="6" column="4">
|
||||||
<widget class="QLineEdit" name="dispRxrZMQIP">
|
<widget class="QLineEdit" name="dispRxrZMQIP">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -901,7 +850,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_11">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -930,51 +879,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="4">
|
|
||||||
<widget class="QLineEdit" name="dispRxrOnline">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>180</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>28</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Gets the receiver online status
|
|
||||||
#r_online#</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Offline</string>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_7">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Detector Control Port:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="comboDetector">
|
<widget class="QComboBox" name="comboDetector">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -997,7 +901,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="lblMAC">
|
<widget class="QLabel" name="lblMAC">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -1029,7 +933,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="3">
|
<item row="5" column="3">
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLabel" name="label_12">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -1042,7 +946,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="3">
|
<item row="4" column="3">
|
||||||
<widget class="QLabel" name="label_18">
|
<widget class="QLabel" name="label_18">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -1055,7 +959,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lblIP">
|
<widget class="QLabel" name="lblIP">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -1068,7 +972,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -1081,7 +985,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLineEdit" name="dispDetectorUDPIP">
|
<widget class="QLineEdit" name="dispDetectorUDPIP">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -1504,7 +1408,6 @@ Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|||||||
<tabstop>btnClearRoi</tabstop>
|
<tabstop>btnClearRoi</tabstop>
|
||||||
<tabstop>scrollArea</tabstop>
|
<tabstop>scrollArea</tabstop>
|
||||||
<tabstop>comboDetector</tabstop>
|
<tabstop>comboDetector</tabstop>
|
||||||
<tabstop>dispOnline</tabstop>
|
|
||||||
<tabstop>spinControlPort</tabstop>
|
<tabstop>spinControlPort</tabstop>
|
||||||
<tabstop>spinStopPort</tabstop>
|
<tabstop>spinStopPort</tabstop>
|
||||||
<tabstop>dispDetectorUDPIP</tabstop>
|
<tabstop>dispDetectorUDPIP</tabstop>
|
||||||
@ -1512,7 +1415,6 @@ Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|||||||
<tabstop>spinZMQPort</tabstop>
|
<tabstop>spinZMQPort</tabstop>
|
||||||
<tabstop>dispZMQIP</tabstop>
|
<tabstop>dispZMQIP</tabstop>
|
||||||
<tabstop>dispRxrHostname</tabstop>
|
<tabstop>dispRxrHostname</tabstop>
|
||||||
<tabstop>dispRxrOnline</tabstop>
|
|
||||||
<tabstop>spinRxrTCPPort</tabstop>
|
<tabstop>spinRxrTCPPort</tabstop>
|
||||||
<tabstop>spinRxrUDPPort</tabstop>
|
<tabstop>spinRxrUDPPort</tabstop>
|
||||||
<tabstop>dispRxrUDPIP</tabstop>
|
<tabstop>dispRxrUDPIP</tabstop>
|
||||||
|
@ -43,7 +43,6 @@ private:
|
|||||||
void Initialization();
|
void Initialization();
|
||||||
void PopulateDetectors();
|
void PopulateDetectors();
|
||||||
|
|
||||||
void GetOnline();
|
|
||||||
void GetControlPort();
|
void GetControlPort();
|
||||||
void GetStopPort();
|
void GetStopPort();
|
||||||
void GetDetectorUDPIP();
|
void GetDetectorUDPIP();
|
||||||
@ -51,7 +50,6 @@ private:
|
|||||||
void GetCltZMQPort();
|
void GetCltZMQPort();
|
||||||
void GetCltZMQIP();
|
void GetCltZMQIP();
|
||||||
void GetRxrHostname();
|
void GetRxrHostname();
|
||||||
void GetReceiverOnline();
|
|
||||||
void GetRxrTCPPort();
|
void GetRxrTCPPort();
|
||||||
void GetRxrUDPPort();
|
void GetRxrUDPPort();
|
||||||
void GetRxrUDPIP();
|
void GetRxrUDPIP();
|
||||||
@ -65,11 +63,6 @@ private:
|
|||||||
void GetSubDeadTime();
|
void GetSubDeadTime();
|
||||||
|
|
||||||
multiSlsDetector *myDet;
|
multiSlsDetector *myDet;
|
||||||
/** Tool Tip */
|
|
||||||
QString errOnlineTip;
|
|
||||||
QString detOnlineTip;
|
|
||||||
QString rxrOnlineTip;
|
|
||||||
QPalette red;
|
|
||||||
/** ROI */
|
/** ROI */
|
||||||
std::vector <QLabel*> lblFromX;
|
std::vector <QLabel*> lblFromX;
|
||||||
std::vector <QSpinBox*> spinFromX;
|
std::vector <QSpinBox*> spinFromX;
|
||||||
|
@ -24,14 +24,6 @@ qTabAdvanced::~qTabAdvanced() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetupWidgetWindow() {
|
void qTabAdvanced::SetupWidgetWindow() {
|
||||||
// palette
|
|
||||||
red = QPalette();
|
|
||||||
red.setColor(QPalette::Active, QPalette::WindowText, Qt::red);
|
|
||||||
detOnlineTip = dispOnline->toolTip();
|
|
||||||
rxrOnlineTip = dispRxrOnline->toolTip();
|
|
||||||
errOnlineTip = QString(
|
|
||||||
"<nobr><br><br><font color=\"red\"><nobr>It is offline!</nobr></font>");
|
|
||||||
|
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
switch (myDet->getDetectorTypeAsEnum()) {
|
switch (myDet->getDetectorTypeAsEnum()) {
|
||||||
case slsDetectorDefs::EIGER:
|
case slsDetectorDefs::EIGER:
|
||||||
@ -140,44 +132,6 @@ void qTabAdvanced::PopulateDetectors() {
|
|||||||
SLOT(SetDetector(int)));
|
SLOT(SetDetector(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::GetOnline() {
|
|
||||||
FILE_LOG(logDEBUG) << "Getting detector online status";
|
|
||||||
|
|
||||||
int moduleId = comboDetector->currentIndex();
|
|
||||||
try {
|
|
||||||
myDet->checkOnline(moduleId);
|
|
||||||
|
|
||||||
int ret = myDet->getOnlineFlag(moduleId);
|
|
||||||
switch (ret) {
|
|
||||||
case 1:
|
|
||||||
dispOnline->setText("Online");
|
|
||||||
lblOnline->setText("Detector Online Status: ");
|
|
||||||
dispOnline->setToolTip(detOnlineTip);
|
|
||||||
lblOnline->setToolTip(detOnlineTip);
|
|
||||||
dispOnline->setPalette(lblHostname->palette());
|
|
||||||
lblOnline->setPalette(lblHostname->palette());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dispOnline->setText("Offline");
|
|
||||||
lblOnline->setText("Detector Online Status:* ");
|
|
||||||
dispOnline->setToolTip(detOnlineTip + errOnlineTip);
|
|
||||||
lblOnline->setToolTip(detOnlineTip + errOnlineTip);
|
|
||||||
dispOnline->setPalette(red);
|
|
||||||
lblOnline->setPalette(red);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ignore if checkonline throws socket exception, else display it
|
|
||||||
catch (const sls::SocketError &e) {
|
|
||||||
; // do nothing as it might just be offline
|
|
||||||
}
|
|
||||||
// display any other exception
|
|
||||||
catch (const std::exception &e) {
|
|
||||||
qDefs::ExceptionMessage("Could not get detector online status",
|
|
||||||
e.what(), "qTabAdvanced::GetOnline");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void qTabAdvanced::GetControlPort() {
|
void qTabAdvanced::GetControlPort() {
|
||||||
FILE_LOG(logDEBUG) << "Getting control port ";
|
FILE_LOG(logDEBUG) << "Getting control port ";
|
||||||
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this,
|
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this,
|
||||||
@ -276,44 +230,6 @@ void qTabAdvanced::GetRxrHostname() {
|
|||||||
SLOT(SetRxrHostname()));
|
SLOT(SetRxrHostname()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::GetReceiverOnline() {
|
|
||||||
FILE_LOG(logDEBUG) << "Getting Receiver online status";
|
|
||||||
|
|
||||||
int moduleId = comboDetector->currentIndex();
|
|
||||||
try {
|
|
||||||
myDet->checkReceiverOnline(moduleId);
|
|
||||||
|
|
||||||
int ret = myDet->getReceiverOnlineFlag(moduleId);
|
|
||||||
switch (ret) {
|
|
||||||
case 1:
|
|
||||||
dispRxrOnline->setText("Online");
|
|
||||||
lblRxrOnline->setText("Receiver Online Status: ");
|
|
||||||
dispRxrOnline->setToolTip(rxrOnlineTip);
|
|
||||||
lblRxrOnline->setToolTip(rxrOnlineTip);
|
|
||||||
dispRxrOnline->setPalette(lblHostname->palette());
|
|
||||||
lblRxrOnline->setPalette(lblHostname->palette());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dispRxrOnline->setText("Offline");
|
|
||||||
lblRxrOnline->setText("Receiver Online Status:* ");
|
|
||||||
dispRxrOnline->setToolTip(rxrOnlineTip + errOnlineTip);
|
|
||||||
lblRxrOnline->setToolTip(rxrOnlineTip + errOnlineTip);
|
|
||||||
dispRxrOnline->setPalette(red);
|
|
||||||
lblRxrOnline->setPalette(red);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ignore if checkReceiverOnline throws socket exception
|
|
||||||
catch (const sls::SocketError &e) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
// display any other exception
|
|
||||||
catch (const std::exception &e) {
|
|
||||||
qDefs::ExceptionMessage("Could not check receiver online status",
|
|
||||||
e.what(), "qTabAdvanced::GetReceiverOnline");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void qTabAdvanced::GetRxrTCPPort() {
|
void qTabAdvanced::GetRxrTCPPort() {
|
||||||
FILE_LOG(logDEBUG) << "Getting Receiver TCP port";
|
FILE_LOG(logDEBUG) << "Getting Receiver TCP port";
|
||||||
disconnect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
disconnect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
||||||
@ -402,7 +318,6 @@ void qTabAdvanced::SetDetector(int index) {
|
|||||||
FILE_LOG(logDEBUG) << "Set Detector: "
|
FILE_LOG(logDEBUG) << "Set Detector: "
|
||||||
<< comboDetector->currentText().toAscii().data();
|
<< comboDetector->currentText().toAscii().data();
|
||||||
|
|
||||||
GetOnline();
|
|
||||||
GetControlPort();
|
GetControlPort();
|
||||||
GetStopPort();
|
GetStopPort();
|
||||||
GetDetectorUDPIP();
|
GetDetectorUDPIP();
|
||||||
@ -410,7 +325,6 @@ void qTabAdvanced::SetDetector(int index) {
|
|||||||
GetCltZMQPort();
|
GetCltZMQPort();
|
||||||
GetCltZMQIP();
|
GetCltZMQIP();
|
||||||
GetRxrHostname();
|
GetRxrHostname();
|
||||||
GetReceiverOnline();
|
|
||||||
GetRxrTCPPort();
|
GetRxrTCPPort();
|
||||||
GetRxrUDPPort();
|
GetRxrUDPPort();
|
||||||
GetRxrUDPIP();
|
GetRxrUDPIP();
|
||||||
|
@ -16,7 +16,7 @@ class detectorData;
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define MULTI_SHMVERSION 0x190724
|
#define MULTI_SHMVERSION 0x190726
|
||||||
#define SHORT_STRING_LENGTH 50
|
#define SHORT_STRING_LENGTH 50
|
||||||
#define DATE_LENGTH 30
|
#define DATE_LENGTH 30
|
||||||
|
|
||||||
@ -50,10 +50,6 @@ struct sharedMultiSlsDetector {
|
|||||||
/** Number of detectors operated at once */
|
/** Number of detectors operated at once */
|
||||||
int numberOfDetector[2];
|
int numberOfDetector[2];
|
||||||
|
|
||||||
/** online flag - is set if the detector is connected, unset if socket
|
|
||||||
* connection is not possible */
|
|
||||||
int onlineFlag;
|
|
||||||
|
|
||||||
/** stopped flag - is set if an acquisition error occurs or the detector
|
/** stopped flag - is set if an acquisition error occurs or the detector
|
||||||
* is stopped manually. Is reset to 0 at the start of the acquisition */
|
* is stopped manually. Is reset to 0 at the start of the acquisition */
|
||||||
int stoppedFlag;
|
int stoppedFlag;
|
||||||
@ -199,17 +195,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* (if hostname/rx_hostname has been set/ sockets created)
|
* (if hostname/rx_hostname has been set/ sockets created)
|
||||||
* @param p port type control port or receiver port
|
* @param p port type control port or receiver port
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns FAIL for incompatibility, OK for compatibility
|
|
||||||
*/
|
*/
|
||||||
int checkDetectorVersionCompatibility(int detPos = -1);
|
void checkDetectorVersionCompatibility(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check version compatibility with receiver software
|
* Check version compatibility with receiver software
|
||||||
* (if hostname/rx_hostname has been set/ sockets created)
|
* (if hostname/rx_hostname has been set/ sockets created)
|
||||||
* @param p port type control port or receiver port
|
* @param p port type control port or receiver port
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns FAIL for incompatibility, OK for compatibility
|
|
||||||
*/
|
*/
|
||||||
int checkReceiverVersionCompatibility(int detPos = -1);
|
void checkReceiverVersionCompatibility(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ID or version numbers
|
* Get ID or version numbers
|
||||||
@ -261,7 +256,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the hostname of all sls detectors in shared memory
|
* Sets the hostname of all sls detectors in shared memory
|
||||||
* Connects to them to set up online flag
|
* Connects to them
|
||||||
* @param name concatenated hostname of all the sls detectors
|
* @param name concatenated hostname of all the sls detectors
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
*/
|
*/
|
||||||
@ -278,7 +273,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends detectors to the end of the list in shared memory
|
* Appends detectors to the end of the list in shared memory
|
||||||
* Connects to them to set up online flag
|
* Connects to them
|
||||||
* @param name concatenated hostname of the sls detectors to be appended to
|
* @param name concatenated hostname of the sls detectors to be appended to
|
||||||
* the list
|
* the list
|
||||||
*/
|
*/
|
||||||
@ -406,25 +401,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
void updateOffsets();
|
void updateOffsets();
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the multi detectors are online and sets the online flag
|
|
||||||
* @param online if GET_ONLINE_FLAG, only returns shared memory online flag,
|
|
||||||
* else sets the detector in online/offline state
|
|
||||||
* if OFFLINE_FLAG, (i.e. no communication to the detector - using only
|
|
||||||
* local structure - no data acquisition possible!); if ONLINE_FLAG,
|
|
||||||
* detector in online state (i.e. communication to the detector updating the
|
|
||||||
* local structure)
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns online/offline status
|
|
||||||
*/
|
|
||||||
int setOnline(int value = GET_ONLINE_FLAG, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get detector online status
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
*/
|
|
||||||
int getOnlineFlag(int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if each of the detectors are online/offline
|
* Checks if each of the detectors are online/offline
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
@ -482,17 +458,15 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
/**
|
/**
|
||||||
* Exit detector server
|
* Exit detector server
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int exitServer(int detPos = -1);
|
void exitServer(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a command on the detector server
|
* Execute a command on the detector server
|
||||||
* @param cmd command
|
* @param cmd command
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int execCommand(const std::string &cmd, int detPos);
|
void execCommand(const std::string &cmd, int detPos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load configuration from a configuration File
|
* Load configuration from a configuration File
|
||||||
@ -562,18 +536,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
* @param fname specific settings/trimbits file
|
* @param fname specific settings/trimbits file
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int loadSettingsFile(const std::string &fname, int detPos = -1);
|
void loadSettingsFile(const std::string &fname, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the modules settings/trimbits to a specific file
|
* Saves the modules settings/trimbits to a specific file
|
||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
* @param fname specific settings/trimbits file
|
* @param fname specific settings/trimbits file
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int saveSettingsFile(const std::string &fname, int detPos = -1);
|
void saveSettingsFile(const std::string &fname, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Detector run status
|
* Get Detector run status
|
||||||
@ -585,60 +557,52 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
/**
|
/**
|
||||||
* Prepares detector for acquisition (Eiger)
|
* Prepares detector for acquisition (Eiger)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK if all detectors are ready for acquisition, FAIL otherwise
|
|
||||||
*/
|
*/
|
||||||
int prepareAcquisition(int detPos = -1);
|
void prepareAcquisition(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start detector acquisition (Non blocking)
|
* Start detector acquisition (Non blocking)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL if even one does not start properly
|
|
||||||
*/
|
*/
|
||||||
int startAcquisition(int detPos = -1);
|
void startAcquisition(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop detector acquisition
|
* Stop detector acquisition
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopAcquisition(int detPos = -1);
|
void stopAcquisition(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Give an internal software trigger to the detector (Eiger only)
|
* Give an internal software trigger to the detector (Eiger only)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @return OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int sendSoftwareTrigger(int detPos = -1);
|
void sendSoftwareTrigger(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start detector acquisition and read all data (Blocking until end of
|
* Start detector acquisition and read all data (Blocking until end of
|
||||||
* acquisition)
|
* acquisition)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startAndReadAll(int detPos = -1);
|
void startAndReadAll(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start readout (without exposure or interrupting exposure) (Eiger store in
|
* Start readout (without exposure or interrupting exposure) (Eiger store in
|
||||||
* ram)
|
* ram)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startReadOut(int detPos = -1);
|
void startReadOut(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests and receives all data from the detector (Eiger store in ram)
|
* Requests and receives all data from the detector (Eiger store in ram)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int readAll(int detPos = -1);
|
void readAll(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures in detector the destination for UDP packets
|
* Configures in detector the destination for UDP packets
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int configureMAC(int detPos = -1);
|
void configureMAC(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set starting frame number for the next acquisition
|
* Set starting frame number for the next acquisition
|
||||||
@ -1275,9 +1239,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param index image type
|
* @param index image type
|
||||||
* @param fname file name from which to load image
|
* @param fname file name from which to load image
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int loadImageToDetector(imageType index, const std::string &fname,
|
void loadImageToDetector(imageType index, const std::string &fname,
|
||||||
int detPos = -1);
|
int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1285,18 +1248,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param fname file name to load data from
|
* @param fname file name to load data from
|
||||||
* @param startACQ is 1 to start acquisition after reading counter
|
* @param startACQ is 1 to start acquisition after reading counter
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int writeCounterBlockFile(const std::string &fname, int startACQ = 0,
|
void writeCounterBlockFile(const std::string &fname, int startACQ = 0,
|
||||||
int detPos = -1);
|
int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets counter in detector (Gotthard)
|
* Resets counter in detector (Gotthard)
|
||||||
* @param startACQ is 1 to start acquisition after resetting counter
|
* @param startACQ is 1 to start acquisition after resetting counter
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetCounterBlock(int startACQ = 0, int detPos = -1);
|
void resetCounterBlock(int startACQ = 0, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get counter bit in detector (Gotthard)
|
* Set/get counter bit in detector (Gotthard)
|
||||||
@ -1320,9 +1281,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param n number of rois
|
* @param n number of rois
|
||||||
* @param roiLimits array of roi
|
* @param roiLimits array of roi
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setROI(int n = -1, ROI roiLimits[] = nullptr, int detPos = -1);
|
void setROI(int n = -1, ROI roiLimits[] = nullptr, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ROI from each detector and convert it to the multi detector scale
|
* Get ROI from each detector and convert it to the multi detector scale
|
||||||
@ -1423,9 +1383,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param addr address of adc register
|
* @param addr address of adc register
|
||||||
* @param val value
|
* @param val value
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns return value (mostly -1 as it can't read adc register)
|
|
||||||
*/
|
*/
|
||||||
int writeAdcRegister(uint32_t addr, uint32_t val, int detPos = -1);
|
void writeAdcRegister(uint32_t addr, uint32_t val, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activates/Deactivates the detector (Eiger only)
|
* Activates/Deactivates the detector (Eiger only)
|
||||||
@ -1503,9 +1462,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param x is x coordinate
|
* @param x is x coordinate
|
||||||
* @param y is y coordinate
|
* @param y is y coordinate
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int pulsePixel(int n = 0, int x = 0, int y = 0, int detPos = -1);
|
void pulsePixel(int n = 0, int x = 0, int y = 0, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pulse Pixel and move by a relative value (Eiger)
|
* Pulse Pixel and move by a relative value (Eiger)
|
||||||
@ -1513,17 +1471,15 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param x is relative x value
|
* @param x is relative x value
|
||||||
* @param y is relative y value
|
* @param y is relative y value
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int pulsePixelNMove(int n = 0, int x = 0, int y = 0, int detPos = -1);
|
void pulsePixelNMove(int n = 0, int x = 0, int y = 0, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pulse Chip (Eiger)
|
* Pulse Chip (Eiger)
|
||||||
* @param n is number of times to pulse
|
* @param n is number of times to pulse
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int pulseChip(int n = 0, int detPos = -1);
|
void pulseChip(int n = 0, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/gets threshold temperature (Jungfrau)
|
* Set/gets threshold temperature (Jungfrau)
|
||||||
@ -1561,32 +1517,28 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* Programs FPGA with pof file (Not Eiger)
|
* Programs FPGA with pof file (Not Eiger)
|
||||||
* @param fname file name
|
* @param fname file name
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int programFPGA(const std::string &fname, int detPos = -1);
|
void programFPGA(const std::string &fname, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets FPGA (Not Eiger)
|
* Resets FPGA (Not Eiger)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetFPGA(int detPos = -1);
|
void resetFPGA(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies detector server from tftp and changes respawn server (Not Eiger)
|
* Copies detector server from tftp and changes respawn server (Not Eiger)
|
||||||
* @param fname name of detector server binary
|
* @param fname name of detector server binary
|
||||||
* @param hostname name of pc to tftp from
|
* @param hostname name of pc to tftp from
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int copyDetectorServer(const std::string &fname, const std::string &hostname, int detPos = -1);
|
void copyDetectorServer(const std::string &fname, const std::string &hostname, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reboot detector controller (Not Eiger)
|
* Reboot detector controller (Not Eiger)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int rebootController(int detPos = -1);
|
void rebootController(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the firmware, detector server and then reboots detector controller blackfin. (Not Eiger)
|
* Updates the firmware, detector server and then reboots detector controller blackfin. (Not Eiger)
|
||||||
@ -1594,9 +1546,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param hostname name of pc to tftp from
|
* @param hostname name of pc to tftp from
|
||||||
* @param fname programming file name
|
* @param fname programming file name
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int update(const std::string &sname, const std::string &hostname, const std::string &fname, int detPos = -1);
|
void update(const std::string &sname, const std::string &hostname, const std::string &fname, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Power on/off Chip (Jungfrau)
|
* Power on/off Chip (Jungfrau)
|
||||||
@ -1621,9 +1572,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* if >0 set dead time to t, if < 0 set deadtime to default dead time
|
* if >0 set dead time to t, if < 0 set deadtime to default dead time
|
||||||
* for current settings
|
* for current settings
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns 0 if rate correction disabled, >0 otherwise
|
|
||||||
*/
|
*/
|
||||||
int setRateCorrection(int64_t t = 0, int detPos = -1);
|
void setRateCorrection(int64_t t = 0, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get rate correction ( Eiger)
|
* Get rate correction ( Eiger)
|
||||||
@ -1639,19 +1589,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
void printReceiverConfiguration(TLogLevel level = logINFO, int detPos = -1);
|
void printReceiverConfiguration(TLogLevel level = logINFO, int detPos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets up receiver socket if online and sets the flag
|
|
||||||
* @param online online/offline flag (-1 gets)
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns online/offline flag
|
|
||||||
*/
|
|
||||||
int setReceiverOnline(int value = GET_ONLINE_FLAG, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get receiver online status
|
* Get receiver online status
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns use receiver flag
|
||||||
*/
|
*/
|
||||||
int getReceiverOnlineFlag(int detPos = -1);
|
bool getUseReceiverFlag(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the receiver is really online
|
* Checks if the receiver is really online
|
||||||
@ -1679,18 +1622,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
/**
|
/**
|
||||||
* Turns off the receiver server!
|
* Turns off the receiver server!
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int exitReceiver(int detPos = -1);
|
void exitReceiver(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a system command on the receiver server
|
* Executes a system command on the receiver server
|
||||||
* e.g. mount an nfs disk, reboot and returns answer etc.
|
* e.g. mount an nfs disk, reboot and returns answer etc.
|
||||||
* @param cmd command to be executed
|
* @param cmd command to be executed
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int execReceiverCommand(const std::string &cmd, int detPos = -1);
|
void execReceiverCommand(const std::string &cmd, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns output file directory
|
* Returns output file directory
|
||||||
@ -1796,16 +1737,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
/**
|
/**
|
||||||
* Receiver starts listening to packets
|
* Receiver starts listening to packets
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startReceiver(int detPos = -1);
|
void startReceiver(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops the listening mode of receiver
|
* Stops the listening mode of receiver
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopReceiver(int detPos = -1);
|
void stopReceiver(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the status of the listening mode of receiver
|
* Gets the status of the listening mode of receiver
|
||||||
@ -1832,9 +1771,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* Resets framescaught in receiver
|
* Resets framescaught in receiver
|
||||||
* Use this when using startAcquisition instead of acquire
|
* Use this when using startAcquisition instead of acquire
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetFramesCaught(int detPos = -1);
|
void resetFramesCaught(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Receiving Data Sockets
|
* Create Receiving Data Sockets
|
||||||
@ -2026,9 +1964,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* Sets the mask applied to every pattern (CTB/ Moench)
|
* Sets the mask applied to every pattern (CTB/ Moench)
|
||||||
* @param mask mask to be applied
|
* @param mask mask to be applied
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setPatternMask(uint64_t mask, int detPos = -1);
|
void setPatternMask(uint64_t mask, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the mask applied to every pattern (CTB/ Moench)
|
* Gets the mask applied to every pattern (CTB/ Moench)
|
||||||
@ -2041,9 +1978,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* Selects the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
* Selects the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
||||||
* @param mask mask to select bits
|
* @param mask mask to select bits
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setPatternBitMask(uint64_t mask, int detPos = -1);
|
void setPatternBitMask(uint64_t mask, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
* Gets the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
||||||
@ -2065,9 +2001,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param digital IO mask to select the pins
|
* @param digital IO mask to select the pins
|
||||||
* @param delay delay in ps(1 bit=25ps, max of 775 ps)
|
* @param delay delay in ps(1 bit=25ps, max of 775 ps)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setDigitalIODelay(uint64_t pinMask, int delay, int detPos = -1);
|
void setDigitalIODelay(uint64_t pinMask, int delay, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the detector setup from file
|
* Loads the detector setup from file
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
class ServerInterface;
|
class ServerInterface;
|
||||||
|
|
||||||
#define SLS_SHMVERSION 0x190515
|
#define SLS_SHMVERSION 0x190726
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @short structure allocated in shared memory to store detector settings for IPC and cache
|
* @short structure allocated in shared memory to store detector settings for IPC and cache
|
||||||
@ -24,9 +24,8 @@ struct sharedSlsDetector {
|
|||||||
/** shared memory version */
|
/** shared memory version */
|
||||||
int shmversion;
|
int shmversion;
|
||||||
|
|
||||||
/** online flag - is set if the detector is connected, unset if socket
|
/** is the port used for control functions */
|
||||||
* connection is not possible */
|
int controlPort;
|
||||||
int onlineFlag;
|
|
||||||
|
|
||||||
/** stopped flag - is set if an acquisition error occurs or the detector
|
/** stopped flag - is set if an acquisition error occurs or the detector
|
||||||
* is stopped manually. Is reset to 0 at the start of the acquisition */
|
* is stopped manually. Is reset to 0 at the start of the acquisition */
|
||||||
@ -41,15 +40,13 @@ struct sharedSlsDetector {
|
|||||||
|
|
||||||
/** END OF FIXED PATTERN -----------------------------------------------*/
|
/** END OF FIXED PATTERN -----------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
/** Detector offset in the X & Y direction in the multi detector structure */
|
/** Detector offset in the X & Y direction in the multi detector structure */
|
||||||
int offset[2];
|
int offset[2];
|
||||||
|
|
||||||
/** Number of detectors in multi list in x dir and y dir */
|
/** Number of detectors in multi list in x dir and y dir */
|
||||||
int multiSize[2];
|
int multiSize[2];
|
||||||
|
|
||||||
/** is the port used for control functions */
|
|
||||||
int controlPort;
|
|
||||||
|
|
||||||
/** is the port used to stop the acquisition */
|
/** is the port used to stop the acquisition */
|
||||||
int stopPort;
|
int stopPort;
|
||||||
|
|
||||||
@ -147,9 +144,9 @@ struct sharedSlsDetector {
|
|||||||
/** selected udp interface */
|
/** selected udp interface */
|
||||||
int selectedUDPInterface;
|
int selectedUDPInterface;
|
||||||
|
|
||||||
/** online flag - is set if the receiver is connected,
|
/** is set if the receiver hostname given and is connected,
|
||||||
* unset if socket connection is not possible */
|
* unset if socket connection is not possible */
|
||||||
int rxOnlineFlag;
|
bool useReceiverFlag;
|
||||||
|
|
||||||
/** 10 Gbe enable*/
|
/** 10 Gbe enable*/
|
||||||
int tenGigaEnable;
|
int tenGigaEnable;
|
||||||
@ -187,15 +184,6 @@ struct sharedSlsDetector {
|
|||||||
/** additional json header */
|
/** additional json header */
|
||||||
char rxAdditionalJsonHeader[MAX_STR_LENGTH];
|
char rxAdditionalJsonHeader[MAX_STR_LENGTH];
|
||||||
|
|
||||||
/** detector control server software API version */
|
|
||||||
int64_t detectorControlAPIVersion;
|
|
||||||
|
|
||||||
/** detector stop server software API version */
|
|
||||||
int64_t detectorStopAPIVersion;
|
|
||||||
|
|
||||||
/** receiver server software API version */
|
|
||||||
int64_t receiverAPIVersion;
|
|
||||||
|
|
||||||
/** receiver frames discard policy */
|
/** receiver frames discard policy */
|
||||||
slsDetectorDefs::frameDiscardPolicy rxFrameDiscardMode;
|
slsDetectorDefs::frameDiscardPolicy rxFrameDiscardMode;
|
||||||
|
|
||||||
@ -273,17 +261,13 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check version compatibility with receiver software
|
* Check version compatibility with receiver software
|
||||||
* (if hostname/rx_hostname has been set/ sockets created)
|
|
||||||
* @param p port type control port or receiver port
|
|
||||||
* @returns FAIL for incompatibility, OK for compatibility
|
|
||||||
*/
|
*/
|
||||||
int checkReceiverVersionCompatibility();
|
void checkReceiverVersionCompatibility();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check version compatibility with detector software
|
* Check version compatibility with detector software
|
||||||
* @returns FAIL for incompatibility, OK for compatibility
|
|
||||||
*/
|
*/
|
||||||
int checkDetectorVersionCompatibility();
|
void checkDetectorVersionCompatibility();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ID or version numbers
|
* Get ID or version numbers
|
||||||
@ -304,18 +288,17 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param args_size size of argument
|
* @param args_size size of argument
|
||||||
* @param retval return pointers
|
* @param retval return pointers
|
||||||
* @param retval_size size of return value
|
* @param retval_size size of return value
|
||||||
* @returns success or failure
|
|
||||||
*/
|
*/
|
||||||
int sendToDetector(int fnum, const void *args, size_t args_size,
|
void sendToDetector(int fnum, const void *args, size_t args_size,
|
||||||
void *retval, size_t retval_size);
|
void *retval, size_t retval_size);
|
||||||
|
|
||||||
template <typename Arg, typename Ret>
|
template <typename Arg, typename Ret>
|
||||||
int sendToDetector(int fnum, const Arg &args, Ret &retval);
|
void sendToDetector(int fnum, const Arg &args, Ret &retval);
|
||||||
template<typename Arg>
|
template<typename Arg>
|
||||||
int sendToDetector(int fnum, const Arg &args, std::nullptr_t);
|
void sendToDetector(int fnum, const Arg &args, std::nullptr_t);
|
||||||
template<typename Ret>
|
template<typename Ret>
|
||||||
int sendToDetector(int fnum, std::nullptr_t, Ret & retval);
|
void sendToDetector(int fnum, std::nullptr_t, Ret & retval);
|
||||||
int sendToDetector(int fnum);
|
void sendToDetector(int fnum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send function parameters to detector (stop server)
|
* Send function parameters to detector (stop server)
|
||||||
@ -324,19 +307,18 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param args_size size of argument
|
* @param args_size size of argument
|
||||||
* @param retval return pointers
|
* @param retval return pointers
|
||||||
* @param retval_size size of return value
|
* @param retval_size size of return value
|
||||||
* @returns success or failure
|
|
||||||
*/
|
*/
|
||||||
int sendToDetectorStop(int fnum, const void *args, size_t args_size,
|
void sendToDetectorStop(int fnum, const void *args, size_t args_size,
|
||||||
void *retval, size_t retval_size);
|
void *retval, size_t retval_size);
|
||||||
|
|
||||||
template <typename Arg, typename Ret>
|
template <typename Arg, typename Ret>
|
||||||
int sendToDetectorStop(int fnum, const Arg &args, Ret &retval);
|
void sendToDetectorStop(int fnum, const Arg &args, Ret &retval);
|
||||||
template<typename Arg>
|
template<typename Arg>
|
||||||
int sendToDetectorStop(int fnum, const Arg &args, std::nullptr_t);
|
void sendToDetectorStop(int fnum, const Arg &args, std::nullptr_t);
|
||||||
template<typename Ret>
|
template<typename Ret>
|
||||||
int sendToDetectorStop(int fnum, std::nullptr_t, Ret & retval);
|
void sendToDetectorStop(int fnum, std::nullptr_t, Ret & retval);
|
||||||
|
|
||||||
int sendToDetectorStop(int fnum);
|
void sendToDetectorStop(int fnum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send function parameters to receiver
|
* Send function parameters to receiver
|
||||||
@ -345,18 +327,17 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param args_size size of argument
|
* @param args_size size of argument
|
||||||
* @param retval return pointers
|
* @param retval return pointers
|
||||||
* @param retval_size size of return value
|
* @param retval_size size of return value
|
||||||
* @returns success or failure
|
|
||||||
*/
|
*/
|
||||||
int sendToReceiver(int fnum, const void *args, size_t args_size,
|
void sendToReceiver(int fnum, const void *args, size_t args_size,
|
||||||
void *retval, size_t retval_size);
|
void *retval, size_t retval_size);
|
||||||
template<typename Arg, typename Ret>
|
template<typename Arg, typename Ret>
|
||||||
int sendToReceiver(int fnum, const Arg& args, Ret& retval);
|
void sendToReceiver(int fnum, const Arg& args, Ret& retval);
|
||||||
template<typename Arg>
|
template<typename Arg>
|
||||||
int sendToReceiver(int fnum, const Arg& args, std::nullptr_t);
|
void sendToReceiver(int fnum, const Arg& args, std::nullptr_t);
|
||||||
template<typename Ret>
|
template<typename Ret>
|
||||||
int sendToReceiver(int fnum, std::nullptr_t, Ret& retval);
|
void sendToReceiver(int fnum, std::nullptr_t, Ret& retval);
|
||||||
|
|
||||||
int sendToReceiver(int fnum);
|
void sendToReceiver(int fnum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free shared memory and delete shared memory structure
|
* Free shared memory and delete shared memory structure
|
||||||
@ -490,21 +471,6 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
*/
|
*/
|
||||||
void updateMultiSize(int detx, int dety);
|
void updateMultiSize(int detx, int dety);
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the detector is online and sets the online flag
|
|
||||||
* @param online if GET_ONLINE_FLAG, only returns shared memory online flag,
|
|
||||||
* else sets the detector in online/offline state
|
|
||||||
* if OFFLINE_FLAG, (i.e. no communication to the detector - using only local structure - no data acquisition possible!);
|
|
||||||
* if ONLINE_FLAG, detector in online state (i.e. communication to the detector updating the local structure)
|
|
||||||
* @returns online/offline status
|
|
||||||
*/
|
|
||||||
int setOnline(int value = GET_ONLINE_FLAG);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the online flag
|
|
||||||
*/
|
|
||||||
int getOnlineFlag() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if each of the detector is online/offline
|
* Checks if each of the detector is online/offline
|
||||||
* @returns empty string if it is online
|
* @returns empty string if it is online
|
||||||
@ -551,30 +517,20 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Exit detector server
|
* Exit detector server
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int exitServer();
|
void exitServer();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a system command on the detector server
|
* Executes a system command on the detector server
|
||||||
* e.g. mount an nfs disk, reboot and returns answer etc.
|
* e.g. mount an nfs disk, reboot and returns answer etc.
|
||||||
* @param cmd command to be executed
|
* @param cmd command to be executed
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int execCommand(const std::string &cmd);
|
void execCommand(const std::string &cmd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates some of the shared memory receiving the data from the detector
|
* Updates some of the shared memory receiving the data from the detector
|
||||||
* @returns OK
|
|
||||||
*/
|
*/
|
||||||
int updateDetectorNoWait(sls::ClientSocket &client);
|
void updateCachedDetectorVariables();
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates some of the shared memory receiving the data from the detector
|
|
||||||
* calls updateDetectorNoWait
|
|
||||||
* @returns OK or FAIL or FORCE_RET
|
|
||||||
*/
|
|
||||||
int updateDetector();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get detector specific commands to write into config file
|
* Get detector specific commands to write into config file
|
||||||
@ -628,9 +584,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param e_eV threshold in eV
|
* @param e_eV threshold in eV
|
||||||
* @param isettings ev. change settings
|
* @param isettings ev. change settings
|
||||||
* @param tb 1 to include trimbits, 0 to exclude
|
* @param tb 1 to include trimbits, 0 to exclude
|
||||||
* @returns OK if successful, else FAIL
|
|
||||||
*/
|
*/
|
||||||
int setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings, int tb = 1);
|
void setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings, int tb = 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the detector trimbit/settings directory \sa sharedSlsDetector
|
* Returns the detector trimbit/settings directory \sa sharedSlsDetector
|
||||||
@ -649,17 +604,15 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* Loads the modules settings/trimbits reading from a specific file
|
* Loads the modules settings/trimbits reading from a specific file
|
||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
* @param fname specific settings/trimbits file
|
* @param fname specific settings/trimbits file
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int loadSettingsFile(const std::string &fname);
|
void loadSettingsFile(const std::string &fname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the modules settings/trimbits to a specific file
|
* Saves the modules settings/trimbits to a specific file
|
||||||
* file name extension is automatically generated.
|
* file name extension is automatically generated.
|
||||||
* @param fname specific settings/trimbits file
|
* @param fname specific settings/trimbits file
|
||||||
* returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int saveSettingsFile(const std::string &fname);
|
void saveSettingsFile(const std::string &fname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get run status of the detector
|
* Get run status of the detector
|
||||||
@ -669,51 +622,43 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares detector for acquisition (Eiger)
|
* Prepares detector for acquisition (Eiger)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int prepareAcquisition();
|
void prepareAcquisition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start detector acquisition (Non blocking)
|
* Start detector acquisition (Non blocking)
|
||||||
* @returns OK or FAIL if even one does not start properly
|
|
||||||
*/
|
*/
|
||||||
int startAcquisition();
|
void startAcquisition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop detector acquisition
|
* Stop detector acquisition
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopAcquisition();
|
void stopAcquisition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Give an internal software trigger to the detector (Eiger only)
|
* Give an internal software trigger to the detector (Eiger only)
|
||||||
* @return OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int sendSoftwareTrigger();
|
void sendSoftwareTrigger();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start detector acquisition and read all data (Blocking until end of acquisition)
|
* Start detector acquisition and read all data (Blocking until end of acquisition)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startAndReadAll();
|
void startAndReadAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start readout (without exposure or interrupting exposure) (Eiger store in ram)
|
* Start readout (without exposure or interrupting exposure) (Eiger store in ram)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startReadOut();
|
void startReadOut();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests and receives all data from the detector (Eiger store in ram)
|
* Requests and receives all data from the detector (Eiger store in ram)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int readAll();
|
void readAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures in detector the destination for UDP packets
|
* Configures in detector the destination for UDP packets
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int configureMAC();
|
void configureMAC();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set starting frame number for the next acquisition
|
* Set starting frame number for the next acquisition
|
||||||
@ -1131,40 +1076,35 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* Load dark or gain image to detector (Gotthard)
|
* Load dark or gain image to detector (Gotthard)
|
||||||
* @param index image type, 0 for dark image and 1 for gain image
|
* @param index image type, 0 for dark image and 1 for gain image
|
||||||
* @param fname file name from which to load image
|
* @param fname file name from which to load image
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int loadImageToDetector(imageType index, const std::string &fname);
|
void loadImageToDetector(imageType index, const std::string &fname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from loadImageToDetector to send the image to detector
|
* Called from loadImageToDetector to send the image to detector
|
||||||
* @param index image type, 0 for dark image and 1 for gain image
|
* @param index image type, 0 for dark image and 1 for gain image
|
||||||
* @param imageVals image
|
* @param imageVals image
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int sendImageToDetector(imageType index, int16_t imageVals[]);
|
void sendImageToDetector(imageType index, int16_t imageVals[]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the counter memory block from the detector (Gotthard)
|
* Writes the counter memory block from the detector (Gotthard)
|
||||||
* @param fname file name to load data from
|
* @param fname file name to load data from
|
||||||
* @param startACQ is 1 to start acquisition after reading counter
|
* @param startACQ is 1 to start acquisition after reading counter
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int writeCounterBlockFile(const std::string &fname, int startACQ = 0);
|
void writeCounterBlockFile(const std::string &fname, int startACQ = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets counter memory block in detector (Gotthard)
|
* Gets counter memory block in detector (Gotthard)
|
||||||
* @param image counter memory block from detector
|
* @param image counter memory block from detector
|
||||||
* @param startACQ 1 to start acquisition afterwards, else 0
|
* @param startACQ 1 to start acquisition afterwards, else 0
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int getCounterBlock(int16_t image[], int startACQ = 0);
|
void getCounterBlock(int16_t image[], int startACQ = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets counter in detector
|
* Resets counter in detector
|
||||||
* @param startACQ is 1 to start acquisition after resetting counter
|
* @param startACQ is 1 to start acquisition after resetting counter
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetCounterBlock(int startACQ = 0);
|
void resetCounterBlock(int startACQ = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get counter bit in detector (Gotthard)
|
* Set/get counter bit in detector (Gotthard)
|
||||||
@ -1178,9 +1118,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* At the moment only one set allowed
|
* At the moment only one set allowed
|
||||||
* @param n number of rois
|
* @param n number of rois
|
||||||
* @param roiLimits array of roi
|
* @param roiLimits array of roi
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setROI(int n = -1, ROI roiLimits[] = nullptr);
|
void setROI(int n = -1, ROI roiLimits[] = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||||
@ -1200,9 +1139,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* from setROI
|
* from setROI
|
||||||
* @param n number of ROIs (-1 to get)
|
* @param n number of ROIs (-1 to get)
|
||||||
* @param roiLimits ROI
|
* @param roiLimits ROI
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int sendROI(int n = -1, ROI roiLimits[] = nullptr);
|
void sendROI(int n = -1, ROI roiLimits[] = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set ADC Enable Mask (CTB, Moench)
|
* Set ADC Enable Mask (CTB, Moench)
|
||||||
@ -1291,9 +1229,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* Write to ADC register (Gotthard, Jungfrau, ChipTestBoard). For expert users
|
* Write to ADC register (Gotthard, Jungfrau, ChipTestBoard). For expert users
|
||||||
* @param addr address of adc register
|
* @param addr address of adc register
|
||||||
* @param val value
|
* @param val value
|
||||||
* @returns return value (mostly -1 as it can't read adc register)
|
|
||||||
*/
|
*/
|
||||||
int writeAdcRegister(uint32_t addr, uint32_t val);
|
void writeAdcRegister(uint32_t addr, uint32_t val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activates/Deactivates the detector (Eiger only)
|
* Activates/Deactivates the detector (Eiger only)
|
||||||
@ -1361,25 +1298,22 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param n is number of times to pulse
|
* @param n is number of times to pulse
|
||||||
* @param x is x coordinate
|
* @param x is x coordinate
|
||||||
* @param y is y coordinate
|
* @param y is y coordinate
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int pulsePixel(int n = 0, int x = 0, int y = 0);
|
void pulsePixel(int n = 0, int x = 0, int y = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pulse Pixel and move by a relative value (Eiger)
|
* Pulse Pixel and move by a relative value (Eiger)
|
||||||
* @param n is number of times to pulse
|
* @param n is number of times to pulse
|
||||||
* @param x is relative x value
|
* @param x is relative x value
|
||||||
* @param y is relative y value
|
* @param y is relative y value
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int pulsePixelNMove(int n = 0, int x = 0, int y = 0);
|
void pulsePixelNMove(int n = 0, int x = 0, int y = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pulse Chip (Eiger)
|
* Pulse Chip (Eiger)
|
||||||
* @param n is number of times to pulse
|
* @param n is number of times to pulse
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int pulseChip(int n_pulses = 0);
|
void pulseChip(int n_pulses = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/gets threshold temperature (Jungfrau)
|
* Set/gets threshold temperature (Jungfrau)
|
||||||
@ -1412,29 +1346,25 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
/**
|
/**
|
||||||
* Programs FPGA with pof file (Jungfrau, CTB, Moench)
|
* Programs FPGA with pof file (Jungfrau, CTB, Moench)
|
||||||
* @param buffer programming file in memory
|
* @param buffer programming file in memory
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int programFPGA(std::vector<char> buffer);
|
void programFPGA(std::vector<char> buffer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets FPGA (Jungfrau)
|
* Resets FPGA (Jungfrau)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetFPGA();
|
void resetFPGA();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies detector server from tftp and changes respawn server (Not Eiger)
|
* Copies detector server from tftp and changes respawn server (Not Eiger)
|
||||||
* @param fname name of detector server binary
|
* @param fname name of detector server binary
|
||||||
* @param hostname name of pc to tftp from
|
* @param hostname name of pc to tftp from
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int copyDetectorServer(const std::string &fname, const std::string &hostname);
|
void copyDetectorServer(const std::string &fname, const std::string &hostname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reboot detector controller (blackfin/ powerpc)
|
* Reboot detector controller (blackfin/ powerpc)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int rebootController();
|
void rebootController();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Power on/off Chip (Jungfrau)
|
* Power on/off Chip (Jungfrau)
|
||||||
@ -1463,10 +1393,9 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param module module to be set - must contain correct module number and
|
* @param module module to be set - must contain correct module number and
|
||||||
* also channel and chip registers
|
* also channel and chip registers
|
||||||
* @param tb 1 to include trimbits, 0 to exclude (used for eiger)
|
* @param tb 1 to include trimbits, 0 to exclude (used for eiger)
|
||||||
* @returns ok or fail
|
|
||||||
* \sa ::sls_detector_module
|
* \sa ::sls_detector_module
|
||||||
*/
|
*/
|
||||||
int setModule(sls_detector_module& module, int tb = 1);
|
void setModule(sls_detector_module& module, int tb = 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get module structure from detector (all detectors)
|
* Get module structure from detector (all detectors)
|
||||||
@ -1479,9 +1408,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param t dead time in ns - if 0 disable correction,
|
* @param t dead time in ns - if 0 disable correction,
|
||||||
* if >0 set dead time to t, if < 0 set deadtime to default dead time
|
* if >0 set dead time to t, if < 0 set deadtime to default dead time
|
||||||
* for current settings
|
* for current settings
|
||||||
* @returns 0 if rate correction disabled, >0 otherwise
|
|
||||||
*/
|
*/
|
||||||
int setRateCorrection(int64_t t = 0);
|
void setRateCorrection(int64_t t = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get rate correction (Eiger)
|
* Get rate correction (Eiger)
|
||||||
@ -1503,14 +1431,9 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
void printReceiverConfiguration(TLogLevel level = logINFO);
|
void printReceiverConfiguration(TLogLevel level = logINFO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if receiver is online and set flag
|
* Gets the use receiver flag from shared memory
|
||||||
* Also initializes the data socekt
|
|
||||||
* @param online 1 to set online, 0 to set offline, -1 gets
|
|
||||||
* @returns online, offline (from shared memory)
|
|
||||||
*/
|
*/
|
||||||
int setReceiverOnline(int value = GET_ONLINE_FLAG);
|
bool getUseReceiverFlag() const;
|
||||||
|
|
||||||
int getReceiverOnlineFlag() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the receiver is really online
|
* Checks if the receiver is really online
|
||||||
@ -1533,29 +1456,20 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Exits the receiver TCP server
|
* Exits the receiver TCP server
|
||||||
* @retutns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int exitReceiver();
|
void exitReceiver();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a system command on the receiver server
|
* Executes a system command on the receiver server
|
||||||
* e.g. mount an nfs disk, reboot and returns answer etc.
|
* e.g. mount an nfs disk, reboot and returns answer etc.
|
||||||
* @param cmd command to be executed
|
* @param cmd command to be executed
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int execReceiverCommand(const std::string &cmd);
|
void execReceiverCommand(const std::string &cmd);
|
||||||
|
|
||||||
/**
|
|
||||||
updates the shared memory receiving the data from the detector (without asking and closing the connection
|
|
||||||
/returns OK
|
|
||||||
*/
|
|
||||||
// int updateReceiverNoWait(sls::ClientSocket &receiver);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the shared memory receiving the data from the detector
|
* Updates the shared memory receiving the data from the detector
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int updateCachedReceiverVariables() const;
|
void updateCachedReceiverVariables() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send the multi detector size to the detector
|
* Send the multi detector size to the detector
|
||||||
@ -1660,15 +1574,13 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Receiver starts listening to packets
|
* Receiver starts listening to packets
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startReceiver();
|
void startReceiver();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops the listening mode of receiver
|
* Stops the listening mode of receiver
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopReceiver();
|
void stopReceiver();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the status of the listening mode of receiver
|
* Gets the status of the listening mode of receiver
|
||||||
@ -1691,9 +1603,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
/**
|
/**
|
||||||
* Resets framescaught in receiver
|
* Resets framescaught in receiver
|
||||||
* Use this when using startAcquisition instead of acquire
|
* Use this when using startAcquisition instead of acquire
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetFramesCaught();
|
void resetFramesCaught();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets/Gets receiver file write enable
|
* Sets/Gets receiver file write enable
|
||||||
@ -1786,9 +1697,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* restream the stop dummy packet from receiver
|
* restream the stop dummy packet from receiver
|
||||||
* Used usually for Moench,
|
* Used usually for Moench,
|
||||||
* in case it is lost in network due to high data rate
|
* in case it is lost in network due to high data rate
|
||||||
* @returns OK if success else FAIL
|
|
||||||
*/
|
*/
|
||||||
int restreamStopFromReceiver();
|
void restreamStopFromReceiver();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens pattern file and sends pattern to CTB
|
* Opens pattern file and sends pattern to CTB
|
||||||
@ -1848,9 +1758,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
/**
|
/**
|
||||||
* Sets the mask applied to every pattern (CTB/ Moench)
|
* Sets the mask applied to every pattern (CTB/ Moench)
|
||||||
* @param mask mask to be applied
|
* @param mask mask to be applied
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setPatternMask(uint64_t mask);
|
void setPatternMask(uint64_t mask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the mask applied to every pattern (CTB/ Moench)
|
* Gets the mask applied to every pattern (CTB/ Moench)
|
||||||
@ -1861,9 +1770,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
/**
|
/**
|
||||||
* Selects the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
* Selects the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
||||||
* @param mask mask to select bits
|
* @param mask mask to select bits
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setPatternBitMask(uint64_t mask);
|
void setPatternBitMask(uint64_t mask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
* Gets the bits that the mask will be applied to for every pattern (CTB/ Moench)
|
||||||
@ -1882,9 +1790,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* Set Digital IO Delay (Moench, CTB only)
|
* Set Digital IO Delay (Moench, CTB only)
|
||||||
* @param digital IO mask to select the pins
|
* @param digital IO mask to select the pins
|
||||||
* @param delay delay in ps(1 bit=25ps, max of 775 ps)
|
* @param delay delay in ps(1 bit=25ps, max of 775 ps)
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setDigitalIODelay(uint64_t pinMask, int delay);
|
void setDigitalIODelay(uint64_t pinMask, int delay);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
@ -1929,9 +1836,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
/**
|
/**
|
||||||
* Get MAC from the receiver using udpip and
|
* Get MAC from the receiver using udpip and
|
||||||
* set up UDP connection in detector
|
* set up UDP connection in detector
|
||||||
* @returns Ok or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setUDPConnection();
|
void setUDPConnection();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Template function to do linear interpolation between two points (Eiger only)
|
* Template function to do linear interpolation between two points (Eiger only)
|
||||||
@ -1973,9 +1879,8 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* writes a trim/settings file
|
* writes a trim/settings file
|
||||||
* @param fname name of the file to be written
|
* @param fname name of the file to be written
|
||||||
* @param mod module structure which has to be written to file
|
* @param mod module structure which has to be written to file
|
||||||
* @returns OK or FAIL if the file could not be written
|
|
||||||
*/
|
*/
|
||||||
int writeSettingsFile(const std::string &fname, sls_detector_module& mod);
|
void writeSettingsFile(const std::string &fname, sls_detector_module& mod);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Names of dacs in settings file
|
* Get Names of dacs in settings file
|
||||||
|
@ -129,24 +129,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::string getDetectorType(int detPos = -1);
|
std::string getDetectorType(int detPos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets/Checks the detectors in multi detector list to online/offline
|
|
||||||
* Must be called before communicating with detector
|
|
||||||
* @param online 1 to set detector online, 0 to set it offline, -1 to get
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns (1)online/(0)offline status
|
|
||||||
*/
|
|
||||||
int setOnline(int const online = -1, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets/Checks the receivers in multi detector list to online/offline
|
|
||||||
* Must be called before communicating with receiver
|
|
||||||
* @param online 1 to set receiver online, 0 to set it receiver, -1 to get
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
|
||||||
* @returns (1)online/(0)offline status
|
|
||||||
*/
|
|
||||||
int setReceiverOnline(int const online = -1, int detPos = -1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load configuration from a configuration File (for one time detector setup)
|
* Load configuration from a configuration File (for one time detector setup)
|
||||||
* @param fname configuration file name
|
* @param fname configuration file name
|
||||||
@ -213,16 +195,14 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Check Detector Version Compatibility
|
* Check Detector Version Compatibility
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns true if compatible, else false
|
|
||||||
*/
|
*/
|
||||||
bool isDetectorVersionCompatible(int detPos = -1);
|
void isDetectorVersionCompatible(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check Receiver Version Compatibility
|
* Check Receiver Version Compatibility
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns true if compatible, else false
|
|
||||||
*/
|
*/
|
||||||
bool isReceiverVersionCompatible(int detPos = -1);
|
void isReceiverVersionCompatible(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a complete acquisition
|
* Performs a complete acquisition
|
||||||
@ -236,9 +216,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Stop detector acquisition
|
* Stop detector acquisition
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopMeasurement(int detPos = -1);
|
void stopMeasurement(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Detector run status
|
* Get Detector run status
|
||||||
@ -251,24 +230,21 @@ public:
|
|||||||
* (Advanced user, included in startMeasurement)
|
* (Advanced user, included in startMeasurement)
|
||||||
* Start detector acquisition (Non blocking)
|
* Start detector acquisition (Non blocking)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL if even one does not start properly
|
|
||||||
*/
|
*/
|
||||||
int startAcquisition(int detPos = -1);
|
void startAcquisition(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop detector acquisition (Same as stopMeasurement)
|
* Stop detector acquisition (Same as stopMeasurement)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopAcquisition(int detPos = -1);
|
void stopAcquisition(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Only in non blocking acquire mode)
|
* (Only in non blocking acquire mode)
|
||||||
* Give an internal software trigger to the detector (Eiger)
|
* Give an internal software trigger to the detector (Eiger)
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @return OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int sendSoftwareTrigger(int detPos = -1);
|
void sendSoftwareTrigger(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Rate correction ( Eiger)
|
* Set Rate correction ( Eiger)
|
||||||
@ -534,9 +510,8 @@ public:
|
|||||||
* @param n number of rois
|
* @param n number of rois
|
||||||
* @param roiLimits array of roi
|
* @param roiLimits array of roi
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int detPos = -1);
|
void setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
* Get ROI from each detector and convert it to the multi detector scale (Gotthard)
|
||||||
@ -559,17 +534,15 @@ public:
|
|||||||
* (Advanced user, included in startMeasurement)
|
* (Advanced user, included in startMeasurement)
|
||||||
* Receiver starts listening to packets
|
* Receiver starts listening to packets
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int startReceiver(int detPos = -1);
|
void startReceiver(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Advanced user, included in startMeasurement)
|
* (Advanced user, included in startMeasurement)
|
||||||
* Stops the listening mode of receiver
|
* Stops the listening mode of receiver
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int stopReceiver(int detPos = -1);
|
void stopReceiver(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get receiver silent mode
|
* Set/get receiver silent mode
|
||||||
@ -584,9 +557,8 @@ public:
|
|||||||
* Resets framescaught in receiver
|
* Resets framescaught in receiver
|
||||||
* Use this when using startAcquisition instead of acquire
|
* Use this when using startAcquisition instead of acquire
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int resetFramesCaughtInReceiver(int detPos = -1);
|
void resetFramesCaughtInReceiver(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Advanced user)
|
* (Advanced user)
|
||||||
|
@ -182,22 +182,20 @@ bool multiSlsDetector::isAcquireReady() {
|
|||||||
return OK != 0u;
|
return OK != 0u;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::checkDetectorVersionCompatibility(int detPos) {
|
void multiSlsDetector::checkDetectorVersionCompatibility(int detPos) {
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->checkDetectorVersionCompatibility();
|
detectors[detPos]->checkDetectorVersionCompatibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r = parallelCall(&slsDetector::checkDetectorVersionCompatibility);
|
parallelCall(&slsDetector::checkDetectorVersionCompatibility);
|
||||||
return sls::minusOneIfDifferent(r);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::checkReceiverVersionCompatibility(int detPos) {
|
void multiSlsDetector::checkReceiverVersionCompatibility(int detPos) {
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->checkReceiverVersionCompatibility();
|
detectors[detPos]->checkReceiverVersionCompatibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r = parallelCall(&slsDetector::checkReceiverVersionCompatibility);
|
parallelCall(&slsDetector::checkReceiverVersionCompatibility);
|
||||||
return sls::minusOneIfDifferent(r);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t multiSlsDetector::getId(idMode mode, int detPos) {
|
int64_t multiSlsDetector::getId(idMode mode, int detPos) {
|
||||||
@ -312,7 +310,6 @@ void multiSlsDetector::initializeDetectorStructure() {
|
|||||||
multi_shm()->numberOfDetectors = 0;
|
multi_shm()->numberOfDetectors = 0;
|
||||||
multi_shm()->numberOfDetector[X] = 0;
|
multi_shm()->numberOfDetector[X] = 0;
|
||||||
multi_shm()->numberOfDetector[Y] = 0;
|
multi_shm()->numberOfDetector[Y] = 0;
|
||||||
multi_shm()->onlineFlag = 1;
|
|
||||||
multi_shm()->stoppedFlag = 0;
|
multi_shm()->stoppedFlag = 0;
|
||||||
multi_shm()->dataBytes = 0;
|
multi_shm()->dataBytes = 0;
|
||||||
multi_shm()->dataBytesInclGapPixels = 0;
|
multi_shm()->dataBytesInclGapPixels = 0;
|
||||||
@ -421,7 +418,6 @@ void multiSlsDetector::addMultipleDetectors(const char *name) {
|
|||||||
addSlsDetector(hostname);
|
addSlsDetector(hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
setOnline();
|
|
||||||
updateOffsets();
|
updateOffsets();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,7 +447,6 @@ void multiSlsDetector::addSlsDetector(const std::string &hostname) {
|
|||||||
multi_shm()->numberOfChannels += detectors[pos]->getTotalNumberOfChannels();
|
multi_shm()->numberOfChannels += detectors[pos]->getTotalNumberOfChannels();
|
||||||
|
|
||||||
detectors[pos]->setHostname(hostname);
|
detectors[pos]->setHostname(hostname);
|
||||||
detectors[pos]->setOnline(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::addSlsDetector(std::unique_ptr<slsDetector> det) {
|
void multiSlsDetector::addSlsDetector(std::unique_ptr<slsDetector> det) {
|
||||||
@ -725,29 +720,6 @@ void multiSlsDetector::updateOffsets() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setOnline(int value, int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->setOnline(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
if (value != GET_ONLINE_FLAG) {
|
|
||||||
auto r = parallelCall(&slsDetector::setOnline, value);
|
|
||||||
multi_shm()->onlineFlag = sls::minusOneIfDifferent(r);
|
|
||||||
}
|
|
||||||
return multi_shm()->onlineFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
int multiSlsDetector::getOnlineFlag(int detPos) {
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->getOnlineFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
auto r = serialCall(&slsDetector::getOnlineFlag);
|
|
||||||
return sls::minusOneIfDifferent(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string multiSlsDetector::checkOnline(int detPos) {
|
std::string multiSlsDetector::checkOnline(int detPos) {
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->checkOnline();
|
return detectors[detPos]->checkOnline();
|
||||||
@ -809,20 +781,18 @@ std::string multiSlsDetector::getLastClientIP(int detPos) {
|
|||||||
return sls::concatenateIfDifferent(r);
|
return sls::concatenateIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::exitServer(int detPos) {
|
void multiSlsDetector::exitServer(int detPos) {
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->exitServer();
|
detectors[detPos]->exitServer();
|
||||||
}
|
}
|
||||||
auto r = parallelCall(&slsDetector::exitServer);
|
parallelCall(&slsDetector::exitServer);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::execCommand(const std::string &cmd, int detPos) {
|
void multiSlsDetector::execCommand(const std::string &cmd, int detPos) {
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->execCommand(cmd);
|
detectors[detPos]->execCommand(cmd);
|
||||||
}
|
}
|
||||||
auto r = parallelCall(&slsDetector::execCommand, cmd);
|
parallelCall(&slsDetector::execCommand, cmd);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::readConfigurationFile(const std::string &fname) {
|
void multiSlsDetector::readConfigurationFile(const std::string &fname) {
|
||||||
@ -949,26 +919,24 @@ std::string multiSlsDetector::setSettingsDir(const std::string &directory,
|
|||||||
return sls::concatenateIfDifferent(r);
|
return sls::concatenateIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::loadSettingsFile(const std::string &fname, int detPos) {
|
void multiSlsDetector::loadSettingsFile(const std::string &fname, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->loadSettingsFile(fname);
|
return detectors[detPos]->loadSettingsFile(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::loadSettingsFile, fname);
|
parallelCall(&slsDetector::loadSettingsFile, fname);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::saveSettingsFile(const std::string &fname, int detPos) {
|
void multiSlsDetector::saveSettingsFile(const std::string &fname, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->saveSettingsFile(fname);
|
return detectors[detPos]->saveSettingsFile(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::saveSettingsFile, fname);
|
parallelCall(&slsDetector::saveSettingsFile, fname);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::runStatus multiSlsDetector::getRunStatus(int detPos) {
|
slsDetectorDefs::runStatus multiSlsDetector::getRunStatus(int detPos) {
|
||||||
@ -993,39 +961,33 @@ slsDetectorDefs::runStatus multiSlsDetector::getRunStatus(int detPos) {
|
|||||||
return IDLE;
|
return IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::prepareAcquisition(int detPos) {
|
void multiSlsDetector::prepareAcquisition(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->prepareAcquisition();
|
detectors[detPos]->prepareAcquisition();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::prepareAcquisition);
|
parallelCall(&slsDetector::prepareAcquisition);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::startAcquisition(int detPos) {
|
void multiSlsDetector::startAcquisition(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
if (detectors[detPos]->getDetectorTypeAsEnum() == EIGER) {
|
if (detectors[detPos]->getDetectorTypeAsEnum() == EIGER) {
|
||||||
if (detectors[detPos]->prepareAcquisition() == FAIL) {
|
detectors[detPos]->prepareAcquisition();
|
||||||
return FAIL;
|
|
||||||
}
|
}
|
||||||
}
|
detectors[detPos]->startAcquisition();
|
||||||
return detectors[detPos]->startAcquisition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
if (getDetectorTypeAsEnum() == EIGER) {
|
if (getDetectorTypeAsEnum() == EIGER) {
|
||||||
if (prepareAcquisition() == FAIL) {
|
prepareAcquisition();
|
||||||
return FAIL;
|
|
||||||
}
|
}
|
||||||
}
|
parallelCall(&slsDetector::startAcquisition);
|
||||||
auto r = parallelCall(&slsDetector::startAcquisition);
|
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::stopAcquisition(int detPos) {
|
void multiSlsDetector::stopAcquisition(int detPos) {
|
||||||
// locks to synchronize using client->receiver simultaneously (processing
|
// locks to synchronize using client->receiver simultaneously (processing
|
||||||
// thread)
|
// thread)
|
||||||
std::lock_guard<std::mutex> lock(mg);
|
std::lock_guard<std::mutex> lock(mg);
|
||||||
@ -1035,77 +997,67 @@ int multiSlsDetector::stopAcquisition(int detPos) {
|
|||||||
multi_shm()->stoppedFlag = 1;
|
multi_shm()->stoppedFlag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return detectors[detPos]->stopAcquisition();
|
detectors[detPos]->stopAcquisition();
|
||||||
} else {
|
} else {
|
||||||
multi_shm()->stoppedFlag = 1;
|
multi_shm()->stoppedFlag = 1;
|
||||||
auto r = parallelCall(&slsDetector::stopAcquisition);
|
parallelCall(&slsDetector::stopAcquisition);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::sendSoftwareTrigger(int detPos) {
|
void multiSlsDetector::sendSoftwareTrigger(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->sendSoftwareTrigger();
|
detectors[detPos]->sendSoftwareTrigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::sendSoftwareTrigger);
|
parallelCall(&slsDetector::sendSoftwareTrigger);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::startAndReadAll(int detPos) {
|
void multiSlsDetector::startAndReadAll(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
if (detectors[detPos]->getDetectorTypeAsEnum() == EIGER) {
|
if (detectors[detPos]->getDetectorTypeAsEnum() == EIGER) {
|
||||||
if (detectors[detPos]->prepareAcquisition() == FAIL) {
|
detectors[detPos]->prepareAcquisition();
|
||||||
return FAIL;
|
|
||||||
}
|
}
|
||||||
}
|
detectors[detPos]->startAndReadAll();
|
||||||
return detectors[detPos]->startAndReadAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
if (getDetectorTypeAsEnum() == EIGER) {
|
if (getDetectorTypeAsEnum() == EIGER) {
|
||||||
if (prepareAcquisition() == FAIL) {
|
prepareAcquisition();
|
||||||
return FAIL;
|
|
||||||
}
|
}
|
||||||
}
|
parallelCall(&slsDetector::startAndReadAll);
|
||||||
auto r = parallelCall(&slsDetector::startAndReadAll);
|
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::startReadOut(int detPos) {
|
void multiSlsDetector::startReadOut(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->startReadOut();
|
detectors[detPos]->startReadOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::startReadOut);
|
parallelCall(&slsDetector::startReadOut);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::readAll(int detPos) {
|
void multiSlsDetector::readAll(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->readAll();
|
detectors[detPos]->readAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::readAll);
|
parallelCall(&slsDetector::readAll);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::configureMAC(int detPos) {
|
void multiSlsDetector::configureMAC(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->configureMAC();
|
detectors[detPos]->configureMAC();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::configureMAC);
|
parallelCall(&slsDetector::configureMAC);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::setStartingFrameNumber(const uint64_t value,
|
void multiSlsDetector::setStartingFrameNumber(const uint64_t value,
|
||||||
@ -2134,12 +2086,12 @@ int multiSlsDetector::digitalTest(digitalTestMode mode, int ival, int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::loadImageToDetector(imageType index,
|
void multiSlsDetector::loadImageToDetector(imageType index,
|
||||||
const std::string &fname,
|
const std::string &fname,
|
||||||
int detPos) {
|
int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->loadImageToDetector(index, fname);
|
detectors[detPos]->loadImageToDetector(index, fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
@ -2153,56 +2105,36 @@ int multiSlsDetector::loadImageToDetector(imageType index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// send image to all
|
// send image to all
|
||||||
std::vector<int> r;
|
|
||||||
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
||||||
r.push_back(detectors[idet]->sendImageToDetector(
|
detectors[idet]->sendImageToDetector(index, imageVals + idet * detectors[idet]->getTotalNumberOfChannels());
|
||||||
index,
|
|
||||||
imageVals + idet * detectors[idet]->getTotalNumberOfChannels()));
|
|
||||||
}
|
}
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::writeCounterBlockFile(const std::string &fname,
|
void multiSlsDetector::writeCounterBlockFile(const std::string &fname,
|
||||||
int startACQ, int detPos) {
|
int startACQ, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->writeCounterBlockFile(fname, startACQ);
|
detectors[detPos]->writeCounterBlockFile(fname, startACQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
|
|
||||||
// get image from all
|
|
||||||
int nch = multi_shm()->numberOfChannels;
|
int nch = multi_shm()->numberOfChannels;
|
||||||
short int imageVals[nch];
|
short int imageVals[nch];
|
||||||
std::vector<int> r;
|
|
||||||
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
for (size_t idet = 0; idet < detectors.size(); ++idet) {
|
||||||
r.push_back(detectors[idet]->getCounterBlock(
|
detectors[idet]->getCounterBlock(
|
||||||
imageVals + idet * detectors[idet]->getTotalNumberOfChannels(),
|
imageVals + idet * detectors[idet]->getTotalNumberOfChannels(),
|
||||||
startACQ));
|
startACQ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// write image if all ok
|
void multiSlsDetector::resetCounterBlock(int startACQ, int detPos) {
|
||||||
if (sls::allEqualTo(r, static_cast<int>(OK))) {
|
|
||||||
if (writeDataFile(fname, nch, imageVals) <
|
|
||||||
nch * (int)sizeof(short int)) {
|
|
||||||
throw RuntimeError(
|
|
||||||
"Could not open file to write or did not write enough data"
|
|
||||||
" in file to write counter block file from detector.");
|
|
||||||
}
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int multiSlsDetector::resetCounterBlock(int startACQ, int detPos) {
|
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->resetCounterBlock(startACQ);
|
detectors[detPos]->resetCounterBlock(startACQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::resetCounterBlock, startACQ);
|
parallelCall(&slsDetector::resetCounterBlock, startACQ);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setCounterBit(int i, int detPos) {
|
int multiSlsDetector::setCounterBit(int i, int detPos) {
|
||||||
@ -2232,10 +2164,10 @@ void multiSlsDetector::verifyMinMaxROI(int n, ROI r[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
|
void multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setROI(n, roiLimits);
|
detectors[detPos]->setROI(n, roiLimits);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
@ -2252,7 +2184,7 @@ int multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((n < 0) || (roiLimits == nullptr)) {
|
if ((n < 0) || (roiLimits == nullptr)) {
|
||||||
return FAIL;
|
throw RuntimeError("Cannot set ROI due to Invalid ROI");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensures min < max
|
// ensures min < max
|
||||||
@ -2371,12 +2303,9 @@ int multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// settings the rois for each detector
|
// settings the rois for each detector
|
||||||
std::vector<int> r;
|
|
||||||
r.reserve(detectors.size());
|
|
||||||
for (size_t i = 0; i != detectors.size(); ++i) {
|
for (size_t i = 0; i != detectors.size(); ++i) {
|
||||||
r.push_back(detectors[i]->setROI(nroi[i], allroi[i]));
|
detectors[i]->setROI(nroi[i], allroi[i]);
|
||||||
}
|
}
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const slsDetectorDefs::ROI *multiSlsDetector::getROI(int &n, int detPos) {
|
const slsDetectorDefs::ROI *multiSlsDetector::getROI(int &n, int detPos) {
|
||||||
@ -2645,16 +2574,15 @@ int multiSlsDetector::getReceiverDbitOffset(int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::writeAdcRegister(uint32_t addr, uint32_t val,
|
void multiSlsDetector::writeAdcRegister(uint32_t addr, uint32_t val,
|
||||||
int detPos) {
|
int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->writeAdcRegister(addr, val);
|
detectors[detPos]->writeAdcRegister(addr, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::writeAdcRegister, addr, val);
|
parallelCall(&slsDetector::writeAdcRegister, addr, val);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::activate(int const enable, int detPos) {
|
int multiSlsDetector::activate(int const enable, int detPos) {
|
||||||
@ -2762,37 +2690,34 @@ std::vector<int> multiSlsDetector::getTrimEn(int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::pulsePixel(int n, int x, int y, int detPos) {
|
void multiSlsDetector::pulsePixel(int n, int x, int y, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->pulsePixel(n, x, y);
|
detectors[detPos]->pulsePixel(n, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::pulsePixel, n, x, y);
|
parallelCall(&slsDetector::pulsePixel, n, x, y);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::pulsePixelNMove(int n, int x, int y, int detPos) {
|
void multiSlsDetector::pulsePixelNMove(int n, int x, int y, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->pulsePixelNMove(n, x, y);
|
detectors[detPos]->pulsePixelNMove(n, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::pulsePixelNMove, n, x, y);
|
parallelCall(&slsDetector::pulsePixelNMove, n, x, y);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::pulseChip(int n, int detPos) {
|
void multiSlsDetector::pulseChip(int n, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->pulseChip(n);
|
detectors[detPos]->pulseChip(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::pulseChip, n);
|
parallelCall(&slsDetector::pulseChip, n);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setThresholdTemperature(int val, int detPos) {
|
int multiSlsDetector::setThresholdTemperature(int val, int detPos) {
|
||||||
@ -2839,61 +2764,57 @@ int multiSlsDetector::setStoragecellStart(int pos, int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::programFPGA(const std::string &fname, int detPos) {
|
void multiSlsDetector::programFPGA(const std::string &fname, int detPos) {
|
||||||
FILE_LOG(logINFO) << "This can take awhile. Please be patient...";
|
FILE_LOG(logINFO) << "This can take awhile. Please be patient...";
|
||||||
// read pof file
|
// read pof file
|
||||||
std::vector<char> buffer = readPofFile(fname);
|
std::vector<char> buffer = readPofFile(fname);
|
||||||
|
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->programFPGA(buffer);
|
detectors[detPos]->programFPGA(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::programFPGA, buffer);
|
parallelCall(&slsDetector::programFPGA, buffer);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::resetFPGA(int detPos) {
|
void multiSlsDetector::resetFPGA(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->resetFPGA();
|
detectors[detPos]->resetFPGA();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::resetFPGA);
|
parallelCall(&slsDetector::resetFPGA);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::copyDetectorServer(const std::string &fname,
|
void multiSlsDetector::copyDetectorServer(const std::string &fname,
|
||||||
const std::string &hostname,
|
const std::string &hostname,
|
||||||
int detPos) {
|
int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
detectors[detPos]->copyDetectorServer(fname, hostname);
|
detectors[detPos]->copyDetectorServer(fname, hostname);
|
||||||
return detectors[detPos]
|
detectors[detPos]->rebootController();
|
||||||
->rebootController(); // reboot and copy should be independant for
|
// reboot and copy should be independant for
|
||||||
// update command
|
// update command
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
parallelCall(&slsDetector::copyDetectorServer, fname, hostname);
|
parallelCall(&slsDetector::copyDetectorServer, fname, hostname);
|
||||||
auto r = parallelCall(&slsDetector::rebootController);
|
parallelCall(&slsDetector::rebootController);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::rebootController(int detPos) {
|
void multiSlsDetector::rebootController(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->rebootController();
|
detectors[detPos]->rebootController();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::rebootController);
|
parallelCall(&slsDetector::rebootController);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::update(const std::string &sname,
|
void multiSlsDetector::update(const std::string &sname,
|
||||||
const std::string &hostname,
|
const std::string &hostname,
|
||||||
const std::string &fname, int detPos) {
|
const std::string &fname, int detPos) {
|
||||||
FILE_LOG(logINFO) << "This can take awhile. Please be patient...";
|
FILE_LOG(logINFO) << "This can take awhile. Please be patient...";
|
||||||
@ -2903,13 +2824,12 @@ int multiSlsDetector::update(const std::string &sname,
|
|||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
detectors[detPos]->copyDetectorServer(sname, hostname);
|
detectors[detPos]->copyDetectorServer(sname, hostname);
|
||||||
return detectors[detPos]->programFPGA(buffer);
|
detectors[detPos]->programFPGA(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
parallelCall(&slsDetector::copyDetectorServer, sname, hostname);
|
parallelCall(&slsDetector::copyDetectorServer, sname, hostname);
|
||||||
auto r = parallelCall(&slsDetector::programFPGA, buffer);
|
parallelCall(&slsDetector::programFPGA, buffer);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::powerChip(int ival, int detPos) {
|
int multiSlsDetector::powerChip(int ival, int detPos) {
|
||||||
@ -2944,15 +2864,14 @@ int multiSlsDetector::setAutoComparatorDisableMode(int ival, int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setRateCorrection(int64_t t, int detPos) {
|
void multiSlsDetector::setRateCorrection(int64_t t, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setRateCorrection(t);
|
detectors[detPos]->setRateCorrection(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setRateCorrection, t);
|
parallelCall(&slsDetector::setRateCorrection, t);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t multiSlsDetector::getRateCorrection(int detPos) {
|
int64_t multiSlsDetector::getRateCorrection(int detPos) {
|
||||||
@ -2978,26 +2897,19 @@ void multiSlsDetector::printReceiverConfiguration(TLogLevel level, int detPos) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setReceiverOnline(int value, int detPos) {
|
bool multiSlsDetector::getUseReceiverFlag(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setReceiverOnline(value);
|
return detectors[detPos]->getUseReceiverFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setReceiverOnline, value);
|
auto r = parallelCall(&slsDetector::getUseReceiverFlag);
|
||||||
return sls::minusOneIfDifferent(r);
|
if (sls::allEqual(r)) {
|
||||||
|
return r.front();
|
||||||
|
} else {
|
||||||
|
throw RuntimeError("Inconsistent Use receiver flags");
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getReceiverOnlineFlag(int detPos) {
|
|
||||||
// single
|
|
||||||
if (detPos >= 0) {
|
|
||||||
return detectors[detPos]->getReceiverOnlineFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
// multi
|
|
||||||
auto r = parallelCall(&slsDetector::getReceiverOnlineFlag);
|
|
||||||
return sls::minusOneIfDifferent(r);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string multiSlsDetector::checkReceiverOnline(int detPos) {
|
std::string multiSlsDetector::checkReceiverOnline(int detPos) {
|
||||||
@ -3033,26 +2945,24 @@ std::string multiSlsDetector::getReceiverLastClientIP(int detPos) {
|
|||||||
return sls::concatenateIfDifferent(r);
|
return sls::concatenateIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::exitReceiver(int detPos) {
|
void multiSlsDetector::exitReceiver(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->exitReceiver();
|
detectors[detPos]->exitReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::exitReceiver);
|
parallelCall(&slsDetector::exitReceiver);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::execReceiverCommand(const std::string &cmd, int detPos) {
|
void multiSlsDetector::execReceiverCommand(const std::string &cmd, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->execReceiverCommand(cmd);
|
detectors[detPos]->execReceiverCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::execReceiverCommand, cmd);
|
parallelCall(&slsDetector::execReceiverCommand, cmd);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string multiSlsDetector::getFilePath(int detPos) {
|
std::string multiSlsDetector::getFilePath(int detPos) {
|
||||||
@ -3204,26 +3114,24 @@ int multiSlsDetector::getFileIndex(int detPos) const {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::startReceiver(int detPos) {
|
void multiSlsDetector::startReceiver(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->startReceiver();
|
detectors[detPos]->startReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::startReceiver);
|
parallelCall(&slsDetector::startReceiver);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::stopReceiver(int detPos) {
|
void multiSlsDetector::stopReceiver(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->stopReceiver();
|
detectors[detPos]->stopReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::stopReceiver);
|
parallelCall(&slsDetector::stopReceiver);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::runStatus multiSlsDetector::getReceiverStatus(int detPos) {
|
slsDetectorDefs::runStatus multiSlsDetector::getReceiverStatus(int detPos) {
|
||||||
@ -3285,15 +3193,14 @@ uint64_t multiSlsDetector::getReceiverCurrentFrameIndex(int detPos) {
|
|||||||
return ((sls::sum(r)) / (int)detectors.size());
|
return ((sls::sum(r)) / (int)detectors.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::resetFramesCaught(int detPos) {
|
void multiSlsDetector::resetFramesCaught(int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->resetFramesCaught();
|
detectors[detPos]->resetFramesCaught();
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::resetFramesCaught);
|
parallelCall(&slsDetector::resetFramesCaught);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::createReceivingDataSockets(const bool destroy) {
|
int multiSlsDetector::createReceivingDataSockets(const bool destroy) {
|
||||||
@ -3938,15 +3845,14 @@ uint64_t multiSlsDetector::setPatternWaitTime(int level, uint64_t t,
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setPatternMask(uint64_t mask, int detPos) {
|
void multiSlsDetector::setPatternMask(uint64_t mask, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setPatternMask(mask);
|
detectors[detPos]->setPatternMask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setPatternMask, mask);
|
parallelCall(&slsDetector::setPatternMask, mask);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t multiSlsDetector::getPatternMask(int detPos) {
|
uint64_t multiSlsDetector::getPatternMask(int detPos) {
|
||||||
@ -3962,12 +3868,11 @@ uint64_t multiSlsDetector::getPatternMask(int detPos) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setPatternBitMask(uint64_t mask, int detPos) {
|
void multiSlsDetector::setPatternBitMask(uint64_t mask, int detPos) {
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setPatternBitMask(mask);
|
detectors[detPos]->setPatternBitMask(mask);
|
||||||
}
|
}
|
||||||
auto r = parallelCall(&slsDetector::setPatternBitMask, mask);
|
parallelCall(&slsDetector::setPatternBitMask, mask);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t multiSlsDetector::getPatternBitMask(int detPos) {
|
uint64_t multiSlsDetector::getPatternBitMask(int detPos) {
|
||||||
@ -3995,16 +3900,15 @@ int multiSlsDetector::setLEDEnable(int enable, int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setDigitalIODelay(uint64_t pinMask, int delay,
|
void multiSlsDetector::setDigitalIODelay(uint64_t pinMask, int delay,
|
||||||
int detPos) {
|
int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setDigitalIODelay(pinMask, delay);
|
detectors[detPos]->setDigitalIODelay(pinMask, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setDigitalIODelay, pinMask, delay);
|
parallelCall(&slsDetector::setDigitalIODelay, pinMask, delay);
|
||||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::retrieveDetectorSetup(const std::string &fname1,
|
int multiSlsDetector::retrieveDetectorSetup(const std::string &fname1,
|
||||||
@ -4209,7 +4113,7 @@ void multiSlsDetector::registerDataCallback(
|
|||||||
void *pArg) {
|
void *pArg) {
|
||||||
dataReady = userCallback;
|
dataReady = userCallback;
|
||||||
pCallbackArg = pArg;
|
pCallbackArg = pArg;
|
||||||
if (setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) {
|
if (getUseReceiverFlag()) {
|
||||||
if (dataReady == nullptr) {
|
if (dataReady == nullptr) {
|
||||||
enableDataStreamingToClient(0);
|
enableDataStreamingToClient(0);
|
||||||
enableDataStreamingFromReceiver(0);
|
enableDataStreamingFromReceiver(0);
|
||||||
@ -4282,7 +4186,7 @@ int multiSlsDetector::acquire() {
|
|||||||
// process)
|
// process)
|
||||||
sem_init(&sem_endRTAcquisition, 1, 0);
|
sem_init(&sem_endRTAcquisition, 1, 0);
|
||||||
|
|
||||||
bool receiver = (setReceiverOnline() == ONLINE_FLAG);
|
bool receiver = getUseReceiverFlag();
|
||||||
progressIndex = 0;
|
progressIndex = 0;
|
||||||
multi_shm()->stoppedFlag = 0;
|
multi_shm()->stoppedFlag = 0;
|
||||||
setJoinThreadFlag(false);
|
setJoinThreadFlag(false);
|
||||||
@ -4291,9 +4195,7 @@ int multiSlsDetector::acquire() {
|
|||||||
if (receiver) {
|
if (receiver) {
|
||||||
std::lock_guard<std::mutex> lock(mg);
|
std::lock_guard<std::mutex> lock(mg);
|
||||||
if (getReceiverStatus() != IDLE) {
|
if (getReceiverStatus() != IDLE) {
|
||||||
if (stopReceiver() == FAIL) {
|
stopReceiver();
|
||||||
multi_shm()->stoppedFlag = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4302,19 +4204,13 @@ int multiSlsDetector::acquire() {
|
|||||||
// resets frames caught in receiver
|
// resets frames caught in receiver
|
||||||
if (receiver && multi_shm()->stoppedFlag == 0) {
|
if (receiver && multi_shm()->stoppedFlag == 0) {
|
||||||
std::lock_guard<std::mutex> lock(mg);
|
std::lock_guard<std::mutex> lock(mg);
|
||||||
if (resetFramesCaught() == FAIL) {
|
resetFramesCaught();
|
||||||
multi_shm()->stoppedFlag = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start receiver
|
// start receiver
|
||||||
if (receiver && multi_shm()->stoppedFlag == 0) {
|
if (receiver && multi_shm()->stoppedFlag == 0) {
|
||||||
std::lock_guard<std::mutex> lock(mg);
|
std::lock_guard<std::mutex> lock(mg);
|
||||||
if (startReceiver() == FAIL) {
|
startReceiver();
|
||||||
FILE_LOG(logERROR) << "Start receiver failed ";
|
|
||||||
stopReceiver();
|
|
||||||
multi_shm()->stoppedFlag = 1;
|
|
||||||
}
|
|
||||||
// let processing thread listen to these packets
|
// let processing thread listen to these packets
|
||||||
if (multi_shm()->stoppedFlag == 0)
|
if (multi_shm()->stoppedFlag == 0)
|
||||||
sem_post(&sem_newRTAcquisition);
|
sem_post(&sem_newRTAcquisition);
|
||||||
@ -4326,15 +4222,13 @@ int multiSlsDetector::acquire() {
|
|||||||
// stop receiver
|
// stop receiver
|
||||||
if (receiver) {
|
if (receiver) {
|
||||||
std::lock_guard<std::mutex> lock(mg);
|
std::lock_guard<std::mutex> lock(mg);
|
||||||
if (stopReceiver() == FAIL) {
|
stopReceiver();
|
||||||
multi_shm()->stoppedFlag = 1;
|
|
||||||
} else {
|
|
||||||
if (dataReady != nullptr) {
|
if (dataReady != nullptr) {
|
||||||
sem_wait(&sem_endRTAcquisition); // waits for receiver's
|
sem_wait(&sem_endRTAcquisition); // waits for receiver's
|
||||||
}
|
}
|
||||||
// external process to be
|
// external process to be
|
||||||
// done sending data to gui
|
// done sending data to gui
|
||||||
}
|
|
||||||
incrementFileIndex();
|
incrementFileIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4372,9 +4266,7 @@ void multiSlsDetector::startProcessingThread() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::processData() {
|
void multiSlsDetector::processData() {
|
||||||
if (setReceiverOnline() == OFFLINE_FLAG) {
|
if (getUseReceiverFlag()) {
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
if (dataReady != nullptr) {
|
if (dataReady != nullptr) {
|
||||||
readFrameFromReceiver();
|
readFrameFromReceiver();
|
||||||
}
|
}
|
||||||
@ -4391,7 +4283,7 @@ void multiSlsDetector::processData() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get progress
|
// get progress
|
||||||
if (setReceiverOnline() == ONLINE_FLAG) {
|
{
|
||||||
std::lock_guard<std::mutex> lock(mg);
|
std::lock_guard<std::mutex> lock(mg);
|
||||||
caught = getFramesCaughtByReceiver(0);
|
caught = getFramesCaughtByReceiver(0);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -301,13 +301,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
commands to configure detector status
|
commands to configure detector status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \page config
|
|
||||||
- <b>online [i]</b> sets the detector in online (1) or offline (0) mode. \c Returns \c (int)
|
|
||||||
*/
|
|
||||||
descrToFuncMap[i].m_pFuncName = "online";
|
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOnline;
|
|
||||||
++i;
|
|
||||||
|
|
||||||
/*! \page config
|
/*! \page config
|
||||||
- <b>checkonline</b> returns the hostnames of all detectors without connecting to them. \c Returns (string) "All online" or "[list of offline hostnames] : Not online".
|
- <b>checkonline</b> returns the hostnames of all detectors without connecting to them. \c Returns (string) "All online" or "[list of offline hostnames] : Not online".
|
||||||
*/
|
*/
|
||||||
@ -1804,13 +1797,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
/*! \page receiver
|
|
||||||
- <b>rx_online [i]</b> sets/gets the receiver in online/offline mode. 1 is online, 0 is offline. Get is from shared memory. \c Returns \c (int)
|
|
||||||
*/
|
|
||||||
descrToFuncMap[i].m_pFuncName = "rx_online";
|
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOnline;
|
|
||||||
++i;
|
|
||||||
|
|
||||||
/*! \page receiver
|
/*! \page receiver
|
||||||
- <b>rx_checkonline</b> Checks the receiver if it is online/offline mode. Only get! \c Returns (string) "All online" or "[list of offline hostnames] : Not online".
|
- <b>rx_checkonline</b> Checks the receiver if it is online/offline mode. Only get! \c Returns (string) "All online" or "[list of offline hostnames] : Not online".
|
||||||
*/
|
*/
|
||||||
@ -2219,13 +2205,9 @@ std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[],
|
|||||||
return std::string("acquire failed");
|
return std::string("acquire failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
int rx_online = myDet->setReceiverOnline(-1, detPos);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (myDet->acquire() == FAIL)
|
if (myDet->acquire() == FAIL)
|
||||||
return std::string("acquire failed");
|
return std::string("acquire failed");
|
||||||
if (rx_online) {
|
if (myDet->getUseReceiverFlag(detPos)) {
|
||||||
char answer[100];
|
char answer[100];
|
||||||
sprintf(answer, "\nAcquired %d", myDet->getFramesCaughtByReceiver(detPos));
|
sprintf(answer, "\nAcquired %d", myDet->getFramesCaughtByReceiver(detPos));
|
||||||
return std::string(answer);
|
return std::string(answer);
|
||||||
@ -2261,7 +2243,7 @@ std::string slsDetectorCommand::cmdData(int narg, const char * const args[], int
|
|||||||
// myDet->setThreadedProcessing(0);
|
// myDet->setThreadedProcessing(0);
|
||||||
// myDet->readAll(detPos);
|
// myDet->readAll(detPos);
|
||||||
// //processdata in receiver is useful only for gui purposes
|
// //processdata in receiver is useful only for gui purposes
|
||||||
// if(myDet->setReceiverOnline(detPos)==OFFLINE_FLAG)
|
// if(myDet->getUseReceiverFlag(detPos)==OFFLINE_FLAG)
|
||||||
// myDet->processData();
|
// myDet->processData();
|
||||||
// myDet->setThreadedProcessing(b);
|
// myDet->setThreadedProcessing(b);
|
||||||
return std::string("");
|
return std::string("");
|
||||||
@ -2489,27 +2471,19 @@ std::string slsDetectorCommand::cmdExitServer(int narg, const char * const args[
|
|||||||
|
|
||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
if (cmd == "exitserver") {
|
if (cmd == "exitserver") {
|
||||||
if (myDet->exitServer(detPos) == OK)
|
myDet->exitServer(detPos);
|
||||||
return std::string("Server shut down.");
|
return std::string("Server shut down.");
|
||||||
else
|
|
||||||
return std::string("Error closing server\n");
|
|
||||||
} else if (cmd == "rx_exit") {
|
} else if (cmd == "rx_exit") {
|
||||||
|
|
||||||
if (myDet->exitReceiver(detPos) == OK)
|
myDet->exitReceiver(detPos);
|
||||||
return std::string("Receiver shut down\n");
|
return std::string("Receiver shut down\n");
|
||||||
else
|
|
||||||
return std::string("Error closing receiver\n");
|
|
||||||
} else if (cmd == "execcommand") {
|
} else if (cmd == "execcommand") {
|
||||||
if (myDet->execCommand(std::string(args[1]), detPos) == OK)
|
myDet->execCommand(std::string(args[1]), detPos);
|
||||||
return std::string("Command executed successfully\n");
|
return std::string("Command executed successfully\n");
|
||||||
else
|
|
||||||
return std::string("Command failed\n");
|
|
||||||
} else if (cmd == "rx_execcommand") {
|
} else if (cmd == "rx_execcommand") {
|
||||||
|
|
||||||
if (myDet->execReceiverCommand(std::string(args[1]), detPos) == OK)
|
myDet->execReceiverCommand(std::string(args[1]), detPos);
|
||||||
return std::string("Command executed successfully\n");
|
return std::string("Command executed successfully\n");
|
||||||
else
|
|
||||||
return std::string("Command failed\n");
|
|
||||||
} else
|
} else
|
||||||
return ("cannot decode command\n");
|
return ("cannot decode command\n");
|
||||||
} else
|
} else
|
||||||
@ -2781,7 +2755,6 @@ std::string slsDetectorCommand::helpThreaded(int action) {
|
|||||||
|
|
||||||
std::string slsDetectorCommand::cmdImage(int narg, const char * const args[], int action, int detPos) {
|
std::string slsDetectorCommand::cmdImage(int narg, const char * const args[], int action, int detPos) {
|
||||||
std::string sval;
|
std::string sval;
|
||||||
int retval = FAIL;
|
|
||||||
if (action == HELP_ACTION)
|
if (action == HELP_ACTION)
|
||||||
return helpImage(HELP_ACTION);
|
return helpImage(HELP_ACTION);
|
||||||
else if (action == GET_ACTION)
|
else if (action == GET_ACTION)
|
||||||
@ -2790,14 +2763,11 @@ std::string slsDetectorCommand::cmdImage(int narg, const char * const args[], in
|
|||||||
sval = std::string(args[1]);
|
sval = std::string(args[1]);
|
||||||
|
|
||||||
if (std::string(args[0]) == std::string("darkimage"))
|
if (std::string(args[0]) == std::string("darkimage"))
|
||||||
retval = myDet->loadImageToDetector(DARK_IMAGE, sval, detPos);
|
myDet->loadImageToDetector(DARK_IMAGE, sval, detPos);
|
||||||
else if (std::string(args[0]) == std::string("gainimage"))
|
else if (std::string(args[0]) == std::string("gainimage"))
|
||||||
retval = myDet->loadImageToDetector(GAIN_IMAGE, sval, detPos);
|
myDet->loadImageToDetector(GAIN_IMAGE, sval, detPos);
|
||||||
|
|
||||||
if (retval == OK)
|
|
||||||
return std::string("Image loaded succesfully");
|
return std::string("Image loaded succesfully");
|
||||||
else
|
|
||||||
return std::string("Image load failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string slsDetectorCommand::helpImage(int action) {
|
std::string slsDetectorCommand::helpImage(int action) {
|
||||||
@ -2831,13 +2801,16 @@ std::string slsDetectorCommand::cmdCounter(int narg, const char * const args[],
|
|||||||
if (narg < 3)
|
if (narg < 3)
|
||||||
return std::string("should specify I/O file");
|
return std::string("should specify I/O file");
|
||||||
sval = std::string(args[2]);
|
sval = std::string(args[2]);
|
||||||
retval = myDet->writeCounterBlockFile(sval, ival, detPos);
|
myDet->writeCounterBlockFile(sval, ival, detPos);
|
||||||
|
return std::string("Counter read succesfully");
|
||||||
}
|
}
|
||||||
} else if (std::string(args[0]) == std::string("resetctr")) {
|
} else if (std::string(args[0]) == std::string("resetctr")) {
|
||||||
if (action == GET_ACTION)
|
if (action == GET_ACTION)
|
||||||
return std::string("Cannot get");
|
return std::string("Cannot get");
|
||||||
else
|
else {
|
||||||
retval = myDet->resetCounterBlock(ival, detPos);
|
myDet->resetCounterBlock(ival, detPos);
|
||||||
|
return std::string("successful");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (std::string(args[0]) == std::string("resmat")) {
|
else if (std::string(args[0]) == std::string("resmat")) {
|
||||||
@ -2852,7 +2825,7 @@ std::string slsDetectorCommand::cmdCounter(int narg, const char * const args[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (retval == OK)
|
if (retval == OK)
|
||||||
return std::string("Counter read/reset succesfully");
|
return std::string("Counter set/reset succesfully");
|
||||||
else
|
else
|
||||||
return std::string("Counter read/reset failed");
|
return std::string("Counter read/reset failed");
|
||||||
}
|
}
|
||||||
@ -3254,15 +3227,7 @@ std::string slsDetectorCommand::cmdOnline(int narg, const char * const args[], i
|
|||||||
int ival;
|
int ival;
|
||||||
char ans[1000];
|
char ans[1000];
|
||||||
|
|
||||||
if (cmd == "online") {
|
if (cmd == "checkonline") {
|
||||||
if (action == PUT_ACTION) {
|
|
||||||
if (sscanf(args[1], "%d", &ival))
|
|
||||||
myDet->setOnline(ival, detPos);
|
|
||||||
else
|
|
||||||
return std::string("Could not scan online mode ") + std::string(args[1]);
|
|
||||||
}
|
|
||||||
sprintf(ans, "%d", myDet->setOnline(-1, detPos));
|
|
||||||
} else if (cmd == "checkonline") {
|
|
||||||
if (action == PUT_ACTION)
|
if (action == PUT_ACTION)
|
||||||
return std::string("cannot set");
|
return std::string("cannot set");
|
||||||
strcpy(ans, myDet->checkOnline(detPos).c_str());
|
strcpy(ans, myDet->checkOnline(detPos).c_str());
|
||||||
@ -3289,14 +3254,6 @@ std::string slsDetectorCommand::cmdOnline(int narg, const char * const args[], i
|
|||||||
}
|
}
|
||||||
int ret = myDet->setDeactivatedRxrPaddingMode(-1, detPos);
|
int ret = myDet->setDeactivatedRxrPaddingMode(-1, detPos);
|
||||||
sprintf(ans, "%d %s", myDet->activate(-1, detPos), ret == 1 ? "padding" : (ret == 0 ? "nopadding" : "unknown"));
|
sprintf(ans, "%d %s", myDet->activate(-1, detPos), ret == 1 ? "padding" : (ret == 0 ? "nopadding" : "unknown"));
|
||||||
} else if (cmd == "rx_online") {
|
|
||||||
if (action == PUT_ACTION) {
|
|
||||||
if (sscanf(args[1], "%d", &ival))
|
|
||||||
myDet->setReceiverOnline(ival, detPos);
|
|
||||||
else
|
|
||||||
return std::string("Could not scan online mode ") + std::string(args[1]);
|
|
||||||
}
|
|
||||||
sprintf(ans, "%d", myDet->setReceiverOnline(-1, detPos));
|
|
||||||
} else {
|
} else {
|
||||||
if (action == PUT_ACTION)
|
if (action == PUT_ACTION)
|
||||||
return std::string("cannot set");
|
return std::string("cannot set");
|
||||||
@ -3314,14 +3271,10 @@ std::string slsDetectorCommand::helpOnline(int action) {
|
|||||||
|
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
if (action == PUT_ACTION || action == HELP_ACTION) {
|
if (action == PUT_ACTION || action == HELP_ACTION) {
|
||||||
os << "online i \n sets the detector in online (1) or offline (0) mode" << std::endl;
|
|
||||||
os << "rx_online i \n sets the receiver in online (1) or offline (0) mode" << std::endl;
|
|
||||||
os << "activate i [p]\n sets the detector in activated (1) or deactivated (0) mode (does not send data). p is optional and can be padding (default) or nonpadding for receivers for deactivated detectors. Only for Eiger." << std::endl;
|
os << "activate i [p]\n sets the detector in activated (1) or deactivated (0) mode (does not send data). p is optional and can be padding (default) or nonpadding for receivers for deactivated detectors. Only for Eiger." << std::endl;
|
||||||
}
|
}
|
||||||
if (action == GET_ACTION || action == HELP_ACTION) {
|
if (action == GET_ACTION || action == HELP_ACTION) {
|
||||||
os << "online \n gets the detector online (1) or offline (0) mode" << std::endl;
|
|
||||||
os << "checkonline \n returns the hostnames of all detectors in offline mode" << std::endl;
|
os << "checkonline \n returns the hostnames of all detectors in offline mode" << std::endl;
|
||||||
os << "rx_online \n gets the receiver online (1) or offline (0) mode" << std::endl;
|
|
||||||
os << "rx_checkonline \n returns the hostnames of all receiver in offline mode" << std::endl;
|
os << "rx_checkonline \n returns the hostnames of all receiver in offline mode" << std::endl;
|
||||||
os << "activate \n gets the detector activated (1) or deactivated (0) mode. And padding or nonpadding for the deactivated receiver. Only for Eiger." << std::endl;
|
os << "activate \n gets the detector activated (1) or deactivated (0) mode. And padding or nonpadding for the deactivated receiver. Only for Eiger." << std::endl;
|
||||||
}
|
}
|
||||||
@ -3333,17 +3286,12 @@ std::string slsDetectorCommand::cmdConfigureMac(int narg, const char * const arg
|
|||||||
if (action == HELP_ACTION) {
|
if (action == HELP_ACTION) {
|
||||||
return helpConfigureMac(action);
|
return helpConfigureMac(action);
|
||||||
}
|
}
|
||||||
int ret;
|
|
||||||
char ans[1000];
|
|
||||||
|
|
||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
|
myDet->configureMAC(detPos);
|
||||||
ret = myDet->configureMAC(detPos);
|
|
||||||
} else
|
} else
|
||||||
return std::string("Cannot get ") + cmd;
|
return std::string("Cannot get ") + cmd;
|
||||||
|
|
||||||
sprintf(ans, "%d", ret);
|
return std::string("successful");
|
||||||
return ans;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string slsDetectorCommand::helpConfigureMac(int action) {
|
std::string slsDetectorCommand::helpConfigureMac(int action) {
|
||||||
@ -3547,17 +3495,13 @@ std::string slsDetectorCommand::cmdSettings(int narg, const char * const args[],
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout << " trimfile " << sval << std::endl;
|
std::cout << " trimfile " << sval << std::endl;
|
||||||
#endif
|
#endif
|
||||||
int ret = OK;
|
|
||||||
if (action == GET_ACTION) {
|
if (action == GET_ACTION) {
|
||||||
//create file names
|
//create file names
|
||||||
ret = myDet->saveSettingsFile(sval, detPos);
|
myDet->saveSettingsFile(sval, detPos);
|
||||||
} else if (action == PUT_ACTION) {
|
} else if (action == PUT_ACTION) {
|
||||||
ret = myDet->loadSettingsFile(sval, detPos);
|
myDet->loadSettingsFile(sval, detPos);
|
||||||
}
|
}
|
||||||
if (ret == OK)
|
|
||||||
return sval;
|
return sval;
|
||||||
else
|
|
||||||
return std::string("failed");
|
|
||||||
}
|
}
|
||||||
return std::string("Specify file name for geting settings file");
|
return std::string("Specify file name for geting settings file");
|
||||||
} else if (cmd == "trimval") {
|
} else if (cmd == "trimval") {
|
||||||
@ -3652,19 +3596,13 @@ std::string slsDetectorCommand::cmdSN(int narg, const char * const args[], int a
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cmd == "checkdetversion") {
|
if (cmd == "checkdetversion") {
|
||||||
int retval = myDet->checkDetectorVersionCompatibility(detPos);
|
myDet->checkDetectorVersionCompatibility(detPos);
|
||||||
if (retval < 0)
|
return std::string("compatible");
|
||||||
sprintf(answer, "%d", -1);
|
|
||||||
sprintf(answer, "%s", retval == OK ? "compatible" : "incompatible");
|
|
||||||
return std::string(answer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd == "rx_checkversion") {
|
if (cmd == "rx_checkversion") {
|
||||||
int retval = myDet->checkReceiverVersionCompatibility(detPos);
|
myDet->checkReceiverVersionCompatibility(detPos);
|
||||||
if (retval < 0)
|
return std::string("compatible");
|
||||||
sprintf(answer, "%d", -1);
|
|
||||||
sprintf(answer, "%s", retval == OK ? "compatible" : "incompatible");
|
|
||||||
return std::string(answer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::string("unknown id mode ") + cmd;
|
return std::string("unknown id mode ") + cmd;
|
||||||
@ -3779,7 +3717,8 @@ std::string slsDetectorCommand::cmdRegister(int narg, const char * const args[],
|
|||||||
;
|
;
|
||||||
else
|
else
|
||||||
return std::string("Could not scan value (hexadecimal fomat) ") + std::string(args[2]);
|
return std::string("Could not scan value (hexadecimal fomat) ") + std::string(args[2]);
|
||||||
sprintf(answer, "%s", (myDet->writeAdcRegister(addr, val, detPos) == OK) ? "successful" : "failed");
|
myDet->writeAdcRegister(addr, val, detPos);
|
||||||
|
sprintf(answer, "%s","successful");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (sscanf(args[2], "%d", &n))
|
if (sscanf(args[2], "%d", &n))
|
||||||
@ -4815,17 +4754,15 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
if (strstr(args[1], ".pof") == nullptr)
|
if (strstr(args[1], ".pof") == nullptr)
|
||||||
return std::string("wrong usage: programming file should have .pof extension");
|
return std::string("wrong usage: programming file should have .pof extension");
|
||||||
std::string sval = std::string(args[1]);
|
std::string sval = std::string(args[1]);
|
||||||
if (myDet->programFPGA(sval, detPos) == OK)
|
myDet->programFPGA(sval, detPos);
|
||||||
return std::string("successful");
|
return std::string("successful");
|
||||||
return std::string("failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (cmd == "resetfpga") {
|
else if (cmd == "resetfpga") {
|
||||||
if (action == GET_ACTION)
|
if (action == GET_ACTION)
|
||||||
return std::string("cannot get");
|
return std::string("cannot get");
|
||||||
if (myDet->resetFPGA(detPos) == OK)
|
myDet->resetFPGA(detPos);
|
||||||
return std::string("successful");
|
return std::string("successful");
|
||||||
return std::string("failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (cmd == "copydetectorserver") {
|
else if (cmd == "copydetectorserver") {
|
||||||
@ -4835,17 +4772,15 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
return ("wrong usage." + helpAdvanced(PUT_ACTION));
|
return ("wrong usage." + helpAdvanced(PUT_ACTION));
|
||||||
std::string sval = std::string(args[1]);
|
std::string sval = std::string(args[1]);
|
||||||
std::string pval = std::string(args[2]);
|
std::string pval = std::string(args[2]);
|
||||||
if (myDet->copyDetectorServer(sval, pval, detPos) == OK)
|
myDet->copyDetectorServer(sval, pval, detPos);
|
||||||
return std::string("successful");
|
return std::string("successful");
|
||||||
return std::string("failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (cmd == "rebootcontroller") {
|
else if (cmd == "rebootcontroller") {
|
||||||
if (action == GET_ACTION)
|
if (action == GET_ACTION)
|
||||||
return std::string("cannot get");
|
return std::string("cannot get");
|
||||||
if (myDet->rebootController(detPos) == OK)
|
myDet->rebootController(detPos);
|
||||||
return std::string("successful");
|
return std::string("successful");
|
||||||
return std::string("failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (cmd == "update") {
|
else if (cmd == "update") {
|
||||||
@ -4859,9 +4794,8 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
std::string sval = std::string(args[1]);
|
std::string sval = std::string(args[1]);
|
||||||
std::string pval = std::string(args[2]);
|
std::string pval = std::string(args[2]);
|
||||||
std::string fval = std::string(args[3]);
|
std::string fval = std::string(args[3]);
|
||||||
if (myDet->update(sval, pval, fval, detPos) == OK)
|
myDet->update(sval, pval, fval, detPos);
|
||||||
return std::string("successful");
|
return std::string("successful");
|
||||||
return std::string("failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (cmd == "powerchip") {
|
else if (cmd == "powerchip") {
|
||||||
@ -4899,10 +4833,8 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
if (!sscanf(args[2], "%d", &delay))
|
if (!sscanf(args[2], "%d", &delay))
|
||||||
return std::string("could not scan diodelay delay " + std::string(args[2]));
|
return std::string("could not scan diodelay delay " + std::string(args[2]));
|
||||||
|
|
||||||
int retval = myDet->setDigitalIODelay(pinMask, delay, detPos);
|
myDet->setDigitalIODelay(pinMask, delay, detPos);
|
||||||
if (retval == -1)
|
return std::string("successful");
|
||||||
return std::to_string(-1);
|
|
||||||
return std::string((retval == OK) ? "successful" : "failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (cmd == "auto_comp_disable") {
|
else if (cmd == "auto_comp_disable") {
|
||||||
@ -5048,11 +4980,8 @@ std::string slsDetectorCommand::cmdReceiver(int narg, const char * const args[],
|
|||||||
if (action == GET_ACTION)
|
if (action == GET_ACTION)
|
||||||
return std::string("cannot get");
|
return std::string("cannot get");
|
||||||
else {
|
else {
|
||||||
if (myDet->resetFramesCaught(detPos) == OK)
|
myDet->resetFramesCaught(detPos);
|
||||||
strcpy(answer, "successful");
|
return std::string("successful");
|
||||||
else
|
|
||||||
strcpy(answer, "failed");
|
|
||||||
return std::string(answer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5102,7 +5031,7 @@ std::string slsDetectorCommand::cmdReceiver(int narg, const char * const args[],
|
|||||||
else if (cmd == "rx_silent") {
|
else if (cmd == "rx_silent") {
|
||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
if (!sscanf(args[1], "%d", &ival))
|
if (!sscanf(args[1], "%d", &ival))
|
||||||
return std::string("Could not scan rx_online input ") + std::string(args[1]);
|
return std::string("Could not scan rx_silent input ") + std::string(args[1]);
|
||||||
if (ival >= 0)
|
if (ival >= 0)
|
||||||
sprintf(answer, "%d", myDet->setReceiverSilentMode(ival, detPos));
|
sprintf(answer, "%d", myDet->setReceiverSilentMode(ival, detPos));
|
||||||
} else
|
} else
|
||||||
@ -5729,7 +5658,6 @@ std::string slsDetectorCommand::helpPulse(int action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string slsDetectorCommand::cmdPulse(int narg, const char * const args[], int action, int detPos) {
|
std::string slsDetectorCommand::cmdPulse(int narg, const char * const args[], int action, int detPos) {
|
||||||
int retval = FAIL;
|
|
||||||
|
|
||||||
if (action == HELP_ACTION)
|
if (action == HELP_ACTION)
|
||||||
return helpPulse(action);
|
return helpPulse(action);
|
||||||
@ -5742,7 +5670,7 @@ std::string slsDetectorCommand::cmdPulse(int narg, const char * const args[], in
|
|||||||
return std::string("Could not scan 1st argument ") + std::string(args[1]);
|
return std::string("Could not scan 1st argument ") + std::string(args[1]);
|
||||||
|
|
||||||
if (std::string(args[0]) == std::string("pulsechip"))
|
if (std::string(args[0]) == std::string("pulsechip"))
|
||||||
retval = myDet->pulseChip(ival1, detPos);
|
myDet->pulseChip(ival1, detPos);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
//next commands requires 3 addnl. arguments
|
//next commands requires 3 addnl. arguments
|
||||||
@ -5755,19 +5683,16 @@ std::string slsDetectorCommand::cmdPulse(int narg, const char * const args[], in
|
|||||||
return std::string("Could not scan 3rd argument ") + std::string(args[3]);
|
return std::string("Could not scan 3rd argument ") + std::string(args[3]);
|
||||||
|
|
||||||
if (std::string(args[0]) == std::string("pulse"))
|
if (std::string(args[0]) == std::string("pulse"))
|
||||||
retval = myDet->pulsePixel(ival1, ival2, ival3, detPos);
|
myDet->pulsePixel(ival1, ival2, ival3, detPos);
|
||||||
|
|
||||||
else if (std::string(args[0]) == std::string("pulsenmove"))
|
else if (std::string(args[0]) == std::string("pulsenmove"))
|
||||||
retval = myDet->pulsePixelNMove(ival1, ival2, ival3, detPos);
|
myDet->pulsePixelNMove(ival1, ival2, ival3, detPos);
|
||||||
|
|
||||||
else
|
else
|
||||||
return std::string("could not decode command") + cmd;
|
std::string("could not decode command") + cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retval == OK)
|
|
||||||
return std::string(" successful");
|
return std::string(" successful");
|
||||||
else
|
|
||||||
return std::string(" failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,13 +30,6 @@ int slsDetectorUsers::getDetectorSize(int &x, int &y, int &nx, int &ny, int detP
|
|||||||
std::string slsDetectorUsers::getDetectorType(int detPos){
|
std::string slsDetectorUsers::getDetectorType(int detPos){
|
||||||
return detector.getDetectorTypeAsString(detPos);
|
return detector.getDetectorTypeAsString(detPos);
|
||||||
}
|
}
|
||||||
int slsDetectorUsers::setOnline(int const online, int detPos){
|
|
||||||
return detector.setOnline(online, detPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverOnline(int const online, int detPos){
|
|
||||||
return detector.setReceiverOnline(online, detPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
int slsDetectorUsers::readConfigurationFile(const std::string& fname){
|
int slsDetectorUsers::readConfigurationFile(const std::string& fname){
|
||||||
try{
|
try{
|
||||||
@ -79,36 +72,36 @@ int64_t slsDetectorUsers::getReceiverSoftwareVersion(int detPos){
|
|||||||
return detector.getId(slsDetectorDefs::RECEIVER_VERSION, detPos);
|
return detector.getId(slsDetectorDefs::RECEIVER_VERSION, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool slsDetectorUsers::isDetectorVersionCompatible(int detPos) {
|
void slsDetectorUsers::isDetectorVersionCompatible(int detPos) {
|
||||||
return (detector.checkDetectorVersionCompatibility(detPos) == slsDetectorDefs::OK);
|
detector.checkDetectorVersionCompatibility(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool slsDetectorUsers::isReceiverVersionCompatible(int detPos) {
|
void slsDetectorUsers::isReceiverVersionCompatible(int detPos) {
|
||||||
return (detector.checkReceiverVersionCompatibility(detPos) == slsDetectorDefs::OK);
|
detector.checkReceiverVersionCompatibility(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::startMeasurement(){
|
int slsDetectorUsers::startMeasurement(){
|
||||||
return detector.acquire();
|
return detector.acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::stopMeasurement(int detPos){
|
void slsDetectorUsers::stopMeasurement(int detPos){
|
||||||
return detector.stopAcquisition(detPos);
|
detector.stopAcquisition(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getDetectorStatus(int detPos){
|
int slsDetectorUsers::getDetectorStatus(int detPos){
|
||||||
return (int)detector.getRunStatus(detPos);
|
return (int)detector.getRunStatus(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::startAcquisition(int detPos) {
|
void slsDetectorUsers::startAcquisition(int detPos) {
|
||||||
return detector.startAcquisition(detPos);
|
detector.startAcquisition(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::stopAcquisition(int detPos) {
|
void slsDetectorUsers::stopAcquisition(int detPos) {
|
||||||
return detector.stopAcquisition(detPos);
|
detector.stopAcquisition(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::sendSoftwareTrigger(int detPos) {
|
void slsDetectorUsers::sendSoftwareTrigger(int detPos) {
|
||||||
return detector.sendSoftwareTrigger(detPos);
|
detector.sendSoftwareTrigger(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::enableCountRateCorrection(int i, int detPos){
|
int slsDetectorUsers::enableCountRateCorrection(int i, int detPos){
|
||||||
@ -237,8 +230,8 @@ int slsDetectorUsers::setFlowControl10G(int i, int detPos) {
|
|||||||
return detector.setFlowControl10G(i, detPos);
|
return detector.setFlowControl10G(i, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setROI(int n, slsDetectorDefs::ROI roiLimits[], int detPos) {
|
void slsDetectorUsers::setROI(int n, slsDetectorDefs::ROI roiLimits[], int detPos) {
|
||||||
return detector.setROI(n, roiLimits, detPos);
|
detector.setROI(n, roiLimits, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
const slsDetectorDefs::ROI* slsDetectorUsers::getROI(int &n, int detPos) {
|
const slsDetectorDefs::ROI* slsDetectorUsers::getROI(int &n, int detPos) {
|
||||||
@ -252,20 +245,20 @@ const slsDetectorDefs::ROI* slsDetectorUsers::getROI(int &n, int detPos) {
|
|||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
int slsDetectorUsers::startReceiver(int detPos) {
|
void slsDetectorUsers::startReceiver(int detPos) {
|
||||||
return detector.startReceiver(detPos);
|
detector.startReceiver(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::stopReceiver(int detPos) {
|
void slsDetectorUsers::stopReceiver(int detPos) {
|
||||||
return detector.stopReceiver(detPos);
|
detector.stopReceiver(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverSilentMode(int i, int detPos) {
|
int slsDetectorUsers::setReceiverSilentMode(int i, int detPos) {
|
||||||
return detector.setReceiverSilentMode(i, detPos);
|
return detector.setReceiverSilentMode(i, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::resetFramesCaughtInReceiver(int detPos) {
|
void slsDetectorUsers::resetFramesCaughtInReceiver(int detPos) {
|
||||||
return detector.resetFramesCaught(detPos);
|
detector.resetFramesCaught(detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setReceiverFifoDepth(int i, int detPos) {
|
int slsDetectorUsers::setReceiverFifoDepth(int i, int detPos) {
|
||||||
|
@ -243,9 +243,9 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
if(bind(sockfd.fd,(struct sockaddr *) &serverAddress,sizeof(serverAddress))<0){
|
if(bind(sockfd.fd,(struct sockaddr *) &serverAddress,sizeof(serverAddress))<0){
|
||||||
FILE_LOG(logERROR) << "Can not bind socket";
|
FILE_LOG(logERROR) << "Can not bind socket. Please check if another process is running.";
|
||||||
sockfd.fd =-1;
|
sockfd.fd =-1;
|
||||||
throw SocketError("Can not bind socket");
|
throw SocketError("Can not bind socket. Please check if another process is running.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -262,17 +262,6 @@ format
|
|||||||
*/
|
*/
|
||||||
enum { GET_ACTION, PUT_ACTION, READOUT_ACTION, HELP_ACTION };
|
enum { GET_ACTION, PUT_ACTION, READOUT_ACTION, HELP_ACTION };
|
||||||
|
|
||||||
/** online flags enum \sa setOnline*/
|
|
||||||
enum {
|
|
||||||
GET_ONLINE_FLAG = -1, /**< returns wether the detector is in online or
|
|
||||||
offline state */
|
|
||||||
OFFLINE_FLAG = 0, /**< detector in offline state (i.e. no communication
|
|
||||||
to the detector - using only local structure - no
|
|
||||||
data acquisition possible!) */
|
|
||||||
ONLINE_FLAG = 1 /**< detector in online state (i.e. communication to the
|
|
||||||
detector updating the local structure) */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
flags to get (or set) the size of the detector
|
flags to get (or set) the size of the detector
|
||||||
*/
|
*/
|
||||||
|
@ -29,7 +29,7 @@ ServerSocket::ServerSocket(int port)
|
|||||||
if (bind(getSocketId(), (struct sockaddr *)&serverAddr,
|
if (bind(getSocketId(), (struct sockaddr *)&serverAddr,
|
||||||
sizeof(serverAddr)) != 0) {
|
sizeof(serverAddr)) != 0) {
|
||||||
close();
|
close();
|
||||||
throw sls::SocketError("Server ERROR: cannot bind socket");
|
throw sls::SocketError("Server ERROR: cannot bind socket. Please check if another instance is running.");
|
||||||
}
|
}
|
||||||
if (listen(getSocketId(), DEFAULT_BACKLOG) != 0) {
|
if (listen(getSocketId(), DEFAULT_BACKLOG) != 0) {
|
||||||
close();
|
close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user