Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
evg
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cs
ds
evg
Commits
f874628a
Commit
f874628a
authored
Apr 02, 2020
by
Giulio Gaio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial import
parent
922db613
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6042 additions
and
0 deletions
+6042
-0
Makefile
Makefile
+7
-0
src/ClassFactory.cpp
src/ClassFactory.cpp
+49
-0
src/Evg.cpp
src/Evg.cpp
+2150
-0
src/Evg.h
src/Evg.h
+643
-0
src/EvgClass.cpp
src/EvgClass.cpp
+1595
-0
src/EvgClass.h
src/EvgClass.h
+957
-0
src/EvgStateMachine.cpp
src/EvgStateMachine.cpp
+566
-0
src/main.cpp
src/main.cpp
+75
-0
No files found.
Makefile
0 → 100644
View file @
f874628a
NAME_SRV
=
evg-srv
CXXFLAGS
=
LDFLAGS
=
-levg
include
../makefiles/Make-8.1.2.c.in
src/ClassFactory.cpp
0 → 100644
View file @
f874628a
static
const
char
*
RcsId
=
"$Header: /home/cvsadm/cvsroot/fermi/servers/evg/src/ClassFactory.cpp,v 1.1.1.3 2010-04-14 09:17:33 giulio Exp $"
;
//+=============================================================================
//
// file : ClassFactory.cpp
//
// description : C++ source for the class_factory method of the DServer
// device class. This method is responsible to create
// all class singletin for a device server. It is called
// at device server startup
//
// project : TANGO Device Server
//
// $Author: giulio $ Giulio Gaio
//
// $Revision: 1.1.1.3 $ 1.0
//
// $Log: ClassFactory.cpp,v $
// Revision 1.1.1.3 2010-04-14 09:17:33 giulio
// Clean Release
//
//
// copyleft : Sincrotrone Trieste S.C.p.A. di interesse nazionale
// Strada Statale 14 - km 163,5 in AREA Science Park
// 34012 Basovizza, Trieste ITALY
// Tel. +39 040 37581
// Fax. +39 040 9380902
//
//-=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#include <tango.h>
#include <EvgClass.h>
/**
* Create EvgClass singleton and store it in DServer object.
*/
void
Tango
::
DServer
::
class_factory
()
{
add_class
(
Evg_ns
::
EvgClass
::
init
(
"Evg"
));
}
src/Evg.cpp
0 → 100644
View file @
f874628a
This diff is collapsed.
Click to expand it.
src/Evg.h
0 → 100644
View file @
f874628a
//=============================================================================
//
// file : Evg.h
//
// description : Include for the Evg class.
//
// project : Evg
//
// $Author: giulio $ Giulio Gaio
//
// $Revision: 1.2 $ 1.0
//
// $Log: Evg.h,v $
// Revision 1.2 2013-12-23 16:54:26 giulio
// Moved to Tango 8
//
// Revision 1.1.1.3 2010-04-14 09:17:33 giulio
// Clean Release
//
//
// copyleft : Sincrotrone Trieste S.C.p.A. di interesse nazionale
// Strada Statale 14 - km 163,5 in AREA Science Park
// 34012 Basovizza, Trieste ITALY
// Tel. +39 040 37581
// Fax. +39 040 9380902
//
//=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#ifndef _EVG_H
#define _EVG_H
#include <tango.h>
#include <devMrfEvg.h>
//using namespace Tango;
/**
* @author $Author: giulio $
* @version $Revision: 1.2 $
*/
// Add your own constants definitions here.
//-----------------------------------------------
namespace
Evg_ns
{
/**
* Class Description:
* MicroSearch Finland Event Generator board. (fpga ver. E307
*/
/*
* Device States Description:
* Tango::ON : Status is ON when EVG is enabled to transmit events
* Tango::OFF : Status of OFF when event generation is disables
* Tango::FAULT : Status is FAULT when there are errors incoming from low level api's.
*/
class
Evg
:
public
Tango
::
Device_4Impl
{
public
:
// Add your own data members here
//-----------------------------------------
// Here is the Start of the automatic code generation part
//-------------------------------------------------------------
/**
* @name attributes
* Attributs member data.
*/
//@{
//@}
/**
* @name Device properties
* Device properties member data.
*/
//@{
/**
* Linux device name (ex: /dev/evg0
*/
string
evgname
;
/**
* Sequencer Ram1 data:
* col0]: event code
* col[1]: timestamp (32bit
*/
vector
<
string
>
seqRam1
;
/**
* Sequencer Ram2 data:
* col[0]: event code
* col[1]: timestamp
*/
vector
<
string
>
seqRam2
;
/**
* Set RF clock:
* val[0]: 0:internal oscillator (Mycrel); 1:External RF input
* val[1]: External RF input division (4,5,6,8,10,12
*/
vector
<
long
>
rFClock
;
/**
* Trigger event table codes:
* col[0]: event number (0..7)
* col[1]: event code
*/
vector
<
string
>
eventCodes
;
/**
* Enable multiplexer counter to be triggered by events [bit 7..0]
*/
Tango
::
DevLong
eventMXCEnable
;
/**
* Multiplexer prescaler table.
* col[0]: multiplexer number [0..7]
* col[1]: prescaler value [32bit]
*/
vector
<
string
>
mXCPrescaler
;
/**
* Event trigger enable mask [bit 7..0]
*/
Tango
::
DevLong
eventEnable
;
/**
* Enable multiplexed counter (0,1) to trigger sequencer (1,2).
* bit 0: 1=enable multiplexed counter 0 to trigger sequencer 1
* bit 1: 1=enable multiplexed counter 1 to trigger sequencer 2
*/
Tango
::
DevLong
seqMXCEnable
;
/**
* Enable Sequencer bitmask.
* bit 0: 1=enable Sequencer 1
* bit 1: 1=enable Sequencer 2
*/
Tango
::
DevLong
seqEnable
;
/**
* Select sequencer clock source .
* col[0]: sequencer number (1,2)
* col[1]: clock source bitmask; bit [7-0] event clock, bit [15-8] dbus clock
*/
vector
<
string
>
seqClock
;
/**
* Enable[1]/Disable[0] software events
*/
Tango
::
DevLong
swEventEnable
;
/**
* Internal clock reference [Mycrel SY87739L] configuration mask.
* 0xC928166=210927974: 499654000/4 => 124907000 Hz
* 0xFE816D=16679277: 499800000/4 => 124950000 Hz
* 0x18741AD=25641389: 476000000/4 => 119000000 Hz
* 0x9743AD=9913261: =>50000000 Hz
*/
Tango
::
DevLong
internalFrac
;
/**
* long[0]: Sequencer mask (bit 0:seq1, bit1:seq2)
* long[1]: Prescaler
*/
vector
<
long
>
seqACTrig
;
//@}
/**@name Constructors
* Miscellaneous constructors */
//@{
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
Evg
(
Tango
::
DeviceClass
*
cl
,
string
&
s
);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
Evg
(
Tango
::
DeviceClass
*
cl
,
const
char
*
s
);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
Evg
(
Tango
::
DeviceClass
*
cl
,
const
char
*
s
,
const
char
*
d
);
//@}
/**@name Destructor
* Only one desctructor is defined for this class */
//@{
/**
* The object desctructor.
*/
~
Evg
()
{
delete_device
();};
/**
* will be called at device destruction or at init command.
*/
void
delete_device
();
//@}
/**@name Miscellaneous methods */
//@{
/**
* Initialize the device
*/
virtual
void
init_device
();
/**
* Always executed method befor execution command method.
*/
virtual
void
always_executed_hook
();
//@}
/**
* @name Evg methods prototypes
*/
//@{
/**
* Execution allowed for On command.
*/
virtual
bool
is_On_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for Off command.
*/
virtual
bool
is_Off_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetState command.
*/
virtual
bool
is_GetState_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetRXViolation command.
*/
virtual
bool
is_GetRXViolation_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for Reset command.
*/
virtual
bool
is_Reset_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for EventEnable command.
*/
virtual
bool
is_EventEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for EventDisable command.
*/
virtual
bool
is_EventDisable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for EventState command.
*/
virtual
bool
is_EventState_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SetTriggerEvent command.
*/
virtual
bool
is_SetTriggerEvent_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetTriggerEvent command.
*/
virtual
bool
is_GetTriggerEvent_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for EventMXCEnable command.
*/
virtual
bool
is_EventMXCEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for EventMXCDisable command.
*/
virtual
bool
is_EventMXCDisable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetEventMXCState command.
*/
virtual
bool
is_GetEventMXCState_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SwEventEnable command.
*/
virtual
bool
is_SwEventEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SwEventDisable command.
*/
virtual
bool
is_SwEventDisable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SendSwEvent command.
*/
virtual
bool
is_SendSwEvent_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for DBusMXCEnable command.
*/
virtual
bool
is_DBusMXCEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for DBusMXCDisable command.
*/
virtual
bool
is_DBusMXCDisable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetDBusMXCState command.
*/
virtual
bool
is_GetDBusMXCState_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SetMXCPrescaler command.
*/
virtual
bool
is_SetMXCPrescaler_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetMXCPrescaler command.
*/
virtual
bool
is_GetMXCPrescaler_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for ResetMXC command.
*/
virtual
bool
is_ResetMXC_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SeqEnable command.
*/
virtual
bool
is_SeqEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SeqReset command.
*/
virtual
bool
is_SeqReset_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SetSeqPrescaler command.
*/
virtual
bool
is_SetSeqPrescaler_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetSeqPrescaler command.
*/
virtual
bool
is_GetSeqPrescaler_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SeqMXCEnable command.
*/
virtual
bool
is_SeqMXCEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SeqMXCDisable command.
*/
virtual
bool
is_SeqMXCDisable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SeqRamWrite command.
*/
virtual
bool
is_SeqRamWrite_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SeqRamRead command.
*/
virtual
bool
is_SeqRamRead_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for SetRFClock command.
*/
virtual
bool
is_SetRFClock_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for GetRFClock command.
*/
virtual
bool
is_GetRFClock_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for DataBufferEnable command.
*/
virtual
bool
is_DataBufferEnable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for DataBufferDisable command.
*/
virtual
bool
is_DataBufferDisable_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for DataBufferWrite command.
*/
virtual
bool
is_DataBufferWrite_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Execution allowed for DataBufferRead command.
*/
virtual
bool
is_DataBufferRead_allowed
(
const
CORBA
::
Any
&
any
);
/**
* Enable mastering
* @exception DevFailed
*/
void
on
();
/**
* Disable mastering
* @exception DevFailed
*/
void
off
();
/**
* 31: master disabled: grey: master enabled: green
* 30: fifo Full: red: :
* 22: SEQ1 Recycle On: green: SEQ1 Recycle Off : grey
* 21: SEQ2 Recycle On: green: SEQ2 Recycle Off : grey
* 16: receiver violation: red: : :
* 13: SEQ1 Single Mode: green : :
* 12: SEQ2 Single Mode: green : :
* 11: CMode On: green : :
* 2: SEQ1 On: green : SEQ1 Off: grey
* 1: SEQ1 On: green : SEQ1 Off: grey
* 0: VME Event On: green : VME Event Off: grey
* @return
* @exception DevFailed
*/
Tango
::
DevLong
get_state
();
/**
* Return 0 if RX violation hasn't yet occurred.
* @return
* @exception DevFailed
*/
Tango
::
DevLong
get_rxviolation
();
/**
* Reset errors
* @exception DevFailed
*/
void
reset
();
/**
* Enable event trigger [bit 7-0]
* @param argin event trigger bitmask
* @exception DevFailed
*/
void
event_enable
(
Tango
::
DevLong
);
/**
* Disable event trigger [bit 7-0].
* @param argin event trigger bitmask
* @exception DevFailed
*/
void
event_disable
(
Tango
::
DevLong
);
/**
* Trigger enabled state (1=enabled,0=disabled)
* 0: on: green: off: red
* 1: on: green: off: red
* 2: on: green: off: red
* 3: on: green: off: red
* 4: on: green: off: red
* 5: on: green: off: red
* 6: on: green: off: red
* 7: on: green: off: red
* @return event trigger enabled mask
* @exception DevFailed
*/
Tango
::
DevLong
event_state
();
/**
* argin1: event code [0..128]
* @param argin argin0: event number [0..7]; argin1: event code [0..128]
* @exception DevFailed
*/
void
set_trigger_event
(
const
Tango
::
DevVarLongArray
*
);
/**
* Get the code of the event trigger.
* @param argin event number [0..7]
* @return event code
* @exception DevFailed
*/
Tango
::
DevLong
get_trigger_event
(
Tango
::
DevLong
);
/**
* Enable multiplexed counter
* @param argin input mask [bit 7..0]
* @exception DevFailed
*/
void
event_mxcenable
(
Tango
::
DevLong
);
/**
* Disable multiplexed counters
* @param argin input mask [bit 7..0]
* @exception DevFailed
*/
void
event_mxcdisable
(
Tango
::
DevLong
);
/**
* Get multiplexed counters state (1=enabled 0=disabled)
* 0: on: green: off: grey
* 1: on: green: off: grey
* 2: on: green: off: grey
* 3: on: green: off: grey
* 4: on: green: off: grey
* 5: on: green: off: grey
* 6: on: green: off: grey
* 7: on: green: off: grey
* @return output bitmask [bit 7..0]
* @exception DevFailed
*/
Tango
::
DevLong
get_event_mxcstate
();
/**
* Enable software event
* @exception DevFailed
*/
void
sw_event_enable
();
/**
* Disable software events.
* @exception DevFailed
*/
void
sw_event_disable
();
/**
* Send an event code [0..127] triggered by software
* @param argin event code
* @exception DevFailed
*/
void
send_sw_event
(
Tango
::
DevLong
);
/**
* Enable DBUS signal to trigger multiplexed counter
* @param argin input mask [bit 7..0]
* @exception DevFailed
*/
void
dbus_mxcenable
(
Tango
::
DevLong
);
/**
* Disable DBUS signal to trigger multiplexed counter
* @param argin input mask [bit 7..0]
* @exception DevFailed
*/
void
dbus_mxcdisable
(
Tango
::
DevLong
);
/**
* Get the bitmask of the DBUS multiplexed counter status (1=enabled, 0=disabled)
* 0: on: green: off: grey
* 1: on: green: off: grey
* 2: on: green: off: grey
* 3: on: green: off: grey
* 4: on: green: off: grey
* 5: on: green: off: grey
* 6: on: green: off: grey
* 7: on: green: off: grey
* @return output mask [bit 7..0]
* @exception DevFailed
*/
Tango
::
DevLong
get_dbus_mxcstate
();
/**
* arg1: prescaler value [32bit]
* @param argin arg0:multiplexer counte r[0..7]; arg1: prescaler value [32bit]
* @exception DevFailed
*/
void
set_mxcprescaler
(
const
Tango
::
DevVarLongArray
*
);
/**
* Get the prescaler value of the specified multiplexer counter.
* @param argin multiplexer counter[0..7]
* @return prescaler vaule (32bit)
* @exception DevFailed
*/
Tango
::
DevLong
get_mxcprescaler
(
Tango
::
DevLong
);
/**
* Reset multiplexer counters.
* @param argin input mask [bit 7..0]
* @exception DevFailed
*/
void
reset_mxc
(
Tango
::
DevLong
);
/**
* 0: disable sequencer2
* @param argin sequencer enable/disable bitmask
* @exception DevFailed
*/
void
seq_enable
(
Tango
::
DevLong
);
/**
* Reset sequencer
* @param argin sequencer RAM number (1,2)
* @exception DevFailed
*/
void
seq_reset
(
Tango
::
DevLong
);
/**
* Set sequencer prescaler value
* @param argin arg0: prescaler RAM selection [1,2] arg1:prescaler value [32bit]
* @exception DevFailed
*/
void
set_seq_prescaler
(
const
Tango
::
DevVarLongArray
*
);
/**
* Get prescaler value
* @param argin sequencer RAM [1,2]
* @return prescaler value
* @exception DevFailed
*/
Tango
::
DevLong
get_seq_prescaler
(
Tango
::
DevLong
);
/**
* Enable multiplexer counter to trigger the sequencer.Multiplexer counter 0 triggers RAM1, multiplexer
* counter 1 triggers RAM2
* @param argin Select RAM sequencer [1,2]
* @exception DevFailed
*/
void
seq_mxcenable
(
Tango
::
DevLong
);
/**
* Disable multiplexer counter to trigger the sequencer. Multiplexer counter 0 triggers RAM1, multiplexer
* counter 1 triggers RAM2
* @param argin Sequencer RAM number [1,2]
* @exception DevFailed
*/
void
seq_mxcdisable
(
Tango
::
DevLong
);
/**
* arg[i+1]: timestamp
* @param argin arg0: sequencer ram [1,2]; arg[i]:event code; arg[i+1]: timestamp
* @exception DevFailed
*/
void
seq_ram_write
(
const
Tango
::
DevVarLongArray
*
);
/**
* arg[i+1]: timestamp
* @param argin arg0: sequencer ram[1,2]; arg1: size
* @return arg[i]: event code; arg[i+1]: timestamp
* @exception DevFailed
*/
Tango
::
DevVarLongArray
*
seq_ram_read
(
const
Tango
::
DevVarLongArray
*
);
/**
* arg1: external prescaler (4,5,6,8,10,12)
* @param argin arg0: type [0=internal, 1=external]; arg1: external prescaler (4,5,6,8,10,12)
* @exception DevFailed
*/
void
set_rfclock
(
const
Tango
::
DevVarLongArray
*
);
/**
* arg2: internal Mycrel frequency
* @return arg0: external [1] , internal[0]; arg1: external RFIN division; arg2: internal Mycrel frequency
* @exception DevFailed
*/
Tango
::
DevVarLongArray
*
get_rfclock
();
/**
* Enable data buffer to be distributed
* @exception DevFailed
*/
void
data_buffer_enable
();
/**
* Disable data buffer to be transmitted.
* @exception DevFailed
*/
void
data_buffer_disable
();
/**
* arg[i..]:array of long transmitted
* @param argin arg[0]: start address [long]; arg[i..]:array of long transmitted
* @exception DevFailed
*/
void
data_buffer_write
(
const
Tango
::
DevVarLongArray
*
);
/**
* arg1: size
* @param argin arg0:start address; arg1: size
* @return array of data
* @exception DevFailed