00001 /* 00002 This software is Copyright by the Board of Trustees of Michigan 00003 State University (c) Copyright 2005. 00004 00005 You may use this software under the terms of the GNU public license 00006 (GPL). The terms of this license are described at: 00007 00008 http://www.gnu.org/licenses/gpl.txt 00009 00010 Author: 00011 Ron Fox 00012 NSCL 00013 Michigan State University 00014 East Lansing, MI 48824-1321 00015 */ 00016 00017 static const char* Copyright = "(C) Copyright Michigan State University 2002, All rights reserved"; 00018 00019 #include <config.h> 00020 #include "CCAMACScalerLRS2551.h" 00021 00022 #ifdef HAVE_STD_NAMESPACE 00023 using namespace std; 00024 #endif 00025 00026 static const unsigned int nChannels = 12; 00027 00034 CCAMACScalerLRS2551::CCAMACScalerLRS2551 (unsigned int b, 00035 unsigned int c, 00036 unsigned int n) : 00037 CScaler(), 00038 m_Scaler(b,c,n) 00039 { 00040 00041 } 00046 CCAMACScalerLRS2551::CCAMACScalerLRS2551(const CCAMACScalerLRS2551& rhs) : 00047 CScaler(rhs), 00048 m_Scaler(m_Scaler) 00049 { 00050 } 00051 00052 00057 CCAMACScalerLRS2551& CCAMACScalerLRS2551::operator= (const CCAMACScalerLRS2551& aCCAMACScalerLRS2551) 00058 { 00059 if (this != &aCCAMACScalerLRS2551) { 00060 00061 CScaler::operator= (aCCAMACScalerLRS2551); 00062 m_Scaler = aCCAMACScalerLRS2551.m_Scaler; 00063 } 00064 return *this; 00065 } 00066 00070 int 00071 CCAMACScalerLRS2551::operator==(const CCAMACScalerLRS2551& rhs) const 00072 { 00073 return ((m_Scaler == rhs.m_Scaler) && 00074 CScaler::operator==(rhs)); 00075 } 00076 00077 // Functions for class CCAMACScalerLRS2551 00078 00083 void 00084 CCAMACScalerLRS2551::Initialize() 00085 { 00086 // No initialization required. 00087 } 00088 00099 void 00100 CCAMACScalerLRS2551::Read(vector<unsigned long>& Scalers) 00101 { 00102 for(unsigned int i = 0; i < nChannels; i++) { 00103 Scalers.push_back(m_Scaler.Read(0, i)); // Needs channel by channel reads. 00104 } 00105 } 00106 00111 void 00112 CCAMACScalerLRS2551::Clear() 00113 { 00114 m_Scaler.Control(9,0); // Clear channels and lam. 00115 } 00116 00123 unsigned int 00124 CCAMACScalerLRS2551::size() 00125 { 00126 return nChannels; 00127 00128 } 00129 00130