MIDAS
Loading...
Searching...
No Matches
mfed.cxx File Reference
#include <cstdio>
#include <cstring>
#include <history.h>
#include "midas.h"
#include "mfe.h"
#include "odbxx.h"
Include dependency graph for mfed.cxx:

Go to the source code of this file.

Functions

void set_max_event_size (int size)
 
void set_event_buffer_size (int size)
 
void install_poll_event (INT(*f)(INT, INT, BOOL))
 
INT poll_event (__attribute__((unused)) INT source, __attribute__((unused)) INT count, __attribute__((unused)) BOOL test)
 
INT interrupt_configure (__attribute__((unused)) INT cmd, __attribute__((unused)) INT source, __attribute__((unused)) PTYPE adr)
 
void install_frontend_exit (INT(*f)())
 
INT frontend_exit ()
 Frontend exit.
 
void install_begin_of_run (INT(*f)())
 
INT begin_of_run (__attribute__((unused)) INT rn, __attribute__((unused)) char *error)
 
void install_end_of_run (INT(*f)())
 
INT end_of_run (__attribute__((unused)) INT rn, __attribute__((unused)) char *error)
 
void install_pause_run (INT(*f)())
 
INT pause_run (__attribute__((unused)) INT rn, __attribute__((unused)) char *error)
 
void install_resume_run (INT(*f)())
 
INT resume_run (__attribute__((unused)) INT rn, __attribute__((unused)) char *error)
 
void install_frontend_loop (INT(*f)())
 
INT frontend_loop ()
 Frontend loop.
 

Variables

BOOL frontend_call_loop = TRUE
 
INT display_period = 0
 
INT max_event_size = 1024 * 1024
 
INT max_event_size_frag = 5 * 1024 * 1024
 
INT event_buffer_size = 2 * 1024 * 1024
 
INT(* p_poll_event )(INT, INT, BOOL) = NULL
 
INT(* p_frontend_exit )() = NULL
 
INT(* p_begin_of_run )() = NULL
 
INT(* p_end_of_run )() = NULL
 
INT(* p_pause_run )() = NULL
 
INT(* p_resume_run )() = NULL
 
INT(* p_frontend_loop )() = NULL
 

Function Documentation

◆ begin_of_run()

INT begin_of_run ( __attribute__((unused)) INT  rn,
__attribute__((unused)) char error 
)

Definition at line 96 of file mfed.cxx.

97{
99 return p_begin_of_run();
100 return CM_SUCCESS;
101}
#define CM_SUCCESS
Definition midas.h:582
INT(* p_begin_of_run)()
Definition mfed.cxx:89
Here is the caller graph for this function:

◆ end_of_run()

INT end_of_run ( __attribute__((unused)) INT  rn,
__attribute__((unused)) char error 
)

Definition at line 112 of file mfed.cxx.

113{
114 if (p_end_of_run)
115 return p_end_of_run();
116 return CM_SUCCESS;
117}
INT(* p_end_of_run)()
Definition mfed.cxx:105
Here is the caller graph for this function:

◆ frontend_exit()

INT frontend_exit ( void  )

Frontend exit.

Runs at frontend shutdown. Disconnect hardware and set equipment status in ODB

Returns
Midas status code

Definition at line 80 of file mfed.cxx.

81{
83 return p_frontend_exit();
84 return CM_SUCCESS;
85}
INT(* p_frontend_exit)()
Definition mfed.cxx:73
Here is the caller graph for this function:

◆ frontend_loop()

INT frontend_loop ( void  )

Frontend loop.

If frontend_call_loop is true, this routine gets called when the frontend is idle or once between every event.

Returns
Midas status code

Definition at line 162 of file mfed.cxx.

163{
164 if (p_frontend_loop)
165 return p_frontend_loop();
166 else
167 ss_sleep(10); // don't eat all CPU
168 return CM_SUCCESS;
169}
INT ss_sleep(INT millisec)
Definition system.cxx:3628
INT(* p_frontend_loop)()
Definition mfed.cxx:153
Here is the call graph for this function:
Here is the caller graph for this function:

◆ install_begin_of_run()

void install_begin_of_run ( INT(*)()  f)

Definition at line 91 of file mfed.cxx.

92{
94}

◆ install_end_of_run()

void install_end_of_run ( INT(*)()  f)

Definition at line 107 of file mfed.cxx.

108{
109 p_end_of_run = f;
110}

◆ install_frontend_exit()

void install_frontend_exit ( INT(*)()  f)

Definition at line 75 of file mfed.cxx.

76{
78}

◆ install_frontend_loop()

void install_frontend_loop ( INT(*)()  f)

Definition at line 155 of file mfed.cxx.

156{
157 p_frontend_loop = f;
158}

◆ install_pause_run()

void install_pause_run ( INT(*)()  f)

Definition at line 123 of file mfed.cxx.

124{
125 p_pause_run = f;
126}
INT(* p_pause_run)()
Definition mfed.cxx:121

◆ install_poll_event()

void install_poll_event ( INT(*)(INT, INT, BOOL f)

Definition at line 54 of file mfed.cxx.

55{
56 p_poll_event = f;
57}
INT(* p_poll_event)(INT, INT, BOOL)
Definition mfed.cxx:52
Here is the caller graph for this function:

◆ install_resume_run()

void install_resume_run ( INT(*)()  f)

Definition at line 139 of file mfed.cxx.

140{
141 p_resume_run = f;
142}
INT(* p_resume_run)()
Definition mfed.cxx:137

◆ interrupt_configure()

INT interrupt_configure ( __attribute__((unused)) INT  cmd,
__attribute__((unused)) INT  source,
__attribute__((unused)) PTYPE  adr 
)

Definition at line 66 of file mfed.cxx.

67{
68 return 1;
69}
Here is the caller graph for this function:

◆ pause_run()

INT pause_run ( __attribute__((unused)) INT  rn,
__attribute__((unused)) char error 
)

Definition at line 128 of file mfed.cxx.

129{
130 if (p_pause_run)
131 return p_pause_run();
132 return CM_SUCCESS;
133}

◆ poll_event()

INT poll_event ( __attribute__((unused)) INT  source,
__attribute__((unused)) INT  count,
__attribute__((unused)) BOOL  test 
)

Definition at line 59 of file mfed.cxx.

60{
61 if (p_poll_event)
62 return p_poll_event(source, count, test);
63 return 1;
64}
double count
Definition mdump.cxx:33
program test
Definition miniana.f:6
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resume_run()

INT resume_run ( __attribute__((unused)) INT  rn,
__attribute__((unused)) char error 
)

Definition at line 144 of file mfed.cxx.

145{
146 if (p_resume_run)
147 return p_resume_run();
148 return CM_SUCCESS;
149}

◆ set_event_buffer_size()

void set_event_buffer_size ( int  size)

Definition at line 45 of file mfed.cxx.

46{
47 event_buffer_size = size;
48}
INT event_buffer_size
Definition mfed.cxx:36

◆ set_max_event_size()

void set_max_event_size ( int  size)

Definition at line 40 of file mfed.cxx.

41{
42 max_event_size = size;
43}
INT max_event_size
Definition mfed.cxx:30

Variable Documentation

◆ display_period

INT display_period = 0

Definition at line 27 of file mfed.cxx.

◆ event_buffer_size

INT event_buffer_size = 2 * 1024 * 1024

Definition at line 36 of file mfed.cxx.

◆ frontend_call_loop

BOOL frontend_call_loop = TRUE

Definition at line 24 of file mfed.cxx.

◆ max_event_size

INT max_event_size = 1024 * 1024

Definition at line 30 of file mfed.cxx.

◆ max_event_size_frag

INT max_event_size_frag = 5 * 1024 * 1024

Definition at line 33 of file mfed.cxx.

◆ p_begin_of_run

INT(* p_begin_of_run) () ( ) = NULL

Definition at line 89 of file mfed.cxx.

◆ p_end_of_run

INT(* p_end_of_run) () ( ) = NULL

Definition at line 105 of file mfed.cxx.

◆ p_frontend_exit

INT(* p_frontend_exit) () ( ) = NULL

Definition at line 73 of file mfed.cxx.

◆ p_frontend_loop

INT(* p_frontend_loop) () ( ) = NULL

Definition at line 153 of file mfed.cxx.

◆ p_pause_run

INT(* p_pause_run) () ( ) = NULL

Definition at line 121 of file mfed.cxx.

◆ p_poll_event

INT(* p_poll_event) (INT, INT, BOOL) ( INT  ,
INT  ,
BOOL   
) = NULL

Definition at line 52 of file mfed.cxx.

◆ p_resume_run

INT(* p_resume_run) () ( ) = NULL

Definition at line 137 of file mfed.cxx.