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