Commit 3473116e authored by Roberto Arturo Homs-Regojo's avatar Roberto Arturo Homs-Regojo

Merge branch 'master' of github.com:esrf-bliss/Lima

parents 2563c004 3d8ba984
......@@ -3,7 +3,7 @@
ProjectType="Visual C++"
Version="9,00"
Name="LibLimaCore"
ProjectGUID="{A4B703A6-C50F-442F-8952-54FB8EA51FF3}"
ProjectGUID="{4E635F51-6D2C-4F67-94A0-5A4658C76F06}"
RootNamespace="LimaCore"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
......
Subproject commit b696b2f9edaf428ee1839dde54b120067159dc2f
Subproject commit 566e08ca6a508b86728e1b665867905ec19cb789
Subproject commit 1ef77a30a5d495c93b1c93036632a663eb59cd24
Subproject commit 764415da79bb22dcb7a5473d745ccb7e49e7b2ac
Subproject commit a88e946226d62a377c0dcba85c68b3f22794c194
Subproject commit bfbdbebcbfd9470c6e5bedffaea201b07fb74b84
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.soleil.lib</groupId>
<artifactId>Lima</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</parent>
<groupId>fr.soleil.lib.Lima</groupId>
......
Subproject commit 694909e91ee8d29f2115e8c32ac30c68108aa94d
Subproject commit 87100bcaba7db7a006e83bd7503bac9fdd0efbec
......@@ -37,6 +37,7 @@ namespace Simulator
class LIBSIMULATOR_API Camera
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "Simulator");
public:
Camera();
~Camera();
......@@ -77,6 +78,7 @@ class LIBSIMULATOR_API Camera
private:
class SimuThread : public CmdThread
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "SimuThread");
public:
enum { // Status
Ready = MaxThreadStatus, Exposure, Readout, Latency,
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.soleil.lib.Lima</groupId>
<artifactId>Camera</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</parent>
<groupId>fr.soleil.lib.Lima.Camera</groupId>
......
......@@ -32,23 +32,31 @@ using namespace std;
Camera::SimuThread::SimuThread(Camera& simu)
: m_simu(&simu)
{
DEB_CONSTRUCTOR();
m_acq_frame_nb = 0;
m_force_stop = false;
}
void Camera::SimuThread::start()
{
DEB_MEMBER_FUNCT();
CmdThread::start();
waitStatus(Ready);
}
void Camera::SimuThread::init()
{
DEB_MEMBER_FUNCT();
setStatus(Ready);
}
void Camera::SimuThread::execCmd(int cmd)
{
DEB_MEMBER_FUNCT();
int status = getStatus();
switch (cmd) {
case StartAcq:
......@@ -61,6 +69,8 @@ void Camera::SimuThread::execCmd(int cmd)
void Camera::SimuThread::execStartAcq()
{
DEB_MEMBER_FUNCT();
StdBufferCbMgr& buffer_mgr = m_simu->m_buffer_ctrl_obj.getBuffer();
buffer_mgr.setStartTimestamp(Timestamp::now());
......@@ -103,12 +113,16 @@ void Camera::SimuThread::execStartAcq()
int Camera::SimuThread::getNbAcquiredFrames()
{
DEB_MEMBER_FUNCT();
return m_acq_frame_nb;
}
Camera::Camera() :
m_thread(*this)
{
DEB_CONSTRUCTOR();
init();
m_thread.start();
......@@ -116,6 +130,8 @@ Camera::Camera() :
void Camera::init()
{
DEB_MEMBER_FUNCT();
m_exp_time = 1.0;
m_lat_time = 0.0;
m_nb_frames = 1;
......@@ -123,6 +139,7 @@ void Camera::init()
Camera::~Camera()
{
DEB_DESTRUCTOR();
}
HwBufferCtrlObj* Camera::getBufferCtrlObj()
......@@ -225,6 +242,8 @@ HwInterface::StatusType::Basic Camera::getStatus()
void Camera::startAcq()
{
DEB_MEMBER_FUNCT();
m_thread.m_force_stop = false;//uggly but work
m_buffer_ctrl_obj.getBuffer().setStartTimestamp(Timestamp::now());
......@@ -234,6 +253,8 @@ void Camera::startAcq()
void Camera::stopAcq()
{
DEB_MEMBER_FUNCT();
m_thread.m_force_stop = true;//uggly but work
m_thread.sendCmd(SimuThread::StopAcq);
m_thread.waitStatus(SimuThread::Ready);
......
Subproject commit a671535c4e7fbf939e136dc2ed5958db9bda2ccf
Subproject commit 9beb9493e437aa2c031f0c0dafbdd5ffc7bbac95
Subproject commit a3a26726853c8acacc004caf39dbd7aa1bdea797
Subproject commit 49b011b0706a921bdee9a6c37054ad0282b1df64
Subproject commit f4ce64a59218cb25b8361f9e4fd91355bbcc1e9d
Subproject commit 95e5557cb575c4a065412f306523331161834701
......@@ -19,6 +19,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifdef WITH_CONFIG
#ifndef CONFIGUTILS_H
#define CONFIGUTILS_H
#include "Debug.h"
......@@ -62,3 +63,4 @@ namespace lima
};
}
#endif
#endif //WITH_CONFIG
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.soleil.lib</groupId>
<artifactId>Lima</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</parent>
<groupId>fr.soleil.lib.Lima</groupId>
......@@ -20,12 +20,7 @@
<groupId>fr.soleil.lib.Lima.Third-party.Processlib</groupId>
<artifactId>LimaProcesslibTasks-${aol}-shared-${mode}</artifactId>
</dependency>
<dependency>
<groupId>com.hyperrealm</groupId>
<artifactId>configcpp-${aol}-shared-release</artifactId>
<version>1.4.9</version>
</dependency>
</dependencies>
<build>
......
......@@ -19,6 +19,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifdef WITH_CONFIG
#include <libconfig.h++>
#include "Exceptions.h"
......@@ -140,3 +141,5 @@ bool Setting::getChild(const char* alias,Setting& child) const
}
return returnFlag;
}
#endif //WITH_CONFIG
......@@ -41,7 +41,7 @@ endif
ifneq ($(COMPILE_CONFIG),0)
common-objs += ConfigUtils.o
CXXFLAGS += -I../../third-party/libconfig/lib
CXXFLAGS += -DWITH_CONFIG -I../../third-party/libconfig/lib
endif
all: Common.o
......
......@@ -163,8 +163,11 @@ namespace lima
inline void _callIfNeedThresholdCallback(Data &aData,long long value);
#ifdef WITH_CONFIG
class _ConfigHandler;
CtConfig::ModuleTypeCallback* _getConfigHandler();
#endif //WITH_CONFIG
};
inline std::ostream& operator<<(std::ostream &os,
......
......@@ -130,8 +130,10 @@ namespace lima
void _apply();
void _hwRead();
#ifdef WITH_CONFIG
class _ConfigHandler;
CtConfig::ModuleTypeCallback* _getConfigHandler();
#endif //WITH_CONFIG
HwSyncCtrlObj *m_hw_sync;
HwSyncCtrlObj::ValidRangesType m_valid_ranges;
......
......@@ -19,6 +19,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifdef WITH_CONFIG
#ifndef CTCONFIGCONTEXT_H
#define CTCONFIGCONTEXT_H
#include <string>
......@@ -106,4 +107,5 @@ namespace lima
};
}
#endif
#endif //WITH_CONFIG
......@@ -188,8 +188,10 @@ class LIMACORE_API CtImage {
void _setHSFlip(const Flip &flip);
void _resetFlip();
#ifdef WITH_CONFIG
class _ConfigHandler;
CtConfig::ModuleTypeCallback* _getConfigHandler();
#endif //WITH_CONFIG
HwDetInfoCtrlObj* m_hw_det;
CtMaxImageSizeCB* m_cb_size;
......
......@@ -396,8 +396,10 @@ namespace lima {
bool _checkHwFileFormat(const std::string&) const;
void _ReadImage(Data&,int framenb);
#ifdef WITH_CONFIG
class _ConfigHandler;
CtConfig::ModuleTypeCallback* _getConfigHandler();
#endif //WITH_CONFIG
};
inline const char* convert_2_string(CtSaving::FileFormat fileFormat)
......
......@@ -71,8 +71,10 @@ namespace lima {
void apply(); /* internal/CtControl call only */
void reset(); /* internal/CtControl call only */
#ifdef WITH_CONFIG
class _ConfigHandler;
CtConfig::ModuleTypeCallback* _getConfigHandler();
#endif //WITH_CONFIG
bool m_has_shutter;
HwShutterCtrlObj* m_hw_shutter;
......
......@@ -127,8 +127,10 @@ namespace lima
void _check_video_mode(VideoMode);
void _prepareAcq();
#ifdef WITH_CONFIG
class _ConfigHandler;
CtConfig::ModuleTypeCallback* _getConfigHandler();
#endif //WITH_CONFIG
Parameters m_pars;
int m_pars_modify_mask;
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.soleil.lib</groupId>
<artifactId>Lima</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</parent>
<groupId>fr.soleil.lib.Lima</groupId>
......@@ -30,25 +30,21 @@
<groupId>fr.soleil.lib.Lima.Third-party.Processlib</groupId>
<artifactId>LimaProcesslibTasks-${aol}-shared-${mode}</artifactId>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT4Tango-${aol}-${library}-${mode}</artifactId>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-${library}-${mode}</artifactId>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>Nexus4Tango-${aol}-${library}-${mode}</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>NexusCPP-${aol}-${library}-${mode}</artifactId>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>com.hyperrealm</groupId>
<artifactId>configcpp-${aol}-shared-release</artifactId>
<version>1.4.9</version>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -196,6 +196,8 @@ void CtAccumulation::Parameters::reset()
{
active = false;
}
#ifdef WITH_CONFIG
// ******** _ConfigHandler ********
class CtAccumulation::_ConfigHandler : public CtConfig::ModuleTypeCallback
{
......@@ -230,6 +232,8 @@ public:
private:
CtAccumulation& m_acc;
};
#endif //WITH_CONFIG
// ******** CtAccumulation ********
CtAccumulation::CtAccumulation(CtControl &ct) :
m_buffers_size(16),
......@@ -686,8 +690,9 @@ void CtAccumulation::_accFrame(Data &src,Data &dst)
}
}
#ifdef WITH_CONFIG
CtConfig::ModuleTypeCallback* CtAccumulation::_getConfigHandler()
{
return new _ConfigHandler(*this);
}
#endif //WITH_CONFIG
\ No newline at end of file
......@@ -62,6 +62,7 @@ private:
/*----------------------------------------------------------------------
ModuleTypeCallback
----------------------------------------------------------------------*/
#ifdef WITH_CONFIG
class CtAcquisition::_ConfigHandler : public CtConfig::ModuleTypeCallback
{
public:
......@@ -110,6 +111,7 @@ public:
private:
CtAcquisition& m_acq;
};
#endif //WITH_CONFIG
CtAcquisition::CtAcquisition(HwInterface *hw) :
m_acc_nframes(-1),
......@@ -544,10 +546,12 @@ void CtAcquisition::getLatencyTime(double& time) const
DEB_RETURN() << DEB_VAR1(time);
}
#ifdef WITH_CONFIG
CtConfig::ModuleTypeCallback* CtAcquisition::_getConfigHandler()
{
return new _ConfigHandler(*this);
}
#endif //WITH_CONFIG
// ------------------
// struct Parameters
......
......@@ -19,6 +19,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifdef WITH_CONFIG
#ifdef WIN32
#pragma warning( disable : 4290 )
#endif
......@@ -413,3 +414,5 @@ void CtConfig::update(const std::string& alias,
delete this;
}
#endif //WITH_CONFIG
......@@ -957,7 +957,9 @@ CtAccumulation* CtControl::accumulation() { return m_ct_accumulation; }
CtVideo* CtControl::video() { return m_ct_video;}
CtShutter* CtControl::shutter() { return m_ct_shutter; }
CtEvent* CtControl::event() { return m_ct_event; }
#ifdef WITH_CONFIG
CtConfig* CtControl::config() { return m_ct_config; }
#endif
SoftOpExternalMgr* CtControl::externalOperation() {return m_op_ext;}
......
......@@ -417,6 +417,7 @@ void CtMaxImageSizeCB::maxImageSizeChanged(const Size& size, ImageType
// ----------------------------------------------------------------------------
// CLASS _ConfigHandler
// ----------------------------------------------------------------------------
#ifdef WITH_CONFIG
class CtImage::_ConfigHandler : public CtConfig::ModuleTypeCallback
{
public:
......@@ -521,6 +522,7 @@ public:
private:
CtImage& m_image;
};
#endif //WITH_CONFIG
// ----------------------------------------------------------------------------
// CLASS CtImage
// ----------------------------------------------------------------------------
......@@ -1019,7 +1021,9 @@ bool CtImage::applySoft(SoftOpInternalMgr *op)
return sw_is_active;
}
#ifdef WITH_CONFIG
CtConfig::ModuleTypeCallback* CtImage::_getConfigHandler()
{
return new _ConfigHandler(*this);
}
#endif //WITH_CONFIG
\ No newline at end of file
......@@ -393,6 +393,7 @@ private:
CtSaving& m_saving;
};
#ifdef WITH_CONFIG
// --- Config
class CtSaving::_ConfigHandler : public CtConfig::ModuleTypeCallback
{
......@@ -473,6 +474,7 @@ public:
private:
CtSaving& m_saving;
};
#endif //WITH_CONFIG
//@brief constructor
CtSaving::CtSaving(CtControl &aCtrl) :
......@@ -1605,10 +1607,12 @@ void CtSaving::_prepare()
}
}
#ifdef WITH_CONFIG
CtConfig::ModuleTypeCallback* CtSaving::_getConfigHandler()
{
return new _ConfigHandler(*this);
}
#endif //WITH_CONFIG
CtSaving::SaveContainer::SaveContainer(Stream& stream)
: m_written_frames(0), m_stream(stream), m_statistic_size(16),
......
......@@ -112,11 +112,7 @@ void SaveContainerNxs::_writeFile(Data &aData,
//create N4T main object needed to generate Nexus file
DEB_TRACE()<<"SaveContainerNxs::_writeFile() - create the writer";
#ifdef __unix
m_writer = new n4t::BufferedData1D(m_pars.prefix, m_pars.nbframes,m_pars.framesPerFile);
#else
m_writer = new nx::DataStreamer(m_pars.prefix, m_pars.nbframes,m_pars.framesPerFile);
#endif
m_writer = new nxcpp::DataStreamer(m_pars.prefix, (std::size_t)m_pars.nbframes, (std::size_t)m_pars.framesPerFile);
m_writer->Initialize(m_pars.directory, "");
......@@ -148,11 +144,8 @@ void SaveContainerNxs::_writeFile(Data &aData,
//- Display Nexus statistics
#ifdef __unix
n4t::BufferedData::Statistics nxsStats;
#else
nx::DataStreamer::Statistics nxsStats;
#endif
nxcpp::DataStreamer::Statistics nxsStats;
nxsStats = m_writer->GetStatistics();
DEB_TRACE()<<"WrittenBytes = " <<nxsStats.ui64WrittenBytes;
......
//###########################################################################
//
// Copyright (C) 2012 Arafat Noureddine <arafat.noureddine@synchrotron-soleil.fr>
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef CTSAVING_NXS_H
#define CTSAVING_NXS_H
#include <cstdio>
#include <iostream>
#include "CtSaving.h"
#ifdef __unix
#include <nexus4tango.h>
#else
#include "nexuscpp\nexuscpp.h"
namespace nx = nxcpp;
#endif
//--------------------------------------------------------------------------------------------------------------------
namespace lima
{
class SaveContainerNxs : public CtSaving::SaveContainer
{
DEB_CLASS_NAMESPC(DebModControl,"Saving NXS Container","Control");
public:
SaveContainerNxs(CtSaving::Stream& stream);
virtual ~SaveContainerNxs();
protected:
virtual bool _open(const std::string &filename, std::ios_base::openmode flags);
virtual void _close();
virtual void _writeFile(Data &data, CtSaving::HeaderMap &aHeader, CtSaving::FileFormat);
private:
#ifdef __unix
n4t::BufferedData1D* m_writer;
#else
nx::DataStreamer* m_writer;
#endif
CtSaving::Parameters m_pars;
};
}
//--------------------------------------------------------------------------------------------------------------------
#endif // CTSAVING_NXS_H
//###########################################################################
//
// Copyright (C) 2012 Arafat Noureddine <arafat.noureddine@synchrotron-soleil.fr>
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef CTSAVING_NXS_H
#define CTSAVING_NXS_H
#include <cstdio>
#include <iostream>
#include "CtSaving.h"
#include <nexuscpp/nexuscpp.h>
//--------------------------------------------------------------------------------------------------------------------
namespace lima
{
class SaveContainerNxs : public CtSaving::SaveContainer
{
DEB_CLASS_NAMESPC(DebModControl,"Saving NXS Container","Control");
public:
SaveContainerNxs(CtSaving::Stream& stream);
virtual ~SaveContainerNxs();
protected:
virtual bool _open(const std::string &filename, std::ios_base::openmode flags);
virtual void _close();
virtual void _writeFile(Data &data, CtSaving::HeaderMap &aHeader, CtSaving::FileFormat);
private:
nxcpp::DataStreamer* m_writer;
CtSaving::Parameters m_pars;
};
}
//--------------------------------------------------------------------------------------------------------------------
#endif // CTSAVING_NXS_H
......@@ -32,6 +32,7 @@ using namespace lima;
else\
throw LIMA_CTL_EXC(Error, "No shutter capability");
#ifdef WITH_CONFIG
// --- config management
class CtShutter::_ConfigHandler : public CtConfig::ModuleTypeCallback
{
......@@ -65,6 +66,7 @@ public:
private:
CtShutter& m_shutter;
};
#endif //WITH_CONFIG
CtShutter::CtShutter(HwInterface *hw)
{
......@@ -197,6 +199,7 @@ void CtShutter::apply()
}
}
#ifdef WITH_CONFIG
CtConfig::ModuleTypeCallback* CtShutter::_getConfigHandler()
{
if(m_has_shutter)
......@@ -204,3 +207,4 @@ CtConfig::ModuleTypeCallback* CtShutter::_getConfigHandler()
else
return NULL;
}
#endif //WITH_CONFIG
\ No newline at end of file
......@@ -155,6 +155,7 @@ bool CtVideo::_InternalImageCBK::newImage(char * data,int width,int height,Video
}
return true;
}
#ifdef WITH_CONFIG
// --- _ConfigHandler
class CtVideo::_ConfigHandler : public CtConfig::ModuleTypeCallback
{
......@@ -229,6 +230,8 @@ public:
private:
CtVideo& m_video;
};
#endif //WITH_CONFIG