///////////////////////////////////////////////////////////////////// // TpllPixController.cxx ///////////////////////////////////////////////////////////////////// // // 12/06/03 Version 1.0 (PM) // Initial release // //! TPLL Driver #include "PixController/TpllPixController.h" #include "PixConfDBInterface/PixConfDBInterface.h" #include "Bits/Bits.h" #ifndef NOTDAQ #include "RCCVmeInterface.h" #endif #include "Config/Config.h" #include #ifndef WIN32 #include #endif using namespace PixLib; using namespace SctPixelRod; TpllPixController::TpllPixController(PixModuleGroup &modGrp, DBInquire *dbInquire) : PixController(modGrp, dbInquire) { //! Constructor configInit(); m_conf->read(dbInquire); } TpllPixController::TpllPixController(PixModuleGroup &modGrp) : PixController(modGrp) { //! Constructor configInit(); } TpllPixController::~TpllPixController() { //! Destructor } void TpllPixController::initHW() { //! Hardware (re)init #ifndef NOTDAQ if (getModGroup().getVmeInterface().ok()) { if (m_tpllSlot >= 0x10 && m_tpllSlot <= 0xf0) { // Create the VME port for this object m_port = new VmePort(m_tpllSlot<<24, 0x8000000, VmeInterface::A32, getModGroup().getVmeInterface()); m_map = (unsigned long *)m_port->getMap(); // Config PLL tpllConfig(); } else { throw TpllPixControllerExc(TpllPixControllerExc::BAD_SLOT_NUM, PixControllerExc::ERROR, getModGroup().getRodName(), m_tpllSlot); } } #endif } void TpllPixController::testHW() { //! Hardware test } void TpllPixController::configInit() { // Create the Config object m_conf = new Config("TpllPixController"); Config &conf = *m_conf; // Group general conf.addGroup("general"); conf["general"].addInt("Slot", m_tpllSlot, 1, "TPLL slot", true); // Select default values conf.reset(); } void TpllPixController::sendCommand(Bits commands, int moduleMask) { //! Send command no out } void TpllPixController::sendCommandOutSync(Bits commands, int moduleMask, std::vector& output) { //! Send command sync } void TpllPixController::sendCommandOutAsync(Bits commands, int moduleMask, int commandID) { //! Send command async } bool TpllPixController::checkOutReady(int commandID) { //! Wait for command termination return false; } void TpllPixController::getOutput(int commandID, std::vector& output) { //! Get command output } void TpllPixController::writeRunConfig(PixRunConfig &cfg) { //! Get the run configuration parameters from PixModuleGroup } void TpllPixController::getHisto(HistoType type, unsigned int xmod, unsigned int slv, std::vector< std::vector >& his) { //! Read an histogram } void TpllPixController::getFitResults(HistoType type, unsigned int mod, unsigned int slv, std::vector< Histo * > &thr, std::vector< Histo * > &noise, std::vector< Histo * > &chi2){ } void TpllPixController::startRun(int ntrig) { //! Start a run } void TpllPixController::stopRun() { //! Terminates a run } void TpllPixController::stopScan(){ //! Aborts a running scan } int TpllPixController::runStatus() { //! Check the status of the run return 0; } int TpllPixController::nTrigger() { //! Returns the number of trigger processed so far return 0; } bool TpllPixController::primitiveExists(std::string str) { //! Ask if a given primitive is implemented return false; } void TpllPixController::tpllConfig() { unsigned int face = *(unsigned short *)(m_map + PLL_FACE); if (face == 0xFFFF) { std::cout << "FACE test ok - slot " << m_tpllSlot << std::endl; } else { throw TpllPixControllerExc(TpllPixControllerExc::BAD_SLOT_NUM, PixControllerExc::FATAL, getModGroup().getRodName(), m_tpllSlot); } } void TpllPixController::shiftPixMask(int mask, int steps){ }