Altro.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 "Altro.h"
00026 #include <rcuxx/Altro.h>
00027 #include <rcudb/Row.h>
00028 #include <rcudb/Sql.h>
00029 
00030 //____________________________________________________________________
00031 Rcuxx::AltroRegister*
00032 RcuConf::Altro::Name2Register(const std::string& name) 
00033 {
00034   Rcuxx::AltroRegister* reg = 0;
00035   if      (name == "ADEVL")     reg = 0; // Read-only fAltro.ADEVL(); 
00036   else if (name == "BCTHR")     reg = fAltro.BCTHR();
00037   else if (name == "DPCF2")     reg = fAltro.DPCF2();
00038   else if (name == "DPCFG")     reg = fAltro.DPCFG();
00039   else if (name == "ERSTR")     reg = 0; // Read-only fAltro.ERSTR();
00040   else if (name == "K1")        reg = fAltro.K1();
00041   else if (name == "K2")        reg = fAltro.K2();
00042   else if (name == "K3")        reg = fAltro.K3();
00043   else if (name == "L1")        reg = fAltro.L1();
00044   else if (name == "L2")        reg = fAltro.L2();
00045   else if (name == "L3")        reg = fAltro.L3();
00046   else if (name == "PMADD")     reg = fAltro.PMADD();
00047   else if (name == "PMDTA")     reg = fAltro.PMDTA();
00048   else if (name == "TRCFG")     reg = fAltro.TRCFG();
00049   else if (name == "TRCNT")     reg = 0; // Read-only fAltro.TRCNT();
00050   else if (name == "VFPED")     reg = fAltro.VFPED();
00051   else if (name == "ZSTHR")     reg = fAltro.ZSTHR();
00052 
00053   return reg;
00054 }
00055 
00056 //____________________________________________________________________
00057 Rcuxx::AltroCommand*
00058 RcuConf::Altro::Name2Command(const std::string& name) 
00059 {
00060   Rcuxx::AltroCommand* cmd = 0;
00061   if      (name == "CHRDO")     cmd = fAltro.CHRDO();
00062   else if (name == "ERCLR")     cmd = fAltro.ERCLR();
00063   else if (name == "RPINC")     cmd = fAltro.RPINC();
00064   else if (name == "SWTRG")     cmd = fAltro.SWTRG();
00065   else if (name == "TRCLR")     cmd = fAltro.TRCLR();
00066   else if (name == "WPINC")     cmd = fAltro.WPINC();
00067   return cmd;
00068 }
00069 
00070 //____________________________________________________________________
00071 bool
00072 RcuConf::Altro::Create(RcuDb::Server& s) 
00073 {
00074   // Everything is in the RCU 
00075   Parameter::Where w = Parameter::kAltro;
00076   // Create throws an exception in case of errors
00077   try {
00078     /* === Registers === */
00079     // Component::Create(s, "ADEVL",    w, false, 0xffffffff); // Read-only
00080     Component::Create(s, "BCTHR",       w, false, 0xffffffff);
00081     Component::Create(s, "DPCF2",       w, false, 0xffffffff);
00082     Component::Create(s, "DPCFG",       w, false, 0xffffffff);
00083     // Component::Create(s, "ERSTR",    w, false, 0xffffffff); // Read-only
00084     Component::Create(s, "K1",          w, false, 0xffff);
00085     Component::Create(s, "K2",          w, false, 0xffff);
00086     Component::Create(s, "K3",          w, false, 0xffff);
00087     Component::Create(s, "L1",          w, false, 0xffff);
00088     Component::Create(s, "L2",          w, false, 0xffff);
00089     Component::Create(s, "L3",          w, false, 0xffff);
00090     Component::Create(s, "PMADD",       w, false, 0x3ff);
00091     Component::Create(s, "PMDTA",       w, false, 0x3ff);
00092     Component::Create(s, "TRCFG",       w, false, 0xffffffff);
00093     // Component::Create(s, "TRCNT",    w, false, 0xffffffff); // Read-only
00094     Component::Create(s, "VFPED",       w, false, 0x3ff);
00095     Component::Create(s, "ZSTHR",       w, false, 0xffffffff);
00096     /* === Commands === */
00097     Component::Create(s, "CHRDO",       w, false, 0xffffffff);
00098     Component::Create(s, "ERCLR",       w, false, 0xffffffff);
00099     Component::Create(s, "RPINC",       w, false, 0xffffffff);
00100     Component::Create(s, "SWTRG",       w, false, 0xffffffff);
00101     Component::Create(s, "TRCLR",       w, false, 0xffffffff);
00102     Component::Create(s, "WPINC",       w, false, 0xffffffff);
00103   }
00104   catch (bool& e) {
00105     return e;
00106   }
00107   return true;
00108 }
00109 
00110 
00111 //____________________________________________________________________
00112 //
00113 // EOF
00114 //
Top of page Last update Fri Apr 27 01:54:15 2007
Copyright © 2004 Christian Holm Created by DoxyGen 1.3.5