zmq separated for client and rx, ports and ip included in expert advanced mode

This commit is contained in:
Dhanya Maliakal 2017-11-17 17:37:00 +01:00
parent 28e2ebf75a
commit 70e4c6e2a2
4 changed files with 138 additions and 18 deletions

View File

@ -958,7 +958,7 @@ An extension given by the modules serial number will be attached.
<property name="geometry">
<rect>
<x>420</x>
<y>143</y>
<y>140</y>
<width>291</width>
<height>25</height>
</rect>
@ -1264,7 +1264,7 @@ An extension given by the modules serial number will be attached.
</sizepolicy>
</property>
<property name="text">
<string>ZMQ Port TX:</string>
<string>ZMQ Port:</string>
</property>
</widget>
</item>
@ -1312,6 +1312,42 @@ An extension given by the modules serial number will be attached.
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>ZMQ IP:</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLineEdit" name="dispZMQIP2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Sets the Receiver UDP IP
#rx_udpip#</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
@ -1625,7 +1661,7 @@ An extension given by the modules serial number will be attached.
</sizepolicy>
</property>
<property name="text">
<string>ZMQ Port RX:</string>
<string>Client ZMQ Port:</string>
</property>
</widget>
</item>
@ -1673,6 +1709,42 @@ An extension given by the modules serial number will be attached.
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="lblIP_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Client ZMQ IP:</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLineEdit" name="dispZMQIP">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Sets the detector IP to send packets to receiver
#detectorip#</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>

View File

@ -146,13 +146,13 @@ public:
void SetHistogram(bool enable,int histArg, int min=0, int max=0, double size=0){histogram = enable;histogramArgument = histArg; histFrom=min;histTo=max;histSize=size;};
/** Get X Minimum value from plot */
double GetXMinimum() { if(plot_in_scope==1) return plot1D->GetXMinimum(); else plot2D->GetPlot()->GetXMinimum();};
double GetXMinimum() { if(plot_in_scope==1) return plot1D->GetXMinimum(); else return plot2D->GetPlot()->GetXMinimum();};
/** Get X Maximum value from plot */
double GetXMaximum() { if(plot_in_scope==1) return plot1D->GetXMaximum(); else plot2D->GetPlot()->GetXMaximum();};
double GetXMaximum() { if(plot_in_scope==1) return plot1D->GetXMaximum(); else return plot2D->GetPlot()->GetXMaximum();};
/** Get Y Minimum value from plot */
double GetYMinimum() { if(plot_in_scope==1) return plot1D->GetYMinimum(); else plot2D->GetPlot()->GetYMinimum();};
double GetYMinimum() { if(plot_in_scope==1) return plot1D->GetYMinimum(); else return plot2D->GetPlot()->GetYMinimum();};
/** Get Y Maximum value from plot */
double GetYMaximum() { if(plot_in_scope==1) return plot1D->GetYMaximum(); else plot2D->GetPlot()->GetYMaximum();};
double GetYMaximum() { if(plot_in_scope==1) return plot1D->GetYMaximum(); else return plot2D->GetPlot()->GetYMaximum();};
public slots:
/** To select 1D or 2D plot

View File

@ -158,6 +158,14 @@ private slots:
*/
void SetNetworkParameters();
/** Sets client zmq ip to listen to
*/
void SetClientZMQIP();
/** Sets receiver zmq ip to stream from
*/
void SetReceiverZMQIP();
/** Sets the receiver. which also sets the receiver parameters
*/
void SetReceiver();

View File

@ -79,6 +79,8 @@ void qTabAdvanced::SetupWidgetWindow(){
isAngular = true;
spinZmqPort->setEnabled(false);
spinZmqPort2->setEnabled(false);
dispZMQIP->setEnabled(false);
dispZMQIP2->setEnabled(false);
break;
case slsDetectorDefs::EIGER:
isEnergy = true;
@ -165,7 +167,8 @@ void qTabAdvanced::SetupWidgetWindow(){
dispRxrHostname->setText(det->getReceiver().c_str());
dispUDPIP->setText(det->getReceiverUDPIP().c_str());
dispUDPMAC->setText(det->getReceiverUDPMAC().c_str());
dispZMQIP->setText(det->getClientStreamingIP().c_str());
dispZMQIP2->setText(det->getReceiverStreamingIP().c_str());
//check if its online and set it to red if offline
#ifdef VERYVERBOSE
@ -261,11 +264,7 @@ void qTabAdvanced::Initialization(){
connect(spinStopPort, SIGNAL(valueChanged(int)), this, SLOT(SetStopPort(int)));
connect(comboOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetOnline(int)));
if((detType==slsDetectorDefs::GOTTHARD) ||
(detType==slsDetectorDefs::MOENCH) ||
(detType==slsDetectorDefs::PROPIX) ||
(detType==slsDetectorDefs::JUNGFRAU) ||
(detType==slsDetectorDefs::EIGER)){
if(detType!=slsDetectorDefs::MYTHEN){
//network
connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
@ -279,6 +278,9 @@ void qTabAdvanced::Initialization(){
connect(dispUDPIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
connect(dispUDPMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetClientZMQIP()));
connect(dispZMQIP2, SIGNAL(editingFinished()), this, SLOT(SetReceiverZMQIP()));
connect(btnRxr, SIGNAL(clicked()), this, SLOT(SetReceiver()));
}
@ -840,6 +842,38 @@ void qTabAdvanced::SetNetworkParameters(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetClientZMQIP(){
#ifdef VERBOSE
cout << "Setting Client ZMQ IP" << endl;
#endif
disconnect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetClientZMQIP()));
dispZMQIP->setText(QString(det->setClientStreamingIP(dispZMQIP->text().toAscii().constData()).c_str()));
qDefs::checkErrorMessage(det,"qTabAdvanced::SetClientZMQIP");
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetClientZMQIP()));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetReceiverZMQIP(){
#ifdef VERBOSE
cout << "Setting Receiver ZMQ IP" << endl;
#endif
disconnect(dispZMQIP2, SIGNAL(editingFinished()), this, SLOT(SetReceiverZMQIP()));
dispZMQIP2->setText(QString(det->setReceiverStreamingIP(dispZMQIP2->text().toAscii().constData()).c_str()));
qDefs::checkErrorMessage(det,"qTabAdvanced::SetReceiverZMQIP");
connect(dispZMQIP2, SIGNAL(editingFinished()), this, SLOT(SetReceiverZMQIP()));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetReceiver(){
#ifdef VERBOSE
cout << "Setting Receiver" << endl;
@ -1107,6 +1141,8 @@ void qTabAdvanced::SetDetector(int index){
dispRxrHostname->setText(det->getReceiver().c_str());
dispUDPIP->setText(det->getReceiverUDPIP().c_str());
dispUDPMAC->setText(det->getReceiverUDPMAC().c_str());
dispZMQIP->setText(det->getClientStreamingIP().c_str());
dispZMQIP2->setText(det->getReceiverStreamingIP().c_str());
//check if its online and set it to red if offline
@ -1280,11 +1316,7 @@ void qTabAdvanced::Refresh(){
#ifdef VERBOSE
cout << "Getting Receiver Network Information" << endl;
#endif
if ((detType==slsDetectorDefs::GOTTHARD) ||
(detType==slsDetectorDefs::MOENCH)||
(detType==slsDetectorDefs::PROPIX)||
(detType==slsDetectorDefs::JUNGFRAU)||
(detType==slsDetectorDefs::EIGER)){
if (detType!=slsDetectorDefs::MYTHEN){
//disconnect
disconnect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
disconnect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
@ -1326,6 +1358,14 @@ void qTabAdvanced::Refresh(){
connect(dispUDPMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
connect(btnRxr, SIGNAL(clicked()), this, SLOT(SetReceiver()));
// zmq parameters
disconnect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetClientZMQIP()));
dispZMQIP->setText(det->getClientStreamingIP().c_str());
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetClientZMQIP()));
disconnect(dispZMQIP2, SIGNAL(editingFinished()), this, SLOT(SetReceiverZMQIP()));
dispZMQIP2->setText(det->getReceiverStreamingIP().c_str());
connect(dispZMQIP2, SIGNAL(editingFinished()), this, SLOT(SetReceiverZMQIP()));
}
//highlight in red if detector or receiver is offline