MIDAS
Loading...
Searching...
No Matches
fetest_tmfe_thread.cxx File Reference
#include <stdio.h>
#include <signal.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include "midas.h"
#include "tmfe.h"
Include dependency graph for fetest_tmfe_thread.cxx:

Go to the source code of this file.

Classes

class  Myfe
 

Functions

static void usage ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char argv[] 
)

Definition at line 99 of file fetest_tmfe_thread.cxx.

100{
103
105
106 std::string name = "";
107
108 if (argc == 2) {
109 name = argv[1];
110 } else {
111 usage(); // DOES NOT RETURN
112 }
113
115
116 TMFeError err = mfe->Connect("fetest_tmfe_thread", __FILE__);
117 if (err.error) {
118 printf("Cannot connect, bye.\n");
119 return 1;
120 }
121
122 //mfe->SetWatchdogSec(0);
123
125 common->EventID = 1;
126 common->LogHistory = 1;
127 //common->Buffer = "SYSTEM";
128
129 TMFeEquipment* eq = new TMFeEquipment(mfe, "tmfe", common);
130 eq->Init();
131 eq->SetStatus("Starting...", "white");
132 eq->ZeroStatistics();
133 eq->WriteStatistics();
134
135 mfe->RegisterEquipment(eq);
136
137 Myfe* myfe = new Myfe(mfe, eq);
138
139 mfe->RegisterRpcHandler(myfe);
140
141 //mfe->SetTransitionSequenceStart(910);
142 //mfe->SetTransitionSequenceStop(90);
143 //mfe->DeregisterTransitionPause();
144 //mfe->DeregisterTransitionResume();
145
146 myfe->Init();
147
148 mfe->RegisterPeriodicHandler(eq, myfe);
149
150 printf("Main thread is %s\n", TMFE::GetThreadId().c_str());
151
152 mfe->StartRpcThread();
153 mfe->StartPeriodicThread();
154
155 eq->SetStatus("Started...", "white");
156
157 while (!mfe->fShutdownRequested) {
158 ::sleep(1);
159 }
160
161 mfe->Disconnect();
162
163 return 0;
164}
Definition tmfe.h:381
static std::string GetThreadId()
return identification of this thread
Definition tmfe.cxx:1140
static TMFE * Instance()
Definition tmfe.cxx:57
int error
Definition tmfe_rev0.h:87
static void usage()
std::vector< FMT_ID > eq
Definition mdump.cxx:55
#define sleep(ms)
#define name(x)
Definition midas_macro.h:24
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:

◆ usage()

static void usage ( )
static

Definition at line 93 of file fetest_tmfe_thread.cxx.

94{
95 fprintf(stderr, "Usage: fetest_tmfe_thread ...\n");
96 exit(1);
97}
Here is the call graph for this function:
Here is the caller graph for this function: