Skip to content
Snippets Groups Projects
Commit fae8858a authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Update calibration option during init

parent f161d12d
No related branches found
No related tags found
No related merge requests found
......@@ -122,12 +122,6 @@ protected:
*/
HardwareHandle hh_;
/**
* Init with calibration?
*/
static bool isInitWithCalib_;
/**
* HW simulator
*/
......
......@@ -39,11 +39,12 @@ public:
/**
* Instanciate a AcqirisDC211 board.
* @param _id The number of the card in the cPCI crate.
* @param _calibration Calibration done in init phase (if set to true).
* @param _exclusive_access Allows or not the exclusive access (exclusive access by default).
* @return A pointer to the card.
* @throw DAQException
*/
static AcqirisDC211* instanciate (unsigned short _id, bool _exclusive_access = true)
static AcqirisDC211* instanciate (unsigned short _id, bool _calibration, bool _exclusive_access = true)
throw (DAQException);
/**
......
......@@ -39,11 +39,12 @@ public:
/**
* Instanciate a AcqirisDC252 board.
* @param _id The number of the card in the cPCI crate.
* @param _calibration Calibration done in init phase (if set to true).
* @param _exclusive_access Allows or not the exclusive access (exclusive access by default).
* @return A pointer to the card.
* @throw DAQException
*/
static AcqirisDC252* instanciate (unsigned short _id, bool _exclusive_access = true)
static AcqirisDC252* instanciate (unsigned short _id, bool _calibration, bool _exclusive_access = true)
throw (DAQException);
/**
......
......@@ -41,7 +41,8 @@ public:
*/
static Digitizer * instanciate (unsigned short _type,
unsigned short _id,
bool _exclusive_access)
bool _exclusive_access,
bool _calibration)
throw (DAQException);
/**
......@@ -101,8 +102,9 @@ protected:
/**
* Register the board with the driver.
* @param _calibration Calibration done in init phase (if set to true).
*/
virtual int register_hardware ();
virtual int register_hardware (bool _calibration);
/**
* Unregister the board with the driver.
......
......@@ -35,7 +35,6 @@ Digitizer * Digitizer::instanciate (unsigned short _type,
{
std::cout << "Digitizer::instanciate() entering -->> calibration = " << _calibration << " - exclusive = " << _exclusive_access << std::endl;
Digitizer * d = 0;
isInitWithCalib_ = _calibration;
#if defined(_NI_SUPPORT_)
......@@ -43,7 +42,7 @@ Digitizer * Digitizer::instanciate (unsigned short _type,
#elif defined(_ACQIRIS_SUPPORT_) || defined(_AGILENT_SUPPORT_)
d = dsl::AcqirisDigitizer::instanciate(_type, _id, _exclusive_access);
d = dsl::AcqirisDigitizer::instanciate(_type, _id, _exclusive_access, _calibration);
#endif
return d;
......
......@@ -35,7 +35,7 @@ AcqirisDC211::Repository AcqirisDC211::repository;
// ============================================================================
// AcqirisDC211::instanciate
// ============================================================================
AcqirisDC211 * AcqirisDC211::instanciate (unsigned short _id, bool _exclusive_access)
AcqirisDC211 * AcqirisDC211::instanciate (unsigned short _id, bool _calibration, bool _exclusive_access)
throw (DAQException)
{
//- lock
......@@ -78,7 +78,7 @@ AcqirisDC211 * AcqirisDC211::instanciate (unsigned short _id, bool _exclusive_ac
//- open driver session
try
{
d->register_hardware();
d->register_hardware(_calibration);
}
catch (const DAQException&)
{
......
......@@ -35,7 +35,7 @@ AcqirisDC252::Repository AcqirisDC252::repository;
// ============================================================================
// AcqirisDC252::instanciate
// ============================================================================
AcqirisDC252 * AcqirisDC252::instanciate (unsigned short _id, bool _exclusive_access)
AcqirisDC252 * AcqirisDC252::instanciate (unsigned short _id, bool _calibration, bool _exclusive_access)
throw (DAQException)
{
std::cout << "soso -- AcqirisDC252::instanciate() entering -->>" << std::endl;
......@@ -81,7 +81,7 @@ std::cout << "soso -- AcqirisDC252::instanciate() entering -->>" << std::endl;
//- open driver session
try
{
d->register_hardware();
d->register_hardware(_calibration);
}
catch (const DAQException&)
{
......
......@@ -52,7 +52,8 @@ namespace dsl {
// ============================================================================
Digitizer * AcqirisDigitizer::instanciate (unsigned short _type,
unsigned short _id,
bool _exclusive_access)
bool _exclusive_access,
bool _calibration)
throw (DAQException)
{
Digitizer * d = 0;
......@@ -62,11 +63,11 @@ Digitizer * AcqirisDigitizer::instanciate (unsigned short _type,
{
//- AGILENT-ACQIRIS-211
case dsl::ACQIRIS_DC211:
d = AcqirisDC211::instanciate(_id, _exclusive_access);
d = AcqirisDC211::instanciate(_id, _calibration, _exclusive_access);
break;
//- AGILENT-ACQIRIS-XXX
//- AGILENT-ACQIRIS-252
case dsl::ACQIRIS_DC252:
d = AcqirisDC252::instanciate(_id, _exclusive_access);
d = AcqirisDC252::instanciate(_id, _calibration, _exclusive_access);
break;
//- unsupported hardware
default:
......@@ -102,9 +103,9 @@ AcqirisDigitizer::~AcqirisDigitizer ()
// ============================================================================
// AcqirisDigitizer::register_hardware
// ============================================================================
int AcqirisDigitizer::register_hardware ()
int AcqirisDigitizer::register_hardware (bool _calibration)
{
std::cout << "soso -- AcqirisDigitizer::register_hardware () entering - calibration required? " << isInitWithCalib_ << std::endl;
std::cout << "soso -- AcqirisDigitizer::register_hardware () entering - calibration required? " << _calibration << std::endl;
#if !defined(_SIMULATION_)
//- build resource name
......@@ -121,7 +122,7 @@ std::cout << "soso -- AcqirisDigitizer::register_hardware () entering - calibrat
int err = 0;
// check if calibration is required at init or not...
if (isInitWithCalib_)
if (_calibration)
{
//- initialize with default options (including hardware calibration)
//- blocking action (about 15s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment