ICP  1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CRPTProxy Class Reference

#include <CRPTProxy.h>

Inheritance diagram for CRPTProxy:
Inheritance graph

Classes

struct  parameter_t
 

Public Types

typedef std::map< std::string,
parameter_t
parameter_map_t
 

Public Member Functions

ISISCRPT_DATAcrptData ()
 
Poco::Mutex & getLockRef ()
 
Poco::Mutex & getDataLockRef ()
 
const std::string & statusLog () const
 
const std::string & eventLog () const
 
const std::string & debugLog () const
 
const std::string & monitoringLog () const
 
const std::string & timeDiffLog () const
 
parameter_map_tsampleParameters ()
 
parameter_map_tbeamlineParameters ()
 
int assignLogFiles (const std::string &prefix)
 
int assignLogFiles (bool use_full_inst_name_for_files, const std::string &data_dir, int run_number_digits)
 
void rawDataUpdated ()
 
time_t rawDataUpdateTime () const
 
isisU32_t rawDataSizeMax () const
 
isisU32_t rawDataSizeUsed () const
 
std::string dataFileName () const
 
std::string dataSectionName () const
 
isisU32_trawData ()
 
const isisU32_trawData () const
 
isisU32_tspectrumIntegrals ()
 
const isisU32_tspectrumIntegrals () const
 
isisU32_t dataFileSize () const
 
void setICPStartTime (time_t t)
 
void zeroAllRawData (DAEstatus &status)
 
void zeroUsedRawData (DAEstatus &status)
 
void zeroEventRawData (DAEstatus &status)
 
ISISCRPT_STRUCTCRPT ()
 
const ISISCRPT_STRUCTCRPT () const
 
 CRPTProxy ()
 
bool isValid () const
 
ISISCRPT_STRUCToperator-> ()
 
const ISISCRPT_STRUCToperator-> () const
 
int flushCRPT (DAEstatus &status, bool flush_raw_data=false)
 
int mapCRPT (const std::string &crpt_name, const std::string &crpt_data_name, bool read_only, bool existing)
 
int loadOrCreateCRPT (const std::string &crpt_file, const std::string &crpt_name, const std::string &crpt_data_file, const std::string &crpt_data_name, int crpt_data_size, ISISDAE::DAEType dae_type, const std::string &comp_name, boost::function< int(DAEstatus &)> readRecoveryFile, DAEstatus &status)
 
int loadOrCreateCRPT (const char *crpt_file, const char *crpt_name, const char *crpt_data_file, const char *crpt_data_name, int crpt_data_size, ISISDAE::DAEType dae_type, const char *comp_name, boost::function< int(DAEstatus &)> readRecoveryFile, DAEstatus &status)
 
int loadCRPT (const char *crpt_file, const char *crpt_name, const char *crpt_data_file, const char *crpt_data_name, int crpt_data_size, bool read_only, DAEstatus &status)
 
int loadCRPT (const char *crpt_file, HANDLE crpt_fh, const char *crpt_name, const char *crpt_data_file, HANDLE crpt_data_fh, const char *crpt_data_name, int crpt_data_size, bool read_only, DAEstatus &status)
 
int unloadCRPT (bool delete_crpt_file, bool delete_crpt_data_file, DAEstatus &status)
 
int unloadCRPT (DAEstatus &status)
 
 ~CRPTProxy ()
 
int createFrom (CRPTProxy &proxy_clone, int id, bool blank_raw_data, DAEstatus &status)
 
int updateFrom (CRPTProxy &proxy_clone, bool copy_raw_data, DAEstatus &status)
 
int getIntArrayItem (const char *item_name, const long *spec_array, int nspec, long *larray, DAEstatus &status) const
 
int getIntArrayItem (const char *item_name, long *larray, DAEstatus &status) const
 
int getRealArrayItem (const char *item_name, const long *spec_array, int nspec, double *darray, DAEstatus &status) const
 
int getRealArrayItem (const char *item_name, const long *spec_array, int nspec, float *farray, DAEstatus &status) const
 
int getRealArrayItem (const char *item_name, double *darray, DAEstatus &status) const
 
int getRealArrayItem (const char *item_name, float *farray, DAEstatus &status) const
 
bool isRawDataCacheValid () const
 
uint32_t spectrumCRPTOffset (int spec, int daq_period) const
 

Static Public Member Functions

static void histogramEventsToCRPT (const ISISCRPT_STRUCT *crpt1, const ISISCRPT_STRUCT *crpt2, ISISCRPT_DATA *crpt_data1, ISISCRPT_DATA *crpt_data2, const DAEEventHeader *head, const DetectorEvent32 *ev, int n, int event_source_id)
 
static void histogramEventsToCRPT (CRPTProxy &crpt, const DAEEventHeader *head, const DetectorEvent32 *ev, int n, int event_source_id)
 
static void histogramEventsToCRPT (CRPTProxy &crpt1, CRPTProxy &crpt2, const DAEEventHeader *head, const DetectorEvent32 *ev, int n, int event_source_id)
 

Private Member Functions

 CRPTProxy (const CRPTProxy &)
 
void invalidateHandles ()
 
int flushSection (void *address, HANDLE file_handle, DAEstatus &status)
 

Private Attributes

Poco::Mutex m_crpt_lock
 
Poco::Mutex m_data_lock
 
ISISCRPT_STRUCTm_crpt
 
ISISCRPT_DATA m_crpt_data
 
HANDLE m_crpt_fh
 
HANDLE m_crpt_fm
 
ISISDAE::DAEType m_dae_type
 
std::string m_comp_name
 
std::string m_crpt_file
 
std::string m_crpt_name
 name of memory section More...
 
time_t m_raw_data_update_time
 
std::string m_status_log
 time of last full scale update of raw_data More...
 
std::string m_event_log
 
std::string m_debug_log
 
std::string m_monitoring_log
 
std::string m_timediff_log
 
parameter_map_t m_sample_parameters
 
parameter_map_t m_beamline_parameters
 

Additional Inherited Members

- Protected Member Functions inherited from ISIS::Base
 Base (const std::string &logger_name="UNKNOWN")
 
void setLoggerName (const std::string &logger_name)
 
virtual ~Base ()
 
virtual std::string loggingPrefix () const
 
void setThisLoggerLevel (int level)
 
- Static Protected Member Functions inherited from ISIS::Base
static void setAllLoggerLevel (int level)
 
- Protected Attributes inherited from ISIS::Base
Poco::Logger * m_logger
 
Poco::LogStream * m_logstr
 
Poco::Mutex m_logger_lock
 

Detailed Description

Definition at line 238 of file CRPTProxy.h.

Member Typedef Documentation

typedef std::map<std::string, parameter_t> CRPTProxy::parameter_map_t

Definition at line 248 of file CRPTProxy.h.

Constructor & Destructor Documentation

CRPTProxy::CRPTProxy ( const CRPTProxy )
inlineprivate

Definition at line 273 of file CRPTProxy.h.

CRPTProxy::CRPTProxy ( )

Definition at line 4 of file CRPTProxy.cpp.

References invalidateHandles().

CRPTProxy::~CRPTProxy ( )
inline

Definition at line 368 of file CRPTProxy.h.

References unloadCRPT().

Member Function Documentation

int CRPTProxy::assignLogFiles ( const std::string &  prefix)
int CRPTProxy::assignLogFiles ( bool  use_full_inst_name_for_files,
const std::string &  data_dir,
int  run_number_digits 
)
parameter_map_t& CRPTProxy::beamlineParameters ( )
inline
int CRPTProxy::createFrom ( CRPTProxy proxy_clone,
int  id,
bool  blank_raw_data,
DAEstatus status 
)
ISISCRPT_STRUCT* CRPTProxy::CRPT ( )
inline
const ISISCRPT_STRUCT* CRPTProxy::CRPT ( ) const
inline

Definition at line 349 of file CRPTProxy.h.

References m_crpt.

ISISCRPT_DATA* CRPTProxy::crptData ( )
inline

Definition at line 284 of file CRPTProxy.h.

References m_crpt_data.

Referenced by ISISinstrumentControl::loadCRPTWithHistogrammedEvents().

std::string CRPTProxy::dataFileName ( ) const
inline

Definition at line 300 of file CRPTProxy.h.

References ISISCRPT_DATA::fileName(), and m_crpt_data.

Referenced by createFrom().

isisU32_t CRPTProxy::dataFileSize ( ) const
inline

Definition at line 320 of file CRPTProxy.h.

References ISISCRPT_DATA::fileSizeMax(), and m_crpt_data.

Referenced by createFrom().

std::string CRPTProxy::dataSectionName ( ) const
inline

Definition at line 301 of file CRPTProxy.h.

References m_crpt_data, and ISISCRPT_DATA::sectionName().

Referenced by createFrom().

const std::string& CRPTProxy::debugLog ( ) const
inline
const std::string& CRPTProxy::eventLog ( ) const
inline

Definition at line 288 of file CRPTProxy.h.

References m_event_log.

Referenced by ISISinstrumentControl::logEvent().

int CRPTProxy::flushCRPT ( DAEstatus status,
bool  flush_raw_data = false 
)
int CRPTProxy::flushSection ( void *  address,
HANDLE  file_handle,
DAEstatus status 
)
private
Poco::Mutex& CRPTProxy::getDataLockRef ( )
inline

Definition at line 286 of file CRPTProxy.h.

References m_data_lock.

Referenced by ISISinstrumentControl::updateCRPTWithDAE().

int CRPTProxy::getIntArrayItem ( const char *  item_name,
const long *  spec_array,
int  nspec,
long *  larray,
DAEstatus status 
) const
inline
int CRPTProxy::getIntArrayItem ( const char *  item_name,
long *  larray,
DAEstatus status 
) const
inline

Definition at line 378 of file CRPTProxy.h.

References ISISCRPT_STRUCT::getIntArrayItem(), m_crpt, rawData(), and rawDataSizeMax().

Poco::Mutex& CRPTProxy::getLockRef ( )
inline

Definition at line 285 of file CRPTProxy.h.

References m_crpt_lock.

int CRPTProxy::getRealArrayItem ( const char *  item_name,
const long *  spec_array,
int  nspec,
double *  darray,
DAEstatus status 
) const
inline
int CRPTProxy::getRealArrayItem ( const char *  item_name,
const long *  spec_array,
int  nspec,
float *  farray,
DAEstatus status 
) const
inline

Definition at line 386 of file CRPTProxy.h.

References ISISCRPT_STRUCT::getRealArrayItem(), m_crpt, rawData(), and rawDataSizeMax().

int CRPTProxy::getRealArrayItem ( const char *  item_name,
double *  darray,
DAEstatus status 
) const
inline

Definition at line 390 of file CRPTProxy.h.

References ISISCRPT_STRUCT::getRealArrayItem(), m_crpt, rawData(), and rawDataSizeMax().

int CRPTProxy::getRealArrayItem ( const char *  item_name,
float *  farray,
DAEstatus status 
) const
inline

Definition at line 394 of file CRPTProxy.h.

References ISISCRPT_STRUCT::getRealArrayItem(), m_crpt, rawData(), and rawDataSizeMax().

void CRPTProxy::histogramEventsToCRPT ( const ISISCRPT_STRUCT crpt1,
const ISISCRPT_STRUCT crpt2,
ISISCRPT_DATA crpt_data1,
ISISCRPT_DATA crpt_data2,
const DAEEventHeader head,
const DetectorEvent32 ev,
int  n,
int  event_source_id 
)
static
void CRPTProxy::histogramEventsToCRPT ( CRPTProxy crpt,
const DAEEventHeader head,
const DetectorEvent32 ev,
int  n,
int  event_source_id 
)
static

Definition at line 420 of file CRPTProxy.cpp.

References CRPT(), histogramEventsToCRPT(), and m_crpt_data.

void CRPTProxy::histogramEventsToCRPT ( CRPTProxy crpt1,
CRPTProxy crpt2,
const DAEEventHeader head,
const DetectorEvent32 ev,
int  n,
int  event_source_id 
)
static

Definition at line 425 of file CRPTProxy.cpp.

References CRPT(), histogramEventsToCRPT(), and m_crpt_data.

void CRPTProxy::invalidateHandles ( )
inlineprivate

Definition at line 274 of file CRPTProxy.h.

References ISISCRPT_DATA::init(), m_crpt, m_crpt_data, m_crpt_fh, and m_crpt_fm.

Referenced by CRPTProxy(), mapCRPT(), and unloadCRPT().

bool CRPTProxy::isRawDataCacheValid ( ) const
inline

Definition at line 398 of file CRPTProxy.h.

References m_crpt, m_raw_data_update_time, and ISISCRPT_STRUCT::start_time.

bool CRPTProxy::isValid ( ) const
inline
int CRPTProxy::loadCRPT ( const char *  crpt_file,
const char *  crpt_name,
const char *  crpt_data_file,
const char *  crpt_data_name,
int  crpt_data_size,
bool  read_only,
DAEstatus status 
)
Todo:
use file_attributes ?

Definition at line 204 of file CRPTProxy.cpp.

References DAEstatus::addVa(), defaultNoInheritHandles(), ERRTYPE_OUTOFMEM, FAC_CRPT, DAEstatus::Failure, and SEV_ERROR.

Referenced by createFrom().

int CRPTProxy::loadCRPT ( const char *  crpt_file,
HANDLE  crpt_fh,
const char *  crpt_name,
const char *  crpt_data_file,
HANDLE  crpt_data_fh,
const char *  crpt_data_name,
int  crpt_data_size,
bool  read_only,
DAEstatus status 
)
int CRPTProxy::loadOrCreateCRPT ( const std::string &  crpt_file,
const std::string &  crpt_name,
const std::string &  crpt_data_file,
const std::string &  crpt_data_name,
int  crpt_data_size,
ISISDAE::DAEType  dae_type,
const std::string &  comp_name,
boost::function< int(DAEstatus &)>  readRecoveryFile,
DAEstatus status 
)

Definition at line 76 of file CRPTProxy.cpp.

Referenced by ISISinstrumentControl::loadCRPT().

int CRPTProxy::loadOrCreateCRPT ( const char *  crpt_file,
const char *  crpt_name,
const char *  crpt_data_file,
const char *  crpt_data_name,
int  crpt_data_size,
ISISDAE::DAEType  dae_type,
const char *  comp_name,
boost::function< int(DAEstatus &)>  readRecoveryFile,
DAEstatus status 
)
int CRPTProxy::mapCRPT ( const std::string &  crpt_name,
const std::string &  crpt_data_name,
bool  read_only,
bool  existing 
)
const std::string& CRPTProxy::monitoringLog ( ) const
inline

Definition at line 290 of file CRPTProxy.h.

References m_monitoring_log.

Referenced by ISISinstrumentControl::updateMonitoringLog().

ISISCRPT_STRUCT* CRPTProxy::operator-> ( )
inline

Definition at line 352 of file CRPTProxy.h.

References m_crpt.

const ISISCRPT_STRUCT* CRPTProxy::operator-> ( ) const
inline

Definition at line 353 of file CRPTProxy.h.

References m_crpt.

isisU32_t* CRPTProxy::rawData ( )
inline
const isisU32_t* CRPTProxy::rawData ( ) const
inline

Definition at line 307 of file CRPTProxy.h.

References m_crpt_data, and ISISCRPT_DATA::rawData().

isisU32_t CRPTProxy::rawDataSizeMax ( ) const
inline
isisU32_t CRPTProxy::rawDataSizeUsed ( ) const
inline

Definition at line 299 of file CRPTProxy.h.

References ISISCRPT_STRUCT::getPeriodSize(), m_crpt, and ISISCRPT_STRUCT::nper_daq.

Referenced by zeroUsedRawData().

void CRPTProxy::rawDataUpdated ( )
inline
time_t CRPTProxy::rawDataUpdateTime ( ) const
inline

Definition at line 297 of file CRPTProxy.h.

References m_raw_data_update_time.

parameter_map_t& CRPTProxy::sampleParameters ( )
inline
void CRPTProxy::setICPStartTime ( time_t  t)
inline

Definition at line 324 of file CRPTProxy.h.

References ISISCRPT_STRUCT::icp_start_time, and m_crpt.

Referenced by ISISinstrumentControl::ISISinstrumentControl().

uint32_t CRPTProxy::spectrumCRPTOffset ( int  spec,
int  daq_period 
) const
inline
isisU32_t* CRPTProxy::spectrumIntegrals ( )
inline
const isisU32_t* CRPTProxy::spectrumIntegrals ( ) const
inline

Definition at line 316 of file CRPTProxy.h.

References m_crpt_data, and ISISCRPT_DATA::spectrumIntegrals().

const std::string& CRPTProxy::statusLog ( ) const
inline

Definition at line 287 of file CRPTProxy.h.

References m_status_log.

Referenced by ISISinstrumentControl::updateStatusLog().

const std::string& CRPTProxy::timeDiffLog ( ) const
inline

Definition at line 291 of file CRPTProxy.h.

References m_timediff_log.

Referenced by ISISinstrumentControl::updateICPTimeDiffLog().

int CRPTProxy::unloadCRPT ( bool  delete_crpt_file,
bool  delete_crpt_data_file,
DAEstatus status 
)
int CRPTProxy::unloadCRPT ( DAEstatus status)
inline

Definition at line 367 of file CRPTProxy.h.

References unloadCRPT().

Referenced by unloadCRPT().

int CRPTProxy::updateFrom ( CRPTProxy proxy_clone,
bool  copy_raw_data,
DAEstatus status 
)
void CRPTProxy::zeroAllRawData ( DAEstatus status)
inline

Definition at line 328 of file CRPTProxy.h.

References m_crpt_data, m_data_lock, rawDataUpdated(), and ISISCRPT_DATA::zeroRawData().

void CRPTProxy::zeroEventRawData ( DAEstatus status)
void CRPTProxy::zeroUsedRawData ( DAEstatus status)
inline

Member Data Documentation

parameter_map_t CRPTProxy::m_beamline_parameters
private

Definition at line 271 of file CRPTProxy.h.

Referenced by beamlineParameters(), and updateFrom().

std::string CRPTProxy::m_comp_name
private

Definition at line 258 of file CRPTProxy.h.

Referenced by loadOrCreateCRPT().

ISISCRPT_STRUCT* CRPTProxy::m_crpt
private
ISISCRPT_DATA CRPTProxy::m_crpt_data
private
HANDLE CRPTProxy::m_crpt_fh
private

Definition at line 255 of file CRPTProxy.h.

Referenced by flushCRPT(), invalidateHandles(), loadCRPT(), loadOrCreateCRPT(), and unloadCRPT().

std::string CRPTProxy::m_crpt_file
private

Definition at line 259 of file CRPTProxy.h.

Referenced by createFrom(), loadCRPT(), loadOrCreateCRPT(), and unloadCRPT().

HANDLE CRPTProxy::m_crpt_fm
private

Definition at line 256 of file CRPTProxy.h.

Referenced by invalidateHandles(), loadCRPT(), loadOrCreateCRPT(), mapCRPT(), and unloadCRPT().

Poco::Mutex CRPTProxy::m_crpt_lock
private

Definition at line 250 of file CRPTProxy.h.

Referenced by getLockRef().

std::string CRPTProxy::m_crpt_name
private

name of memory section

Definition at line 260 of file CRPTProxy.h.

Referenced by createFrom(), loadCRPT(), and loadOrCreateCRPT().

ISISDAE::DAEType CRPTProxy::m_dae_type
private

Definition at line 257 of file CRPTProxy.h.

Referenced by loadOrCreateCRPT().

Poco::Mutex CRPTProxy::m_data_lock
private
std::string CRPTProxy::m_debug_log
private

Definition at line 265 of file CRPTProxy.h.

Referenced by assignLogFiles(), debugLog(), and updateFrom().

std::string CRPTProxy::m_event_log
private

Definition at line 264 of file CRPTProxy.h.

Referenced by assignLogFiles(), eventLog(), and updateFrom().

std::string CRPTProxy::m_monitoring_log
private

Definition at line 266 of file CRPTProxy.h.

Referenced by assignLogFiles(), monitoringLog(), and updateFrom().

time_t CRPTProxy::m_raw_data_update_time
private
parameter_map_t CRPTProxy::m_sample_parameters
private

Definition at line 270 of file CRPTProxy.h.

Referenced by sampleParameters(), and updateFrom().

std::string CRPTProxy::m_status_log
private

time of last full scale update of raw_data

Definition at line 263 of file CRPTProxy.h.

Referenced by assignLogFiles(), statusLog(), and updateFrom().

std::string CRPTProxy::m_timediff_log
private

Definition at line 267 of file CRPTProxy.h.

Referenced by assignLogFiles(), timeDiffLog(), and updateFrom().


The documentation for this class was generated from the following files: