MIDAS
Loading...
Searching...
No Matches
fetest_tmfe.cxx File Reference
#include <stdio.h>
#include <signal.h>
#include <assert.h>
#include <stdlib.h>
#include "midas.h"
#include "tmfe.h"
Include dependency graph for fetest_tmfe.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 104 of file fetest_tmfe.cxx.

105{
108
110
111 std::string name = "";
112
113 if (argc == 2) {
114 name = argv[1];
115 } else {
116 usage(); // DOES NOT RETURN
117 }
118
120
121 TMFeError err = mfe->Connect("fetest_tmfe", __FILE__);
122 if (err.error) {
123 printf("Cannot connect, bye.\n");
124 return 1;
125 }
126
127 //mfe->SetWatchdogSec(0);
128
130 common->EventID = 1;
131 common->LogHistory = 1;
132 //common->Buffer = "SYSTEM";
133
134 TMFeEquipment* eq = new TMFeEquipment(mfe, "tmfe", common);
135 eq->Init();
136 eq->SetStatus("Starting...", "white");
137 eq->ZeroStatistics();
138 eq->WriteStatistics();
139
140 mfe->RegisterEquipment(eq);
141
142 Myfe* myfe = new Myfe(mfe, eq);
143
144 mfe->RegisterRpcHandler(myfe);
145
146 //mfe->SetTransitionSequenceStart(910);
147 //mfe->SetTransitionSequenceStop(90);
148 //mfe->DeregisterTransitionPause();
149 //mfe->DeregisterTransitionResume();
150 //mfe->RegisterTransitionStartAbort();
151
152 myfe->Init();
153
154 mfe->RegisterPeriodicHandler(eq, myfe);
155
156 eq->SetStatus("Started...", "white");
157
158 while (!mfe->fShutdownRequested) {
159 mfe->PollMidas(10);
160 }
161
162 mfe->Disconnect();
163
164 return 0;
165}
Definition tmfe.h:381
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 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 98 of file fetest_tmfe.cxx.

99{
100 fprintf(stderr, "Usage: fetest_tmfe ...\n");
101 exit(1);
102}
Here is the call graph for this function:
Here is the caller graph for this function: