Commit 309a1908 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Add Camera NetworkParameter control, force FlowCtrl10G if using 10G

parent f6df477f
......@@ -54,6 +54,7 @@ public:
typedef Defs::ClockDiv ClockDiv;
typedef Defs::ReadoutFlags ReadoutFlags;
typedef Defs::DetStatus DetStatus;
typedef Defs::NetworkParameter NetworkParameter;
Camera(std::string config_fname);
virtual ~Camera();
......@@ -143,6 +144,9 @@ public:
void getReadoutFlags(ReadoutFlags& flags);
void getValidReadoutFlags(IntList& flag_list, NameList& flag_name_list);
void setNetworkParameter(NetworkParameter net_param, std::string& val);
void getNetworkParameter(NetworkParameter net_param, std::string& val);
void setTolerateLostPackets(bool tol_lost_packets);
void getTolerateLostPackets(bool& tol_lost_packets);
......
......@@ -169,6 +169,22 @@ enum DetStatus {
Stopped = slsDetectorDefs::STOPPED,
};
enum NetworkParameter {
DetectorMAC = slsDetectorDefs::DETECTOR_MAC,
DetectorIP = slsDetectorDefs::DETECTOR_IP,
RecvHostName = slsDetectorDefs::RECEIVER_HOSTNAME,
RecvUDPIP = slsDetectorDefs::RECEIVER_UDP_IP,
RecvUDPPort = slsDetectorDefs::RECEIVER_UDP_PORT,
RecvUDPMAC = slsDetectorDefs::RECEIVER_UDP_MAC,
RecvUDPPort2 = slsDetectorDefs::RECEIVER_UDP_PORT2,
DetTxDelayLeft = slsDetectorDefs::DETECTOR_TXN_DELAY_LEFT,
DetTxDelayRight = slsDetectorDefs::DETECTOR_TXN_DELAY_RIGHT,
DetTxDelayFrame = slsDetectorDefs::DETECTOR_TXN_DELAY_FRAME,
FlowCtrl10G = slsDetectorDefs::FLOW_CONTROL_10G,
FlowCtrlWrPtr = slsDetectorDefs::FLOW_CONTROL_WR_PTR,
FlowCtrlRdPtr = slsDetectorDefs::FLOW_CONTROL_RD_PTR,
};
std::ostream& operator <<(std::ostream& os, TrigMode trig_mode);
std::ostream& operator <<(std::ostream& os, Settings settings);
std::ostream& operator <<(std::ostream& os, DACIndex dac_idx);
......@@ -176,6 +192,7 @@ std::ostream& operator <<(std::ostream& os, ADCIndex adc_idx);
std::ostream& operator <<(std::ostream& os, ClockDiv clock_div);
std::ostream& operator <<(std::ostream& os, ReadoutFlags flags);
std::ostream& operator <<(std::ostream& os, DetStatus status);
std::ostream& operator <<(std::ostream& os, NetworkParameter net_param);
} // namespace Defs
......
......@@ -104,6 +104,11 @@ public:
void getValidReadoutFlags(std::vector<int>& flag_list /Out/,
std::vector<std::string>& flag_name_list /Out/);
void setNetworkParameter(SlsDetector::Defs::NetworkParameter net_param,
std::string& val /In,Out/);
void getNetworkParameter(SlsDetector::Defs::NetworkParameter net_param,
std::string& val /Out/);
void setTolerateLostPackets(bool tol_lost_packets);
void getTolerateLostPackets(bool& tol_lost_packets /Out/);
......
......@@ -265,6 +265,22 @@ enum DetStatus {
Stopped = STOPPED,
};
enum NetworkParameter {
DetectorMAC = DETECTOR_MAC,
DetectorIP = DETECTOR_IP,
RecvHostName = RECEIVER_HOSTNAME,
RecvUDPIP = RECEIVER_UDP_IP,
RecvUDPPort = RECEIVER_UDP_PORT,
RecvUDPMAC = RECEIVER_UDP_MAC,
RecvUDPPort2 = RECEIVER_UDP_PORT2,
DetTxDelayLeft = DETECTOR_TXN_DELAY_LEFT,
DetTxDelayRight = DETECTOR_TXN_DELAY_RIGHT,
DetTxDelayFrame = DETECTOR_TXN_DELAY_FRAME,
FlowCtrl10G = FLOW_CONTROL_10G,
FlowCtrlWrPtr = FLOW_CONTROL_WR_PTR,
FlowCtrlRdPtr = FLOW_CONTROL_RD_PTR,
};
}; // namespace Defs
......
......@@ -482,6 +482,12 @@ Camera::Camera(string config_fname)
setNbFrames(1);
setExpTime(0.99);
setFramePeriod(1.0);
if (m_det->enableTenGigabitEthernet()) {
DEB_TRACE() << "Forcing 10G Ethernet flow control";
string val = "1";
setNetworkParameter(Defs::FlowCtrl10G, val);
}
}
Camera::~Camera()
......@@ -1320,6 +1326,27 @@ void Camera::getValidReadoutFlags(IntList& flag_list, NameList& flag_name_list)
}
}
void Camera::setNetworkParameter(NetworkParameter net_param, string& val)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR2(net_param, val);
typedef slsDetectorDefs::networkParameter NetParam;
NetParam param = static_cast<NetParam>(net_param);
string res = m_det->setNetworkParameter(param, val);
val = res;
DEB_RETURN() << DEB_VAR1(val);
}
void Camera::getNetworkParameter(NetworkParameter net_param, string& val)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(net_param);
typedef slsDetectorDefs::networkParameter NetParam;
NetParam param = static_cast<NetParam>(net_param);
val = m_det->getNetworkParameter(param);
DEB_RETURN() << DEB_VAR1(val);
}
void Camera::setTolerateLostPackets(bool tol_lost_packets)
{
DEB_MEMBER_FUNCT();
......
......@@ -213,6 +213,28 @@ ostream& lima::SlsDetector::Defs::operator <<(ostream& os, DetStatus status)
return os << name;
}
ostream& lima::SlsDetector::Defs::operator <<(ostream& os,
NetworkParameter net_param)
{
const char *name = "Unknown";
switch (net_param) {
case DetectorMAC: name = "DetectorMAC"; break;
case DetectorIP: name = "DetectorIP"; break;
case RecvHostName: name = "RecvHostName"; break;
case RecvUDPIP: name = "RecvUDPIP"; break;
case RecvUDPPort: name = "RecvUDPPort"; break;
case RecvUDPMAC: name = "RecvUDPMAC"; break;
case RecvUDPPort2: name = "RecvUDPPort2"; break;
case DetTxDelayLeft: name = "DetTxDelayLeft"; break;
case DetTxDelayRight: name = "DetTxDelayRight"; break;
case DetTxDelayFrame: name = "DetTxDelayFrame"; break;
case FlowCtrl10G: name = "FlowCtrl10G"; break;
case FlowCtrlWrPtr: name = "FlowCtrlWrPtr"; break;
case FlowCtrlRdPtr: name = "FlowCtrlRdPtr"; break;
}
return os << name;
}
Glob::Glob(string pattern)
: m_pattern(pattern)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment