$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-components/UserTableDataFormats/FEPurdueNetworkMasterInterfaceTable.h" 00003 #include "otsdaq-core/Macros/TablePluginMacros.h" 00004 #include "otsdaq-core/TablePluginDataFormats/DataManagerTable.h" 00005 00006 using namespace ots; 00007 00008 //============================================================================== 00009 FEPurdueNetworkMasterInterfaceTable::FEPurdueNetworkMasterInterfaceTable(void) 00010 : FEInterfaceTableBase("FEPurdueNetworkMasterInterfaceTable") 00011 { 00013 // WARNING: the names and the order MUST match the ones in the enum // 00015 // FEPurdueNetworkMasterInterfaceTableInfo.xml 00016 //<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 00017 //<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 00018 // xsi:noNamespaceSchemaLocation="TableInfo.xsd"> 00019 // <TABLE Name="FEPurdueNetworkMasterInterfaceTable"> 00020 // <VIEW Name="FE_PURDUE_NETWORK_MASTER_INTERFACE_TABLE" 00021 // Type="File,Database,DatabaseTest"> 00022 // <COLUMN NAME="InterfaceID" StorageName="INTERFACE_ID" 00023 // DataType="VARCHAR2" /> <COLUMN Name="Status" StorageName="STATUS" 00024 // DataType="VARCHAR2"/> <COLUMN Name="FirmwareVersion" 00025 // StorageName="FIRMWARE_VERSION" DataType="NUMBER" /> <COLUMN 00026 // Name="IPAddress" StorageName="IP_ADDRESS" DataType="VARCHAR2"/> 00027 // <COLUMN Name="Port" StorageName="PORT" DataType="NUMBER" /> 00028 // <COLUMN Name="InterfaceIPAddress" StorageName="INTERFACE_IP_ADDRESS" 00029 // DataType="VARCHAR2"/> <COLUMN Name="InterfacePort" 00030 // StorageName="INTERFACE_PORT" DataType="NUMBER" /> 00031 // </VIEW> 00032 // </TABLE> 00033 //</ROOT> 00034 } 00035 00036 //============================================================================== 00037 FEPurdueNetworkMasterInterfaceTable::~FEPurdueNetworkMasterInterfaceTable(void) {} 00038 00039 //============================================================================== 00040 void FEPurdueNetworkMasterInterfaceTable::init(ConfigurationManager* configManager) 00041 { 00042 /* 00043 std::string enumValue1; 00044 unsigned int enumValue2; 00045 for(unsigned int row=0; row<TableBase::tableData_.getNumberOfRows(); 00046 row++) 00047 { 00048 TableBase::tableData_.getValue(enumValue1,row,Enum1); 00049 TableBase::tableData_.getValue(enumValue2,row,Enum2); 00050 } 00051 */ 00052 } 00053 00054 //============================================================================== 00055 bool FEPurdueNetworkMasterInterfaceTable::getStatus(std::string interfaceID) const 00056 { 00057 bool tmpStatus; 00058 TableBase::activeTableView_->getValue( 00059 tmpStatus, 00060 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00061 Status); 00062 return tmpStatus; 00063 } 00064 00065 //============================================================================== 00066 unsigned int FEPurdueNetworkMasterInterfaceTable::getFirmwareVersion( 00067 std::string interfaceID) const 00068 { 00069 unsigned int tmpFirmwareVersion; 00070 TableBase::activeTableView_->getValue( 00071 tmpFirmwareVersion, 00072 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00073 FirmwareVersion); 00074 return tmpFirmwareVersion; 00075 } 00076 00077 //============================================================================== 00078 std::string FEPurdueNetworkMasterInterfaceTable::getIPAddress( 00079 std::string interfaceID) const 00080 { 00081 std::string tmpIPAddress; 00082 TableBase::activeTableView_->getValue( 00083 tmpIPAddress, 00084 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00085 IPAddress); 00086 return tmpIPAddress; 00087 } 00088 00089 //============================================================================== 00090 unsigned int FEPurdueNetworkMasterInterfaceTable::getPort(std::string interfaceID) const 00091 { 00092 unsigned int tmpPort; 00093 TableBase::activeTableView_->getValue( 00094 tmpPort, TableBase::activeTableView_->findRow(InterfaceID, interfaceID), Port); 00095 return tmpPort; 00096 } 00097 00098 //============================================================================== 00099 std::string FEPurdueNetworkMasterInterfaceTable::getInterfaceIPAddress( 00100 std::string interfaceID) const 00101 { 00102 std::string tmpInterfaceIPAddress; 00103 TableBase::activeTableView_->getValue( 00104 tmpInterfaceIPAddress, 00105 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00106 InterfaceIPAddress); 00107 return tmpInterfaceIPAddress; 00108 } 00109 00110 //============================================================================== 00111 unsigned int FEPurdueNetworkMasterInterfaceTable::getInterfacePort( 00112 std::string interfaceID) const 00113 { 00114 unsigned int tmpInterfacePort; 00115 TableBase::activeTableView_->getValue( 00116 tmpInterfacePort, 00117 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00118 InterfacePort); 00119 return tmpInterfacePort; 00120 } 00121 00122 DEFINE_OTS_TABLE(FEPurdueNetworkMasterInterfaceTable)