You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
#include "rgooseHardwareResource.h"
|
|
|
|
#define LOG( X ) m_pLog->Log( "HWR", this, X )
|
|
|
|
#ifdef DEBUG
|
|
#define LOG_ERROR( X ) {\
|
|
char _tBfrErrMSG2w34[256];\
|
|
sprintf( _tBfrErrMSG2w34, "In file %s[%d] in func:%s %s",__FILE__, __LINE__, __func__, X );\
|
|
m_pLog->Log( "HWR", this, _LOG_ERROR, _tBfrErrMSG2w34 );\
|
|
}
|
|
#else
|
|
#define LOG_ERROR( X ) m_pLog->Log( "HWR", this, _LOG_ERROR, X );
|
|
#endif
|
|
|
|
argusHardwareResource::argusHardwareResource( uint32_t id, ARGUS_HARDWARE_TYPE type ): basicObject(){
|
|
m_pDBC = argusDBC::getInstance();
|
|
m_pLog = basicLogCollection::getInstance();
|
|
if( id > 0 ){
|
|
if( m_pDBC!=NULL ){
|
|
DBC_SOCKET_DATA *tData = m_pDBC->getSocketData( id );
|
|
if( tData != NULL ) {
|
|
memcpy( &m_sSettings, tData, sizeof(DBC_SOCKET_DATA));
|
|
free( tData );
|
|
} else {
|
|
LOG_ERROR("Cannot Fetch Hardware Data from DB!");
|
|
memset( &m_sSettings, 0, sizeof( DBC_SOCKET_DATA ));
|
|
m_sSettings.socket_id = id;
|
|
m_sSettings.type = type;
|
|
};
|
|
} else {
|
|
memset( &m_sSettings, 0, sizeof( DBC_SOCKET_DATA ));
|
|
m_sSettings.socket_id = id;
|
|
m_sSettings.type = type;
|
|
};
|
|
} else {
|
|
memset( &m_sSettings, 0, sizeof( DBC_SOCKET_DATA ));
|
|
m_sSettings.socket_id = id;
|
|
m_sSettings.type = type;
|
|
};
|
|
};
|
|
|
|
argusHardwareResource::~argusHardwareResource(){
|
|
};
|
|
|
|
#undef LOG
|
|
#undef LOG_ERROR
|
|
|