/*************************************************************************** PrimListItem.h - description ------------------- begin : Wed 26 Jan 2006 copyright : (C) 2006 by jgrosse email : joern.grosse-knetter@uni-bonn.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef PRIMLISTITEM_H #define PRIMLISTITEM_H #include #include #include namespace PixLib{ class DBInquire; class Config; class PixScan; } using namespace PixLib; class ChipTest; class PrlToolSubcfg { public: PrlToolSubcfg(DBInquire *inq, Config &cfg_in); virtual ~PrlToolSubcfg(){}; Config& config(){return m_config;}; protected: virtual void setupGenConfig()=0; Config &m_config; }; class PrlToolSubVcal : public PrlToolSubcfg { public: PrlToolSubVcal(DBInquire *inq, Config &cfg_in); ~PrlToolSubVcal(); protected: void setupGenConfig(); float m_charge; bool m_chigh; }; class PrlToolSubFEGR : public PrlToolSubcfg { public: PrlToolSubFEGR(DBInquire *inq, Config &cfg_in); ~PrlToolSubFEGR(); protected: void setupGenConfig(); int m_cfgType, m_cfgVal; }; class PrlToolSubFEPR : public PrlToolSubcfg { public: PrlToolSubFEPR(DBInquire *inq, Config &cfg_in); ~PrlToolSubFEPR(); protected: void setupGenConfig(); int m_cfgType, m_cfgVal; }; class PrlToolSubPwr : public PrlToolSubcfg { public: PrlToolSubPwr(DBInquire *inq, Config &cfg_in); ~PrlToolSubPwr(); protected: void setupGenConfig(); std::string m_dcsName; bool m_on_or_off; }; class PrlToolSubSetDcs : public PrlToolSubcfg { public: PrlToolSubSetDcs(DBInquire *inq, Config &cfg_in); ~PrlToolSubSetDcs(); protected: void setupGenConfig(); std::string m_dcsName; int m_dcsSetType; float m_setVal; }; class PrlToolSubGetDcs : public PrlToolSubcfg { public: PrlToolSubGetDcs(DBInquire *inq, Config &cfg_in); ~PrlToolSubGetDcs(); protected: void setupGenConfig(); std::string m_dcsName; int m_dcsGetType; std::string m_storeName; float m_minCut; float m_maxCut; }; class PrlToolSubFitScan : public PrlToolSubcfg { public: PrlToolSubFitScan(DBInquire *inq, Config &cfg_in); ~PrlToolSubFitScan(); protected: void setupGenConfig(); std::string m_scanName; int m_funcType, m_histoType, m_storeType; std::vector m_fitParPreset; float m_fitRgMin, m_fitRgMax; float m_conversion, m_offset; }; class PrlToolSubWait : public PrlToolSubcfg { public: PrlToolSubWait(DBInquire *inq, Config &cfg_in); ~PrlToolSubWait(); protected: void setupGenConfig(); int m_waitTime; }; class PrlToolSubWaitForSignal : public PrlToolSubcfg { public: PrlToolSubWaitForSignal(DBInquire *inq, Config &cfg_in); ~PrlToolSubWaitForSignal(); protected: void setupGenConfig(); int m_waitChannel; int m_ctrlCombi; bool m_waitOnOne; }; class PrlToolSubConfigureMods : public PrlToolSubcfg { public: PrlToolSubConfigureMods(DBInquire *inq, Config &cfg_in); ~PrlToolSubConfigureMods(); protected: void setupGenConfig(); int m_configType; int m_DCtoWrite; int m_patternType; int m_latch; }; class PrlToolSubSaveCfg : public PrlToolSubcfg { public: PrlToolSubSaveCfg(DBInquire *inq, Config &cfg_in); ~PrlToolSubSaveCfg(); protected: void setupGenConfig(); std::string m_extString; }; class PrlToolSubSetFeMode : public PrlToolSubcfg { public: PrlToolSubSetFeMode(DBInquire *inq, Config &cfg_in); ~PrlToolSubSetFeMode(); protected: void setupGenConfig(); int m_mode; }; class PrlToolSubLoadCfg : public PrlToolSubcfg { public: PrlToolSubLoadCfg(DBInquire *inq, Config &cfg_in); ~PrlToolSubLoadCfg(); protected: void setupGenConfig(); std::string m_fname; }; class PrlToolSubLoadModCfg : public PrlToolSubcfg { public: PrlToolSubLoadModCfg(DBInquire *inq, Config &cfg_in); ~PrlToolSubLoadModCfg(); protected: void setupGenConfig(); bool m_setChipSN; int m_chipSN; }; class PrlToolSubResetMods : public PrlToolSubcfg { public: PrlToolSubResetMods(DBInquire *inq, Config &cfg_in); ~PrlToolSubResetMods(); protected: void setupGenConfig(); int m_resetType; }; class PrlToolSubSendDcsCmd : public PrlToolSubcfg { public: PrlToolSubSendDcsCmd(DBInquire *inq, Config &cfg_in); ~PrlToolSubSendDcsCmd(); protected: void setupGenConfig(); std::string m_dcsName; std::string m_command; bool m_readResp; }; class PrlToolSubAnaGraph : public PrlToolSubcfg { public: PrlToolSubAnaGraph(DBInquire *inq, Config &cfg_in); ~PrlToolSubAnaGraph(); protected: void setupGenConfig(); std::string m_scanName; int m_anaAction, m_storeType; std::vector m_anaArgs; }; class PrimListItem { friend class PrlToolSubcfg; public: enum PrimListTypes {DEF_SCAN, CUST_SCAN, TOOL, CHIP_TEST, MAX_PRL_TYPES}; enum PrimListTools { INIT_ROD, RESET_MODS, CFG_MODS, SET_VCAL, LINK_CHECK, DISABLE_FAILED, RELOAD_CFG, SET_FE_GR, SET_FE_PR, INIT_DCS, DCS_PWR, DCS_SET, DCS_GET, FIT_SCAN, GEN_WAIT, SIG_WAIT, GET_SRVREC, GET_TIME, SAVE_CFG, LOAD_MOD_CFG, SET_FE_MODE, LOAD_NEW_CFG, GEN_WAIT_MSEC, SEND_DCS_CMD, ANA_GRAPH, RD_EPROM, BURN_EPROM, MAX_PRL_TOOLS}; PrimListItem(PrimListTypes, int, const char*, PixScan *in_ps=0); PrimListItem(DBInquire*); PrimListItem(PrimListItem&, int); ~PrimListItem(); Config& config(){return *m_config;}; PrimListTypes getType(){return (PrimListTypes)m_type;}; int getIndex(){return m_index;}; void setIndex(int new_index){m_index = new_index;}; std::string getLabel(){return m_label;}; std::string getScanLabel(){return m_scanLabel;}; void setScanLabel(const char *newLabel){m_scanLabel = newLabel;}; bool getAbort(){return m_abortIfError;}; bool getSkipFlag(){return m_executeIfSkip;}; std::string getTypeLabel(PrimListTypes type); std::string getToolLabel(PrimListTools type); int getSubType(){return m_subType;}; PixScan* getPS(){return m_ps;}; ChipTest* getCT(){return m_ct;}; void setupSubcfg(DBInquire *inq); int getReadDcs(){return m_readDcs;}; protected: void setupGenConfig(bool doreset=true); void setupSpecConfig(PixScan *in_ps=0, bool doreset=true); // general members int m_type; int m_index; bool m_abortIfError; bool m_executeIfSkip; bool m_raiseSkipIfFailed; std::string m_label, m_scanLabel; int m_readDcs; Config *m_config; std::map m_typeDef; std::map m_prlTools; std::map m_scanTypes; std::map m_scanStdTypes; // type-specific members int m_subType; PixScan *m_ps; std::vector m_toolArgs; PrlToolSubcfg *m_subCfg; ChipTest *m_ct; }; #endif // PRIMLISTITEM_H