MIDAS
Loading...
Searching...
No Matches
scfe.cxx
Go to the documentation of this file.
1/********************************************************************\
2
3 Name: frontend.c
4 Created by: Stefan Ritt
5
6 Contents: Example Slow Control Frontend program. Defines two
7 slow control equipments, one for a HV device and one
8 for a multimeter (usually a general purpose PC plug-in
9 card with A/D inputs/outputs. As a device driver,
10 the "null" driver is used which simulates a device
11 without accessing any hardware. The used class drivers
12 cd_hv and cd_multi act as a link between the ODB and
13 the equipment and contain some functionality like
14 ramping etc. To form a fully functional frontend,
15 the device driver "null" has to be replaces with
16 real device drivers.
17
18 $Id$
19
20\********************************************************************/
21
22#include <stdio.h>
23#include "midas.h"
24#include "mfe.h"
25#include "history.h"
26#include "class/hv.h"
27#include "class/multi.h"
28#include "device/nulldev.h"
29#include "bus/null.h"
30
31/*-- Globals -------------------------------------------------------*/
32
33/* The frontend name (client name) as seen by other MIDAS clients */
34const char *frontend_name = "SC Frontend";
35/* The frontend file name, don't change it */
37
38/*-- Equipment list ------------------------------------------------*/
39
40/* device driver list */
42 {"Dummy Device", nulldev, 16, null},
43 {""}
44};
45
47 {"Input", nulldev, 3, null, DF_INPUT},
48 {"Output", nulldev, 2, null, DF_OUTPUT},
49 {""}
50};
51
53
55
56 {"Environment", /* equipment name */
57 {10, 0, /* event ID, trigger mask */
58 "SYSTEM", /* event buffer */
59 EQ_SLOW, /* equipment type */
60 0, /* event source */
61 "FIXED", /* format */
62 TRUE, /* enabled */
63 RO_RUNNING | RO_TRANSITIONS, /* read when running and on transitions */
64 60000, /* produce event every 60 sec */
65 0, /* stop run after this event limit */
66 0, /* number of sub events */
67 1, /* log history every second */
68 "", "", ""} ,
69 cd_multi_read, /* readout routine */
70 cd_multi, /* class driver main routine */
71 multi_driver, /* device driver list */
72 NULL, /* init string */
73 },
74
75 {""}
76};
77
78
79/*-- Frontend Init -------------------------------------------------*/
80
82{
83 hs_define_panel("Environment", "Sines", {
84 "Environment/Input:Input Channel 0",
85 "Environment/Input:Input Channel 1"
86 });
87
88 return CM_SUCCESS;
89}
#define CM_SUCCESS
Definition midas.h:582
INT hs_define_panel(const char *group, const char *panel, const std::vector< std::string > var)
Definition history.cxx:3492
#define RO_TRANSITIONS
Definition midas.h:434
#define RO_RUNNING
Definition midas.h:426
#define EQ_SLOW
Definition midas.h:418
DWORD BOOL
Definition midas.h:105
int INT
Definition midas.h:129
#define DF_OUTPUT
Definition midas.h:1051
#define TRUE
Definition midas.h:182
#define DF_INPUT
Definition midas.h:1050
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
const char * frontend_file_name
The frontend file name, don't change it.
Definition scfe.cxx:36
DEVICE_DRIVER multi_driver[]
Definition scfe.cxx:46
INT frontend_init()
Frontend initialization.
Definition scfe.cxx:81
BOOL equipment_common_overwrite
Definition scfe.cxx:52
EQUIPMENT equipment[]
Main structure for midas equipment.
Definition scfe.cxx:54
const char * frontend_name
The frontend name (client name) as seen by other MIDAS clients.
Definition scfe.cxx:34
DEVICE_DRIVER hv_driver[]
Definition scfe.cxx:41