configserver.h

00001 #ifndef SCT_CONFIGSERVER_H
00002 #define SCT_CONFIGSERVER_H
00003 #include <ipc/object.h>
00004 #include <ipc/server.h>
00005 
00006 #include "sctConfIPC/configuration.hh"
00007 
00008 #include "sctConf/configRegistry.h"
00009 
00010 #include <is/inforeceiver.h>
00011 #include <is/info.h>
00012 #include <rc/RCStateInfo.h>
00013 #include <memory>
00014 
00015 class ConfigServer : public IPCNamedObject<POA_sctConf::Configuration, ipc::single_thread> {
00016   std::auto_ptr<SctConfiguration::Configuration> m_config;
00017   SctConfiguration::Configuration &config() {return *m_config;}
00018 
00019   std::auto_ptr<ISInfoReceiver> infoReceiver;     
00020   
00022   static sctConf::ConfigurationException wrapException(SctConfiguration::ConfigurationException& e);
00023  public:
00024 
00025   ConfigServer(const IPCPartition& p, const std::string& name, const std::string backend, const std::string fileName = "");
00026   virtual ~ConfigServer();      // destructor
00027   
00028  // methods
00029 
00030   virtual sctConf::PartitionList* listPartitions ();
00031   virtual sctConf::CrateList* listCratesInPartition (CORBA::ULong partition);
00032   virtual CORBA::Boolean isDummyCrate (CORBA::ULong partition, CORBA::ULong crate);
00033   virtual sctConf::RodList* listRodsInCrate (CORBA::ULong partition, CORBA::ULong crate);
00034   virtual sctConf::MURList* listMURSInRod (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod);
00035   virtual sctConf::ModuleList* listModulesInMUR (CORBA::ULong partition, CORBA::ULong MUR);
00036   virtual sctConf::ModuleList* listRModulesInMUR (CORBA::ULong partition, CORBA::ULong MUR);
00037   virtual sctConf::ModuleList* listAllModules ();
00038   virtual sctConf::ModuleList* listUnusedModules ();
00039   virtual sctConf::ABCDModule getModuleConfig (const char* mod);
00040   virtual CORBA::UShort getModuleGroup (const char* mod);
00041   virtual void setModuleGroup (const char* mod, CORBA::Short group);
00042   virtual CORBA::ULong getModuleErrorMask (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong channel, CORBA::UShort link);
00043   virtual void setModuleErrorMask (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong channel, CORBA::UShort link, CORBA::ULong mask);
00044   virtual void setDefaultModuleErrorMask (CORBA::ULong mask);
00045   virtual sctConf::RodConfig * getRodConfig (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod);
00046   virtual sctConf::SlaveConfig* getDefaultSlaveConfig (CORBA::Octet type);
00047   virtual sctConf::TimConfig getTimConfig (CORBA::ULong partition, CORBA::ULong crate);
00048   virtual sctConf::CharBlock* getFibreMappings (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod);
00049   virtual void setFibreMapping(CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong channel, CORBA::ULong tx, CORBA::ULong rx0, CORBA::ULong rx1);
00050   virtual sctConf::BOCChannelConfig getBOCConfig (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong channel);
00051   virtual sctConf::BOCGlobalConfig getBOCGlobalConfig (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod);
00052   virtual char* printModuleConfig(const sctConf::ABCDModule& conf);
00053   virtual sctConf::MURType getMURType (CORBA::ULong MUR);
00054   virtual CORBA::ULong getFreeMurId ();
00055   virtual void translateToROD(CORBA::ULong MUR, CORBA::ULong mod, CORBA::ULong& partition, CORBA::ULong& crate, CORBA::ULong& rod, CORBA::ULong& channel);
00056   virtual void translateToRROD(CORBA::ULong MUR, CORBA::ULong mod, CORBA::ULong& partition, CORBA::ULong& crate, CORBA::ULong& rod, CORBA::ULong& channel);
00057   virtual void translateToSN(CORBA::ULong MUR, CORBA::ULong mod, CORBA::String_out sn);
00058   virtual void translateToRMUR(CORBA::ULong RMUR, CORBA::ULong rmod, CORBA::ULong& MUR, CORBA::ULong& mod);
00059   virtual void translateToBarrel(CORBA::ULong MUR, CORBA::ULong mod, CORBA::ULong& barrel, CORBA::ULong& row, CORBA::Long& number);
00060   virtual void translateToEndcap(CORBA::ULong MUR, CORBA::ULong mod, CORBA::Long& disk, CORBA::ULong& ring, CORBA::ULong& number);
00061   virtual void translateToPowerSupply(CORBA::ULong MUR, CORBA::ULong mod, CORBA::ULong& partition, CORBA::ULong& crate, CORBA::ULong& channel);
00062   virtual void translateFromROD(CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong channel, CORBA::ULong& MUR, CORBA::ULong& mod);
00063   virtual void translateFromRROD(CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong channel, CORBA::ULong& MUR, CORBA::ULong& mod);
00064   virtual void translateFromSN (const char* sn, CORBA::ULong& MUR, CORBA::ULong& mod);
00065   virtual void translateFromRMUR(CORBA::ULong MUR, CORBA::ULong mod, CORBA::ULong& RMUR, CORBA::ULong& rmod);
00066   virtual void translateFromBarrel(CORBA::ULong barrel, CORBA::ULong row, CORBA::Long number, CORBA::ULong& MUR, CORBA::ULong& mod);
00067   virtual void translateFromEndcap(CORBA::Long disk, CORBA::ULong ring, CORBA::ULong number, CORBA::ULong& MUR, CORBA::ULong& mod);
00068   virtual void translateFromPowerSupply(CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong channel, CORBA::ULong& MUR, CORBA::ULong& mod);
00069   virtual void configureModuleFromStructure (const char* number, const sctConf::ABCDModule& mConf);
00070   virtual void configureModuleFromFile (const char* filename);
00071   virtual void configureROD (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, const sctConf::RodConfig& conf);
00072   virtual void configureTIM (CORBA::ULong partition, CORBA::ULong crate, const sctConf::TimConfig& conf);
00073   virtual void configureBOC (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, const sctConf::BOCGlobalConfig& conf);
00074   virtual void clearAll ();
00075   virtual void namePartition (CORBA::ULong partition, const char* name);
00076   virtual void mapRODMUR (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong order, CORBA::ULong number);
00077   virtual void unmapRODMUR (CORBA::ULong MUR);
00078   virtual void mapBarrelMUR (CORBA::ULong MUR, CORBA::ULong barrel, CORBA::ULong row, CORBA::Long position);
00079   virtual void unmapBarrelMUR (CORBA::ULong MUR);
00080   virtual void mapEndcapMUR (CORBA::ULong MUR, CORBA::Long disk, CORBA::ULong quadrant, CORBA::ULong position);
00081   virtual void unmapEndcapMUR (CORBA::ULong MUR);
00082   virtual void mapPowerChannel (CORBA::ULong MUR, CORBA::ULong number, CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong channel);
00083   virtual void unmapPowerChannel (CORBA::ULong MUR, CORBA::ULong number);
00084   virtual void mapModuleMUR (CORBA::ULong MUR, CORBA::ULong order, CORBA::ULong RMUR, CORBA::ULong rorder, const char* sn);
00085   virtual void unmapModuleMUR (CORBA::ULong MUR, CORBA::ULong order);
00086   virtual void getMapMURROD (CORBA::ULong MUR, CORBA::ULong& partition, CORBA::ULong& crate, CORBA::ULong& rod, CORBA::ULong& order);
00087   virtual void getMapRODMUR (CORBA::ULong partition, CORBA::ULong crate, CORBA::ULong rod, CORBA::ULong order, CORBA::ULong& MUR);
00088   virtual sctConf::MURType getMapMURPhysical (CORBA::ULong MUR, CORBA::ULong& plane, CORBA::ULong& section, CORBA::ULong& position);
00089   virtual void swapMURNames (CORBA::ULong MUR1, CORBA::ULong MUR2);
00090   virtual void modifyDefaultPowerParam(const char* state, const char* name, const char* type, CORBA::Float value);
00091   virtual void modifyHVCardParam(CORBA::ULong crate, CORBA::ULong card, const char* name, const char* type, CORBA::Float value);
00092   virtual void modifyLVCardParam(CORBA::ULong crate, CORBA::ULong card, const char* name, const char* type, CORBA::Float value);
00093   virtual void modifyPowerParam(CORBA::ULong MUR, CORBA::ULong number, const char* state, const char* name, const char* type, CORBA::Float value);
00094   virtual void modifyPowerParamCC(CORBA::ULong crate, CORBA::ULong channel, const char* state, const char* name, const char* type, CORBA::Float value);
00095   virtual CORBA::Float getDefaultPowerParam(const char* state, const char* name, const char* type);
00096   virtual CORBA::Float getHVCardParam(CORBA::ULong crate, CORBA::ULong card, const char* name, const char* type);
00097   virtual CORBA::Float getLVCardParam(CORBA::ULong crate, CORBA::ULong card, const char* name, const char* type);
00098   virtual CORBA::Float getPowerParam(CORBA::ULong MUR, CORBA::ULong number, const char* state, const char* name, const char* type);
00099   virtual CORBA::Float getPowerParamCC(CORBA::ULong crate, CORBA::ULong channel, const char* state, const char* name, const char* type);
00100   virtual sctConf::NameList* listDefaultPowerParams ();
00101   virtual sctConf::NameList* listDCSChannelParams ();
00102   virtual sctConf::NameList* listDCSCardParams ();
00103   virtual sctConf::NameList* listDCSCrateParams ();
00104   virtual void configureBOCChannel (CORBA::ULong MUR, CORBA::ULong position, const sctConf::BOCChannelConfig& conf);
00105   virtual void useMRSForMessages(bool);
00106   virtual void useISForChanges(bool);
00107   virtual char* getConfigurationFileName();
00108   virtual void loadConfiguration (const char* filename);
00109   virtual void saveConfiguration (const char* filename);
00110   virtual void saveModuleConfiguration (const char* sn, const char* filename);
00111   virtual char* getModuleConfigurationString (const char* modsn, const sctConf::ABCDModule& config);
00112   virtual void writePowerSupplyConfiguration (const char* directory);
00113   virtual void shutdown();
00114 };
00115 
00116 #endif

Generated on Mon Feb 6 14:01:18 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6