#include "RodInfo.h" #include #include #include #include #include #include using namespace SctPixelRod; RodInfo::RodInfo( PixLib::RodPixController *in_rm, QWidget* parent, const char* , bool , Qt::WFlags fl ) : ReadmeDisplay(parent, fl), m_rod(in_rm) { setCaption("ROD Status Information"); if(m_rod->rodMod()!=0) getStatus(); else textReadme->setText("no link to hardware found"); } RodInfo::~RodInfo(){ } void RodInfo::getStatus(){ RodStatus *rodStatus=0; try{ rodStatus = new RodStatus(*(m_rod->rodMod())); // } catch (RodException &r) { // std::cout << __FUNCTION__ // << "ROD exception thrown when creating the RodModule/RodStatus objects" // << std::endl // << r; // } catch (VmeException &v) { // std::cout << __FUNCTION__ // << ": VME exception thrown when creating the RodModule/RodStatus objects\n " // << v // << "RodModule not found on VME (wrong slot number or h/w error)!" // << std::endl; } catch (...) { QMessageBox::warning(this,"RodInfo::getStatus","Error creating RodStatus from RodModule."); return; } std::stringstream info_txt; try{ rodStatus->snapShot(*(m_rod->rodMod())); if (!rodStatus->isSane()) { QMessageBox::warning(this,"RodInfo::getStatus","Error reading from RodStatus."); } else { info_txt << *rodStatus; } } catch (...) { QMessageBox::warning(this,"RodInfo::getStatus","Error reading from RodStatus."); } delete rodStatus; try{ for(int fID=0; fID<8;fID++){ int fmtVal = m_rod->readRegister((0x48+fID), 0, 32); info_txt << "FMT " << fID <<" setting: 0x" << std::hex << fmtVal << std::endl; } } catch (...) { QMessageBox::warning(this,"RodInfo::getStatus","Error reading from FMT setting register."); } textReadme->setText(info_txt.str().c_str()); }