Commit a396116c authored by ics's avatar ics
Browse files

change to generic name

parent 4a031c49
#include "drivers/gigecam/photonics/CameraHandler.h" #include "drivers/gigecam/genericam/CameraHandler.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <limits> #include <limits>
//#include "pylon/Platform.h" //#include "pylon/Platform.h"
//#include "pylon/api_autoconf.h" //#include "pylon/api_autoconf.h"
#include "drivers/gigecam/photonics/BufferInformation.h" #include "drivers/gigecam/genericam/BufferInformation.h"
#include "drivers/gigecam/photonics/DoubleBufferHandler.h" #include "drivers/gigecam/genericam/DoubleBufferHandler.h"
// this function initializes the Baumer GAPI SDK and // this function initializes the Baumer GAPI SDK and
// searches for connected cameras // searches for connected cameras
......
#include "drivers/gigecam/photonics/DoubleBufferHandler.h" #include "drivers/gigecam/genericam/DoubleBufferHandler.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include "drivers/gigecam/photonics/BufferInformation.h" #include "drivers/gigecam/genericam/BufferInformation.h"
CDoubleBufferHandler::CDoubleBufferHandler() CDoubleBufferHandler::CDoubleBufferHandler()
: buffer_read_(nullptr) : buffer_read_(nullptr)
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
* limitations under the Licence. * limitations under the Licence.
*/ */
#ifndef PHOTONICSDEF_H #ifndef GENERICCAMDEF_H
#define PHOTONICSDEF_H #define GENERICCAMDEF_H
#include <string> #include <string>
#include <common/base/PropertyType.h> #include <common/base/PropertyType.h>
namespace photonics { namespace genericam {
static const std::string MILLISEC = "Millisec"; static const std::string MILLISEC = "Millisec";
......
...@@ -16,33 +16,33 @@ ...@@ -16,33 +16,33 @@
* limitations under the Licence. * limitations under the Licence.
*/ */
#include "drivers/gigecam/photonics/PhotonicsDriver.h" #include "drivers/gigecam/genericam/GenericCamDriver.h"
#include <math.h> #include <math.h>
#include "drivers/gigecam/photonics/PerfectPhotonicsDriver.h" #include "drivers/gigecam/genericam/PerfectGenericCamDriver.h"
#include "drivers/gigecam/photonics/PhotonicsDef.h" #include "drivers/gigecam/genericam/GenericCamDef.h"
#include "drivers/gigecam/photonics/PhotonicsState.h" #include "drivers/gigecam/genericam/GenericCamState.h"
#include "drivers/gigecam/photonics/RealPhotonicsDriver.h" #include "drivers/gigecam/genericam/RealGenericCamDriver.h"
#include "drivers/gigecam/photonics/SimulatedPhotonicsDriver.h" #include "drivers/gigecam/genericam/SimulatedGenericCamDriver.h"
using namespace std; using namespace std;
namespace photonics { namespace genericam {
const std::string PhotonicsDriver::TYPE = "photonics"; const std::string GenericCamDriver::TYPE = "genericam";
const std::string PhotonicsDriver:: MODE[4] = {"Standard", "Average","Summation","Accumulation"}; const std::string GenericCamDriver:: MODE[4] = {"Standard", "Average","Summation","Accumulation"};
/* /*
* Constructor * Constructor
*/ */
PhotonicsDriver::PhotonicsDriver(const string& name): GenericCamDriver::GenericCamDriver(const string& name):
acquisition::NoTofAcquisitionCommon(name),acquisition::KineticAcquisitionCommon(name), acquisition::NoTofAcquisitionCommon(name),acquisition::KineticAcquisitionCommon(name),
acquisition::TimeGateCommon(name), acquisition::TimeGateCommon(name),
acquisition::DetectorCommon(name) acquisition::DetectorCommon(name)
{ {
registerStates(new RealPhotonicsDriver(this), new PerfectPhotonicsDriver(this), new SimulatedPhotonicsDriver(this)); registerStates(new RealGenericCamDriver(this), new PerfectGenericCamDriver(this), new SimulatedGenericCamDriver(this));
driver::SocketTcp::init(name); driver::SocketTcp::init(name);
...@@ -92,13 +92,13 @@ PhotonicsDriver::PhotonicsDriver(const string& name): ...@@ -92,13 +92,13 @@ PhotonicsDriver::PhotonicsDriver(const string& name):
/* /*
* Destructor * Destructor
*/ */
PhotonicsDriver::~PhotonicsDriver() { GenericCamDriver::~GenericCamDriver() {
} }
/* /*
* refreshDataSizeProperty * refreshDataSizeProperty
*/ */
void PhotonicsDriver::refreshDataSizeProperty(int32 value) throw (CannotSetValue) { void GenericCamDriver::refreshDataSizeProperty(int32 value) throw (CannotSetValue) {
if (m_DataShort != NULL) { if (m_DataShort != NULL) {
delete[] m_DataShort; delete[] m_DataShort;
} }
...@@ -113,7 +113,7 @@ void PhotonicsDriver::refreshDataSizeProperty(int32 value) throw (CannotSetValue ...@@ -113,7 +113,7 @@ void PhotonicsDriver::refreshDataSizeProperty(int32 value) throw (CannotSetValue
/* /*
* refreshModeProperty * refreshModeProperty
*/ */
void PhotonicsDriver::refreshModeProperty(int32 value) throw (CannotSetValue) { void GenericCamDriver::refreshModeProperty(int32 value) throw (CannotSetValue) {
if (value != acquisition::GateCommon::TIME_MODE) { if (value != acquisition::GateCommon::TIME_MODE) {
throw CannotSetValue(); throw CannotSetValue();
} }
...@@ -122,13 +122,13 @@ void PhotonicsDriver::refreshModeProperty(int32 value) throw (CannotSetValue) { ...@@ -122,13 +122,13 @@ void PhotonicsDriver::refreshModeProperty(int32 value) throw (CannotSetValue) {
/* /*
* execute * execute
*/ */
void PhotonicsDriver::execute(const std::string& aCommand) { void GenericCamDriver::execute(const std::string& aCommand) {
if ((aCommand != driver::PAUSE_COMMAND) && (aCommand != driver::STOP_COMMAND) && (aCommand != driver::STATUS_COMMAND) if ((aCommand != driver::PAUSE_COMMAND) && (aCommand != driver::STOP_COMMAND) && (aCommand != driver::STATUS_COMMAND)
&& (aCommand != driver::READ_COMMAND)) { && (aCommand != driver::READ_COMMAND)) {
commandProgression = PROGRESSION_UNKNOWNSTATE_DEVICE_CONTAINER; commandProgression = PROGRESSION_UNKNOWNSTATE_DEVICE_CONTAINER;
} }
PhotonicsState* currentState = dynamic_cast<PhotonicsState*>(getCurrentState()); GenericCamState* currentState = dynamic_cast<GenericCamState*>(getCurrentState());
// Check command // Check command
if (aCommand == driver::INIT_COMMAND) { if (aCommand == driver::INIT_COMMAND) {
// Init command // Init command
...@@ -187,7 +187,7 @@ void PhotonicsDriver::execute(const std::string& aCommand) { ...@@ -187,7 +187,7 @@ void PhotonicsDriver::execute(const std::string& aCommand) {
/* /*
* calculateProgression * calculateProgression
*/ */
void PhotonicsDriver::calculateProgression() { void GenericCamDriver::calculateProgression() {
int32 progression = 0; int32 progression = 0;
float64 setpoint = 0.0; float64 setpoint = 0.0;
float64 actual = 0.0; float64 actual = 0.0;
...@@ -210,9 +210,9 @@ void PhotonicsDriver::calculateProgression() { ...@@ -210,9 +210,9 @@ void PhotonicsDriver::calculateProgression() {
} }
/* /*
* PhotonicsDriver * GenericCamDriver
*/ */
void PhotonicsDriver::computeGateStatus(int32 value) { void GenericCamDriver::computeGateStatus(int32 value) {
int32 valueout = 0; int32 valueout = 0;
if (value == COUNTING) { if (value == COUNTING) {
valueout |= GateCommon::RUNNING_STATUS; valueout |= GateCommon::RUNNING_STATUS;
...@@ -224,18 +224,18 @@ void PhotonicsDriver::computeGateStatus(int32 value) { ...@@ -224,18 +224,18 @@ void PhotonicsDriver::computeGateStatus(int32 value) {
} }
/* /*
* PhotonicsDriver * GenericCamDriver
*/ */
void PhotonicsDriver::computeDetectorStatus(int32 value) { void GenericCamDriver::computeDetectorStatus(int32 value) {
int32 valueout = 0; int32 valueout = 0;
detectorStatus.update(valueout); detectorStatus.update(valueout);
} }
/* /*
* PhotonicsDriver * GenericCamDriver
*/ */
void PhotonicsDriver::computeAcquisitionStatus(int32 value) { void GenericCamDriver::computeAcquisitionStatus(int32 value) {
int32 valueout = 0; int32 valueout = 0;
acquisitionStatus.update(valueout); acquisitionStatus.update(valueout);
} }
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
* limitations under the Licence. * limitations under the Licence.
*/ */
#ifndef PHOTONICSDRIVER_H #ifndef GENERICCAMDRIVER_H
#define PHOTONICSDRIVER_H #define GENERICCAMDRIVER_H
#define _GNULINUX #define _GNULINUX
#include <Driver.h> #include <Driver.h>
...@@ -31,21 +31,21 @@ ...@@ -31,21 +31,21 @@
#include "drivers/legacy/def/DriverErrorDef.h" #include "drivers/legacy/def/DriverErrorDef.h"
//#include "/usr/local/src/baumer/inc/" //#include "/usr/local/src/baumer/inc/"
namespace photonics { namespace genericam {
/** /**
* Global Implementation of the vme card called Psl made in Ill. It needs a board called Men A201. * Global Implementation of the vme card called Psl made in Ill. It needs a board called Men A201.
*/ */
class PhotonicsDriver: public acquisition::NoTofAcquisitionCommon, class GenericCamDriver: public acquisition::NoTofAcquisitionCommon,
public acquisition::TimeGateCommon, public acquisition::TimeGateCommon,
public acquisition::KineticAcquisitionCommon, public acquisition::KineticAcquisitionCommon,
public acquisition::DetectorCommon, public acquisition::DetectorCommon,
public driver::SocketTcp public driver::SocketTcp
{ {
friend class RealPhotonicsDriver; friend class RealGenericCamDriver;
friend class PerfectPhotonicsDriver; friend class PerfectGenericCamDriver;
friend class SimulatedPhotonicsDriver; friend class SimulatedGenericCamDriver;
public: public:
static const std::string MODE[4]; static const std::string MODE[4];
...@@ -58,12 +58,12 @@ public: ...@@ -58,12 +58,12 @@ public:
* \brief Constructor * \brief Constructor
* \param[in] name the name of the device driver * \param[in] name the name of the device driver
*/ */
PhotonicsDriver(const std::string& name); GenericCamDriver(const std::string& name);
/*! /*!
* \brief Destructor * \brief Destructor
*/ */
virtual ~PhotonicsDriver(); virtual ~GenericCamDriver();
/*! /*!
* \brief Method called for executing a command * \brief Method called for executing a command
......
...@@ -16,23 +16,23 @@ ...@@ -16,23 +16,23 @@
* limitations under the Licence. * limitations under the Licence.
*/ */
#ifndef PHOTONICSSTATE_H #ifndef GENERICCAMSTATE_H
#define PHOTONICSSTATE_H #define GENERICCAMSTATE_H
#include <Driver.h> #include <Driver.h>
#include "drivers/gigecam/photonics/PhotonicsDriver.h" #include "drivers/gigecam/genericam/GenericCamDriver.h"
namespace photonics { namespace genericam {
/*! /*!
* \class PhotonicsState * \class GenericCamState
* \brief Virtual class for implement State pattern * \brief Virtual class for implement State pattern
* *
* Define all methods that perfect, simulated and real classes have to implement * Define all methods that perfect, simulated and real classes have to implement
*/ */
class PhotonicsState: public DriverState<PhotonicsDriver> { class GenericCamState: public DriverState<GenericCamDriver> {
public: public:
...@@ -40,13 +40,13 @@ public: ...@@ -40,13 +40,13 @@ public:
* \brief Constructor * \brief Constructor
* \param[in] owner The device driver main class link * \param[in] owner The device driver main class link
*/ */
PhotonicsState(PhotonicsDriver* owner) : GenericCamState(GenericCamDriver* owner) :
DriverState<PhotonicsDriver>(owner) { DriverState<GenericCamDriver>(owner) {
} }
/*! /*!
* \brief Destructor * \brief Destructor
*/ */
virtual ~PhotonicsState() { virtual ~GenericCamState() {
} }
/*! /*!
...@@ -107,4 +107,4 @@ public: ...@@ -107,4 +107,4 @@ public:
}; };
} }
#endif //PHOTONICSSTATE_H #endif //GENERICCAMSTATE_H
<module name="photonics"> <module name="genericam">
<driver class="photonics::PhotonicsDriver"/> <driver class="genericam::GenericCamDriver"/>
<link path="/usr/local/lib/baumer" lib="bgapi2_genicam"/> <link path="/usr/local/lib/baumer" lib="bgapi2_genicam"/>
<link lib="opencv_core"/> <link lib="opencv_core"/>
<link lib="opencv_calib3d"/> <link lib="opencv_calib3d"/>
......
...@@ -16,37 +16,37 @@ ...@@ -16,37 +16,37 @@
* limitations under the Licence. * limitations under the Licence.
*/ */
#include "drivers/gigecam/photonics/PerfectPhotonicsDriver.h" #include "drivers/gigecam/genericam/PerfectGenericCamDriver.h"
#include <stdlib.h> #include <stdlib.h>
#include "drivers/gigecam/photonics/PhotonicsDef.h" #include "drivers/gigecam/genericam/GenericCamDef.h"
#include "drivers/gigecam/photonics/PhotonicsDriver.h" #include "drivers/gigecam/genericam/GenericCamDriver.h"
namespace photonics { namespace genericam {
/* /*
* Constructor * Constructor
*/ */
PerfectPhotonicsDriver::PerfectPhotonicsDriver(PhotonicsDriver* owner) : PerfectGenericCamDriver::PerfectGenericCamDriver(GenericCamDriver* owner) :
PhotonicsState(owner) { GenericCamState(owner) {
/* Empty */ /* Empty */
} }
/* /*
* Destructor * Destructor
*/ */
PerfectPhotonicsDriver::~PerfectPhotonicsDriver() { PerfectGenericCamDriver::~PerfectGenericCamDriver() {
/* Empty */ /* Empty */
} }
void PerfectPhotonicsDriver::init() { void PerfectGenericCamDriver::init() {
} }
/* /*
* clearvme/daugther/Photonics * clearvme/daugther/GenericCam
*/ */
void PerfectPhotonicsDriver::clear() { void PerfectGenericCamDriver::clear() {
// Read command // Read command
owner()->time = 0; owner()->time = 0;
owner()->counts = 0; owner()->counts = 0;
...@@ -57,13 +57,13 @@ void PerfectPhotonicsDriver::clear() { ...@@ -57,13 +57,13 @@ void PerfectPhotonicsDriver::clear() {
/* /*
* writeParam * writeParam
*/ */
void PerfectPhotonicsDriver::writeParam() { void PerfectGenericCamDriver::writeParam() {
} }
/* /*
* synchroniseRead * synchroniseRead
*/ */
void PerfectPhotonicsDriver::synchroniseRead() { void PerfectGenericCamDriver::synchroniseRead() {
read(); read();
owner()->m_SynchroniseReadTerminated = true; owner()->m_SynchroniseReadTerminated = true;
} }
...@@ -71,7 +71,7 @@ void PerfectPhotonicsDriver::synchroniseRead() { ...@@ -71,7 +71,7 @@ void PerfectPhotonicsDriver::synchroniseRead() {
///* ///*
// * regroup // * regroup
// */ // */
//void PerfectPhotonicsDriver::regroup() { //void PerfectGenericCamDriver::regroup() {
// std::cout << owner()->xSize() << std::endl; // std::cout << owner()->xSize() << std::endl;
// std::cout << owner()->ySize() << std::endl; // std::cout << owner()->ySize() << std::endl;
//} //}
...@@ -79,7 +79,7 @@ void PerfectPhotonicsDriver::synchroniseRead() { ...@@ -79,7 +79,7 @@ void PerfectPhotonicsDriver::synchroniseRead() {
/* /*
* read * read
*/ */
void PerfectPhotonicsDriver::read() { void PerfectGenericCamDriver::read() {
// Read command // Read command
int32 size = owner()->dataSize(); int32 size = owner()->dataSize();
...@@ -109,35 +109,35 @@ void PerfectPhotonicsDriver::read() { ...@@ -109,35 +109,35 @@ void PerfectPhotonicsDriver::read() {
/* /*
* pause * pause
*/ */
void PerfectPhotonicsDriver::pause() { void PerfectGenericCamDriver::pause() {
} }
/* /*
* continue * continue
*/ */
void PerfectPhotonicsDriver::resume() { void PerfectGenericCamDriver::resume() {
} }
/* /*
* start * start
*/ */
void PerfectPhotonicsDriver::start() { void PerfectGenericCamDriver::start() {
owner()->time = owner()->time.setpoint(); owner()->time = owner()->time.setpoint();
} }
/* /*
* stop * stop
*/ */
void PerfectPhotonicsDriver::stop() { void PerfectGenericCamDriver::stop() {
} }
/* /*
* readStatus * readStatus
*/ */
void PerfectPhotonicsDriver::readStatus() { void PerfectGenericCamDriver::readStatus() {
owner()->startActivated = false; owner()->startActivated = false;
// Status command // Status command
owner()->computeGateStatus(photonics::READOUT_COMPLETE); owner()->computeGateStatus(genericam::READOUT_COMPLETE);
owner()->computeAcquisitionStatus(0); owner()->computeAcquisitionStatus(0);
owner()->computeDetectorStatus(0); owner()->computeDetectorStatus(0);
if (owner()->m_SynchroniseReadActivated == true) { if (owner()->m_SynchroniseReadActivated == true) {
...@@ -154,7 +154,7 @@ void PerfectPhotonicsDriver::readStatus() { ...@@ -154,7 +154,7 @@ void PerfectPhotonicsDriver::readStatus() {
/* /*
* readInfos * readInfos
*/ */
void PerfectPhotonicsDriver::readInfos() { void PerfectGenericCamDriver::readInfos() {