MIDAS
Loading...
Searching...
No Matches
TMFE Class Reference

#include <tmfe.h>

Collaboration diagram for TMFE:

Public Member Functions

TMFeResult Connect (const char *progname=NULL, const char *hostname=NULL, const char *exptname=NULL)
 
TMFeResult Disconnect ()
 
void RpcThread ()
 
void StartRpcThread ()
 
void StopRpcThread ()
 
TMFeResult EventBufferOpen (TMEventBuffer **pbuf, const char *bufname, size_t bufsize=0)
 
TMFeResult EventBufferFlushCacheAll (bool wait=true)
 
TMFeResult EventBufferCloseAll ()
 
void StopRun ()
 
void StartRun ()
 
TMFeResult SetWatchdogSec (int sec)
 
void Yield (double sleep_sec)
 
void MidasPeriodicTasks ()
 
TMFeResult TriggerAlarm (const char *name, const char *message, const char *aclass)
 
TMFeResult ResetAlarm (const char *name)
 
void Msg (int message_type, const char *filename, int line, const char *routine, const char *format,...) MATTRPRINTF(6
 
void void Msg (int message_type, const char *filename, int line, const char *routine, const std::string &message)
 
void AddRpcHandler (TMFeRpcHandlerInterface *)
 
void RemoveRpcHandler (TMFeRpcHandlerInterface *)
 
void SetTransitionSequenceStart (int seqno)
 
void SetTransitionSequenceStop (int seqno)
 
void SetTransitionSequencePause (int seqno)
 
void SetTransitionSequenceResume (int seqno)
 
void SetTransitionSequenceStartAbort (int seqno)
 
void DeregisterTransitions ()
 
void DeregisterTransitionStart ()
 
void DeregisterTransitionStop ()
 
void DeregisterTransitionPause ()
 
void DeregisterTransitionResume ()
 
void DeregisterTransitionStartAbort ()
 
void RegisterTransitionStartAbort ()
 
void RegisterRPCs ()
 
TMFeError Connect (const char *progname, const char *filename=NULL, const char *hostname=NULL, const char *exptname=NULL)
 
TMFeError Disconnect ()
 
TMFeError RegisterEquipment (TMFeEquipment *eq)
 
void RegisterRpcHandler (TMFeRpcHandlerInterface *handler)
 RPC handlers are executed from the RPC thread, if started.
 
void RegisterPeriodicHandler (TMFeEquipment *eq, TMFePeriodicHandlerInterface *handler)
 periodic handlers are executed from the periodic thread, if started
 
void StartRpcThread ()
 
void StartPeriodicThread ()
 
void StopRpcThread ()
 
void StopPeriodicThread ()
 
TMFeError SetWatchdogSec (int sec)
 
void PollMidas (int millisec)
 
void MidasPeriodicTasks ()
 
void EquipmentPeriodicTasks ()
 
TMFeError TriggerAlarm (const char *name, const char *message, const char *aclass)
 
TMFeError ResetAlarm (const char *name)
 
void Msg (int message_type, const char *filename, int line, const char *routine, const char *format,...) MATTRPRINTF(6
 
void void SetTransitionSequenceStart (int seqno)
 
void SetTransitionSequenceStop (int seqno)
 
void SetTransitionSequencePause (int seqno)
 
void SetTransitionSequenceResume (int seqno)
 
void SetTransitionSequenceStartAbort (int seqno)
 
void DeregisterTransitions ()
 
void DeregisterTransitionStart ()
 
void DeregisterTransitionStop ()
 
void DeregisterTransitionPause ()
 
void DeregisterTransitionResume ()
 
void DeregisterTransitionStartAbort ()
 
void RegisterTransitionStartAbort ()
 

Static Public Member Functions

static TMFEInstance ()
 
static double GetTime ()
 return current time in seconds, with micro-second precision
 
static void Sleep (double sleep_time_sec)
 sleep, with micro-second precision
 
static std::string GetThreadId ()
 return identification of this thread
 
static TMFEInstance ()
 
static double GetTime ()
 return current time in seconds, with micro-second precision
 
static void Sleep (double sleep_time_sec)
 sleep, with micro-second precision
 
static std::string GetThreadId ()
 return identification of this thread
 

Public Attributes

std::string fExptname
 experiment name, blank if only one experiment defined in exptab
 
std::string fMserverHostname
 hostname where the mserver is running, blank if using shared memory
 
std::string fProgramName
 frontend program name
 
std::string fHostname
 hostname we are running on
 
std::mutex fMutex
 
int fDB = 0
 ODB database handle.
 
MVOdbfOdbRoot = NULL
 ODB root.
 
std::atomic_bool fShutdownRequested {false}
 shutdown was requested by Ctrl-C or by RPC command
 
int fRunNumber = 0
 current run number
 
bool fStateRunning = false
 run state is running or paused
 
std::thread * fRpcThread = NULL
 
std::atomic_bool fRpcThreadStarting {false}
 
std::atomic_bool fRpcThreadRunning {false}
 
std::atomic_bool fRpcThreadShutdownRequested {false}
 
std::mutex fEventBuffersMutex
 
std::vector< TMEventBuffer * > fEventBuffers
 
bool fRunStopRequested = false
 run stop was requested by equipment
 
double fRunStartTime = 0
 start a new run at this time
 
std::vector< TMFeRpcHandlerInterface * > fRpcHandlers
 
std::string fFrontendName
 frontend program name
 
std::string fFrontendHostname
 frontend hostname
 
std::string fFrontendFilename
 frontend program file name
 
bool fShutdownRequested
 shutdown was requested by Ctrl-C or by RPC command
 
std::vector< TMFeEquipment * > fEquipments
 
std::vector< TMFePeriodicHandler * > fPeriodicHandlers
 
double fNextPeriodic
 
bool fRpcThreadStarting
 
bool fRpcThreadRunning
 
bool fRpcThreadShutdownRequested
 
bool fPeriodicThreadStarting
 
bool fPeriodicThreadRunning
 
bool fPeriodicThreadShutdownRequested
 

Static Public Attributes

static bool gfVerbose = false
 

Private Member Functions

 TMFE ()
 default constructor is private for singleton classes
 
virtual ~TMFE ()
 destructor is private for singleton classes
 
 TMFE ()
 default constructor is private for singleton classes
 
virtual ~TMFE ()
 destructor is private for singleton classes
 

Static Private Attributes

static TMFEgfMFE = NULL
 

Detailed Description

Definition at line 380 of file tmfe.h.

Constructor & Destructor Documentation

◆ TMFE() [1/2]

TMFE::TMFE ( )
private

default constructor is private for singleton classes

Definition at line 44 of file tmfe.cxx.

45{
46 if (gfVerbose)
47 printf("TMFE::ctor!\n");
48}
static bool gfVerbose
Definition tmfe.h:424
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~TMFE() [1/2]

TMFE::~TMFE ( )
privatevirtual

destructor is private for singleton classes

Definition at line 50 of file tmfe.cxx.

51{
52 if (gfVerbose)
53 printf("TMFE::dtor!\n");
54 assert(!"TMFE::~TMFE(): destruction of the TMFE singleton is not permitted!");
55}
Here is the call graph for this function:

◆ TMFE() [2/2]

TMFE::TMFE ( )
private

default constructor is private for singleton classes

◆ ~TMFE() [2/2]

virtual TMFE::~TMFE ( )
privatevirtual

destructor is private for singleton classes

Member Function Documentation

◆ AddRpcHandler()

void TMFE::AddRpcHandler ( TMFeRpcHandlerInterface h)

Definition at line 1526 of file tmfe.cxx.

1527{
1528 fRpcHandlers.push_back(h);
1529}
std::vector< TMFeRpcHandlerInterface * > fRpcHandlers
Definition tmfe.h:464
Here is the caller graph for this function:

◆ Connect() [1/2]

TMFeError TMFE::Connect ( const char progname,
const char filename = NULL,
const char hostname = NULL,
const char exptname = NULL 
)

Definition at line 51 of file tmfe_rev0.cxx.

52{
53 if (progname)
55 if (filename)
56 fFrontendFilename = filename;
57
59
60 int status;
61
64
65 /* get default from environment */
67 assert(status == CM_SUCCESS);
68
69 if (hostname)
70 mstrlcpy(xhostname, hostname, sizeof(xhostname));
71
72 if (exptname)
74
77
78 fprintf(stderr, "TMFE::Connect: Program \"%s\" connecting to experiment \"%s\" on host \"%s\"\n", progname, fExptname.c_str(), fHostname.c_str());
79
81 //int watchdog = 60*1000;
82
84
85 if (status == CM_UNDEF_EXP) {
86 fprintf(stderr, "TMidasOnline::connect: Error: experiment \"%s\" not defined.\n", fExptname.c_str());
87 return TMFeError(status, "experiment is not defined");
88 } else if (status != CM_SUCCESS) {
89 fprintf(stderr, "TMidasOnline::connect: Cannot connect to MIDAS, status %d.\n", status);
90 return TMFeError(status, "cannot connect");
91 }
92
94 if (status != CM_SUCCESS) {
95 return TMFeError(status, "cm_get_experiment_database");
96 }
97
99
100 return TMFeError();
101}
std::string fFrontendFilename
frontend program file name
Definition tmfe_rev0.h:214
int fDB
ODB database handle.
Definition tmfe.h:394
std::string fFrontendHostname
frontend hostname
Definition tmfe_rev0.h:213
std::string fFrontendName
frontend program name
Definition tmfe_rev0.h:212
std::string fHostname
hostname we are running on
Definition tmfe.h:388
MVOdb * fOdbRoot
ODB root.
Definition tmfe.h:395
std::string fExptname
experiment name, blank if only one experiment defined in exptab
Definition tmfe.h:384
INT cm_get_experiment_database(HNDLE *hDB, HNDLE *hKeyClient)
Definition midas.cxx:3011
INT cm_connect_experiment1(const char *host_name, const char *default_exp_name, const char *client_name, void(*func)(char *), INT odb_size, DWORD watchdog_timeout)
Definition midas.cxx:2297
INT cm_get_environment(char *host_name, int host_name_size, char *exp_name, int exp_name_size)
Definition midas.cxx:2134
#define CM_SUCCESS
Definition midas.h:582
#define CM_UNDEF_EXP
Definition midas.h:586
std::string ss_gethostname()
Definition system.cxx:5706
#define HOST_NAME_LENGTH
Definition midas.h:273
#define DEFAULT_WATCHDOG_TIMEOUT
Definition midas.h:290
#define DEFAULT_ODB_SIZE
Definition midas.h:270
#define NAME_LENGTH
Definition midas.h:272
DWORD status
Definition odbhist.cxx:39
Here is the call graph for this function:

◆ Connect() [2/2]

TMFeResult TMFE::Connect ( const char progname = NULL,
const char hostname = NULL,
const char exptname = NULL 
)

Definition at line 65 of file tmfe.cxx.

66{
67 if (progname)
69
70 if (fProgramName.empty()) {
71 return TMFeErrorMessage("TMFE::Connect: frontend program name is not set");
72 }
73
75
76 int status;
77
78 std::string env_hostname;
79 std::string env_exptname;
80
81 /* get default from environment */
83
84 if (status != CM_SUCCESS) {
85 return TMFeMidasError("Cannot connect to MIDAS", "cm_get_environment", status);
86 }
87
88 if (hostname && hostname[0]) {
89 fMserverHostname = hostname;
90 } else {
92 }
93
94 if (exptname && exptname[0]) {
96 } else {
98 }
99
100 if (gfVerbose) {
101 printf("TMFE::Connect: Program \"%s\" connecting to experiment \"%s\" on host \"%s\"\n", fProgramName.c_str(), fExptname.c_str(), fMserverHostname.c_str());
102 }
103
105 //int watchdog = 60*1000;
106
108
109 if (status == CM_UNDEF_EXP) {
110 return TMFeMidasError(msprintf("Cannot connect to MIDAS, experiment \"%s\" is not defined", fExptname.c_str()), "cm_connect_experiment1", status);
111 } else if (status != CM_SUCCESS) {
112 return TMFeMidasError("Cannot connect to MIDAS", "cm_connect_experiment1", status);
113 }
114
116 if (status != CM_SUCCESS) {
117 return TMFeMidasError("Cannot connect to MIDAS", "cm_get_experiment_database", status);
118 }
119
121
122 int run_state = 0;
123
124 fOdbRoot->RI("Runinfo/state", &run_state);
125 fOdbRoot->RI("Runinfo/run number", &fRunNumber);
126
127 if (run_state == STATE_RUNNING) {
128 fStateRunning = true;
129 } else if (run_state == STATE_PAUSED) {
130 fStateRunning = true;
131 } else {
132 fStateRunning = false;
133 }
134
135 RegisterRPCs();
136
137 if (gfVerbose) {
138 printf("TMFE::Connect: Program \"%s\" connected to experiment \"%s\" on host \"%s\"\n", fProgramName.c_str(), fExptname.c_str(), fMserverHostname.c_str());
139 }
140
141 return TMFeOk();
142}
bool fStateRunning
run state is running or paused
Definition tmfe.h:402
void RegisterRPCs()
Definition tmfe.cxx:1512
std::string fMserverHostname
hostname where the mserver is running, blank if using shared memory
Definition tmfe.h:385
std::string fProgramName
frontend program name
Definition tmfe.h:387
int fRunNumber
current run number
Definition tmfe.h:401
#define STATE_PAUSED
Definition midas.h:306
#define STATE_RUNNING
Definition midas.h:307
INT run_state
Definition mfe.cxx:35
std::string msprintf(const char *format,...)
Definition midas.cxx:410
TMFeResult TMFeErrorMessage(const std::string &message)
Definition tmfe.cxx:29
TMFeResult TMFeMidasError(const std::string &message, const char *midas_function_name, int midas_status)
Definition tmfe.cxx:34
TMFeResult TMFeOk()
Definition tmfe.h:106
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeregisterTransitionPause() [1/2]

void TMFE::DeregisterTransitionPause ( )

Definition at line 1492 of file tmfe.cxx.

1493{
1495}
INT cm_deregister_transition(INT transition)
Definition midas.cxx:3669
#define TR_PAUSE
Definition midas.h:407
Here is the call graph for this function:

◆ DeregisterTransitionPause() [2/2]

void TMFE::DeregisterTransitionPause ( )

◆ DeregisterTransitionResume() [1/2]

void TMFE::DeregisterTransitionResume ( )

Definition at line 1497 of file tmfe.cxx.

1498{
1500}
#define TR_RESUME
Definition midas.h:408
Here is the call graph for this function:

◆ DeregisterTransitionResume() [2/2]

void TMFE::DeregisterTransitionResume ( )

◆ DeregisterTransitions() [1/2]

void TMFE::DeregisterTransitions ( )

Definition at line 1473 of file tmfe.cxx.

Here is the call graph for this function:

◆ DeregisterTransitions() [2/2]

void TMFE::DeregisterTransitions ( )

◆ DeregisterTransitionStart() [1/2]

void TMFE::DeregisterTransitionStart ( )

Definition at line 1482 of file tmfe.cxx.

1483{
1485}
Here is the call graph for this function:

◆ DeregisterTransitionStart() [2/2]

void TMFE::DeregisterTransitionStart ( )

◆ DeregisterTransitionStartAbort() [1/2]

void TMFE::DeregisterTransitionStartAbort ( )

Definition at line 1502 of file tmfe.cxx.

Here is the call graph for this function:

◆ DeregisterTransitionStartAbort() [2/2]

void TMFE::DeregisterTransitionStartAbort ( )

◆ DeregisterTransitionStop() [1/2]

void TMFE::DeregisterTransitionStop ( )

Definition at line 1487 of file tmfe.cxx.

1488{
1490}
Here is the call graph for this function:

◆ DeregisterTransitionStop() [2/2]

void TMFE::DeregisterTransitionStop ( )

◆ Disconnect() [1/2]

TMFeError TMFE::Disconnect ( )

Definition at line 154 of file tmfe.cxx.

155{
156 if (gfVerbose)
157 printf("TMFE::Disconnect: Disconnecting from experiment \"%s\" on host \"%s\"\n", fExptname.c_str(), fMserverHostname.c_str());
160 if (gfVerbose)
161 printf("TMFE::Disconnect: Disconnected from experiment \"%s\" on host \"%s\"\n", fExptname.c_str(), fMserverHostname.c_str());
162 return TMFeOk();
163}
void StopRpcThread()
Definition tmfe.cxx:935
INT cm_disconnect_experiment(void)
Definition midas.cxx:2846
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Disconnect() [2/2]

TMFeError TMFE::Disconnect ( )

◆ EquipmentPeriodicTasks()

void TMFE::EquipmentPeriodicTasks ( )

Definition at line 128 of file tmfe_rev0.cxx.

129{
130 double now = GetTime();
131
132 if (fNextPeriodic == 0 || now >= fNextPeriodic) {
133 int n = fPeriodicHandlers.size();
134 fNextPeriodic = 0;
135 for (int i=0; i<n; i++) {
137 double period = h->fEq->fCommon->Period/1000.0;
138 //printf("periodic[%d] period %f, last call %f, next call %f (+%f)\n", i, period, h->fLastCallTime, h->fNextCallTime, now - h->fNextCallTime);
139 if (period <= 0)
140 continue;
141 if (h->fNextCallTime == 0 || now >= h->fNextCallTime) {
142 h->fLastCallTime = now;
143 h->fNextCallTime = h->fLastCallTime + period;
144
145 if (h->fNextCallTime < now) {
146 fprintf(stderr, "TMFE::EquipmentPeriodicTasks: periodic equipment does not keep up!\n"); // FIXME
147 while (h->fNextCallTime < now) {
148 h->fNextCallTime += period;
149 }
150 }
151
152 if (fNextPeriodic == 0)
154 else if (h->fNextCallTime < fNextPeriodic)
156
158
159 now = GetTime();
160 }
161 }
162
163 //printf("next periodic %f (+%f)\n", fNextPeriodic, fNextPeriodic - now);
164 } else {
165 //printf("next periodic %f (+%f), waiting\n", fNextPeriodic, fNextPeriodic - now);
166 }
167}
static double GetTime()
return current time in seconds, with micro-second precision
Definition tmfe.cxx:1011
std::vector< TMFePeriodicHandler * > fPeriodicHandlers
Definition tmfe_rev0.h:226
double fNextPeriodic
Definition tmfe_rev0.h:227
TMFeCommon * fCommon
Definition tmfe_rev0.h:136
TMFePeriodicHandlerInterface * fHandler
Definition tmfe_rev0.h:196
TMFeEquipment * fEq
Definition tmfe_rev0.h:195
virtual void HandlePeriodic()=0
DWORD n[4]
Definition mana.cxx:247
INT i
Definition mdump.cxx:32
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EventBufferCloseAll()

TMFeResult TMFE::EventBufferCloseAll ( )

Definition at line 484 of file tmfe.cxx.

485{
486 std::lock_guard<std::mutex> guard(fEventBuffersMutex);
487
488 for (auto b : fEventBuffers) {
489 if (!b)
490 continue;
491 TMFeResult r = b->CloseBuffer();
492 if (r.error_flag)
493 return r;
494
495 delete b;
496 }
497
498 fEventBuffers.clear();
499
500 return TMFeOk();
501}
std::vector< TMEventBuffer * > fEventBuffers
Definition tmfe.h:436
std::mutex fEventBuffersMutex
Definition tmfe.h:435
bool error_flag
Definition tmfe.h:89
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EventBufferFlushCacheAll()

TMFeResult TMFE::EventBufferFlushCacheAll ( bool  wait = true)

Definition at line 448 of file tmfe.cxx.

449{
450 int flag = BM_NO_WAIT;
451 if (wait)
452 flag = BM_WAIT;
453
454 /* flush of event socket in no-wait mode does nothing */
455 if (wait && rpc_is_remote()) {
456 int status = bm_flush_cache(0, flag);
457
458 //printf("bm_flush_cache(0,%d) status %d\n", flag, status);
459
460 if (status == BM_SUCCESS) {
461 // nothing
462 } else if (status == BM_ASYNC_RETURN) {
463 // nothing
464 } else {
465 return TMFeMidasError("Cannot flush mserver event socket", "bm_flush_cache", status);
466 }
467 }
468
469 std::lock_guard<std::mutex> guard(fEventBuffersMutex);
470
471 for (auto b : fEventBuffers) {
472 if (!b)
473 continue;
474
475 TMFeResult r = b->FlushCache(wait);
476
477 if (r.error_flag)
478 return r;
479 }
480
481 return TMFeOk();
482}
INT bm_flush_cache(int buffer_handle, int timeout_msec)
Definition midas.cxx:10207
#define BM_ASYNC_RETURN
Definition midas.h:613
#define BM_SUCCESS
Definition midas.h:605
#define BM_NO_WAIT
Definition midas.h:366
#define BM_WAIT
Definition midas.h:365
bool rpc_is_remote(void)
Definition midas.cxx:12761
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EventBufferOpen()

TMFeResult TMFE::EventBufferOpen ( TMEventBuffer **  pbuf,
const char bufname,
size_t  bufsize = 0 
)

Definition at line 413 of file tmfe.cxx.

414{
415 assert(pbuf != NULL);
416 assert(bufname != NULL);
417
418 std::lock_guard<std::mutex> guard(fEventBuffersMutex);
419
420 for (auto b : fEventBuffers) {
421 if (!b)
422 continue;
423
424 if (b->fBufName == bufname) {
425 *pbuf = b;
426 if (bufsize != 0 && bufsize > b->fBufSize) {
427 Msg(MERROR, "TMFE::EventBufferOpen", "Event buffer \"%s\" size %d is smaller than requested size %d", b->fBufName.c_str(), (int)b->fBufSize, (int)bufsize);
428 }
429 return TMFeOk();
430 }
431 }
432
433 TMEventBuffer *b = new TMEventBuffer(this);
434
435 fEventBuffers.push_back(b);
436
437 *pbuf = b;
438
440
441 if (r.error_flag) {
442 return r;
443 }
444
445 return TMFeOk();
446}
TMFeResult OpenBuffer(const char *bufname, size_t bufsize=0)
Definition tmfe.cxx:183
void Msg(int message_type, const char *filename, int line, const char *routine, const char *format,...) MATTRPRINTF(6
Definition tmfe.cxx:991
#define MERROR
Definition tmfe_rev0.h:70
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetThreadId() [1/2]

std::string TMFE::GetThreadId ( )
static

return identification of this thread

Definition at line 1140 of file tmfe.cxx.

1141{
1142 return ss_tid_to_string(ss_gettid());
1143}
std::string ss_tid_to_string(midas_thread_t thread_id)
Definition system.cxx:1571
midas_thread_t ss_gettid(void)
Definition system.cxx:1519
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetThreadId() [2/2]

static std::string TMFE::GetThreadId ( )
static

return identification of this thread

◆ GetTime() [1/2]

double TMFE::GetTime ( )
static

return current time in seconds, with micro-second precision

Definition at line 1011 of file tmfe.cxx.

1012{
1013 struct timeval tv;
1014 gettimeofday(&tv, NULL);
1015 return tv.tv_sec*1.0 + tv.tv_usec/1000000.0;
1016}
int gettimeofday(struct timeval *tp, void *tzp)
timeval tv
Definition msysmon.cxx:1095
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTime() [2/2]

static double TMFE::GetTime ( )
static

return current time in seconds, with micro-second precision

◆ Instance() [1/2]

TMFE * TMFE::Instance ( )
static

TMFE is a singleton class. Call instance() to get a reference to the one instance of this class.

Definition at line 57 of file tmfe.cxx.

58{
59 if (!gfMFE)
60 gfMFE = new TMFE();
61
62 return gfMFE;
63}
TMFE()
default constructor is private for singleton classes
Definition tmfe.cxx:44
static TMFE * gfMFE
Definition tmfe.h:413
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Instance() [2/2]

static TMFE * TMFE::Instance ( )
static

TMFE is a singleton class. Call instance() to get a reference to the one instance of this class.

◆ MidasPeriodicTasks() [1/2]

void TMFE::MidasPeriodicTasks ( )

Definition at line 852 of file tmfe.cxx.

853{
855}
INT cm_periodic_tasks()
Definition midas.cxx:5579
Here is the call graph for this function:

◆ MidasPeriodicTasks() [2/2]

void TMFE::MidasPeriodicTasks ( )

◆ Msg() [1/3]

void TMFE::Msg ( int  message_type,
const char filename,
int  line,
const char routine,
const char format,
  ... 
)

Definition at line 991 of file tmfe.cxx.

992{
993 char message[1024];
994 //printf("format [%s]\n", format);
995 va_list ap;
996 va_start(ap, format);
997 vsnprintf(message, sizeof(message)-1, format, ap);
998 va_end(ap);
999 //printf("message [%s]\n", message);
1000 cm_msg(message_type, filename, line, routine, "%s", message);
1002}
INT cm_msg_flush_buffer()
Definition midas.cxx:865
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
Definition midas.cxx:915
#define message(type, str)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Msg() [2/3]

void TMFE::Msg ( int  message_type,
const char filename,
int  line,
const char routine,
const char format,
  ... 
)

◆ Msg() [3/3]

void TMFE::Msg ( int  message_type,
const char filename,
int  line,
const char routine,
const std::string &  message 
)

Definition at line 1004 of file tmfe.cxx.

1005{
1006 //printf("message [%s]\n", message.c_str());
1007 cm_msg(message_type, filename, line, routine, "%s", message.c_str());
1009}
Here is the call graph for this function:

◆ PollMidas()

void TMFE::PollMidas ( int  millisec)

Definition at line 169 of file tmfe_rev0.cxx.

170{
171 double now = GetTime();
172 //double sleep_start = now;
173 double sleep_end = now + msec/1000.0;
174
175 while (!fShutdownRequested) {
178 }
179
180 now = GetTime();
181
182 double sleep_time = sleep_end - now;
183 int s = 0;
184 if (sleep_time > 0)
185 s = 1 + sleep_time*1000.0;
186
187 //printf("now %f, sleep_end %f, s %d\n", now, sleep_end, s);
188
189 int status = cm_yield(s);
190
191 if (status == RPC_SHUTDOWN || status == SS_ABORT) {
192 fShutdownRequested = true;
193 fprintf(stderr, "TMFE::PollMidas: cm_yield(%d) status %d, shutdown requested...\n", msec, status);
194 }
195
196 now = GetTime();
197 if (now >= sleep_end)
198 break;
199 }
200
201 //printf("TMFE::PollMidas: msec %d, actual %f msec\n", msec, (now - sleep_start) * 1000.0);
202}
void EquipmentPeriodicTasks()
bool fPeriodicThreadRunning
Definition tmfe_rev0.h:235
std::atomic_bool fShutdownRequested
shutdown was requested by Ctrl-C or by RPC command
Definition tmfe.h:398
INT cm_yield(INT millisec)
Definition midas.cxx:5642
#define SS_ABORT
Definition midas.h:677
#define RPC_SHUTDOWN
Definition midas.h:707
Here is the call graph for this function:

◆ RegisterEquipment()

TMFeError TMFE::RegisterEquipment ( TMFeEquipment eq)

Definition at line 122 of file tmfe_rev0.cxx.

123{
124 fEquipments.push_back(eq);
125 return TMFeError();
126}
std::vector< TMFeEquipment * > fEquipments
Definition tmfe_rev0.h:224
std::vector< FMT_ID > eq
Definition mdump.cxx:55

◆ RegisterPeriodicHandler()

void TMFE::RegisterPeriodicHandler ( TMFeEquipment eq,
TMFePeriodicHandlerInterface handler 
)

periodic handlers are executed from the periodic thread, if started

Definition at line 579 of file tmfe_rev0.cxx.

580{
582 p->fEq = eq;
583 p->fHandler = h;
584 fPeriodicHandlers.push_back(p);
585 fNextPeriodic = 0;
586}

◆ RegisterRpcHandler()

void TMFE::RegisterRpcHandler ( TMFeRpcHandlerInterface handler)

RPC handlers are executed from the RPC thread, if started.

Definition at line 484 of file tmfe_rev0.cxx.

485{
486 if (fRpcHandlers.size() == 0) {
487 // for the first handler, register with MIDAS
493 //cm_register_transition(TR_STARTABORT, tr_startabort, 500);
494 }
495
496 fRpcHandlers.push_back(h);
497}
INT cm_register_transition(INT transition, INT(*func)(INT, char *), INT sequence_number)
Definition midas.cxx:3593
INT cm_register_function(INT id, INT(*func)(INT, void **))
Definition midas.cxx:5790
#define RPC_JRPC
Definition mrpc.h:130
INT tr_stop(INT rn, char *error)
Definition mana.cxx:2036
INT tr_start(INT rn, char *error)
Definition mana.cxx:2014
INT tr_pause(INT rn, char *error)
Definition mana.cxx:2065
INT tr_resume(INT rn, char *error)
Definition mana.cxx:2078
static INT rpc_callback(INT index, void *prpc_param[])
Definition tmfe.cxx:1145
Here is the call graph for this function:

◆ RegisterRPCs()

void TMFE::RegisterRPCs ( )

Definition at line 1512 of file tmfe.cxx.

1513{
1514 if (TMFE::gfVerbose)
1515 printf("TMFE::RegisterRPCs!\n");
1516
1524}
#define RPC_BRPC
Definition mrpc.h:131
static INT tr_startabort(INT run_number, char *errstr)
Definition tmfe.cxx:1416
static INT binary_rpc_callback(INT index, void *prpc_param[])
Definition tmfe.cxx:1175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterTransitionStartAbort() [1/2]

void TMFE::RegisterTransitionStartAbort ( )

Definition at line 1507 of file tmfe.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterTransitionStartAbort() [2/2]

void TMFE::RegisterTransitionStartAbort ( )

◆ RemoveRpcHandler()

void TMFE::RemoveRpcHandler ( TMFeRpcHandlerInterface h)

Definition at line 1531 of file tmfe.cxx.

1532{
1533 for (unsigned i=0; i<fRpcHandlers.size(); i++) {
1534 if (fRpcHandlers[i] == h) {
1535 fRpcHandlers[i] = NULL;
1536 }
1537 }
1538}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetAlarm() [1/2]

TMFeError TMFE::ResetAlarm ( const char name)

Definition at line 2239 of file tmfe.cxx.

2240{
2241 int status = al_reset_alarm(name);
2242
2243 if (status) {
2244 return TMFeMidasError("Cannot reset alarm", "al_reset_alarm", status);
2245 }
2246
2247 return TMFeOk();
2248}
INT al_reset_alarm(const char *alarm_name)
Definition alarm.cxx:525
#define name(x)
Definition midas_macro.h:24
Here is the call graph for this function:

◆ ResetAlarm() [2/2]

TMFeError TMFE::ResetAlarm ( const char name)

◆ RpcThread()

void TMFE::RpcThread ( )

Definition at line 857 of file tmfe.cxx.

858{
859 if (TMFE::gfVerbose)
860 printf("TMFE::RpcThread: RPC thread started\n");
861
862 int msec = 1000;
863
864 fRpcThreadRunning = true;
866
868
869 int status = cm_yield(msec);
870
871 if (status == RPC_SHUTDOWN || status == SS_ABORT) {
872 fShutdownRequested = true;
873 if (TMFE::gfVerbose)
874 printf("TMFE::RpcThread: cm_yield(%d) status %d, shutdown requested...\n", msec, status);
875 }
876 }
878 if (TMFE::gfVerbose)
879 printf("TMFE::RpcThread: RPC thread stopped\n");
880 fRpcThreadRunning = false;
881}
std::atomic_bool fRpcThreadShutdownRequested
Definition tmfe.h:408
std::atomic_bool fRpcThreadRunning
Definition tmfe.h:407
INT ss_suspend_set_rpc_thread(midas_thread_t thread_id)
Definition system.cxx:4002
INT ss_suspend_exit()
Definition system.cxx:4226
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetTransitionSequencePause() [1/2]

void TMFE::SetTransitionSequencePause ( int  seqno)

Definition at line 1458 of file tmfe.cxx.

1459{
1461}
INT cm_set_transition_sequence(INT transition, INT sequence_number)
Definition midas.cxx:3723
Here is the call graph for this function:

◆ SetTransitionSequencePause() [2/2]

void TMFE::SetTransitionSequencePause ( int  seqno)

◆ SetTransitionSequenceResume() [1/2]

void TMFE::SetTransitionSequenceResume ( int  seqno)

Definition at line 1463 of file tmfe.cxx.

Here is the call graph for this function:

◆ SetTransitionSequenceResume() [2/2]

void TMFE::SetTransitionSequenceResume ( int  seqno)

◆ SetTransitionSequenceStart() [1/2]

void TMFE::SetTransitionSequenceStart ( int  seqno)

Definition at line 1448 of file tmfe.cxx.

Here is the call graph for this function:

◆ SetTransitionSequenceStart() [2/2]

void void TMFE::SetTransitionSequenceStart ( int  seqno)

◆ SetTransitionSequenceStartAbort() [1/2]

void TMFE::SetTransitionSequenceStartAbort ( int  seqno)

Definition at line 1468 of file tmfe.cxx.

Here is the call graph for this function:

◆ SetTransitionSequenceStartAbort() [2/2]

void TMFE::SetTransitionSequenceStartAbort ( int  seqno)

◆ SetTransitionSequenceStop() [1/2]

void TMFE::SetTransitionSequenceStop ( int  seqno)

Definition at line 1453 of file tmfe.cxx.

Here is the call graph for this function:

◆ SetTransitionSequenceStop() [2/2]

void TMFE::SetTransitionSequenceStop ( int  seqno)

◆ SetWatchdogSec() [1/2]

TMFeError TMFE::SetWatchdogSec ( int  sec)

Definition at line 144 of file tmfe.cxx.

145{
146 if (sec == 0) {
147 cm_set_watchdog_params(false, 0);
148 } else {
149 cm_set_watchdog_params(true, sec*1000);
150 }
151 return TMFeOk();
152}
INT cm_set_watchdog_params(BOOL call_watchdog, DWORD timeout)
Definition midas.cxx:3283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWatchdogSec() [2/2]

TMFeError TMFE::SetWatchdogSec ( int  sec)

◆ Sleep() [1/2]

void TMFE::Sleep ( double  sleep_time_sec)
static

sleep, with micro-second precision

Definition at line 1019 of file tmfe.cxx.

1020{
1021 if (time_sec < 0) {
1022 TMFE::Instance()->Msg(MERROR, "TMFE::Sleep", "TMFE::Sleep() called with negative sleep time: %f", time_sec);
1023 return;
1024 }
1025
1026 if (time_sec == 0) {
1027 TMFE::Instance()->Msg(MERROR, "TMFE::Sleep", "TMFE::Sleep() called with zero sleep time");
1028 return;
1029 }
1030
1031 if (time_sec > 1.01) {
1032 // break long sleep into short sleeps
1033
1034 double t0 = TMFE::GetTime();
1035 double tend = t0 + time_sec;
1036
1037 while (1) {
1038 double now = TMFE::GetTime();
1039 if (now >= tend) {
1040 //printf("t0 %f, tend %f, now %f, done!\n", t0, tend, now);
1041 return;
1042 }
1043
1044 double tsleep = tend - now;
1045
1046 //printf("t0 %f, tend %f, now %f, tsleep %f!\n", t0, tend, now, tsleep);
1047
1048 if (tsleep > 1.0)
1049 tsleep = 1.0;
1050
1052 }
1053
1054 return;
1055 }
1056
1057 int status;
1058 struct timeval timeout;
1059
1060 timeout.tv_sec = time_sec;
1061 timeout.tv_usec = (time_sec-timeout.tv_sec)*1000000.0;
1062
1063 while (1) {
1064 status = select(0, NULL, NULL, NULL, &timeout);
1065#ifdef EINVAL
1066 if (status < 0 && errno == EINVAL) {
1067 // #warning HERE EINVAL!
1068 TMFE::Instance()->Msg(MERROR, "TMFE::Sleep", "TMFE::Sleep() called with invalid sleep time: %f, tv_sec: %lld, tv_usec: %lld", time_sec, (long long int)timeout.tv_sec, (long long int)timeout.tv_usec);
1069 return;
1070 }
1071#endif
1072#ifdef EINTR
1073 if (status < 0 && errno == EINTR) {
1074 // #warning HERE EINTR!
1075 // NOTE1: on linux, "timeout" is modified by the kernel to subtract time already slept, we do not need to adjust it while handling EINTR.
1076 // NOTE2: on macos and other BSD-based systems, "timeout" value is not changed, and for accurate sleeping we should modify here, to account for time already slept, but we do not.
1077 // NOTE3: see "man select" on Linux and Macos.
1078 // NOTE4: MIDAS no longer uses SIGALRM to run cm_watchdog() and MIDAS applications do nto use signals.
1079 // NOTE4: so in theory, we do not have to worry about EINTR interrupting our sleep. K.O. Dec-2024
1080 // TMFE::Instance()->Msg(MERROR, "TMFE::Sleep", "TMFE::Sleep() EINTR, sleep time: %f, tv_sec: %lld, tv_usec: %lld", time_sec, (long long int)timeout.tv_sec, (long long int)timeout.tv_usec);
1081 continue;
1082 }
1083#endif
1084 break;
1085 }
1086
1087 if (status < 0) {
1088 TMFE::Instance()->Msg(MERROR, "TMFE::Sleep", "select() returned %d, errno %d (%s)", status, errno, strerror(errno));
1089 }
1090}
static TMFE * Instance()
Definition tmfe.cxx:57
static void Sleep(double sleep_time_sec)
sleep, with micro-second precision
Definition tmfe.cxx:1019
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sleep() [2/2]

static void TMFE::Sleep ( double  sleep_time_sec)
static

sleep, with micro-second precision

◆ StartPeriodicThread()

void TMFE::StartPeriodicThread ( )

Definition at line 262 of file tmfe_rev0.cxx.

263{
265 fprintf(stderr, "TMFE::StartPeriodicThread: periodic thread already running\n");
266 return;
267 }
268
271}
bool fPeriodicThreadStarting
Definition tmfe_rev0.h:234
midas_thread_t ss_thread_create(INT(*thread_func)(void *), void *param)
Definition system.cxx:2310
static int tmfe_periodic_thread(void *param)
Here is the call graph for this function:

◆ StartRpcThread() [1/2]

void TMFE::StartRpcThread ( )

Definition at line 903 of file tmfe.cxx.

904{
905 // NOTE: this is thread safe
906
907 std::lock_guard<std::mutex> guard(fMutex);
908
910 if (gfVerbose)
911 printf("TMFE::StartRpcThread: RPC thread already running\n");
912 return;
913 }
914
915 fRpcThreadStarting = true;
916 fRpcThread = new std::thread(&TMFE::RpcThread, this);
917}
std::thread * fRpcThread
Definition tmfe.h:405
std::atomic_bool fRpcThreadStarting
Definition tmfe.h:406
void RpcThread()
Definition tmfe.cxx:857
std::mutex fMutex
Definition tmfe.h:391
Here is the call graph for this function:

◆ StartRpcThread() [2/2]

void TMFE::StartRpcThread ( )

◆ StartRun()

void TMFE::StartRun ( )

Definition at line 714 of file tmfe.cxx.

715{
716 fRunStartTime = 0;
717
718 /* check if really stopped */
719 int run_state = 0;
720 fOdbRoot->RI("Runinfo/State", &run_state);
721
722 if (run_state != STATE_STOPPED) {
723 Msg(MERROR, "TMFE::StartRun", "Run start requested, but run is already in progress");
724 return;
725 }
726
727 bool logger_auto_restart = false;
728 fOdbRoot->RB("Logger/Auto restart", &logger_auto_restart);
729
730 if (!logger_auto_restart) {
731 Msg(MERROR, "TMFE::StartRun", "Run start requested, but logger/auto restart is off");
732 return;
733 }
734
735 Msg(MTALK, "TMFE::StartRun", "Starting new run");
736
738
739 int status = cm_transition(TR_START, 0, str, sizeof(str), TR_SYNC, FALSE);
740 if (status != CM_SUCCESS) {
741 Msg(MERROR, "TMFE::StartRun", "Cannot restart run, error: %s", str);
742 }
743}
#define FALSE
Definition cfortran.h:309
double fRunStartTime
start a new run at this time
Definition tmfe.h:445
INT cm_transition(INT transition, INT run_number, char *errstr, INT errstr_size, INT async_flag, INT debug_flag)
Definition midas.cxx:5286
#define TR_SYNC
Definition midas.h:358
#define STATE_STOPPED
Definition midas.h:305
#define TRANSITION_ERROR_STRING_LENGTH
Definition midas.h:280
char str[256]
Definition odbhist.cxx:33
#define MTALK
Definition tmfe_rev0.h:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopPeriodicThread()

void TMFE::StopPeriodicThread ( )

Definition at line 294 of file tmfe_rev0.cxx.

295{
297 return;
298
301 for (int i=0; i<60; i++) {
303 break;
304 if (i>5) {
305 fprintf(stderr, "TMFE::StopPeriodicThread: waiting for periodic thread to stop\n");
306 }
307 ::sleep(1);
308 }
309
311 fprintf(stderr, "TMFE::StopPeriodicThread: timeout waiting for periodic thread to stop\n");
312 }
313}
bool fPeriodicThreadShutdownRequested
Definition tmfe_rev0.h:236
#define sleep(ms)
Here is the call graph for this function:

◆ StopRpcThread() [1/2]

void TMFE::StopRpcThread ( )

Definition at line 935 of file tmfe.cxx.

936{
937 // NOTE: this is thread safe
938
939 fRpcThreadStarting = false;
941
942 for (int i=0; i<60; i++) {
943 if (!fRpcThreadRunning) {
944 std::lock_guard<std::mutex> guard(fMutex);
945 if (fRpcThread) {
946 fRpcThread->join();
947 delete fRpcThread;
949 if (gfVerbose)
950 printf("TMFE::StopRpcThread: RPC thread stopped\n");
951 }
952 return;
953 }
954 if (i>5) {
955 fprintf(stderr, "TMFE::StopRpcThread: waiting for RPC thread to stop\n");
956 }
957 ::sleep(1);
958 }
959
960 fprintf(stderr, "TMFE::StopRpcThread: timeout waiting for RPC thread to stop\n");
961}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopRpcThread() [2/2]

void TMFE::StopRpcThread ( )

◆ StopRun()

void TMFE::StopRun ( )

Definition at line 687 of file tmfe.cxx.

688{
690
691 int status = cm_transition(TR_STOP, 0, str, sizeof(str), TR_SYNC, FALSE);
692 if (status != CM_SUCCESS) {
693 Msg(MERROR, "TMFE::StopRun", "Cannot stop run, error: %s", str);
694 fRunStopRequested = false;
695 return;
696 }
697
698 fRunStopRequested = false;
699
700 bool logger_auto_restart = false;
701 fOdbRoot->RB("Logger/Auto restart", &logger_auto_restart);
702
704 fOdbRoot->RI("Logger/Auto restart delay", &logger_auto_restart_delay);
705
707 Msg(MINFO, "TMFE::StopRun", "Run will restart after %d seconds", logger_auto_restart_delay);
709 } else {
710 fRunStartTime = 0;
711 }
712}
bool fRunStopRequested
run stop was requested by equipment
Definition tmfe.h:444
#define MINFO
Definition tmfe_rev0.h:71
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TriggerAlarm() [1/2]

TMFeError TMFE::TriggerAlarm ( const char name,
const char message,
const char aclass 
)

Definition at line 2228 of file tmfe.cxx.

2229{
2231
2232 if (status) {
2233 return TMFeMidasError("Cannot trigger alarm", "al_trigger_alarm", status);
2234 }
2235
2236 return TMFeOk();
2237}
INT al_trigger_alarm(const char *alarm_name, const char *alarm_message, const char *default_class, const char *cond_str, INT type)
Definition alarm.cxx:283
#define AT_INTERNAL
Definition midas.h:1442
Here is the call graph for this function:

◆ TriggerAlarm() [2/2]

TMFeError TMFE::TriggerAlarm ( const char name,
const char message,
const char aclass 
)

◆ Yield()

void TMFE::Yield ( double  sleep_sec)

Definition at line 821 of file tmfe.cxx.

822{
823 double now = GetTime();
824 //double sleep_start = now;
825 double sleep_end = now + sleep_sec;
826
827 while (!fShutdownRequested) {
828 now = GetTime();
829
830 double sleep_time = sleep_end - now;
831 int s = 0;
832 if (sleep_time > 0)
833 s = 1 + sleep_time*1000.0;
834
835 //printf("TMFE::Yield: now %f, sleep_end %f, s %d\n", now, sleep_end, s);
836
837 int status = cm_yield(s);
838
839 if (status == RPC_SHUTDOWN || status == SS_ABORT) {
840 fShutdownRequested = true;
841 fprintf(stderr, "TMFE::Yield: cm_yield(%d) status %d, shutdown requested...\n", s, status);
842 }
843
844 now = GetTime();
845 if (now >= sleep_end)
846 break;
847 }
848
849 //printf("TMFE::Yield: sleep_sec %.6f, actual %.6f sec\n", sleep_sec, now - sleep_start);
850}
Here is the call graph for this function:

Member Data Documentation

◆ fDB

int TMFE::fDB = 0

ODB database handle.

Definition at line 394 of file tmfe.h.

◆ fEquipments

std::vector<TMFeEquipment*> TMFE::fEquipments

Definition at line 224 of file tmfe_rev0.h.

◆ fEventBuffers

std::vector<TMEventBuffer*> TMFE::fEventBuffers

Definition at line 436 of file tmfe.h.

◆ fEventBuffersMutex

std::mutex TMFE::fEventBuffersMutex

Definition at line 435 of file tmfe.h.

◆ fExptname

std::string TMFE::fExptname

experiment name, blank if only one experiment defined in exptab

Definition at line 384 of file tmfe.h.

◆ fFrontendFilename

std::string TMFE::fFrontendFilename

frontend program file name

Definition at line 214 of file tmfe_rev0.h.

◆ fFrontendHostname

std::string TMFE::fFrontendHostname

frontend hostname

Definition at line 213 of file tmfe_rev0.h.

◆ fFrontendName

std::string TMFE::fFrontendName

frontend program name

Definition at line 212 of file tmfe_rev0.h.

◆ fHostname

std::string TMFE::fHostname

hostname we are running on

hostname where the mserver is running, blank if using shared memory

Definition at line 388 of file tmfe.h.

◆ fMserverHostname

std::string TMFE::fMserverHostname

hostname where the mserver is running, blank if using shared memory

Definition at line 385 of file tmfe.h.

◆ fMutex

std::mutex TMFE::fMutex

Definition at line 391 of file tmfe.h.

◆ fNextPeriodic

double TMFE::fNextPeriodic

Definition at line 227 of file tmfe_rev0.h.

◆ fOdbRoot

MVOdb * TMFE::fOdbRoot = NULL

ODB root.

Definition at line 395 of file tmfe.h.

◆ fPeriodicHandlers

std::vector<TMFePeriodicHandler*> TMFE::fPeriodicHandlers

Definition at line 226 of file tmfe_rev0.h.

◆ fPeriodicThreadRunning

bool TMFE::fPeriodicThreadRunning

Definition at line 235 of file tmfe_rev0.h.

◆ fPeriodicThreadShutdownRequested

bool TMFE::fPeriodicThreadShutdownRequested

Definition at line 236 of file tmfe_rev0.h.

◆ fPeriodicThreadStarting

bool TMFE::fPeriodicThreadStarting

Definition at line 234 of file tmfe_rev0.h.

◆ fProgramName

std::string TMFE::fProgramName

frontend program name

Definition at line 387 of file tmfe.h.

◆ fRpcHandlers

std::vector< TMFeRpcHandlerInterface * > TMFE::fRpcHandlers

Definition at line 464 of file tmfe.h.

◆ fRpcThread

std::thread* TMFE::fRpcThread = NULL

Definition at line 405 of file tmfe.h.

◆ fRpcThreadRunning [1/2]

std::atomic_bool TMFE::fRpcThreadRunning {false}

Definition at line 407 of file tmfe.h.

407{false};

◆ fRpcThreadRunning [2/2]

bool TMFE::fRpcThreadRunning

Definition at line 231 of file tmfe_rev0.h.

◆ fRpcThreadShutdownRequested [1/2]

std::atomic_bool TMFE::fRpcThreadShutdownRequested {false}

Definition at line 408 of file tmfe.h.

408{false};

◆ fRpcThreadShutdownRequested [2/2]

bool TMFE::fRpcThreadShutdownRequested

Definition at line 232 of file tmfe_rev0.h.

◆ fRpcThreadStarting [1/2]

std::atomic_bool TMFE::fRpcThreadStarting {false}

Definition at line 406 of file tmfe.h.

406{false};

◆ fRpcThreadStarting [2/2]

bool TMFE::fRpcThreadStarting

Definition at line 230 of file tmfe_rev0.h.

◆ fRunNumber

int TMFE::fRunNumber = 0

current run number

Definition at line 401 of file tmfe.h.

◆ fRunStartTime

double TMFE::fRunStartTime = 0

start a new run at this time

Definition at line 445 of file tmfe.h.

◆ fRunStopRequested

bool TMFE::fRunStopRequested = false

run stop was requested by equipment

Definition at line 444 of file tmfe.h.

◆ fShutdownRequested [1/2]

std::atomic_bool TMFE::fShutdownRequested {false}

shutdown was requested by Ctrl-C or by RPC command

Definition at line 398 of file tmfe.h.

398{false};

◆ fShutdownRequested [2/2]

bool TMFE::fShutdownRequested

shutdown was requested by Ctrl-C or by RPC command

Definition at line 221 of file tmfe_rev0.h.

◆ fStateRunning

bool TMFE::fStateRunning = false

run state is running or paused

Definition at line 402 of file tmfe.h.

◆ gfMFE

static TMFE * TMFE::gfMFE = NULL
staticprivate

TMFE is a singleton class: only one instance is allowed at any time

Definition at line 413 of file tmfe.h.

◆ gfVerbose

bool TMFE::gfVerbose = false
static

Definition at line 424 of file tmfe.h.


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