Commit 1ea1b840 authored by Luciano Orsini's avatar Luciano Orsini Committed by Dainius Simelevicius
Browse files

references #73: added hyperdaq tab to display endpoints

parent 8ff0aa10
......@@ -84,6 +84,7 @@ namespace pt
void ReceiverTabPage (xgi::Output * sout);
void SettingsTabPage (xgi::Output * sout);
void EventsTabPage (xgi::Output * sout);
void EndpointsTabPage (xgi::Output * sout);
xoap::MessageReference fireEvent (xoap::MessageReference msg) ;
......@@ -96,10 +97,10 @@ namespace pt
void notifyRCMS( std::string msg );
/**
* Callback invoked when the state machine of the application has changed.
*/
void stateChanged(toolbox::fsm::FiniteStateMachine & fsm) ;
/**
* Callback invoked when the state machine of the application has changed.
*/
void stateChanged(toolbox::fsm::FiniteStateMachine & fsm) ;
void FailAction(toolbox::Event::Reference e) ;
ibvla::EventWorkLoop * ewl_;
......
......@@ -517,6 +517,10 @@ void pt::ibv::Application::Default (xgi::Input * in, xgi::Output * out)
*out << "<div class=\"xdaq-tab\" title=\"Events\">" << std::endl;
this->EventsTabPage(out);
*out << "</div>";
*out << "<div class=\"xdaq-tab\" title=\"Events\">" << std::endl;
this->EndpointsTabPage(out);
*out << "</div>";
}
else
{
......@@ -841,3 +845,81 @@ void pt::ibv::Application::EventsTabPage (xgi::Output * sout)
*sout << "</td></tr></table>";
}
void pt::ibv::Application::EndpointsTabPage (xgi::Output * sout)
{
std::vector<const xdaq::Network*> networks = this->getApplicationContext()->getNetGroup()->getNetworks();
for (std::vector<const xdaq::Network*>::iterator n = networks.begin(); n != networks.end(); n++)
{
if ((*n)->getProtocol() == "ibv")
{
if ((*n)->isEndpointExisting(this->getApplicationDescriptor()->getContextDescriptor()))
{
pt::Address::Reference local = (*n)->getAddress(this->getApplicationDescriptor()->getContextDescriptor());
//std::stringstream ss;
//ss << "Found local network : " << (*n)->getName() << " - " << (*n)->getProtocol() << " - " << local->toString();
pt::ibv::Address & lAddr = dynamic_cast<pt::ibv::Address&>(*local);
*sout << cgicc::table().set("class", "xdaq-table-vertical") << std::endl;
*sout << cgicc::tbody() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">URL</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getURL() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">Network Name</th>";
*sout << "<td style=\"text-align:center;\">" << (*n)->getName() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">Protocol</th>";
*sout << "<td style=\"text-align:center;\">" << (*n)->getProtocol() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">Service</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getService() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">Host</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getHost() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">Port</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getPort() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">IBPort</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getIBPort() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">IBPath</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getIBPath() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">IsGlobal</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getIsGlobal() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tr();
*sout << "<th style=\"text-align:left;\">SGIDIndex</th>";
*sout << "<td style=\"text-align:center;\">" << lAddr.getSGIDIndex() << "</td>";
*sout << cgicc::tr() << std::endl;
*sout << cgicc::tbody();
*sout << cgicc::table();
}
}
}
}
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