Commit d246fe24 authored by Marco De Marco's avatar Marco De Marco
Browse files

Initial import

parents
Loading
Loading
Loading
Loading

Makefile

0 → 100644
+77 −0
Original line number Diff line number Diff line
#================================================================================
EXEC_NAME=preProcessor-srv
INST_NAME=test
DEBUG_LEV=-v1
INSTALL_DIR=/usr/local/bin
#================================================================================
INC_DIR=/usr/local/omniORB/include \
	   /usr/local/zeromq/include/zmq \
	   /usr/local/tango/include/tango \
	   ./src
LIB_DIR=/usr/local/omniORB/lib \
	   /usr/local/zeromq/lib \
	   /usr/local/tango/lib
#================================================================================
CC=g++
CXX_DEBUG_FLAGS=-g -DVERBOSE_DEBUG
CXX_RELEASE_FLAGS=-O3
CXX_DEFAULT_FLAGS=-c -Wall -Wextra -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)))
#================================================================================

.PHONY: all
all: debug 

.PHONY: run
run: debug
	$(EXECUTABLE) $(INST_NAME) $(DEBUG_LEV)

.PHONY: release
release: CXXFLAGS+=$(CXX_RELEASE_FLAGS) $(CXX_DEFAULT_FLAGS)
release: $(EXECUTABLE)

.PHONY: debug
debug: CXXFLAGS+=$(CXX_DEBUG_FLAGS) $(CXX_DEFAULT_FLAGS)
debug: $(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: install
install:
	-cp $(EXECUTABLE) $(INSTALL_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(PreProcessor::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 :     PreProcessor
//
// 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 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 General Public License for more details.
// 
// You should have received a copy of the GNU 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 <PreProcessorClass.h>

//	Add class header files if needed


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

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

src/PreProcessor.cpp

0 → 100644
+240 −0
Original line number Diff line number Diff line
/*----- PROTECTED REGION ID(PreProcessor.cpp) ENABLED START -----*/
//=============================================================================
//
// file :        PreProcessor.cpp
//
// description : C++ source for the PreProcessor 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
//               PreProcessor are implemented in this file.
//
// project :     PreProcessor
//
// 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 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 General Public License for more details.
// 
// You should have received a copy of the GNU 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 <PreProcessor.h>
#include <PreProcessorClass.h>

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

/**
 *  PreProcessor class description:
 *    Pre proccesing generic server
 */

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

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

namespace PreProcessor_ns
{
/*----- PROTECTED REGION ID(PreProcessor::namespace_starting) ENABLED START -----*/

//	static initializations

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

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

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

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

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


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

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


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

//--------------------------------------------------------
/**
 *	Command On related method
 *	Description: 
 *
 */
//--------------------------------------------------------
void PreProcessor::on()
{
	DEBUG_STREAM << "PreProcessor::On()  - " << device_name << endl;
	/*----- PROTECTED REGION ID(PreProcessor::on) ENABLED START -----*/
	
	//	Add your own code
	
	/*----- PROTECTED REGION END -----*/	//	PreProcessor::on
}
//--------------------------------------------------------
/**
 *	Command Off related method
 *	Description: 
 *
 */
//--------------------------------------------------------
void PreProcessor::off()
{
	DEBUG_STREAM << "PreProcessor::Off()  - " << device_name << endl;
	/*----- PROTECTED REGION ID(PreProcessor::off) ENABLED START -----*/
	
	//	Add your own code
	
	/*----- PROTECTED REGION END -----*/	//	PreProcessor::off
}

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

//	Additional Methods

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

src/PreProcessor.h

0 → 100644
+170 −0
Original line number Diff line number Diff line
/*----- PROTECTED REGION ID(PreProcessor.h) ENABLED START -----*/
//=============================================================================
//
// file :        PreProcessor.h
//
// description : Include file for the PreProcessor class
//
// project :     PreProcessor
//
// 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 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 General Public License for more details.
// 
// You should have received a copy of the GNU 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 PreProcessor_H
#define PreProcessor_H

#include <tango.h>


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

/**
 *  PreProcessor class description:
 *    Pre proccesing generic server
 */

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

//	Additional Class Declarations

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

class PreProcessor : public TANGO_BASE_CLASS
{

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

//	Add your own data members

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



//	Constructors and destructors
public:
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	PreProcessor(Tango::DeviceClass *cl,string &s);
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device Name
	 */
	PreProcessor(Tango::DeviceClass *cl,const char *s);
	/**
	 * Constructs a newly device object.
	 *
	 *	@param cl	Class.
	 *	@param s 	Device name
	 *	@param d	Device description.
	 */
	PreProcessor(Tango::DeviceClass *cl,const char *s,const char *d);
	/**
	 * The device object destructor.
	 */	
	~PreProcessor() {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      : PreProcessor::read_attr_hardware()
	 *	Description : Hardware acquisition for attributes.
	 */
	//--------------------------------------------------------
	virtual void read_attr_hardware(vector<long> &attr_list);


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



//	Command related methods
public:
	/**
	 *	Command On related method
	 *	Description: 
	 *
	 */
	virtual void on();
	virtual bool is_On_allowed(const CORBA::Any &any);
	/**
	 *	Command Off related method
	 *	Description: 
	 *
	 */
	virtual void off();
	virtual bool is_Off_allowed(const CORBA::Any &any);


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

//	Additional Method prototypes

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

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

//	Additional Classes Definitions

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

}	//	End of namespace

#endif   //	PreProcessor_H

src/PreProcessor.xmi

0 → 100644
+52 −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="PreProcessor" pogoRevision="8.1">
    <description description="Pre proccesing generic server" title="PreProcessor" sourcePath="/home/mdm/workspace/nadir/pre_precessor/src" language="Cpp" filestogenerate="XMI   file,Code files" license="GPL" 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>
    <commands name="On" description="" execMethod="on" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="">
        <type xsi:type="pogoDsl:VoidType"/>
      </argin>
      <argout description="">
        <type xsi:type="pogoDsl:VoidType"/>
      </argout>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </commands>
    <commands name="Off" description="" execMethod="off" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="">
        <type xsi:type="pogoDsl:VoidType"/>
      </argin>
      <argout description="">
        <type xsi:type="pogoDsl:VoidType"/>
      </argout>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </commands>
    <states name="ON" description="">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </states>
    <states name="OFF" description="">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </states>
    <preferences docHome="./doc_html" makefileHome="/usr/local/tango-8.1.2/share/pogo/preferences"/>
  </classes>
</pogoDsl:PogoSystem>