MIDAS
Loading...
Searching...
No Matches
mscb_fe.cxx File Reference
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <pthread.h>
#include "mscb.h"
#include "midas.h"
#include "odbxx.h"
#include "msystem.h"
#include "mfe.h"
#include "mstrlcpy.h"
#include "class/multi.h"
#include "class/generic.h"
#include "device/mscbdev.h"
#include "device/mscbhvr.h"
#include "device/mdevice.h"
#include "device/mdevice_mscb.h"
Include dependency graph for mscb_fe.cxx:

Go to the source code of this file.

Functions

void scfe_error (const char *error)
 
INT frontend_init ()
 Frontend initialization.
 

Variables

const charfrontend_name = "SC Frontend"
 The frontend name (client name) as seen by other MIDAS clients.
 
const charfrontend_file_name = __FILE__
 The frontend file name, don't change it.
 
BOOL equipment_common_overwrite = TRUE
 
EQUIPMENT equipment []
 Main structure for midas equipment.
 

Function Documentation

◆ frontend_init()

INT frontend_init ( void  )

Frontend initialization.

Runs once at application startup. We initialize the hardware and optical interfaces and set the equipment status in ODB. We also lock the frontend to once physical cpu core.

Returns
Midas status code

Definition at line 74 of file mscb_fe.cxx.

74 {
75 /* set error dispatcher for alarm functionality */
77
78 /* set maximal retry count */
80
81 /*---- set correct ODB device addresses ----*/
82
83 mdevice_mscb envIn("Environment", "Input", DF_INPUT, "mscbxxx.psi.ch");
84 envIn.define_var(1, 0, "Temperature 1", 0.1);
85 envIn.define_var(1, 1, "Temperature 2", 0.1);
86 envIn.define_history_panel("Temperatures", 0, 1);
87
88 mdevice_mscb envOut("Environment", "Output", DF_OUTPUT, "mscbxxx.psi.ch");
89 envOut.define_var(1, 8, "Heat control 1");
90 envOut.define_var(1, 9, "Heat control 2");
91 envIn.define_history_panel("Heat Control", 0, 1);
92
93 return CM_SUCCESS;
94}
#define CM_SUCCESS
Definition midas.h:582
void mfe_set_error(void(*dispatcher)(const char *))
Definition mfe.cxx:2404
#define DF_OUTPUT
Definition midas.h:1051
#define DF_INPUT
Definition midas.h:1050
void scfe_error(const char *error)
Definition mscb_fe.cxx:64
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:

◆ scfe_error()

void scfe_error ( const char error)

Definition at line 64 of file mscb_fe.cxx.

64 {
65 char str[256];
66
67 mstrlcpy(str, error, sizeof(str));
68 cm_msg(MERROR, "scfe_error", "%s", str);
69 al_trigger_alarm("MSCB", str, "MSCB Alarm", "Communication Problem", AT_INTERNAL);
70}
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 MERROR
Definition midas.h:559
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
Definition midas.cxx:915
#define AT_INTERNAL
Definition midas.h:1442
char str[256]
Definition odbhist.cxx:33
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ equipment

EQUIPMENT equipment[]
Initial value:
= {
{
"Environment",
{10, 0,
"SYSTEM",
0,
"MIDAS",
TRUE,
RO_ALWAYS, 60000,
100,
0,
1,
"", "", ""},
},
{""}
}
#define RO_ALWAYS
Definition midas.h:436
#define EQ_SLOW
Definition midas.h:418
#define TRUE
Definition midas.h:182

Main structure for midas equipment.

Definition at line 41 of file mscb_fe.cxx.

41 {
42 {
43 "Environment", /* equipment name */
44 {10, 0, /* event ID, trigger mask */
45 "SYSTEM", /* event buffer */
46 EQ_SLOW, /* equipment type */
47 0, /* event source */
48 "MIDAS", /* format */
49 TRUE, /* enabled */
50 RO_ALWAYS, 60000, /* read full event every 60 sec */
51 100, /* read one value every 100 msec */
52 0, /* number of sub events */
53 1, /* log history every second */
54 "", "", ""},
55 cd_multi_read, /* readout routine */
56 cd_multi /* class driver main routine */
57 },
58
59 {""}
60};

◆ equipment_common_overwrite

BOOL equipment_common_overwrite = TRUE

Definition at line 39 of file mscb_fe.cxx.

◆ frontend_file_name

const char* frontend_file_name = __FILE__

The frontend file name, don't change it.

Definition at line 35 of file mscb_fe.cxx.

◆ frontend_name

const char* frontend_name = "SC Frontend"

The frontend name (client name) as seen by other MIDAS clients.

Definition at line 33 of file mscb_fe.cxx.