$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-components/UserTableDataFormats/FENIMPlusInterfaceTable.h" 00003 #include "otsdaq-core/Macros/TablePluginMacros.h" 00004 #include "otsdaq-core/TablePluginDataFormats/DataManagerTable.h" 00005 00006 using namespace ots; 00007 00008 //============================================================================== 00009 FENIMPlusInterfaceTable::FENIMPlusInterfaceTable(void) 00010 : FEInterfaceTableBase("FENIMPlusInterfaceTable") 00011 { 00013 // WARNING: the names and the order MUST match the ones in the enum // 00015 // FENIMPlusInterfaceTableInfo.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 InterfaceID="FEWRPurdueFSSRInterfaceTable"> 00020 // <VIEW InterfaceID="FEWR_PURDUE_FSSR_INTERFACE_TABLE" 00021 // Type="File,Database,DatabaseTest"> 00022 // <COLUMN NAME="InterfaceID" StorageName="INTERFACE_ID" 00023 // DataType="VARCHAR2" /> <COLUMN InterfaceID="Status" 00024 // StorageName="STATUS" DataType="VARCHAR2"/> <COLUMN 00025 // InterfaceID="FirmwareVersion" StorageName="FIRMWARE_VERSION" 00026 // DataType="NUMBER" /> <COLUMN InterfaceID="IPAddress" 00027 // StorageName="IP_ADDRESS" DataType="VARCHAR2"/> <COLUMN 00028 // InterfaceID="Port" StorageName="PORT" DataType="NUMBER" /> 00029 // <COLUMN InterfaceID="InterfaceIPAddress" StorageName="INTERFACE_IP_ADDRESS" 00030 // DataType="VARCHAR2"/> <COLUMN InterfaceID="InterfacePort" 00031 // StorageName="INTERFACE_PORT" DataType="NUMBER" /> <COLUMN 00032 // InterfaceID="StreamingIPAddress" StorageName="STREAMING_IP_ADDRESS" 00033 // DataType="VARCHAR2"/> <COLUMN InterfaceID="StreamingPort" 00034 // StorageName="STREAMING_PORT" DataType="NUMBER" /> <COLUMN 00035 // InterfaceID="ClockSelect" StorageName="CLOCK_SELECT" 00036 // DataType="VARCHAR2"/> <COLUMN InterfaceID="ClockSpeedMHz" 00037 // StorageName="CLOCK_SPEED_MHZ" DataType="NUMBER" /> <COLUMN 00038 // InterfaceID="ChannelStatus0" StorageName="CHANNEL0_STATUS" 00039 // DataType="VARCHAR2"/> <COLUMN InterfaceID="ChannelStatus1" 00040 // StorageName="CHANNEL1_STATUS" DataType="VARCHAR2"/> <COLUMN 00041 // InterfaceID="ChannelStatus2" StorageName="CHANNEL2_STATUS" 00042 // DataType="VARCHAR2"/> <COLUMN InterfaceID="ChannelStatus3" 00043 // StorageName="CHANNEL3_STATUS" DataType="VARCHAR2"/> <COLUMN 00044 // InterfaceID="ChannelStatus4" StorageName="CHANNEL4_STATUS" 00045 // DataType="VARCHAR2"/> <COLUMN InterfaceID="ChannelStatus5" 00046 // StorageName="CHANNEL5_STATUS" DataType="VARCHAR2"/> 00047 // </VIEW> 00048 // </TABLE> 00049 //</ROOT> 00050 } 00051 00052 //============================================================================== 00053 FENIMPlusInterfaceTable::~FENIMPlusInterfaceTable(void) {} 00054 00055 //============================================================================== 00056 void FENIMPlusInterfaceTable::init(ConfigurationManager* configManager) 00057 { 00058 /* 00059 std::string enumValue1; 00060 unsigned int enumValue2; 00061 for(unsigned int row=0; row<TableBase::tableData_.getNumberOfRows(); 00062 row++) 00063 { 00064 TableBase::tableData_.getValue(enumValue1,row,Enum1); 00065 TableBase::tableData_.getValue(enumValue2,row,Enum2); 00066 } 00067 */ 00068 } 00069 00070 //============================================================================== 00071 bool FENIMPlusInterfaceTable::getStatus(std::string interfaceID) const 00072 { 00073 bool tmpStatus; 00074 TableBase::activeTableView_->getValue( 00075 tmpStatus, 00076 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00077 Status); 00078 return tmpStatus; 00079 } 00080 00081 //============================================================================== 00082 unsigned int FENIMPlusInterfaceTable::getFirmwareVersion(std::string interfaceID) const 00083 { 00084 unsigned int tmpFirmwareVersion; 00085 TableBase::activeTableView_->getValue( 00086 tmpFirmwareVersion, 00087 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00088 FirmwareVersion); 00089 return tmpFirmwareVersion; 00090 } 00091 00092 //============================================================================== 00093 std::string FENIMPlusInterfaceTable::getIPAddress(std::string interfaceID) const 00094 { 00095 std::string tmpIPAddress; 00096 TableBase::activeTableView_->getValue( 00097 tmpIPAddress, 00098 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00099 IPAddress); 00100 return tmpIPAddress; 00101 } 00102 00103 //============================================================================== 00104 unsigned int FENIMPlusInterfaceTable::getPort(std::string interfaceID) const 00105 { 00106 unsigned int tmpPort; 00107 TableBase::activeTableView_->getValue( 00108 tmpPort, TableBase::activeTableView_->findRow(InterfaceID, interfaceID), Port); 00109 return tmpPort; 00110 } 00111 00112 //============================================================================== 00113 std::string FENIMPlusInterfaceTable::getInterfaceIPAddress(std::string interfaceID) const 00114 { 00115 std::string tmpInterfaceIPAddress; 00116 TableBase::activeTableView_->getValue( 00117 tmpInterfaceIPAddress, 00118 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00119 InterfaceIPAddress); 00120 return tmpInterfaceIPAddress; 00121 } 00122 00123 //============================================================================== 00124 unsigned int FENIMPlusInterfaceTable::getInterfacePort(std::string interfaceID) const 00125 { 00126 unsigned int tmpInterfacePort; 00127 TableBase::activeTableView_->getValue( 00128 tmpInterfacePort, 00129 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00130 InterfacePort); 00131 return tmpInterfacePort; 00132 } 00133 00134 //============================================================================== 00135 std::string FENIMPlusInterfaceTable::getStreamingIPAddress(std::string interfaceID) const 00136 { 00137 std::string tmpStreamingIPAddress; 00138 TableBase::activeTableView_->getValue( 00139 tmpStreamingIPAddress, 00140 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00141 StreamingIPAddress); 00142 return tmpStreamingIPAddress; 00143 } 00144 00145 //============================================================================== 00146 unsigned int FENIMPlusInterfaceTable::getStreamingPort(std::string interfaceID) const 00147 { 00148 unsigned int tmpStreamingPort; 00149 TableBase::activeTableView_->getValue( 00150 tmpStreamingPort, 00151 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00152 StreamingPort); 00153 return tmpStreamingPort; 00154 } 00155 00156 //============================================================================== 00157 std::string FENIMPlusInterfaceTable::getClockSelect(std::string interfaceID) const 00158 { 00159 std::string tmpClockSelect; 00160 TableBase::activeTableView_->getValue( 00161 tmpClockSelect, 00162 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00163 ClockSelect); 00164 return tmpClockSelect; 00165 } 00166 00167 //============================================================================== 00168 double FENIMPlusInterfaceTable::getClockSpeedMHz(std::string interfaceID) const 00169 { 00170 double tmpClockSpeedMHz; 00171 TableBase::activeTableView_->getValue( 00172 tmpClockSpeedMHz, 00173 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00174 ClockSpeedMHz); 00175 return tmpClockSpeedMHz; 00176 } 00177 00178 //============================================================================== 00179 bool FENIMPlusInterfaceTable::getChannelStatus(std::string interfaceID, 00180 unsigned int channel) const 00181 { 00182 bool tmpStatus; 00183 switch(channel) 00184 { 00185 case 0: 00186 TableBase::activeTableView_->getValue( 00187 tmpStatus, 00188 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00189 ChannelStatus0); 00190 break; 00191 case 1: 00192 TableBase::activeTableView_->getValue( 00193 tmpStatus, 00194 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00195 ChannelStatus1); 00196 break; 00197 case 2: 00198 TableBase::activeTableView_->getValue( 00199 tmpStatus, 00200 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00201 ChannelStatus2); 00202 break; 00203 case 3: 00204 TableBase::activeTableView_->getValue( 00205 tmpStatus, 00206 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00207 ChannelStatus3); 00208 break; 00209 case 4: 00210 TableBase::activeTableView_->getValue( 00211 tmpStatus, 00212 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00213 ChannelStatus4); 00214 break; 00215 case 5: 00216 TableBase::activeTableView_->getValue( 00217 tmpStatus, 00218 TableBase::activeTableView_->findRow(InterfaceID, interfaceID), 00219 ChannelStatus5); 00220 break; 00221 default: // There are only 6 channels on OtsUDPHardware board 00222 __SS____ << "Table Error:\t" 00223 << "OtsUDPHardware FER Channel " << std::dec << channel 00224 << " does not exist" << std::endl; 00225 __COUT_ERR__ << "\n" << ss.str(); 00226 __SS_THROW__; 00227 } 00228 return tmpStatus; 00229 } 00230 00231 DEFINE_OTS_TABLE(FENIMPlusInterfaceTable)