$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-core/TablePluginDataFormats/DataManagerTable.h" 00003 00004 #include "otsdaq-components/UserTableDataFormats/FEOtsUDPTemplateInterfaceTable.h" 00005 #include "otsdaq-core/Macros/TablePluginMacros.h" 00006 00007 using namespace ots; 00008 00009 //============================================================================== 00010 FEWROtsUDPTemplateInterfaceTable::FEWROtsUDPTemplateInterfaceTable(void) 00011 : FEInterfaceTableBase("FEWROtsUDPTemplateInterfaceTable") 00012 { 00014 // WARNING: the names and the order MUST match the ones in the enum // 00016 // FEWROtsUDPTemplateInterfaceTableInfo.xml 00017 //<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 00018 //<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 00019 // xsi:noNamespaceSchemaLocation="TableInfo.xsd"> 00020 // <TABLE InterfaceID="FEWRPurdueFSSRInterfaceTable"> 00021 // <VIEW InterfaceID="FEWR_PURDUE_FSSR_INTERFACE_TABLE" 00022 // Type="File,Database,DatabaseTest"> 00023 // <COLUMN NAME="InterfaceID" StorageName="INTERFACE_ID" 00024 // DataType="VARCHAR2" /> <COLUMN InterfaceID="Status" 00025 // StorageName="STATUS" DataType="VARCHAR2"/> <COLUMN 00026 // InterfaceID="FirmwareVersion" StorageName="FIRMWARE_VERSION" 00027 // DataType="NUMBER" /> <COLUMN InterfaceID="IPAddress" 00028 // StorageName="IP_ADDRESS" DataType="VARCHAR2"/> <COLUMN 00029 // InterfaceID="Port" StorageName="PORT" DataType="NUMBER" /> 00030 // <COLUMN InterfaceID="InterfaceIPAddress" StorageName="INTERFACE_IP_ADDRESS" 00031 // DataType="VARCHAR2"/> <COLUMN InterfaceID="InterfacePort" 00032 // StorageName="INTERFACE_PORT" DataType="NUMBER" /> <COLUMN 00033 // InterfaceID="StreamingIPAddress" StorageName="STREAMING_IP_ADDRESS" 00034 // DataType="VARCHAR2"/> <COLUMN InterfaceID="StreamingPort" 00035 // StorageName="STREAMING_PORT" DataType="NUMBER" /> <COLUMN 00036 // InterfaceID="NumberOfWords" StorageName="NUMBER_OF_WORDS" 00037 // DataType="NUMBER" /> <COLUMN InterfaceID="DataRate" 00038 // StorageName="DATA_RATE" DataType="NUMBER" /> 00039 // </VIEW> 00040 // </TABLE> 00041 //</ROOT> 00042 } 00043 00044 //============================================================================== 00045 FEWROtsUDPTemplateInterfaceTable::~FEWROtsUDPTemplateInterfaceTable(void) {} 00046 00047 //============================================================================== 00048 void FEWROtsUDPTemplateInterfaceTable::init(ConfigurationManager* configManager) 00049 { 00050 /* 00051 std::string enumValue1; 00052 unsigned int enumValue2; 00053 for(unsigned int row=0; row<TableBase::tableData_.getNumberOfRows(); 00054 row++) 00055 { 00056 TableBase::tableData_.getValue(enumValue1,row,Enum1); 00057 TableBase::tableData_.getValue(enumValue2,row,Enum2); 00058 } 00059 */ 00060 } 00061 00062 //============================================================================== 00063 bool FEWROtsUDPTemplateInterfaceTable::getStatus(std::string interfaceID) const 00064 { 00065 bool tmpStatus; 00066 TableBase::activeTableView_->getValue( 00067 tmpStatus, 00068 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00069 Status); 00070 return tmpStatus; 00071 } 00072 00073 //============================================================================== 00074 unsigned int FEWROtsUDPTemplateInterfaceTable::getFirmwareVersion( 00075 std::string interfaceID) const 00076 { 00077 unsigned int tmpFirmwareVersion; 00078 TableBase::activeTableView_->getValue( 00079 tmpFirmwareVersion, 00080 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00081 FirmwareVersion); 00082 return tmpFirmwareVersion; 00083 } 00084 00085 //============================================================================== 00086 std::string FEWROtsUDPTemplateInterfaceTable::getIPAddress(std::string interfaceID) const 00087 { 00088 std::string tmpIPAddress; 00089 TableBase::activeTableView_->getValue( 00090 tmpIPAddress, 00091 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00092 IPAddress); 00093 return tmpIPAddress; 00094 } 00095 00096 //============================================================================== 00097 unsigned int FEWROtsUDPTemplateInterfaceTable::getPort(std::string interfaceID) const 00098 { 00099 unsigned int tmpPort; 00100 TableBase::activeTableView_->getValue( 00101 tmpPort, TableBase::activeTableView_->findRow(InterfaceID, interfaceID), Port); 00102 return tmpPort; 00103 } 00104 00105 //============================================================================== 00106 std::string FEWROtsUDPTemplateInterfaceTable::getInterfaceIPAddress( 00107 std::string interfaceID) const 00108 { 00109 std::string tmpInterfaceIPAddress; 00110 TableBase::activeTableView_->getValue( 00111 tmpInterfaceIPAddress, 00112 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00113 InterfaceIPAddress); 00114 return tmpInterfaceIPAddress; 00115 } 00116 00117 //============================================================================== 00118 unsigned int FEWROtsUDPTemplateInterfaceTable::getInterfacePort( 00119 std::string interfaceID) const 00120 { 00121 unsigned int tmpInterfacePort; 00122 TableBase::activeTableView_->getValue( 00123 tmpInterfacePort, 00124 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00125 InterfacePort); 00126 return tmpInterfacePort; 00127 } 00128 00129 //============================================================================== 00130 std::string FEWROtsUDPTemplateInterfaceTable::getStreamingIPAddress( 00131 std::string interfaceID) const 00132 { 00133 std::string tmpStreamingIPAddress; 00134 TableBase::activeTableView_->getValue( 00135 tmpStreamingIPAddress, 00136 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00137 StreamingIPAddress); 00138 return tmpStreamingIPAddress; 00139 } 00140 00141 //============================================================================== 00142 unsigned int FEWROtsUDPTemplateInterfaceTable::getStreamingPort( 00143 std::string interfaceID) const 00144 { 00145 unsigned int tmpStreamingPort; 00146 TableBase::activeTableView_->getValue( 00147 tmpStreamingPort, 00148 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00149 StreamingPort); 00150 return tmpStreamingPort; 00151 } 00152 00153 //============================================================================== 00154 int FEWROtsUDPTemplateInterfaceTable::getNumberOfWords(std::string interfaceID) const 00155 { 00156 unsigned int tmpStreamingPort; 00157 TableBase::activeTableView_->getValue( 00158 tmpStreamingPort, 00159 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00160 NumberOfWords); 00161 return tmpStreamingPort; 00162 } 00163 00164 //============================================================================== 00165 unsigned int FEWROtsUDPTemplateInterfaceTable::getDataRate(std::string interfaceID) const 00166 { 00167 unsigned int tmpStreamingPort; 00168 TableBase::activeTableView_->getValue( 00169 tmpStreamingPort, 00170 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00171 DataRate); 00172 return tmpStreamingPort; 00173 } 00174 00175 DEFINE_OTS_TABLE(FEWROtsUDPTemplateInterfaceTable)