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