00001
00002
00003 #ifndef _SCT_Chip_0_SCTDAL_0__H_
00004 #define _SCT_Chip_0_SCTDAL_0__H_
00005
00006 #include <iostream>
00007 #include <string>
00008 #include <map>
00009 #include <vector>
00010
00011 #include <config/Configuration.h>
00012 #include <config/DalObject.h>
00013
00014
00015
00016 namespace SCTDAL {
00021 class SCT_Chip : public virtual ::DalObject {
00022
00023 friend class ::Configuration;
00024
00025 public:
00026
00027 SCT_Chip(::Configuration& conf, ::ConfigObject& obj);
00028 virtual ~SCT_Chip();
00029
00037 static SCT_Chip * create(::Configuration& conf, const std::string& id = "");
00038
00044 bool destroy(::Configuration& conf);
00045
00046
00047 public:
00048
00049 static const std::string s_class_name;
00050 virtual void init(bool init_children);
00051
00052
00053 private:
00054
00055 void check_init() const {if(!p_was_read) const_cast<SCT_Chip*>(this)->init(false);}
00056 static void update(::Configuration& conf, const ::ConfigurationChange * change);
00057 static void reset(::Configuration& conf, bool re_initialise_obj);
00058
00059
00060 public:
00061
00062 virtual void print(unsigned int, bool, std::ostream&) const;
00063
00064
00065 private:
00066
00067 unsigned short m_id;
00068 unsigned short m_address;
00069 bool m_active;
00070 unsigned short m_vthr;
00071 unsigned short m_vcal;
00072 unsigned short m_delay;
00073 unsigned short m_preamp;
00074 unsigned short m_shaper;
00075 std::string m_rc_function;
00076 unsigned short m_rc_function_type;
00077 std::vector<unsigned short> m_config;
00078 float m_c_factor;
00079 float m_target;
00080 std::vector<unsigned long> m_trims;
00081 std::vector<unsigned long> m_mask;
00082
00083
00084 public:
00085
00090 unsigned short get_id() const { check_init(); return m_id; }
00091 unsigned short id() const { check_init(); return m_id; }
00092
00097 bool set_id(unsigned short value) { clear(); return p_obj.set_by_val("id", value); }
00098
00103 unsigned short get_address() const { check_init(); return m_address; }
00104 unsigned short address() const { check_init(); return m_address; }
00105
00110 bool set_address(unsigned short value) { clear(); return p_obj.set_by_val("address", value); }
00111
00117 bool get_active() const { check_init(); return m_active; }
00118 bool active() const { check_init(); return m_active; }
00119
00125 bool set_active(bool value) { clear(); return p_obj.set_by_val("active", value); }
00126
00131 unsigned short get_vthr() const { check_init(); return m_vthr; }
00132 unsigned short vthr() const { check_init(); return m_vthr; }
00133
00138 bool set_vthr(unsigned short value) { clear(); return p_obj.set_by_val("vthr", value); }
00139
00144 unsigned short get_vcal() const { check_init(); return m_vcal; }
00145 unsigned short vcal() const { check_init(); return m_vcal; }
00146
00151 bool set_vcal(unsigned short value) { clear(); return p_obj.set_by_val("vcal", value); }
00152
00157 unsigned short get_delay() const { check_init(); return m_delay; }
00158 unsigned short delay() const { check_init(); return m_delay; }
00159
00164 bool set_delay(unsigned short value) { clear(); return p_obj.set_by_val("delay", value); }
00165
00170 unsigned short get_preamp() const { check_init(); return m_preamp; }
00171 unsigned short preamp() const { check_init(); return m_preamp; }
00172
00177 bool set_preamp(unsigned short value) { clear(); return p_obj.set_by_val("preamp", value); }
00178
00183 unsigned short get_shaper() const { check_init(); return m_shaper; }
00184 unsigned short shaper() const { check_init(); return m_shaper; }
00185
00190 bool set_shaper(unsigned short value) { clear(); return p_obj.set_by_val("shaper", value); }
00191
00196 const std::string& get_rc_function() const { check_init(); return m_rc_function; }
00197 const std::string& rc_function() const { check_init(); return m_rc_function; }
00198
00203 bool set_rc_function(const std::string& value) { clear(); return p_obj.set_by_ref("rc_function", value); }
00204
00209 unsigned short get_rc_function_type() const { check_init(); return m_rc_function_type; }
00210 unsigned short rc_function_type() const { check_init(); return m_rc_function_type; }
00211
00216 bool set_rc_function_type(unsigned short value) { clear(); return p_obj.set_by_val("rc_function_type", value); }
00217
00223 const std::vector<unsigned short>& get_config() const { check_init(); return m_config; }
00224 const std::vector<unsigned short>& config() const { check_init(); return m_config; }
00225
00231 bool set_config(const std::vector<unsigned short>& value) { clear(); return p_obj.set_by_val("config", value); }
00232
00237 float get_c_factor() const { check_init(); return m_c_factor; }
00238 float c_factor() const { check_init(); return m_c_factor; }
00239
00244 bool set_c_factor(float value) { clear(); return p_obj.set_by_val("c_factor", value); }
00245
00250 float get_target() const { check_init(); return m_target; }
00251 float target() const { check_init(); return m_target; }
00252
00257 bool set_target(float value) { clear(); return p_obj.set_by_val("target", value); }
00258
00263 const std::vector<unsigned long>& get_trims() const { check_init(); return m_trims; }
00264 const std::vector<unsigned long>& trims() const { check_init(); return m_trims; }
00265
00270 bool set_trims(const std::vector<unsigned long>& value) { clear(); return p_obj.set_by_val("trims", value); }
00271
00276 const std::vector<unsigned long>& get_mask() const { check_init(); return m_mask; }
00277 const std::vector<unsigned long>& mask() const { check_init(); return m_mask; }
00278
00283 bool set_mask(const std::vector<unsigned long>& value) { clear(); return p_obj.set_by_val("mask", value); }
00284
00285 };
00286
00287
00288
00289 std::ostream& operator<<(std::ostream&, const SCT_Chip*);
00290 std::ostream& operator<<(std::ostream&, const SCT_Chip&);
00291
00292 typedef std::vector<const SCT_Chip*>::const_iterator SCT_ChipIterator;
00293
00294 }
00295
00296 #endif