Commit 30b10e7a authored by Fabio Ravera's avatar Fabio Ravera
Browse files

Formatted

parent 34d25d5f
......@@ -40,10 +40,7 @@ uint32_t BeBoard::getReg(const std::string& pReg) const
return i->second;
}
void BeBoard::setReg(const std::string& pReg, uint32_t psetValue)
{
fRegMap[pReg] = psetValue;
}
void BeBoard::setReg(const std::string& pReg, uint32_t psetValue) { fRegMap[pReg] = psetValue; }
void BeBoard::updateCondData(uint32_t& pTDCVal)
{
......
......@@ -58,9 +58,7 @@ class BeBoard : public BoardContainer
/*!
* \brief Destructor
*/
~BeBoard()
{
}
~BeBoard() {}
// Public Methods
......
......@@ -17,8 +17,8 @@
#include "../Utils/easylogging++.h"
#include "Cic.h"
#include "FrontEndDescription.h"
#include "MPA.h"
#include "Hybrid.h"
#include "MPA.h"
#include "SSA.h"
#include <stdint.h>
#include <vector>
......
......@@ -54,7 +54,7 @@ class ReadoutChip
~ReadoutChip();
uint8_t getId() const override { return ChipContainer::getId(); }
uint8_t getId() const override { return ChipContainer::getId(); }
/*!
* \brief acceptor method for HwDescriptionVisitor
......
......@@ -14,8 +14,8 @@ Support : mail to : lorenzo.bidegain@gmail.com, nico.pier
#include "../HWDescription/Chip.h"
#include "../HWDescription/ChipRegItem.h"
#include "../HWDescription/Definition.h"
#include "../HWDescription/MPA.h"
#include "../HWDescription/Hybrid.h"
#include "../HWDescription/MPA.h"
#include "../HWDescription/ReadoutChip.h"
#include "../HWDescription/SSA.h"
#include "../Utils/Exception.h"
......
......@@ -27,7 +27,7 @@ void BeBoardInterface::setBoard(uint16_t pBoardIdentifier)
LOG(INFO) << "The Board: " << +(pBoardIdentifier >> 8) << " doesn't exist";
else
{
fBoardFW = i->second;
fBoardFW = i->second;
fPrevBoardIdentifier = pBoardIdentifier;
}
}
......
......@@ -421,8 +421,7 @@ bool CbcInterface::WriteChipReg(Chip* pCbc, const std::string& dacName, uint16_t
std::reverse(cSelect.begin(), cSelect.end());
std::bitset<5> cClockDelay(cSelect);
uint8_t cNewRegValue = ((cOriginalValue & 0xE0) | static_cast<uint8_t>(cClockDelay.to_ulong()));
LOG(DEBUG) << BOLDBLUE << "Setting clock delay on Chip" << +pCbc->getId() << " to " << std::bitset<5>(+dacValue) << " - register set to : 0x" << std::hex << +cNewRegValue << std::dec
<< RESET;
LOG(DEBUG) << BOLDBLUE << "Setting clock delay on Chip" << +pCbc->getId() << " to " << std::bitset<5>(+dacValue) << " - register set to : 0x" << std::hex << +cNewRegValue << std::dec << RESET;
return WriteChipSingleReg(pCbc, "40MhzClk&Or254", cNewRegValue, pVerifLoop);
}
else if(dacName == "PtCut")
......
......@@ -42,7 +42,7 @@ void ChipInterface::setBoard(uint16_t pBoardIdentifier)
LOG(INFO) << "The Board: " << +(pBoardIdentifier >> 8) << " doesn't exist";
else
{
fBoardFW = i->second;
fBoardFW = i->second;
fPrevBoardIdentifier = pBoardIdentifier;
}
}
......
......@@ -31,8 +31,8 @@ using BeBoardFWMap = std::map<uint16_t, BeBoardFWInterface*>; /*!< Map of Board
class ChipInterface
{
protected:
BeBoardFWMap fBoardMap; /*!< Map of Board connected */
BeBoardFWInterface* fBoardFW; /*!< Board loaded */
BeBoardFWMap fBoardMap; /*!< Map of Board connected */
BeBoardFWInterface* fBoardFW; /*!< Board loaded */
uint16_t fPrevBoardIdentifier; /*!< Id of the previous board */
uint16_t fRegisterCount; /*!< Counter for the number of Registers written */
......
......@@ -726,7 +726,7 @@ void D19cFWInterface::ConfigureBoard(const BeBoard* pBoard)
cNBytes = 2;
std::vector<uint32_t> cOldI2CSlaveDescription = {cBaseAddress, cNBytes, 1, 1, 1, 1, cCic->getId()};
std::vector<uint32_t> cI2CSlaveDescription = {cBaseAddress, cNBytes, 1, 1, 1, 1};
fI2CSlaveMap[cCic->getId()] = cI2CSlaveDescription;
fI2CSlaveMap[cCic->getId()] = cI2CSlaveDescription;
fSlaveMap.push_back(cOldI2CSlaveDescription);
}
else
......
......@@ -20,7 +20,7 @@ void TCPPublishServer::acceptConnections()
std::cout << __PRETTY_FUNCTION__ << "Wating for clients to connect" << std::endl;
TCPTransmitterSocket* clientSocket = acceptClient<TCPTransmitterSocket>();
std::cout << __PRETTY_FUNCTION__ << "Client connected on socket: " << clientSocket->getSocketId() << std::endl;
}
}
catch(int e)
{
std::cout << __PRETTY_FUNCTION__ << "SHUTTING DOWN SOCKET" << std::endl;
......
......@@ -83,7 +83,7 @@ int TCPServerBase::accept(bool blocking)
while(true)
{
clientSocket = ::accept(getSocketId(), (struct sockaddr*)&clientAddress, &clientAddressSize);
broadcast("");//This message is to check if there are clients that disconnected and, if so, they are removed from the client list
broadcast(""); // This message is to check if there are clients that disconnected and, if so, they are removed from the client list
if(false && fAccept && fMaxNumberOfClients > 0 && fConnectedClients.size() >= fMaxNumberOfClients)
{
send(clientSocket, "Too many clients connected!", 27, 0);
......@@ -207,8 +207,7 @@ void TCPServerBase::broadcastPacket(const std::string& message)
catch(const std::exception& e)
{
// std::cout << __PRETTY_FUNCTION__ << "Connection closed with the server! Stop writing!" << std::endl;
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end())
fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end()) fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
delete it->second;
fConnectedClients.erase(it--);
}
......@@ -230,8 +229,7 @@ void TCPServerBase::broadcast(const char* message, std::size_t length)
// std::cout << __PRETTY_FUNCTION__ << "I don't think that this error is possible because I close the socket when I get disconnected...if you see this then you should contact Lorenzo
// Uplegger" << std::endl; std::cout << __PRETTY_FUNCTION__ << "This should only happen with the TCPSubscribeServer because it doesn't keep track of the connected clients..." << std::endl;
// std::cout << __PRETTY_FUNCTION__ << "Error: " << e.what() << std::endl;
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end())
fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end()) fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
delete it->second;
fConnectedClients.erase(it--);
}
......@@ -250,8 +248,7 @@ void TCPServerBase::broadcast(const std::string& message)
}
catch(const std::exception& e)
{
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end())
fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end()) fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
delete it->second;
fConnectedClients.erase(it--);
}
......@@ -270,8 +267,7 @@ void TCPServerBase::broadcast(const std::vector<char>& message)
}
catch(const std::exception& e)
{
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end())
fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end()) fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
delete it->second;
fConnectedClients.erase(it--);
}
......@@ -289,8 +285,7 @@ void TCPServerBase::broadcast(const std::vector<uint16_t>& message)
}
catch(const std::exception& e)
{
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end())
fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
if(fConnectedClientsFuture.find(it->first) != fConnectedClientsFuture.end()) fConnectedClientsFuture.erase(fConnectedClientsFuture.find(it->first));
delete it->second;
fConnectedClients.erase(it--);
}
......
......@@ -523,15 +523,14 @@ void FileParser::parseHybridContainer(pugi::xml_node pHybridNode, OpticalGroup*
<< " "
<< "|"
<< "----" << pHybridNode.name() << " --> " << BOLDBLUE << pHybridNode.first_attribute().name() << ": " << BOLDYELLOW << pHybridNode.attribute("Id").value() << BOLDBLUE
<< ", FMCId: " << BOLDYELLOW << pOpticalGroup->getFMCId() << BOLDBLUE << ", Status: " << BOLDYELLOW << expandEnvironmentVariables(pHybridNode.attribute("Status").value())
<< BOLDBLUE << ", LinkId: " << BOLDYELLOW << expandEnvironmentVariables(pHybridNode.attribute("LinkId").value()) << RESET << std::endl;
<< ", FMCId: " << BOLDYELLOW << pOpticalGroup->getFMCId() << BOLDBLUE << ", Status: " << BOLDYELLOW << expandEnvironmentVariables(pHybridNode.attribute("Status").value()) << BOLDBLUE
<< ", LinkId: " << BOLDYELLOW << expandEnvironmentVariables(pHybridNode.attribute("LinkId").value()) << RESET << std::endl;
Hybrid* cHybrid;
if(pBoard->getBoardType() == BoardType::RD53)
{
cHybrid =
pOpticalGroup->addHybridContainer(pHybridNode.attribute("Id").as_int(),
new Hybrid(pOpticalGroup->getId(), pOpticalGroup->getFMCId(), pHybridNode.attribute("Id").as_int(), pHybridNode.attribute("Id").as_int()));
cHybrid = pOpticalGroup->addHybridContainer(pHybridNode.attribute("Id").as_int(),
new Hybrid(pOpticalGroup->getId(), pOpticalGroup->getFMCId(), pHybridNode.attribute("Id").as_int(), pHybridNode.attribute("Id").as_int()));
}
else
{
......
......@@ -57,10 +57,7 @@ class ContainerRecycleBin
ContainerRecycleBin& operator=(const ContainerRecycleBin&) = delete;
ContainerRecycleBin& operator=(ContainerRecycleBin&&) = delete;
~ContainerRecycleBin()
{
clean();
}
~ContainerRecycleBin() { clean(); }
void clean()
{
......
......@@ -486,7 +486,6 @@ class DataStreamHybridContainer : public DataStreamBase
bufferWritingPosition += channelContainer->size() * sizeof(T);
std::cout << __PRETTY_FUNCTION__ << "vectorSize = " << +channelContainer->size() << std::endl;
channelContainer = nullptr;
}
}
}
......
......@@ -343,7 +343,7 @@ void D19cCic2Event::SetEvent(const BeBoard* pBoard, uint32_t pNbCbc, const std::
// LOG (INFO) << BOLDBLUE << std::bitset<32>(*(cIterator+cIndex)) << RESET;
size_t cOpticalGroupIndex = 0;
size_t cHybridIndex = 0;
size_t cHybridIndex = 0;
for(auto cOpticalGroup: *pBoard)
{
for(auto cHybrid: *cOpticalGroup)
......@@ -351,7 +351,7 @@ void D19cCic2Event::SetEvent(const BeBoard* pBoard, uint32_t pNbCbc, const std::
if(cHybrid->getId() == cFeId)
{
cOpticalGroupIndex = cOpticalGroup->getIndex();
cHybridIndex = cHybrid->getIndex();
cHybridIndex = cHybrid->getIndex();
}
}
}
......
......@@ -580,8 +580,7 @@ int main(int argc, char** argv)
mySysCntr.fReadoutChipInterface->WriteChipReg(static_cast<RD53*>(cChip), "SER_SEL_OUT", 2, true);
LOG(INFO) << GREEN << "PRBS test for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/" << cOpticalGroup->getId() << "/" << cHybrid->getId() << "/"
<< cChip->getId() << RESET << GREEN << "]: " << BOLDYELLOW
<< ((static_cast<RD53FWInterface*>(mySysCntr.fBeBoardFWMap[cBoard->getId()])->RunPRBStest(given_time, frames_or_time, cHybrid->getId(), cChip->getId()) ==
true)
<< ((static_cast<RD53FWInterface*>(mySysCntr.fBeBoardFWMap[cBoard->getId()])->RunPRBStest(given_time, frames_or_time, cHybrid->getId(), cChip->getId()) == true)
? "PASSED"
: "NOT PASSED")
<< RESET;
......
......@@ -4,8 +4,8 @@
#include "../HWDescription/Chip.h"
#include "../HWDescription/Definition.h"
#include "../HWDescription/FrontEndDescription.h"
#include "../HWDescription/MPA.h"
#include "../HWDescription/Hybrid.h"
#include "../HWDescription/MPA.h"
#include "../HWDescription/OuterTrackerHybrid.h"
#include "../HWDescription/ReadoutChip.h"
#include "../HWInterface/BeBoardInterface.h"
......
......@@ -444,7 +444,7 @@ void PSHybridTester::CheckHybridInputs(BeBoard* pBoard, std::vector<std::string>
for(auto cIndex: cIndices)
{
char cBuffer[20];
sprintf(cBuffer, "debug_blk_counter%02d", (cIndex & 0x63)); //max value can be 99, to avoid GCC 8 warning
sprintf(cBuffer, "debug_blk_counter%02d", (cIndex & 0x63)); // max value can be 99, to avoid GCC 8 warning
std::string cRegName = cBuffer;
uint32_t cCounter = fBeBoardInterface->ReadBoardReg(pBoard, cRegName);
pCounters.push_back(cCounter);
......@@ -501,7 +501,7 @@ void PSHybridTester::CheckHybridOutputs(BeBoard* pBoard, std::vector<std::string
for(auto cIndex: cIndices)
{
char cBuffer[20];
sprintf(cBuffer, "debug_blk_counter%02d", (cIndex & 0x63)); //max value can be 99, to avoid GCC 8 warning
sprintf(cBuffer, "debug_blk_counter%02d", (cIndex & 0x63)); // max value can be 99, to avoid GCC 8 warning
std::string cRegName = cBuffer;
uint32_t cCounter = fBeBoardInterface->ReadBoardReg(pBoard, cRegName);
pCounters.push_back(cCounter);
......
......@@ -18,10 +18,7 @@
PedeNoise::PedeNoise() : Tool() {}
PedeNoise::~PedeNoise()
{
clearDataMembers();
}
PedeNoise::~PedeNoise() { clearDataMembers(); }
void PedeNoise::cleanContainerMap()
{
......@@ -75,7 +72,6 @@ void PedeNoise::Initialise(bool pAllChan, bool pDisableStubLogic)
void PedeNoise::disableStubLogic()
{
fStubLogicValue = new DetectorDataContainer();
fHIPCountValue = new DetectorDataContainer();
ContainerFactory::copyAndInitChip<uint16_t>(*fDetectorContainer, *fStubLogicValue);
......@@ -393,7 +389,7 @@ void PedeNoise::measureSCurves(uint16_t pStartValue)
}
void PedeNoise::extractPedeNoise()
{
fThresholdAndNoiseContainer = new DetectorDataContainer();
fThresholdAndNoiseContainer = new DetectorDataContainer();
ContainerFactory::copyAndInitStructure<ThresholdAndNoise>(*fDetectorContainer, *fThresholdAndNoiseContainer);
uint16_t counter = 0;
std::map<uint16_t, DetectorDataContainer*>::reverse_iterator previousIterator = fSCurveOccupancyMap.rend();
......@@ -493,10 +489,7 @@ void PedeNoise::producePedeNoisePlots()
auto theThresholdAndNoiseStream = prepareChannelContainerStreamer<ThresholdAndNoise>();
for(auto board: *fThresholdAndNoiseContainer)
{
if(fStreamerEnabled)
{
theThresholdAndNoiseStream.streamAndSendBoard(board, fNetworkStreamer);
}
if(fStreamerEnabled) { theThresholdAndNoiseStream.streamAndSendBoard(board, fNetworkStreamer); }
}
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment