Bc.cxx

Go to the documentation of this file.
00001 // -*- mode: C++ -*- 
00002 //
00003 // Copyright (C) 2006 Christian Holm Christensen <cholm@nbi.dk>
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public License
00007 // as published by the Free Software Foundation; either version 2.1
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free
00017 // Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018 // 02111-1307 USA
00019 //
00025 #include "Bc.h"
00026 #include <rcuxx/Bc.h>
00027 #include <rcudb/Row.h>
00028 #include <rcudb/Sql.h>
00029 
00030 //____________________________________________________________________
00031 Rcuxx::AltroRegister*
00032 RcuConf::Bc::Name2Register(const std::string& name) 
00033 {
00034   Rcuxx::AltroRegister* reg = 0;
00035   if      (name == "L1CNT")     reg = 0; // Read-only fBc.L1CNT();
00036   else if (name == "L2CNT")     reg = 0; // Read-only fBc.L2CNT();
00037   else if (name == "SCLKCNT")   reg = 0; // Read-only fBc.SCLKCNT();
00038   else if (name == "DSTBCNT")   reg = 0; // Read-only fBc.DSTBCNT();
00039   else if (name == "TSMWORD")   reg = fBc.TSMWORD();
00040   else if (name == "USRATIO")   reg = fBc.USRATIO();
00041   else if (name == "CSR0")      reg = fBc.CSR0();
00042   else if (name == "CSR1")      reg = 0; // Read-only fBc.CSR1();
00043   else if (name == "CSR2")      reg = fBc.CSR2();
00044   else if (name == "CSR3")      reg = fBc.CSR3();
00045   else if (name == "Version")   reg = 0; // Read-only fBc.Version();
00046   else if (name == "TEMP")      reg = 0; // Read-only fBc.TEMP();
00047   else if (name == "AV")        reg = 0; // Read-only fBc.AV();
00048   else if (name == "AC")        reg = 0; // Read-only fBc.AC();
00049   else if (name == "DV")        reg = 0; // Read-only fBc.DV();
00050   else if (name == "DC")        reg = 0; // Read-only fBc.DC();
00051   else if (name == "TEMP_TH")   reg = fBc.TEMP_TH();
00052   else if (name == "AV_TH")     reg = fBc.AV_TH();
00053   else if (name == "AC_TH")     reg = fBc.AC_TH();
00054   else if (name == "DV_TH")     reg = fBc.DV_TH();
00055   else if (name == "DC_TH")     reg = fBc.DC_TH();
00056 
00057   return reg;
00058 }
00059 
00060 //____________________________________________________________________
00061 Rcuxx::AltroCommand*
00062 RcuConf::Bc::Name2Command(const std::string& name) 
00063 {
00064   Rcuxx::AltroCommand* cmd = 0;
00065   if      (name == "ACQRDO")    cmd = fBc.ACQRDO();
00066   else if (name == "ALRST")     cmd = fBc.ALRST();
00067   else if (name == "BCRST")     cmd = fBc.BCRST();
00068   else if (name == "CNTCLR")    cmd = fBc.CNTCLR();
00069   else if (name == "CNTLAT")    cmd = fBc.CNTLAT();
00070   else if (name == "CSR1CLR")   cmd = fBc.CSR1CLR();
00071   else if (name == "EVLRDO")    cmd = fBc.EVLRDO();
00072   else if (name == "SCEVL")     cmd = fBc.SCEVL();
00073   else if (name == "STCNV")     cmd = fBc.STCNV();
00074   else if (name == "STTSM")     cmd = fBc.STTSM();
00075   return cmd;
00076 }
00077 
00078 //____________________________________________________________________
00079 bool
00080 RcuConf::Bc::Create(RcuDb::Server& s) 
00081 {
00082   // Everything is in the RCU 
00083   Parameter::Where w = Parameter::kBc;
00084   // Create throws an exception in case of errors
00085   try {
00086     /* === Registers === */
00087     // Component::Create(s, "L1CNT",    w, false, 0xffffffff); // Read-only
00088     // Component::Create(s, "L2CNT",    w, false, 0xffffffff); // Read-only
00089     // Component::Create(s, "SCLKCNT",  w, false, 0xffffffff); // Read-only
00090     // Component::Create(s, "DSTBCNT",  w, false, 0xffffffff); // Read-only
00091     Component::Create(s, "TSMWORD",     w, false, 0xffffffff);
00092     Component::Create(s, "USRATIO",     w, false, 0xffffffff);
00093     Component::Create(s, "CSR0",        w, false, 0xffffffff);
00094     // Component::Create(s, "CSR1",     w, false, 0xffffffff); // Read-only
00095     Component::Create(s, "CSR2",        w, false, 0xffffffff);
00096     Component::Create(s, "CSR3",        w, false, 0xffffffff);
00097     // Component::Create(s, "Version",  w, false, 0xffffffff); // Read-only
00098     // Component::Create(s, "TEMP",     w, false, 0xffffffff); // Read-only
00099     // Component::Create(s, "AV",       w, false, 0xffffffff); // Read-only
00100     // Component::Create(s, "AC",       w, false, 0xffffffff); // Read-only
00101     // Component::Create(s, "DV",       w, false, 0xffffffff); // Read-only
00102     // Component::Create(s, "DC",       w, false, 0xffffffff); // Read-only
00103     Component::Create(s, "TEMP_TH",     w, false, 0xffffffff);
00104     Component::Create(s, "AV_TH",       w, false, 0xffffffff);
00105     Component::Create(s, "AC_TH",       w, false, 0xffffffff);
00106     Component::Create(s, "DV_TH",       w, false, 0xffffffff);
00107     Component::Create(s, "DC_TH",       w, false, 0xffffffff);
00108     /* === Commands === */
00109     Component::Create(s, "ACQRDO",      w, false, 0xffffffff);
00110     Component::Create(s, "ALRST",       w, false, 0xffffffff);
00111     Component::Create(s, "BCRST",       w, false, 0xffffffff);
00112     Component::Create(s, "CNTCLR",      w, false, 0xffffffff);
00113     Component::Create(s, "CNTLAT",      w, false, 0xffffffff);
00114     Component::Create(s, "CSR1CLR",     w, false, 0xffffffff);
00115     Component::Create(s, "EVLRDO",      w, false, 0xffffffff);
00116     Component::Create(s, "SCEVL",       w, false, 0xffffffff);
00117     Component::Create(s, "STCNV",       w, false, 0xffffffff);
00118     Component::Create(s, "STTSM",       w, false, 0xffffffff);
00119   }
00120   catch (bool& e) {
00121     return e;
00122   }
00123   return true;
00124 }
00125 
00126 
00127 //____________________________________________________________________
00128 //
00129 // EOF
00130 //
Top of page Last update Fri Apr 27 01:54:15 2007
Copyright © 2004 Christian Holm Created by DoxyGen 1.3.5