Commit 3c04098e authored by Marco De Marco's avatar Marco De Marco
Browse files

Initial import

parents
Loading
Loading
Loading
Loading

Makefile

0 → 100644
+59 −0
Original line number Diff line number Diff line
#================================================================================
EXEC_NAME := fitsImporter-srv
INST_NAME := fitsImporter-test
DEBUG := -v5
INC_DIR := /usr/local/omniORB-4.1.7/include \
	   /usr/local/zeromq-3.2.3/include/zmq \
	   /usr/local/tango-8.1.2/include/tango \
	   ./src
LIB_DIR := /usr/local/omniORB-4.1.7/lib \
	   /usr/local/zeromq-3.2.3/lib \
	   /usr/local/tango-8.1.2/lib
#================================================================================
CC :=g++
DEBUG :=-g
CXXFLAGS :=-c -Wall -std=c++11 -std=gnu++11
LDFLAGS :=-Wall -lomniORB4 -lomniDynamic4 -lCOS4 -lomnithread -ltango -llog4tango
INC_PARM := $(foreach d, $(INC_DIR), -I$d)
LIB_PARM := $(foreach d, $(LIB_DIR), -L$d)
#================================================================================
SRC_DIR :=./src
OBJ_DIR :=./obj
BIN_DIR :=./bin
#================================================================================
EXECUTABLE := $(BIN_DIR)/$(EXEC_NAME)
CPP_FILES := $(wildcard $(SRC_DIR)/*.cpp)
OBJ_FILES := $(addprefix $(OBJ_DIR)/,$(notdir $(CPP_FILES:.cpp=.o)))
#================================================================================

all: $(EXECUTABLE)

run: $(EXECUTABLE)
	$(EXECUTABLE)

$(EXECUTABLE): makedir $(OBJ_FILES)
	$(CC) $(LDFLAGS) $(LIB_PARM) -o $@ $(OBJ_FILES)

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
	$(CC) $(CXXFLAGS) $(INC_PARM) -o $@ $<

.PHONY: makedir 
makedir:
	-mkdir -p $(OBJ_DIR) $(BIN_DIR)

.PHONY: clean
clean:
	-rm -rf $(OBJ_DIR) $(BIN_DIR)

.PHONY: echo
echo:
	@echo EXECUTABLE:
	@echo $(EXECUTABLE)
	@echo CPP FILES:
	@echo $(CPP_FILES)
	@echo OBJ_FILES:
	@echo $(OBJ_FILES)
	@echo INC_PARM
	@echo $(INC_PARM)
	@echo LIB_PARM
	@echo $(LIB_PARM)

src/ClassFactory.cpp

0 → 100644
+56 −0
Original line number Diff line number Diff line
/*----- PROTECTED REGION ID(FitsImporter::ClassFactory.cpp) ENABLED START -----*/
static const char *RcsId = "$Id:  $";
//=============================================================================
//
// file :        ClassFactory.cpp
//
// description : C++ source for the class_factory method of the DServer
//               device class. This method is responsible for the creation of
//               all class singleton for a device server. It is called
//               at device server startup.
//
// project :     Fits importer device server
//
// This file is part of Tango device class.
// 
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Tango 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 Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
// 
// $Author:  $
//
// $Revision:  $
// $Date:  $
//
// $HeadURL:  $
//
//=============================================================================
//                This file is generated by POGO
//        (Program Obviously used to Generate tango Object)
//=============================================================================

#include <tango.h>
#include <FitsImporterClass.h>

//	Add class header files if needed


/**
 *	Create FitsImporter Class singleton and store it in DServer object.
 */

void Tango::DServer::class_factory()
{
	//	Add method class init if needed
	add_class(FitsImporter_ns::FitsImporterClass::init("FitsImporter"));
}
/*----- PROTECTED REGION END -----*/	//	FitsImporter::ClassFactory.cpp

src/FitsImporter.cpp

0 → 100644
+207 −0
Original line number Diff line number Diff line
/*----- PROTECTED REGION ID(FitsImporter.cpp) ENABLED START -----*/
static const char *RcsId = "$Id:  $";
//=============================================================================
//
// file :        FitsImporter.cpp
//
// description : C++ source for the FitsImporter class and its commands.
//               The class is derived from Device. It represents the
//               CORBA servant object which will be accessed from the
//               network. All commands which can be executed on the
//               FitsImporter are implemented in this file.
//
// project :     Fits importer device server
//
// This file is part of Tango device class.
// 
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Tango 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 Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
// 
// $Author:  $
//
// $Revision:  $
// $Date:  $
//
// $HeadURL:  $
//
//=============================================================================
//                This file is generated by POGO
//        (Program Obviously used to Generate tango Object)
//=============================================================================


#include <FitsImporter.h>
#include <FitsImporterClass.h>

/*----- PROTECTED REGION END -----*/	//	FitsImporter.cpp

/**
 *  FitsImporter class description:
 *    Fits importer device server
 */

//================================================================
//  The following table gives the correspondence
//  between command and method names.
//
//  Command name  |  Method name
//================================================================
//  State         |  Inherited (no method)
//  Status        |  Inherited (no method)
//================================================================

//================================================================
//  Attributes managed is:
//================================================================
//================================================================

namespace FitsImporter_ns
{
/*----- PROTECTED REGION ID(FitsImporter::namespace_starting) ENABLED START -----*/

//	static initializations

/*----- PROTECTED REGION END -----*/	//	FitsImporter::namespace_starting

//--------------------------------------------------------
/**
 *	Method      : FitsImporter::FitsImporter()
 *	Description : Constructors for a Tango device
 *                implementing the classFitsImporter
 */
//--------------------------------------------------------
FitsImporter::FitsImporter(Tango::DeviceClass *cl, string &s)
 : TANGO_BASE_CLASS(cl, s.c_str())
{
	/*----- PROTECTED REGION ID(FitsImporter::constructor_1) ENABLED START -----*/
	init_device();
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::constructor_1
}
//--------------------------------------------------------
FitsImporter::FitsImporter(Tango::DeviceClass *cl, const char *s)
 : TANGO_BASE_CLASS(cl, s)
{
	/*----- PROTECTED REGION ID(FitsImporter::constructor_2) ENABLED START -----*/
	init_device();
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::constructor_2
}
//--------------------------------------------------------
FitsImporter::FitsImporter(Tango::DeviceClass *cl, const char *s, const char *d)
 : TANGO_BASE_CLASS(cl, s, d)
{
	/*----- PROTECTED REGION ID(FitsImporter::constructor_3) ENABLED START -----*/
	init_device();
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::constructor_3
}

//--------------------------------------------------------
/**
 *	Method      : FitsImporter::delete_device()
 *	Description : will be called at device destruction or at init command
 */
//--------------------------------------------------------
void FitsImporter::delete_device()
{
	DEBUG_STREAM << "FitsImporter::delete_device() " << device_name << endl;
	/*----- PROTECTED REGION ID(FitsImporter::delete_device) ENABLED START -----*/
	
	//	Delete device allocated objects
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::delete_device
}

//--------------------------------------------------------
/**
 *	Method      : FitsImporter::init_device()
 *	Description : will be called at device initialization.
 */
//--------------------------------------------------------
void FitsImporter::init_device()
{
	DEBUG_STREAM << "FitsImporter::init_device() create device " << device_name << endl;
	/*----- PROTECTED REGION ID(FitsImporter::init_device_before) ENABLED START -----*/
	
	//	Initialization before get_device_property() call
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::init_device_before
	
	//	No device property to be read from database
	

	/*----- PROTECTED REGION ID(FitsImporter::init_device) ENABLED START -----*/
	
	//	Initialize device
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::init_device
}


//--------------------------------------------------------
/**
 *	Method      : FitsImporter::always_executed_hook()
 *	Description : method always executed before any command is executed
 */
//--------------------------------------------------------
void FitsImporter::always_executed_hook()
{
	INFO_STREAM << "FitsImporter::always_executed_hook()  " << device_name << endl;
	/*----- PROTECTED REGION ID(FitsImporter::always_executed_hook) ENABLED START -----*/
	
	//	code always executed before all requests
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::always_executed_hook
}

//--------------------------------------------------------
/**
 *	Method      : FitsImporter::read_attr_hardware()
 *	Description : Hardware acquisition for attributes
 */
//--------------------------------------------------------
void FitsImporter::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
{
	DEBUG_STREAM << "FitsImporter::read_attr_hardware(vector<long> &attr_list) entering... " << endl;
	/*----- PROTECTED REGION ID(FitsImporter::read_attr_hardware) ENABLED START -----*/
	
	//	Add your own code
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::read_attr_hardware
}


//--------------------------------------------------------
/**
 *	Method      : FitsImporter::add_dynamic_attributes()
 *	Description : Create the dynamic attributes if any
 *                for specified device.
 */
//--------------------------------------------------------
void FitsImporter::add_dynamic_attributes()
{
	/*----- PROTECTED REGION ID(FitsImporter::add_dynamic_attributes) ENABLED START -----*/
	
	//	Add your own code to create and add dynamic attributes if any
	
	/*----- PROTECTED REGION END -----*/	//	FitsImporter::add_dynamic_attributes
}


/*----- PROTECTED REGION ID(FitsImporter::namespace_ending) ENABLED START -----*/

//	Additional Methods

/*----- PROTECTED REGION END -----*/	//	FitsImporter::namespace_ending
} //	namespace

src/FitsImporter.h

0 → 100644
+156 −0
Original line number Diff line number Diff line
/*----- PROTECTED REGION ID(FitsImporter.h) ENABLED START -----*/
//=============================================================================
//
// file :        FitsImporter.h
//
// description : Include file for the FitsImporter class
//
// project :     Fits importer device server
//
// This file is part of Tango device class.
// 
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Tango 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 Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
// 
// $Author:  $
//
// $Revision:  $
// $Date:  $
//
// $HeadURL:  $
//
//=============================================================================
//                This file is generated by POGO
//        (Program Obviously used to Generate tango Object)
//=============================================================================


#ifndef FitsImporter_H
#define FitsImporter_H

#include <tango.h>


/*----- PROTECTED REGION END -----*/	//	FitsImporter.h

/**
 *  FitsImporter class description:
 *    Fits importer device server
 */

namespace FitsImporter_ns
{
/*----- PROTECTED REGION ID(FitsImporter::Additional Class Declarations) ENABLED START -----*/

//	Additional Class Declarations

/*----- PROTECTED REGION END -----*/	//	FitsImporter::Additional Class Declarations

class FitsImporter : public TANGO_BASE_CLASS
{

/*----- PROTECTED REGION ID(FitsImporter::Data Members) ENABLED START -----*/

//	Add your own data members

/*----- PROTECTED REGION END -----*/	//	FitsImporter::Data Members



//	Constructors and destructors
public:
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	FitsImporter(Tango::DeviceClass *cl,string &s);
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	FitsImporter(Tango::DeviceClass *cl,const char *s);
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device name
	 *	@param d	Device description.
	 */
	FitsImporter(Tango::DeviceClass *cl,const char *s,const char *d);
	/**
	 * The device object destructor.
	 */	
	~FitsImporter() {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();
	/*
	 *	Always executed method before execution command method.
	 */
	virtual void always_executed_hook();


//	Attribute methods
public:
	//--------------------------------------------------------
	/*
	 *	Method      : FitsImporter::read_attr_hardware()
	 *	Description : Hardware acquisition for attributes.
	 */
	//--------------------------------------------------------
	virtual void read_attr_hardware(vector<long> &attr_list);


	//--------------------------------------------------------
	/**
	 *	Method      : FitsImporter::add_dynamic_attributes()
	 *	Description : Add dynamic attributes if any.
	 */
	//--------------------------------------------------------
	void add_dynamic_attributes();



//	Command related methods
public:


/*----- PROTECTED REGION ID(FitsImporter::Additional Method prototypes) ENABLED START -----*/

//	Additional Method prototypes

/*----- PROTECTED REGION END -----*/	//	FitsImporter::Additional Method prototypes
};

/*----- PROTECTED REGION ID(FitsImporter::Additional Classes Definitions) ENABLED START -----*/

//	Additional Classes Definitions

/*----- PROTECTED REGION END -----*/	//	FitsImporter::Additional Classes Definitions

}	//	End of namespace

#endif   //	FitsImporter_H

src/FitsImporter.xmi

0 → 100644
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
  <classes name="FitsImporter" pogoRevision="8.1">
    <description description="Fits importer device server" title="Fits importer device server" sourcePath="/home/mdm/workspace/nadir/fitsimporter" language="Cpp" filestogenerate="XMI   file,Code files" license="LGPL" hasMandatoryProperty="false" hasConcreteProperty="false" hasAbstractCommand="false" hasAbstractAttribute="false">
      <inheritances classname="Device_Impl" sourcePath=""/>
      <identification contact="at oats.inaf.it - demarco" author="demarco" emailDomain="oats.inaf.it" classFamily="Acquisition" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference=""/>
    </description>
    <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="none">
        <type xsi:type="pogoDsl:VoidType"/>
      </argin>
      <argout description="Device state">
        <type xsi:type="pogoDsl:StateType"/>
      </argout>
      <status abstract="true" inherited="true" concrete="true"/>
    </commands>
    <commands name="Status" description="This command gets the device status (stored in its device_status data member) and returns it to the caller." execMethod="dev_status" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="none">
        <type xsi:type="pogoDsl:VoidType"/>
      </argin>
      <argout description="Device status">
        <type xsi:type="pogoDsl:ConstStringType"/>
      </argout>
      <status abstract="true" inherited="true" concrete="true"/>
    </commands>
    <preferences docHome="./doc_html" makefileHome="/usr/local/tango-8.1.2/share/pogo/preferences"/>
  </classes>
</pogoDsl:PogoSystem>