ngc 1.5.0
 
Loading...
Searching...
No Matches
ngc::gateway::base::App Class Reference

NGC/NGCII data gateway application base class. More...

#include <app.hpp>

Inheritance diagram for ngc::gateway::base::App:
ngcdtt ngc::gateway::ddt::App

Public Member Functions

 App ()
 Constructor.
 
 App (ngcdttPUBLISH *publisher)
 
virtual ~App ()
 Destructor.
 
 App (App &)=delete
 Disables unused constructors and operators.
 
 App (App &&)=delete
 
Appoperator= (App &)=delete
 
- Public Member Functions inherited from ngcdtt
 ngcdtt ()
 Constructor.
 
 ngcdtt (ngcdttPUBLISH *display)
 Constructor with specific display interface.
 
virtual ~ngcdtt ()
 Destructor.
 
virtual void InstallSignalHandlers ()
 Install signal handlers.
 
int ParseArguments (int argc, char **argv)
 Parse arguments.
 
void PrintUsage (const char *argv0)
 Print usage.
 
int Configure (const char *arg, const char *value=NULL)
 Set configuration parameter.
 
void Service (const char *value)
 Set request/reply service name.
 
int ServicePort ()
 Get request/reply service port.
 
void URI (const char *value)
 Set broker URI.
 
void Datastream (const char *value)
 Set datastream name.
 
void DCS (const char *value)
 Assign DCS instance.
 
void DefaultFrame (const char *value)
 Assign default display frame type.
 
void ConnectionId (int id)
 Set connection id (override default)
 
void ExecReply (int stat, const char *msg)
 Send execution reply message and status (1 = success, 0 = failure)
 
int Initialize ()
 Initialize.
 
void Abort ()
 Abort.
 
void StopMainLoop ()
 Stop the gateway main-loop (asynchronous call)
 
int MainLoop ()
 Enter the gateway main-loop.
 
char * ErrMsg ()
 Return actual error message.
 
void Verbose (const char *format,...) __attribute__((format(printf
 Verbose output.
 
void void Log (const char *msg)
 Log message.
 
void Verbose (int flag)
 Switch verbose mode on/off.
 
void VerboseLevel (int level)
 Set verbose level.
 
void LogLevel (int level)
 Set logging level.
 
int VerboseLevel ()
 Return verbose level.
 
int LogLevel ()
 Return logging level.
 
void ExitSignal (int sig)
 Handle EXIT-signal.
 

Public Attributes

log4cplus::Logger * logger
 Logger.
 
std::shared_ptr< DbUpdaterdb
 Database adapter.
 
- Public Attributes inherited from ngcdtt
int ignoreSignal
 Ignore signal in main-loop select call.
 
int cv32
 Enforce conversion to 32 bit.
 
int autoEnable
 Auto enable.
 
int nxMax
 Maximum x-dimension.
 
int nyMax
 Maximum y-dimension.
 
double frequency
 Maximum display frequency (Hz)
 
int dcsMod
 DCS acquisition module index.
 
int interruptible
 Interruptible connection.
 

Protected Member Functions

virtual void Logger (const char *msg) override
 
virtual void Alarm (const char *msg) override
 
virtual void DbAttrState (int state) override
 
virtual void DbAttrFrames (int types) override
 
virtual void DbAttrConnected (int value) override
 
virtual void DbAttrEnabled (int value) override
 
virtual void DbAttrSelFrame (const char *name) override
 
virtual void DbAttrWin (int sx, int sy, int nx, int ny) override
 
- Protected Member Functions inherited from ngcdtt
const char * Process ()
 Return process name.
 
const char * Version ()
 Return version.
 
const char * Instance ()
 Return instance name.
 
void Shutdown ()
 Request shutdown.
 
void DataService (const char *host, int port)
 Assign data service (host and port)
 
int DataOpen ()
 Open data connection.
 
void DataClose ()
 Close data connection.
 
int CamOpen ()
 Open camera.
 
void CamClose ()
 Close camera.
 
int Connected ()
 Return connected status.
 
int Enabled ()
 Return enabled status.
 
void Status (int flag)
 Set transfer status (enable=1, disable=0)
 
void Start ()
 Start (enable transfer)
 
void Stop ()
 Stop (disable transfer)
 
void Invert ()
 Invert image.
 
void Invert (int flag)
 Image inversion on/off.
 
int InvertStatus ()
 Return image inversion flag.
 
int SelectFrame (const char *name)
 Select frame type by name and return 1, if setup has changed.
 
void CurrentFrame (char *name)
 Get current frame type (name)
 
int Window (int sx, int sy, int nx, int ny)
 Set new window and return 1, if setup has changed.
 
int SX ()
 Return lower left x-coordinate of requested window.
 
int SY ()
 Return lower left y-coordinate of requested window.
 
int NX ()
 Return dimension in x-direction of requested window.
 
int NY ()
 Return dimension in y-direction of requested window.
 
void Retransmit ()
 Request frame retransmission.
 
int Store ()
 Store bias frame.
 
void Clear ()
 Clear bias frame.
 
int Subtract (int flag)
 Enable/disable bias frame subtraction.
 
int DS9 (const char *cmd, char *reply, size_t max)
 Execute DS9 command.
 
virtual int MsgInit (int *fd)
 Initialize Initialize message system interface.
 
virtual void MsgShutdown ()
 Shutdown message system interface.
 
virtual int MsgHandler (int fd)
 Message handler.
 
virtual int Select (fd_set *readMask, struct timeval *timeout)
 Select call.
 
virtual void DbAttrInvert (int value)
 Write image inversion flag to database.
 
virtual int DbGetCfg (const char *p, ngcdcs_rtdacq_t *acq)
 Get acquisition process configuration from DCS database.
 

Additional Inherited Members

- Protected Attributes inherited from ngcdtt
ngcdttPUBLISHpublisher
 Publisher object.
 
char acqHost [64]
 Acquisition process host.
 
int acqPort
 Acquisition process port.
 
char camera [128]
 Camera name.
 
char dcsInst [64]
 DCS instance.
 
char dcsHost [64]
 DCS host.
 
ngcdtt_dsup_t defaultSetup
 DTT default setup.
 

Detailed Description

NGC/NGCII data gateway application base class.

NGC/NGCII data gateway application base class

Constructor & Destructor Documentation

◆ App() [1/4]

ngc::gateway::base::App::App ( )

Constructor.

◆ App() [2/4]

ngc::gateway::base::App::App ( ngcdttPUBLISH * publisher)
explicit

Constructor

Parameters
publisherPublisher to be used

◆ ~App()

ngc::gateway::base::App::~App ( )
virtual

Destructor.

Reimplemented in ngc::gateway::ddt::App.

◆ App() [3/4]

ngc::gateway::base::App::App ( App & )
delete

Disables unused constructors and operators.

◆ App() [4/4]

ngc::gateway::base::App::App ( App && )
delete

Member Function Documentation

◆ Alarm()

void ngc::gateway::base::App::Alarm ( const char * msg)
overrideprotectedvirtual

Issue alarm message

Parameters
msgAlarm message

Reimplemented from ngcdtt.

◆ DbAttrConnected()

void ngc::gateway::base::App::DbAttrConnected ( int value)
overrideprotectedvirtual

Update connected-flag in OLDB

Parameters
valueFlag indicating whether microservice is connected or not

Reimplemented from ngcdtt.

◆ DbAttrEnabled()

void ngc::gateway::base::App::DbAttrEnabled ( int value)
overrideprotectedvirtual

Update enabled-flag in OLDB

Parameters
valueFlag indicating whether frame transfer is enabled or not

Reimplemented from ngcdtt.

◆ DbAttrFrames()

void ngc::gateway::base::App::DbAttrFrames ( int types)
overrideprotectedvirtual

Update frame list in OLDB

Parameters
typesBit-list of available frame types

Reimplemented from ngcdtt.

◆ DbAttrSelFrame()

void ngc::gateway::base::App::DbAttrSelFrame ( const char * name)
overrideprotectedvirtual

Update selected frame in OLDB

Parameters
nameName of the currently selected frame

Reimplemented from ngcdtt.

◆ DbAttrState()

void ngc::gateway::base::App::DbAttrState ( int state)
overrideprotectedvirtual

Update gateway state in OLDB

Parameters
stateGateway state (ngcdttSTATE_ONLINE or ngcdttSTATE_OFF)

Reimplemented from ngcdtt.

◆ DbAttrWin()

void ngc::gateway::base::App::DbAttrWin ( int sx,
int sy,
int nx,
int ny )
overrideprotectedvirtual

Update window parameters in OLDB

Parameters
sxLower left corner of window (starts with 1)
syLower left corner of window (starts with 1)
nxX-dimension of window (0 = full frame)
nyY-dimension of window (0 = full frame)

Reimplemented from ngcdtt.

◆ Logger()

void ngc::gateway::base::App::Logger ( const char * msg)
overrideprotectedvirtual

Log message

Parameters
msgMessage to log

Reimplemented from ngcdtt.

◆ operator=()

App & ngc::gateway::base::App::operator= ( App & )
delete

Member Data Documentation

◆ db

std::shared_ptr<DbUpdater> ngc::gateway::base::App::db

Database adapter.

◆ logger

log4cplus::Logger* ngc::gateway::base::App::logger

Logger.


The documentation for this class was generated from the following files: