Commit 0ad166b7 authored by Yuelong Yu's avatar Yuelong Yu
Browse files

split agipd agipdmaster agipdmc

parent b890abb3
BUILD_PATH = ../build
PACKAGE_NAME = AGIPD
MAJOR_VERS = 1
MINOR_VERS = 0
RELEASE = Release_$(MAJOR_VERS)_$(MINOR_VERS)
#===============================================================================
all: lmbdtango agipdtango
RELEASE_TYPE = -g
lmbdtango:
@mkdir -p $(BUILD_PATH)/Lambda
@cd ./lambda/ && $(MAKE) -j4
@cp -r ../liblambda/config ../bin/
#=============================================================================
# OUTPUT_TYPE can be one of the following :
# - 'STATIC_LIB' for a static library (.a)
# - 'SHARED_LIB' for a dynamic library (.so)
# - 'DEVICE' for a device server (will automatically include and link
# with Tango dependencies)
# - 'SIMPLE_EXE' for an executable with no dependency (for exemple the test tool
# of a library with no Tango dependencies)
#
#OUTPUT_TYPE = DEVICE
agipdtango:
@mkdir -p $(BUILD_PATH)/AGIPD
@cd ./agipd/ && $(MAKE) -j4
@cp -r ../libagipd/pattern ../bin/
#OUTPUT_DIR = ./bin/$(PACKAGE_NAME)
cleanlambda:
rm -rf ../bin/Lambda $(BUILD_PATH)/Lambda
#OBJS_DIR = obj
BUILD = build
OBJS_DIR = ../../$(BUILD)/$(PACKAGE_NAME)/
BIN_DIR = ../../bin
cleanagipd:
rm -rf ../bin/AGIPD $(BUILD_PATH)/AGIPD
help:
@echo "compile lambda tango: make lmbdtango"
@echo "compile agipd tango: make agipdtango"
\ No newline at end of file
LIB_PNIIO_CONFIG = $(shell pkg-config --libs pniio)
CPPFLAGS_PNIIO_CONFIG = $(shell pkg-config --cflags pniio)
LIBS_AGIPD_CONFIG = $(shell pkg-config --libs agipd)
CPPFLAGS_AGIPD_CONFIG = $(shell pkg-config --cflags agipd)
# ifndef _ARCH
# _ARCH = $(shell uname -m)
# endif
# ifeq ($(_ARCH), x86_64)
# libdir=lib64
# else
# libdir=lib
# endif
libdir = lib
INC_DIR_USER= -I/usr/include/tango \
-I/usr/include \
-I.
LIB_DIR_USER= -L /usr/$(libdir)
LFLAGS_USR= $(RELEASE_TYPE) -Wall $(LIB_DIR_USER) \
$(LIB_PNIIO_CONFIG) \
$(LIBS_AGIPD_CONFIG) \
-ltango \
-llog4tango \
-lCOS4\
-lomniORB4 \
-lomniDynamic4 \
-lomnithread \
-ldl \
-lpthread \
-lstdc++ \
-lhdf5_hl
#used for time measurement during compression mode
#CXXFLAGS_USR =-O2 -DTIMEMEASUREMENT -std=c++0x $(RELEASE_TYPE) -D_REENTRANT \
$(CPPFLAGS_PNIIO_CONFIG) $(INC_DIR_USER)
CXXFLAGS_USR =-O3 -std=c++11 -Wall $(RELEASE_TYPE) -D_REENTRANT \
$(CPPFLAGS_PNIIO_CONFIG) $(INC_DIR_USER) $(CPPFLAGS_AGIPD_CONFIG)
SVC_INC = $(PACKAGE_NAME).h $(PACKAGE_NAME)Class.h \
DetectorSimulation.h \
AcquisitionThread.h \
NXFileWriter.h \
NXWrapper.h
SVC_OBJS = $(OBJS_DIR)/main.o \
$(OBJS_DIR)/ClassFactory.o \
$(OBJS_DIR)/$(PACKAGE_NAME)StateMachine.o \
$(OBJS_DIR)/$(PACKAGE_NAME)Class.o \
$(OBJS_DIR)/$(PACKAGE_NAME).o \
$(OBJS_DIR)/DetectorSimulation.o
$(OBJS_DIR)/%.o: %.cpp $(SVC_INC)
$(CXX) $(CXXFLAGS_USR) -c $< -o $(OBJS_DIR)/$*.o
all:$(PACKAGE_NAME)
$(PACKAGE_NAME): $(SVC_OBJS)
$(CXX) $(SVC_OBJS) -o $(BIN_DIR)/$(PACKAGE_NAME) $(LFLAGS_USR)
PACKAGE_NAME = AGIPD
MAJOR_VERS = 1
MINOR_VERS = 0
RELEASE = Release_$(MAJOR_VERS)_$(MINOR_VERS)
#===============================================================================
RELEASE_TYPE = -g
#=============================================================================
# OUTPUT_TYPE can be one of the following :
# - 'STATIC_LIB' for a static library (.a)
# - 'SHARED_LIB' for a dynamic library (.so)
# - 'DEVICE' for a device server (will automatically include and link
# with Tango dependencies)
# - 'SIMPLE_EXE' for an executable with no dependency (for exemple the test tool
# of a library with no Tango dependencies)
#
#OUTPUT_TYPE = DEVICE
#OUTPUT_DIR = ./bin/$(PACKAGE_NAME)
#OBJS_DIR = obj
BUILD = build
OBJS_DIR = ../../$(BUILD)/$(PACKAGE_NAME)/
BIN_DIR = ../../bin
LIB_PNIIO_CONFIG = $(shell pkg-config --libs pniio)
CPPFLAGS_PNIIO_CONFIG = $(shell pkg-config --cflags pniio)
LIBS_AGIPD_CONFIG = $(shell pkg-config --libs agipd)
CPPFLAGS_AGIPD_CONFIG = $(shell pkg-config --cflags agipd)
# ifndef _ARCH
# _ARCH = $(shell uname -m)
# endif
# ifeq ($(_ARCH), x86_64)
# libdir=lib64
# else
# libdir=lib
# endif
libdir = lib
INC_DIR_USER= -I/usr/include/tango \
-I/usr/include \
-I.
LIB_DIR_USER= -L /usr/$(libdir)
LFLAGS_USR= $(RELEASE_TYPE) -Wall $(LIB_DIR_USER) \
$(LIB_PNIIO_CONFIG) \
$(LIBS_AGIPD_CONFIG) \
-ltango \
-llog4tango \
-lCOS4\
-lomniORB4 \
-lomniDynamic4 \
-lomnithread \
-ldl \
-lpthread \
-lstdc++ \
-lhdf5_hl
#used for time measurement during compression mode
#CXXFLAGS_USR =-O2 -DTIMEMEASUREMENT -std=c++0x $(RELEASE_TYPE) -D_REENTRANT \
$(CPPFLAGS_PNIIO_CONFIG) $(INC_DIR_USER)
CXXFLAGS_USR =-O3 -std=c++11 -Wall $(RELEASE_TYPE) -D_REENTRANT \
$(CPPFLAGS_PNIIO_CONFIG) $(INC_DIR_USER) $(CPPFLAGS_AGIPD_CONFIG)
SVC_INC = $(PACKAGE_NAME).h $(PACKAGE_NAME)Class.h \
DetectorSimulation.h \
AcquisitionThread.h \
NXFileWriter.h \
NXWrapper.h
SVC_OBJS = $(OBJS_DIR)/main.o \
$(OBJS_DIR)/ClassFactory.o \
$(OBJS_DIR)/$(PACKAGE_NAME)StateMachine.o \
$(OBJS_DIR)/$(PACKAGE_NAME)Class.o \
$(OBJS_DIR)/$(PACKAGE_NAME).o \
$(OBJS_DIR)/DetectorSimulation.o
$(OBJS_DIR)/%.o: %.cpp $(SVC_INC)
$(CXX) $(CXXFLAGS_USR) -c $< -o $(OBJS_DIR)/$*.o
all:$(PACKAGE_NAME)
$(PACKAGE_NAME): $(SVC_OBJS)
$(CXX) $(SVC_OBJS) -o $(BIN_DIR)/$(PACKAGE_NAME) $(LFLAGS_USR)
This diff is collapsed.
/*----- PROTECTED REGION ID(AGIPDMaster.h) ENABLED START -----*/
//=============================================================================
//
// file : AGIPDMaster.h
//
// description : Include for the AGIPDMaster class.
//
// project : AGIPD.
//
// $Author: $
//
// $Revision: $
// $Date: $
//
// SVN only:
// $HeadURL: $
//
// CVS only:
// $Source: $
// $Log: $
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef AGIPDMASTER_H
#define AGIPDMASTER_H
#include <tango.h>
#include <set>
/*----- PROTECTED REGION END -----*/ // AGIPDMaster.h
/**
* AGIPDMaster class description:
* AGIPD master tango server
*/
namespace AGIPDMaster_ns
{
/*----- PROTECTED REGION ID(AGIPDMaster::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
/*----- PROTECTED REGION END -----*/ // AGIPDMaster::Additional Class Declarations
class AGIPDMaster : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(AGIPDMaster::Data Members) ENABLED START -----*/
// Add your own data members
string m_strMsg;
Tango::DevState m_stateDetLatest;
vector<Tango::DeviceProxy*> m_vobjDP;
vector<string> m_vDevName;
omni_thread* m_thAcq;
omni_mutex m_mtxAcq;
public:
bool m_bSysExit;
bool m_bStartAcq;
long m_lLatestImgNo;
/*----- PROTECTED REGION END -----*/ // AGIPDMaster::Data Members
// Device property data members
public:
// SimulationMode:
Tango::DevUShort simulationMode;
// DebugMode:
Tango::DevUShort debugMode;
// UDPMode:
Tango::DevUShort uDPMode;
// SubDevices:
vector<string> subDevices;
// Attribute data members
public:
Tango::DevUShort *attr_ADCLatency_read;
Tango::DevUShort *attr_ADCTrigger_read;
Tango::DevString *attr_ASICCS_read;
Tango::DevString *attr_ASICPS_read;
Tango::DevULong *attr_IntegrationTime_read;
Tango::DevString *attr_SaveFilePath_read;
Tango::DevString *attr_SaveFileName_read;
Tango::DevULong *attr_FrameNumbers_read;
Tango::DevUShort *attr_IntegrationOffset_read;
Tango::DevULong *attr_LatestImageNumber_read;
Tango::DevBoolean *attr_LiveMode_read;
Tango::DevString *attr_PatternFile_read;
Tango::DevBoolean *attr_SaveAllImages_read;
Tango::DevULong *attr_LiveFrameNoDigital_read;
Tango::DevULong *attr_LiveFrameNoAnalog_read;
Tango::DevBoolean *attr_CompressionEnabled_read;
Tango::DevBoolean *attr_CompressorShuffle_read;
Tango::DevULong *attr_CompressionRate_read;
Tango::DevBoolean *attr_FileSplitEnabled_read;
Tango::DevULong *attr_FileSizeLimit_read;
Tango::DevULong *attr_ChunkSize_read;
Tango::DevULong *attr_TotalLossFrames_read;
Tango::DevString *attr_FilePrefix_read;
Tango::DevLong *attr_FileStartNum_read;
Tango::DevString *attr_FilePostfix_read;
Tango::DevString *attr_Mask_read;
Tango::DevString *attr_BunchStructureFile_read;
Tango::DevUShort *attr_TriggerMode_read;
Tango::DevULong *attr_FramesPerFile_read;
Tango::DevString *attr_MicroController_read;
Tango::DevShort *attr_LiveDataAnalog_read;
Tango::DevShort *attr_LiveDataDigital_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
AGIPDMaster(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
AGIPDMaster(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
AGIPDMaster(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~AGIPDMaster() {delete_device();};
// Miscellaneous methods
public:
/*
* will be called at device destruction or at init command.
*/
void delete_device();
/*
* Initialize the device
*/
virtual void init_device();
/*
* Read the device properties from database
*/
void get_device_property();
/*
* Always executed method before execution command method.
*/
virtual void always_executed_hook();
// Attribute methods
public:
//--------------------------------------------------------
/*
* Method : AGIPDMaster::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(vector<long> &attr_list);
//--------------------------------------------------------
/*
* Method : AGIPDMaster::write_attr_hardware()
* Description : Hardware writing for attributes.
*/
//--------------------------------------------------------
virtual void write_attr_hardware(vector<long> &attr_list);
/**
* Attribute ADCLatency related methods
* Description: adc latency
*
* Data type: Tango::DevUShort
* Attr type: Scalar
*/
virtual void read_ADCLatency(Tango::Attribute &attr);
virtual void write_ADCLatency(Tango::WAttribute &attr);
virtual bool is_ADCLatency_allowed(Tango::AttReqType type);
/**
* Attribute ADCTrigger related methods
* Description: adc trigger
*
* Data type: Tango::DevUShort
* Attr type: Scalar
*/
virtual void read_ADCTrigger(Tango::Attribute &attr);
virtual void write_ADCTrigger(Tango::WAttribute &attr);
virtual bool is_ADCTrigger_allowed(Tango::AttReqType type);
/**
* Attribute ASICCS related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_ASICCS(Tango::Attribute &attr);
virtual void write_ASICCS(Tango::WAttribute &attr);
virtual bool is_ASICCS_allowed(Tango::AttReqType type);
/**
* Attribute ASICPS related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_ASICPS(Tango::Attribute &attr);
virtual void write_ASICPS(Tango::WAttribute &attr);
virtual bool is_ASICPS_allowed(Tango::AttReqType type);
/**
* Attribute IntegrationTime related methods
* Description: Number of bunches to integrate(quantized intergration time).
* This attribute depends on the firmware frequency.
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_IntegrationTime(Tango::Attribute &attr);
virtual void write_IntegrationTime(Tango::WAttribute &attr);
virtual bool is_IntegrationTime_allowed(Tango::AttReqType type);
/**
* Attribute SaveFilePath related methods
* Description: path to save image files
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_SaveFilePath(Tango::Attribute &attr);
virtual void write_SaveFilePath(Tango::WAttribute &attr);
virtual bool is_SaveFilePath_allowed(Tango::AttReqType type);
/**
* Attribute SaveFileName related methods
* Description: saving file name
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_SaveFileName(Tango::Attribute &attr);
virtual bool is_SaveFileName_allowed(Tango::AttReqType type);
/**
* Attribute FrameNumbers related methods
* Description: number of frames to be taken
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_FrameNumbers(Tango::Attribute &attr);
virtual void write_FrameNumbers(Tango::WAttribute &attr);
virtual bool is_FrameNumbers_allowed(Tango::AttReqType type);
/**
* Attribute IntegrationOffset related methods
* Description: integration offset
*
* Data type: Tango::DevUShort
* Attr type: Scalar
*/
virtual void read_IntegrationOffset(Tango::Attribute &attr);
virtual void write_IntegrationOffset(Tango::WAttribute &attr);
virtual bool is_IntegrationOffset_allowed(Tango::AttReqType type);
/**
* Attribute LatestImageNumber related methods
* Description: latested arrived image number
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_LatestImageNumber(Tango::Attribute &attr);
virtual bool is_LatestImageNumber_allowed(Tango::AttReqType type);
/**
* Attribute LiveMode related methods
* Description: enable online visualization
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_LiveMode(Tango::Attribute &attr);
virtual void write_LiveMode(Tango::WAttribute &attr);
virtual bool is_LiveMode_allowed(Tango::AttReqType type);
/**
* Attribute PatternFile related methods
* Description: The path of pattern file.
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_PatternFile(Tango::Attribute &attr);
virtual void write_PatternFile(Tango::WAttribute &attr);
virtual bool is_PatternFile_allowed(Tango::AttReqType type);
/**
* Attribute SaveAllImages related methods
* Description:
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_SaveAllImages(Tango::Attribute &attr);
virtual void write_SaveAllImages(Tango::WAttribute &attr);
virtual bool is_SaveAllImages_allowed(Tango::AttReqType type);
/**
* Attribute LiveFrameNoDigital related methods
* Description: frame number of currently displayed digital data
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_LiveFrameNoDigital(Tango::Attribute &attr);
virtual bool is_LiveFrameNoDigital_allowed(Tango::AttReqType type);
/**
* Attribute LiveFrameNoAnalog related methods
* Description: frame number of currently displayed analog data
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_LiveFrameNoAnalog(Tango::Attribute &attr);
virtual bool is_LiveFrameNoAnalog_allowed(Tango::AttReqType type);
/**
* Attribute CompressionEnabled related methods
* Description: compression is enabled or not
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_CompressionEnabled(Tango::Attribute &attr);
virtual void write_CompressionEnabled(Tango::WAttribute &attr);
virtual bool is_CompressionEnabled_allowed(Tango::AttReqType type);
/**
* Attribute CompressorShuffle related methods
* Description: if compressor shuffle is enabled
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_CompressorShuffle(Tango::Attribute &attr);
virtual void write_CompressorShuffle(Tango::WAttribute &attr);
virtual bool is_CompressorShuffle_allowed(Tango::AttReqType type);
/**
* Attribute CompressionRate related methods
* Description:
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_CompressionRate(Tango::Attribute &attr);
virtual void write_CompressionRate(Tango::WAttribute &attr);
virtual bool is_CompressionRate_allowed(Tango::AttReqType type);
/**
* Attribute FileSplitEnabled related methods
* Description: When file exceeds the limit size. It will be automatically splitted.
* If this is enabled. Please check the file size limit as well.
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_FileSplitEnabled(Tango::Attribute &attr);
virtual void write_FileSplitEnabled(Tango::WAttribute &attr);
virtual bool is_FileSplitEnabled_allowed(Tango::AttReqType type);
/**
* Attribute FileSizeLimit related methods
* Description: limit of file size. This is used when the file split is enabled
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_FileSizeLimit(Tango::Attribute &attr);
virtual void write_FileSizeLimit(Tango::WAttribute &attr);
virtual bool is_FileSizeLimit_allowed(Tango::AttReqType type);
/**
* Attribute ChunkSize related methods
* Description: size of chunk when writting data to disk.
* By default, chunk size is 1 frame
*
* Data type: Tango::DevULong
* Attr type: Scalar
*/
virtual void read_ChunkSize(Tango::Attribute &attr);
virtual void write_ChunkSize(Tango::WAttribute &attr);
virtual bool is_ChunkSize_allowed(Tango::AttReqType type);
/**
* Attribute TotalLossFrames related methods
* Description: loss frames during transmission
*
* Data type: Tango::DevULong