File: xrtailab.h

package info (click to toggle)
rtai 3.6.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,448 kB
  • ctags: 13,674
  • sloc: ansic: 64,656; sh: 11,769; cpp: 10,387; makefile: 1,324; yacc: 575; lex: 366; php: 313; asm: 173; perl: 108; xml: 73
file content (325 lines) | stat: -rw-r--r-- 8,925 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
/*
COPYRIGHT (C) 2003  Lorenzo Dozio (dozio@aero.polimi.it)
		    Paolo Mantegazza (mantegazza@aero.polimi.it)
		    Roberto Bucher (roberto.bucher@supsi.ch)
		    Peter Brier (pbrier@dds.nl)

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/

#ifndef _XRTAILAB_H_
#define _XRTAILAB_H_

#define XRTAILAB_VERSION	"3.4.4"

#define MAX_NHOSTS		100
#define MAX_NAMES_SIZE		256
#define MAX_DATA_SIZE		30
#define MAX_RTAI_SCOPES		20
#define MAX_RTAI_LOGS		20
#define MAX_RTAI_METERS		20
#define MAX_RTAI_LEDS		20
#define MAX_RTAI_SYNCHS		20
#define MAX_BATCH_PARAMS	1000
#define MAX_TRACES_PER_SCOPE	10

#define FLTK_EVENTS_TICK        0.05
#define MAX_MSG_LEN             (MAX_MSG_SIZE - 100)
#define REFRESH_RATE            0.05

#define msleep(t)       do { poll(0, 0, t); } while (0)

typedef struct Target_Parameters_Struct Target_Parameters_T;
typedef struct Target_Blocks_Struct Target_Blocks_T;
typedef struct Target_Scopes_Struct Target_Scopes_T;
typedef struct Target_Logs_Struct Target_Logs_T;
typedef struct Target_ALogs_Struct Target_ALogs_T;
typedef struct Target_Leds_Struct Target_Leds_T;
typedef struct Target_Meters_Struct Target_Meters_T;
typedef struct Target_Synchs_Struct Target_Synchs_T;
typedef struct Batch_Parameters_Struct Batch_Parameters_T;

typedef struct Preferences_Struct Preferences_T;
typedef struct Profile_Struct Profile_T;
typedef struct W_Geometry_Struct W_Geometry_T;
typedef struct RGB_Color_Struct RGB_Color_T;

typedef struct Args_Struct Args_T;
typedef struct Args_Struct_ALog Alog_T;             //aggiunta 5/5 per nomi alog

typedef struct s_idx_T {
	int scope_idx;
	int trace_idx;
};

typedef struct p_idx_T {
	int block_idx;
	int param_idx;
	int val_idx;
};

typedef struct Param_Input_Block_T {
	Fl_Float_Input **inputW;
};

struct Args_Struct
{
	const char *mbx_id;
	int index;
	int x, y, w, h;
};
struct Args_Struct_ALog
{
	const char *mbx_id;
	int index;
	int x, y, w, h;
	const char *alog_name;
};
struct Target_Parameters_Struct
{
	char model_name[MAX_NAMES_SIZE];
	char block_name[MAX_NAMES_SIZE];
	char param_name[MAX_NAMES_SIZE];
	unsigned int n_rows;
	unsigned int n_cols;
	unsigned int data_type;
	unsigned int data_class;
	double data_value[MAX_DATA_SIZE];
};

struct Target_Blocks_Struct
{
	char name[MAX_NAMES_SIZE];
	int offset;
};

struct Target_Scopes_Struct
{
	char name[MAX_NAMES_SIZE];
	int ntraces;
	int visible;
	float dt;
};

struct Target_Logs_Struct
{
	char name[MAX_NAMES_SIZE];
	int nrow;
	int ncol;
	float dt;
};

struct Target_ALogs_Struct
{
	char name[MAX_NAMES_SIZE];
	int nrow;
	int ncol;
	float dt;
};

struct Target_Leds_Struct
{
	char name[MAX_NAMES_SIZE];
	int n_leds;
	int visible;
	float dt;
};

struct Target_Meters_Struct
{
	char name[MAX_NAMES_SIZE];
	int visible;
	float dt;
};

struct Target_Synchs_Struct
{
	char name[MAX_NAMES_SIZE];
	int visible;
	float dt;
};

struct Batch_Parameters_Struct
{
	int index;
	int mat_index;
	double value;
};

struct Preferences_Struct
{
	char *Target_IP;
	char *Target_Interface_Task_Name;
	char *Target_Scope_Mbx_ID;
	char *Target_Log_Mbx_ID;
	char *Target_ALog_Mbx_ID;
	char *Target_Led_Mbx_ID;
	char *Target_Meter_Mbx_ID;
	char *Target_Synch_Mbx_ID;
	int MW_w, MW_h, MW_x, MW_y;
	char *Current_Profile;
	int Num_Profiles;
	Fl_String_List Profiles;
};

struct W_Geometry_Struct
{
	int x, y, w, h;
	int visible;
};

struct RGB_Color_Struct
{
	float r, g, b;
};

struct Profile_Struct
{
	char *Target_IP;
	char *Target_Interface_Task_Name;
	char *Target_Scope_Mbx_ID;
	char *Target_Log_Mbx_ID;
	char *Target_ALog_Mbx_ID;
	char *Target_Led_Mbx_ID;
	char *Target_Meter_Mbx_ID;
	char *Target_Synch_Mbx_ID;
	char *Target_Name;

	int n_params, n_blocks;
	int n_scopes, n_logs, n_alogs;           //aggiunto 4/5
	int n_meters, n_leds;
	int n_synchs;

	W_Geometry_T P_Mgr_W;
	int P_Mgr_Batch;

	W_Geometry_T S_Mgr_W;			/* scopes manager geometry */
	int S_Mgr_Show[MAX_RTAI_SCOPES];	/* scopes manager show-hide buttons */
	int S_Mgr_Grid[MAX_RTAI_SCOPES];	/* scopes manager grid on-off buttons */
	int S_Mgr_PT[MAX_RTAI_SCOPES];		/* scopes manager points-time buttons */
	W_Geometry_T S_W[MAX_RTAI_SCOPES];	/* scope geometry */
	RGB_Color_T S_Bg_C[MAX_RTAI_SCOPES];	/* scope background color */
	RGB_Color_T S_Grid_C[MAX_RTAI_SCOPES];	/* scope grid color */
	float S_Mgr_SecDiv[MAX_RTAI_SCOPES];	/* scope seconds per division value */
	int S_Mgr_PSave[MAX_RTAI_SCOPES];	/* scope n points to save */
	float S_Mgr_TSave[MAX_RTAI_SCOPES];	/* scope n seconds to save */
	char *S_Mgr_File[MAX_RTAI_SCOPES];	/* scopes manager save file name */
	int S_Mgr_Flags[MAX_RTAI_SCOPES];	/* scopes Flags  */
	int S_Mgr_Trigger[MAX_RTAI_SCOPES];	/* scopes Trigger mode  */
	int S_Mgr_T_Show[MAX_TRACES_PER_SCOPE][MAX_RTAI_SCOPES];	/* scopes manager trace show-hide buttons */
	float S_Mgr_T_UnitDiv[MAX_TRACES_PER_SCOPE][MAX_RTAI_SCOPES];	/* scope trace units per division value */
	RGB_Color_T S_Trace_C[MAX_TRACES_PER_SCOPE][MAX_RTAI_SCOPES];	/* scope trace color */
	float S_Mgr_T_Width[MAX_TRACES_PER_SCOPE][MAX_RTAI_SCOPES];	/* scope trace width */
	float S_Mgr_T_Offset[MAX_TRACES_PER_SCOPE][MAX_RTAI_SCOPES];	/* scope trace offset */
	int S_Mgr_T_Options[MAX_TRACES_PER_SCOPE][MAX_RTAI_SCOPES];	/* scope trace options */

	int n_traces[MAX_RTAI_SCOPES];

	W_Geometry_T Log_Mgr_W;			/* logs manager geometry */
	int Log_Mgr_PT[MAX_RTAI_LOGS];		/* logs manager points-time buttons */
	int Log_Mgr_PSave[MAX_RTAI_LOGS];	/* logs manager n points to save */
	float Log_Mgr_TSave[MAX_RTAI_LOGS];	/* logs manager n seconds to save */
	char *Log_Mgr_File[MAX_RTAI_LOGS];	/* logs manager save file name */
	
	W_Geometry_T ALog_Mgr_W;		/* logs manager geometry */			//added 4/5
	char *ALog_Mgr_File[MAX_RTAI_LOGS];	/* logs manager save file name */

	W_Geometry_T Led_Mgr_W;			/* leds manager geometry */
	int Led_Mgr_Show[MAX_RTAI_LEDS];	/* leds manager show-hide buttons */
	Fl_String Led_Mgr_Color[MAX_RTAI_LEDS];	/* led color */
	W_Geometry_T Led_W[MAX_RTAI_LEDS];	/* led geometry */

	W_Geometry_T M_Mgr_W;			/* meters manager geometry */
	int M_Mgr_Show[MAX_RTAI_METERS];	/* meters manager show-hide buttons */
	float M_Mgr_Maxv[MAX_RTAI_METERS];	/* meters manager max values */
	float M_Mgr_Minv[MAX_RTAI_METERS];	/* meters manager min values */
	RGB_Color_T M_Bg_C[MAX_RTAI_METERS];	/* meter background color */
	RGB_Color_T M_Arrow_C[MAX_RTAI_METERS];	/* meter arrow color */
	RGB_Color_T M_Grid_C[MAX_RTAI_METERS];	/* meter grid color */
	W_Geometry_T M_W[MAX_RTAI_METERS];	/* meter geometry */

	W_Geometry_T Sy_Mgr_W;			/* synchs manager geometry */
	int Sy_Mgr_Show[MAX_RTAI_SYNCHS];	/* synchs manager show-hide buttons */
	W_Geometry_T Sy_W[MAX_RTAI_SYNCHS];	/* synch geometry */

	char *Text;
};

typedef enum {
	R_COLOR,
	G_COLOR,
	B_COLOR
} RGB_Colors;

typedef enum {
	rt_SCALAR,
	rt_VECTOR,
	rt_MATRIX_ROW_MAJOR,
	rt_MATRIX_COL_MAJOR,
	rt_MATRIX_COL_MAJOR_ND
} Param_Class;

typedef enum {
	CONNECT_TO_TARGET,
	CONNECT_TO_TARGET_WITH_PROFILE,
	DISCONNECT_FROM_TARGET,
	START_TARGET,
	STOP_TARGET,
	UPDATE_PARAM,
	GET_TARGET_TIME,
	BATCH_DOWNLOAD,
	GET_PARAMS,
	CLOSE
} Commands;

typedef enum {
	GEOMETRY_PREF,
	CONNECT_PREF,
	PROFILES_PREF,
	PROFILE_PREF
} Pref_Type;

typedef enum {
	PARAMS_MANAGER,
	SCOPES_MANAGER,
	LOGS_MANAGER,
	ALOGS_MANAGER,
	LEDS_MANAGER,
	METERS_MANAGER,
	SYNCHS_MANAGER
} Manager_Type;

void rlg_quit_cb(Fl_Widget*, void*);
void rlg_connect_cb(Fl_Widget *, void *);
void rlg_disconnect_cb(Fl_Widget *, void *);
void rlg_connect_wprofile_cb(Fl_Widget *, void *);
void rlg_save_profile_cb(Fl_Widget *, void *);
void rlg_delete_profile_cb(Fl_Widget *, void *);
void rlg_start_stop_cb(Fl_Widget *, void *);
void rlg_params_mgr_cb(Fl_Widget *, void *);
void rlg_scopes_mgr_cb(Fl_Widget *, void *);
void rlg_logs_mgr_cb(Fl_Widget *, void *);
void rlg_alogs_mgr_cb(Fl_Widget *, void *); //aggiunto 4/5
void rlg_leds_mgr_cb(Fl_Widget *, void *);
void rlg_meters_mgr_cb(Fl_Widget *, void *);
void rlg_synchs_mgr_cb(Fl_Widget *, void *);
void rlg_update_parameters_cb(Fl_Widget *, void *);
void rlg_batch_update_parameters_cb(Fl_Widget *, void *);
void rlg_upload_parameters_cb(Fl_Widget *, void *);
double get_parameter(Target_Parameters_T, int, int, int *);

Fl_Widget *add_paper(Fl_Group* parent, const char* name, Fl_Image* image);

#endif