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