Skip to content
Snippets Groups Projects
Commit 1c3a88fa authored by Graziano Scalamera's avatar Graziano Scalamera
Browse files

First import

parent 17d6db0f
No related branches found
Tags 1.0.0
No related merge requests found
.nse_depinfo
bin
obj
# Eclipse
.cproject
.project
.settings
NAME_SRV = ccd-spectrometer-srv
LDFLAGS = -lfit
HAVE_RNM = 1
ifeq ($(HAVE_RNM),1)
CXXFLAGS += -DHAVE_RNM
LDFLAGS += -lrnm -lrnmshare
endif
include ../makefiles/Make-9.3.3.in
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*----- PROTECTED REGION ID(CCDSpectrometer::ClassFactory.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// 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 : CCDSpectrometer
//
// 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/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango.h>
#include "CCDSpectrometerClass.h"
// Add class header files if needed
/**
* Create CCDSpectrometer Class singleton and store it in DServer object.
*/
void Tango::DServer::class_factory()
{
// Add method class init if needed
add_class(CCDSpectrometer_ns::CCDSpectrometerClass::init("CCDSpectrometer"));
}
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // CCDSpectrometer::ClassFactory.cpp
/*----- PROTECTED REGION ID(CCDSpectrometer::main.cpp) ENABLED START -----*/
/* clang-format on */
//=============================================================================
//
// file : main.cpp
//
// description : C++ source for the CCDSpectrometer device server main.
// The main rule is to initialize (and create) the Tango
// system and to create the DServerClass singleton.
// The main should be the same for every Tango device server.
//
// project : CCDSpectrometer
//
// 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/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#include <tango.h>
// Check if crash reporting is used.
#if defined(ENABLE_CRASH_REPORT)
# include <crashreporting/crash_report.h>
#else
# define DECLARE_CRASH_HANDLER
# define INSTALL_CRASH_HANDLER
#endif
DECLARE_CRASH_HANDLER
int main(int argc,char *argv[])
{
INSTALL_CRASH_HANDLER
Tango::Util *tg = nullptr;
try
{
// Initialize the device server
//----------------------------------------
tg = Tango::Util::init(argc,argv);
// Create the device server singleton
// which will create everything
//----------------------------------------
tg->server_init(false);
// Run the endless loop
//----------------------------------------
std::cout << "Ready to accept request" << std::endl;
tg->server_run();
}
catch (std::bad_alloc &)
{
std::cout << "Can't allocate memory to store device object !!!" << std::endl;
std::cout << "Exiting" << std::endl;
}
catch (CORBA::Exception &e)
{
Tango::Except::print_exception(e);
std::cout << "Received a CORBA_Exception" << std::endl;
std::cout << "Exiting" << std::endl;
}
if(tg)
{
tg->server_cleanup();
}
return(0);
}
/* clang-format off */
/*----- PROTECTED REGION END -----*/ // CCDSpectrometer::main.cpp
This diff is collapsed.
//
// file : readthread.h
//
// description : reading thread
//
//
//
// copyleft : Sincrotrone Trieste S.C.p.A.
// Strada Statale 14 - km 163,5 in AREA Science Park
// 34012 Basovizza, Trieste ITALY
//
#ifndef RAMPTHREAD_H
#define RAMPTHREAD_H
#include <omnithread.h>
#include <tango.h>
#include <inttypes.h>
namespace CCDSpectrometer_ns
{
class readthread : public omni_thread, public Tango::TangoMonitor, public Tango::LogAdapter
{
private:
Tango::DeviceImpl* device;
void abort_sleep(double time);
Tango::DevLong last_camera_counter;
int wait_counter;
bool use_last_fit;
unsigned long old_bunch_number;
bool just_reconnected;
uint32_t numavg;
int PrepareMeas();
int Measure(double *l_pSpectrum);
void StopMeas();
int Heartbeat();
public:
readthread(Tango::DeviceImpl* devImpl);
~readthread();
int pausesec,pausenano;
double min_fit_time;
double max_fit_time;
double tot_fit_time;
double avg_fit_time;
size_t fit_counter;
bool abortflag;
bool waitflag;
protected:
void run(void *);
}; /* end class readthread() */
}
#endif
/* EOF */
This diff is collapsed.
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment