Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1085 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/**
20
 ------------
21
 CVS :        $Id: draw.c,v 1.1.1.1 2002-09-02 09:37:45 pj Exp $
22
 
23
 File:        $File$
24
 Revision:    $Revision: 1.1.1.1 $
25
 Last update: $Date: 2002-09-02 09:37:45 $
26
 ------------
27
 
28
 This file is similar to the configuration of Hartik 3.3.1
29
 
30
**/
31
 
32
/*
33
 * Copyright (C) 2000 Paolo Gai and ALLEN-DESTRO
34
 *
35
 * This program is free software; you can redistribute it and/or modify
36
 * it under the terms of the GNU General Public License as published by
37
 * the Free Software Foundation; either version 2 of the License, or
38
 * (at your option) any later version.
39
 *
40
 * This program is distributed in the hope that it will be useful,
41
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 * GNU General Public License for more details.
44
 *
45
 * You should have received a copy of the GNU General Public License
46
 * along with this program; if not, write to the Free Software
47
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
48
 *
49
 */
50
 
51
#include "eli.h"
52
 
53
void draw_static()
54
{
55
  int i;
56
  /************************************/
57
  /* Sezione esecutiva della funzione */
58
  /************************************/
59
 
60
  grx_rect(X0min,Y0min,X0max,Y0max,COL_CORNICE);
61
  //       grx_rect(X0min+100,Y0min+100,X0max,Y0max,COL_CORNICE);
62
  grx_line(X0min,Y0min+100,X0min+100,Y0min+100,COL_CORNICE);
63
  //       grx_line(X0min,Y0min+350,X0min+100,Y0min+350,COL_CORNICE);
64
 
65
  grx_line(X0min+25,Y0min+100,X0min+25,Y0max,COL_CORNICE);
66
  grx_line(X0min+50,Y0min+100,X0min+50,Y0max,COL_CORNICE);
67
  grx_line(X0min+75,Y0min+100,X0min+75,Y0max,COL_CORNICE);
68
 
69
  grx_line(X0min,Y0min+100+127,X0min+25,Y0min+100+127,LIGHTBLUE);
70
  grx_line(X0min+50,Y0min+100+127,X0min+100,Y0min+100+127,LIGHTBLUE);
71
  grx_line(X0min+50,Y0min+100+127+250,X0min+100,Y0min+100+127+250,LIGHTBLUE);
72
 
73
 
74
  grx_box(X0min+101+50,400,X0min+230+50,Y0max-1,BROWN);
75
  for(i=1;i<6;i++){
76
    grx_box(X0min+101+50+38,400+35*i-10,X0min+101+50+48,400+35*i,CYAN);
77
    grx_box(X0min+101+50+81,400+35*i-10,X0min+101+50+91,400+35*i,CYAN);
78
  }
79
  grx_box(X0min+101+50+60,Y0max-30,X0min+101+50+70,Y0max-1,GREEN);
80
 
81
 
82
  grx_box(700,520,X0max-1,Y0max-1,CYAN);
83
 
84
 
85
 
86
  grx_text("Fx", X0min+5, Y0min+90, COL_TESTO, COL_SFONDO);
87
  grx_text("Fy", X0min+30, Y0min+90, COL_TESTO, COL_SFONDO);
88
  grx_text("Ax", X0min+55, Y0min+90, COL_TESTO, COL_SFONDO);
89
  grx_text("Ay", X0min+80, Y0min+90, COL_TESTO, COL_SFONDO);
90
  //       grx_text("M", X0min+10, Y0min+351, COL_TESTO, COL_SFONDO);
91
  //       grx_text("P", X0min+35, Y0min+351, COL_TESTO, COL_SFONDO);
92
  grx_text("Vx", X0min+55, Y0min+351, COL_TESTO, COL_SFONDO);
93
  grx_text("Vy", X0min+80, Y0min+351, COL_TESTO, COL_SFONDO);
94
 
95
  grx_text("S   : Su", X0min+110, Y0min+15, COL_TESTO, COL_SFONDO);
96
  grx_text("Z   : Sinistra", X0min+110, Y0min+25, COL_TESTO, COL_SFONDO);
97
  grx_text("X   : Giu", X0min+110, Y0min+35, COL_TESTO, COL_SFONDO);
98
  grx_text("C   : Destra", X0min+110, Y0min+45, COL_TESTO, COL_SFONDO);
99
  grx_text("P   : aggancia Peso", X0min+110, Y0min+55, COL_TESTO, COL_SFONDO);
100
  grx_text("L   : Libera peso", X0min+110, Y0min+65, COL_TESTO, COL_SFONDO);
101
  grx_text("Esc : Usita Programma", X0min+110, Y0min+75, COL_TESTO, COL_SFONDO);
102
 
103
 
104
}       // Fine della funzione draw_static
105
 
106
TASK disegna_stato(int i)
107
{ //double j;
108
 
109
  while (1)
110
    {
111
 
112
      sem_wait(&mutex);
113
 
114
      grx_rect(X0min+100,Y0min+100,X0max,Y0max,COL_CORNICE);
115
 
116
      grx_box(700,565,770,Y0max-1,LIGHTCYAN);
117
 
118
      grx_box(X0min+101+50,400,X0min+230+50,420,BROWN);
119
 
120
 
121
      //####################### FORZA X #############################
122
      if ( 0.25<=Forza_x)  grx_box(7,Y0min+210,26,Y0min+220,GREEN);
123
      else      grx_box(7,Y0min+210,26,Y0min+220,COL_SFONDO);
124
      if ( 0.5<=Forza_x)  grx_box(7,Y0min+195,26,Y0min+205,GREEN);
125
      else      grx_box(7,Y0min+195,26,Y0min+205,COL_SFONDO);
126
      if ( 0.75<=Forza_x) grx_box(7,Y0min+180,26,Y0min+190,GREEN);
127
      else      grx_box(7,Y0min+180,26,Y0min+190,COL_SFONDO);
128
      if ( 1<=Forza_x)    grx_box(7,Y0min+165,26,Y0min+175,GREEN);
129
      else      grx_box(7,Y0min+165,26,Y0min+175,COL_SFONDO);
130
      if ( 1.25<=Forza_x)  grx_box(7,Y0min+150,26,Y0min+160,GREEN);
131
      else      grx_box(7,Y0min+150,26,Y0min+160,COL_SFONDO);
132
      if ( 1.50<=Forza_x)  grx_box(7,Y0min+135,26,Y0min+145,YELLOW);
133
      else      grx_box(7,Y0min+135,26,Y0min+145,COL_SFONDO);
134
      if ( 1.75<=Forza_x)  grx_box(7,Y0min+120,26,Y0min+130,RED);
135
      else      grx_box(7,Y0min+120,26,Y0min+130,COL_SFONDO);
136
      if ( 2<=Forza_x)  grx_box(7,Y0min+105,26,Y0min+115,RED);
137
      else      grx_box(7,Y0min+105,26,Y0min+115,COL_SFONDO);
138
      //###########  ------       
139
      if (-0.25>=Forza_x)  grx_box(7,Y0min+230,26,Y0min+240,GREEN);
140
      else      grx_box(7,Y0min+230,26,Y0min+240,COL_SFONDO);
141
      if ( -0.5>=Forza_x)  grx_box(7,Y0min+245,26,Y0min+255,GREEN);
142
      else      grx_box(7,Y0min+245,26,Y0min+255,COL_SFONDO);
143
      if ( -0.75>=Forza_x) grx_box(7,Y0min+260,26,Y0min+270,GREEN);
144
      else      grx_box(7,Y0min+260,26,Y0min+270,COL_SFONDO);
145
      if ( -1>=Forza_x)    grx_box(7,Y0min+275,26,Y0min+285,GREEN);
146
      else      grx_box(7,Y0min+275,26,Y0min+285,COL_SFONDO);
147
      if ( -1.25>=Forza_x) grx_box(7,Y0min+290,26,Y0min+300,GREEN);
148
      else      grx_box(7,Y0min+290,26,Y0min+300,COL_SFONDO);
149
      if ( -1.50>=Forza_x) grx_box(7,Y0min+305,26,Y0min+315,YELLOW);
150
      else      grx_box(7,Y0min+305,26,Y0min+315,COL_SFONDO);
151
      if ( -1.75>=Forza_x) grx_box(7,Y0min+320,26,Y0min+330,RED);
152
      else      grx_box(7,Y0min+320,26,Y0min+330,COL_SFONDO);
153
      if ( -2>=Forza_x)    grx_box(7,Y0min+335,26,Y0min+345,RED);
154
      else      grx_box(7,Y0min+335,26,Y0min+345,COL_SFONDO);
155
      //####################### FORZA Y #############################         
156
      if ( -0.5>=Forza_y)  grx_box(32,Y0min+340,51,Y0min+345,GREEN);
157
      else  grx_box(32,Y0min+340,51,Y0min+345,COL_SFONDO);
158
      if ( -1>=Forza_y)  grx_box(32,Y0min+333,51,Y0min+338,GREEN);
159
      else  grx_box(32,Y0min+333,51,Y0min+338,COL_SFONDO);
160
      if ( -1.5>=Forza_y)  grx_box(32,Y0min+326,51,Y0min+331,GREEN);
161
      else  grx_box(32,Y0min+326,51,Y0min+331,COL_SFONDO);
162
      if ( -2>=Forza_y)  grx_box(32,Y0min+319,51,Y0min+324,GREEN);
163
      else  grx_box(32,Y0min+319,51,Y0min+324,COL_SFONDO);
164
      if ( -2.5>=Forza_y)  grx_box(32,Y0min+312,51,Y0min+317,GREEN);
165
      else  grx_box(32,Y0min+312,51,Y0min+317,COL_SFONDO);
166
      if ( -3>=Forza_y)  grx_box(32,Y0min+305,51,Y0min+310,GREEN);
167
      else  grx_box(32,Y0min+305,51,Y0min+310,COL_SFONDO);
168
      if ( -3.5>=Forza_y)  grx_box(32,Y0min+298,51,Y0min+303,GREEN);
169
      else  grx_box(32,Y0min+298,51,Y0min+303,COL_SFONDO);
170
      if ( -4>=Forza_y)  grx_box(32,Y0min+291,51,Y0min+296,GREEN);
171
      else  grx_box(32,Y0min+291,51,Y0min+296,COL_SFONDO);
172
      if ( -4.5>=Forza_y)  grx_box(32,Y0min+284,51,Y0min+289,GREEN);
173
      else  grx_box(32,Y0min+284,51,Y0min+289,COL_SFONDO);
174
      if ( -5>=Forza_y) grx_box(32,Y0min+277,51,Y0min+282,GREEN);
175
      else  grx_box(32,Y0min+277,51,Y0min+282,COL_SFONDO);
176
      if ( -5.5>=Forza_y) grx_box(32,Y0min+270,51,Y0min+275,GREEN);
177
      else  grx_box(32,Y0min+270,51,Y0min+275,COL_SFONDO);
178
      if ( -6>=Forza_y) grx_box(32,Y0min+263,51,Y0min+268,GREEN);
179
      else  grx_box(32,Y0min+263,51,Y0min+268,COL_SFONDO);
180
      if ( -6.5>=Forza_y) grx_box(32,Y0min+256,51,Y0min+261,GREEN);
181
      else  grx_box(32,Y0min+256,51,Y0min+261,COL_SFONDO);
182
      if ( -7>=Forza_y) grx_box(32,Y0min+249,51,Y0min+254,GREEN);
183
      else  grx_box(32,Y0min+249,51,Y0min+254,COL_SFONDO);
184
      if ( -7.5>=Forza_y) grx_box(32,Y0min+242,51,Y0min+247,GREEN);
185
      else  grx_box(32,Y0min+242,51,Y0min+247,COL_SFONDO);
186
      if ( -8>=Forza_y) grx_box(32,Y0min+235,51,Y0min+240,GREEN);
187
      else  grx_box(32,Y0min+235,51,Y0min+240,COL_SFONDO);
188
      if ( -8.5>=Forza_y) grx_box(32,Y0min+228,51,Y0min+233,GREEN);
189
      else  grx_box(32,Y0min+228,51,Y0min+233,COL_SFONDO);
190
      if ( -9>=Forza_y) grx_box(32,Y0min+221,51,Y0min+226,GREEN);
191
      else  grx_box(32,Y0min+221,51,Y0min+226,COL_SFONDO);
192
      if ( -9.5>=Forza_y) grx_box(32,Y0min+214,51,Y0min+219,GREEN);
193
      else  grx_box(32,Y0min+214,51,Y0min+219,COL_SFONDO);
194
      if ( -10>=Forza_y) grx_box(32,Y0min+207,51,Y0min+212,GREEN);
195
      else  grx_box(32,Y0min+207,51,Y0min+212,COL_SFONDO);
196
      if ( -10.5>=Forza_y) grx_box(32,Y0min+200,51,Y0min+205,GREEN);
197
      else  grx_box(32,Y0min+200,51,Y0min+205,COL_SFONDO);
198
      if ( -11>=Forza_y) grx_box(32,Y0min+193,51,Y0min+198,GREEN);
199
      else  grx_box(32,Y0min+193,51,Y0min+198,COL_SFONDO);
200
      if ( -11.5>=Forza_y) grx_box(32,Y0min+186,51,Y0min+191,GREEN);
201
      else  grx_box(32,Y0min+186,51,Y0min+191,COL_SFONDO);
202
      if ( -12>=Forza_y) grx_box(32,Y0min+179,51,Y0min+184,GREEN);
203
      else  grx_box(32,Y0min+179,51,Y0min+184,COL_SFONDO);
204
      if ( -12.5>=Forza_y) grx_box(32,Y0min+172,51,Y0min+177,GREEN);
205
      else  grx_box(32,Y0min+172,51,Y0min+177,COL_SFONDO);
206
      if ( -13>=Forza_y) grx_box(32,Y0min+165,51,Y0min+170,GREEN);
207
      else  grx_box(32,Y0min+165,51,Y0min+170,COL_SFONDO);
208
      if ( -13.5>=Forza_y) grx_box(32,Y0min+158,51,Y0min+163,GREEN);
209
      else  grx_box(32,Y0min+158,51,Y0min+163,COL_SFONDO);
210
      if ( -14>=Forza_y) grx_box(32,Y0min+151,51,Y0min+156,GREEN);
211
      else  grx_box(32,Y0min+151,51,Y0min+156,COL_SFONDO);
212
      if ( -14.5>=Forza_y) grx_box(32,Y0min+144,51,Y0min+149,GREEN);
213
      else  grx_box(32,Y0min+144,51,Y0min+149,COL_SFONDO);
214
      if ( -15>=Forza_y) grx_box(32,Y0min+137,51,Y0min+142,YELLOW);
215
      else  grx_box(32,Y0min+137,51,Y0min+142,COL_SFONDO);
216
      if ( -15.5>=Forza_y) grx_box(32,Y0min+130,51,Y0min+135,YELLOW);
217
      else  grx_box(32,Y0min+130,51,Y0min+135,COL_SFONDO);
218
      if ( -16>=Forza_y) grx_box(32,Y0min+123,51,Y0min+128,RED);
219
      else  grx_box(32,Y0min+123,51,Y0min+128,COL_SFONDO);
220
      if ( -16.5>=Forza_y) grx_box(32,Y0min+116,51,Y0min+121,RED);
221
      else  grx_box(32,Y0min+116,51,Y0min+121,COL_SFONDO);
222
      if ( -17>=Forza_y) grx_box(32,Y0min+109,51,Y0min+114,RED);
223
      else  grx_box(32,Y0min+109,51,Y0min+114,COL_SFONDO);
224
      if ( -17.5>=Forza_y) grx_box(32,Y0min+102,51,Y0min+107,RED);
225
      else  grx_box(32,Y0min+102,51,Y0min+107,COL_SFONDO);
226
 
227
      //####################### ACCELERAZIONE X #############################         
228
      if ( -2.125>=Acc_x)grx_box(56,Y0min+340,75,Y0min+345,RED);
229
      else  grx_box(55,Y0min+340,75,Y0min+345,COL_SFONDO);
230
      if ( -2>=Acc_x)  grx_box(56,Y0min+333,75,Y0min+338,RED);
231
      else  grx_box(56,Y0min+333,75,Y0min+338,COL_SFONDO);
232
      if ( -1.875>=Acc_x)grx_box(56,Y0min+326,75,Y0min+331,RED);
233
      else  grx_box(56,Y0min+326,75,Y0min+331,COL_SFONDO);
234
      if ( -1.750>=Acc_x)  grx_box(56,Y0min+319,75,Y0min+324,YELLOW);
235
      else  grx_box(56,Y0min+319,75,Y0min+324,COL_SFONDO);
236
      if ( -1.625>=Acc_x)grx_box(56,Y0min+312,75,Y0min+317,YELLOW);
237
      else  grx_box(56,Y0min+312,75,Y0min+317,COL_SFONDO);
238
      if ( -1.5>=Acc_x)  grx_box(56,Y0min+305,75,Y0min+310,GREEN);
239
      else  grx_box(56,Y0min+305,75,Y0min+310,COL_SFONDO);
240
      if ( -1.375>=Acc_x)grx_box(56,Y0min+298,75,Y0min+303,GREEN);
241
      else  grx_box(56,Y0min+298,75,Y0min+303,COL_SFONDO);
242
      if ( -1.250>=Acc_x)  grx_box(56,Y0min+291,75,Y0min+296,GREEN);
243
      else  grx_box(56,Y0min+291,75,Y0min+296,COL_SFONDO);
244
      if ( -1.125>=Acc_x)grx_box(56,Y0min+284,75,Y0min+289,GREEN);
245
      else  grx_box(56,Y0min+284,75,Y0min+289,COL_SFONDO);
246
      if ( -1>=Acc_x)  grx_box(56,Y0min+277,75,Y0min+282,GREEN);
247
      else  grx_box(56,Y0min+277,75,Y0min+282,COL_SFONDO);
248
      if ( -0.875>=Acc_x)grx_box(56,Y0min+270,75,Y0min+275,GREEN);
249
      else  grx_box(56,Y0min+270,75,Y0min+275,COL_SFONDO);
250
      if ( -0.750>=Acc_x)  grx_box(56,Y0min+263,75,Y0min+268,GREEN);
251
      else  grx_box(56,Y0min+263,75,Y0min+268,COL_SFONDO);
252
      if ( -0.625>=Acc_x)grx_box(56,Y0min+256,75,Y0min+261,GREEN);
253
      else  grx_box(56,Y0min+256,75,Y0min+261,COL_SFONDO);
254
      if ( -0.5>=Acc_x)  grx_box(56,Y0min+249,75,Y0min+254,GREEN);
255
      else  grx_box(56,Y0min+249,75,Y0min+254,COL_SFONDO);
256
      if ( -0.375>=Acc_x)grx_box(56,Y0min+242,75,Y0min+247,GREEN);
257
      else  grx_box(56,Y0min+242,75,Y0min+247,COL_SFONDO);
258
      if ( -0.250>=Acc_x)  grx_box(56,Y0min+235,75,Y0min+240,GREEN);
259
      else  grx_box(56,Y0min+235,75,Y0min+240,COL_SFONDO);
260
      if ( -0.125>=Acc_x)grx_box(56,Y0min+228,75,Y0min+233,GREEN);
261
      else  grx_box(56,Y0min+228,75,Y0min+233,COL_SFONDO);
262
      //#############  ------ 
263
      if ( 0.125<=Acc_x)  grx_box(56,Y0min+221,75,Y0min+226,GREEN);
264
      else  grx_box(56,Y0min+221,75,Y0min+226,COL_SFONDO);
265
      if ( 0.250<=Acc_x)grx_box(56,Y0min+214,75,Y0min+219,GREEN);
266
      else  grx_box(56,Y0min+214,75,Y0min+219,COL_SFONDO);
267
      if ( 0.375<=Acc_x) grx_box(56,Y0min+207,75,Y0min+212,GREEN);
268
      else  grx_box(56,Y0min+207,75,Y0min+212,COL_SFONDO);
269
      if (0.5<=Acc_x)grx_box(56,Y0min+200,75,Y0min+205,GREEN);
270
      else  grx_box(56,Y0min+200,75,Y0min+205,COL_SFONDO);
271
      if ( 0.625<=Acc_x) grx_box(56,Y0min+193,75,Y0min+198,GREEN);
272
      else  grx_box(56,Y0min+193,75,Y0min+198,COL_SFONDO);
273
      if (0.750<=Acc_x)grx_box(56,Y0min+186,75,Y0min+191,GREEN);
274
      else  grx_box(56,Y0min+186,75,Y0min+191,COL_SFONDO);
275
      if (0.875<=Acc_x)  grx_box(56,Y0min+179,75,Y0min+184,GREEN);
276
      else  grx_box(56,Y0min+179,75,Y0min+184,COL_SFONDO);
277
      if (1<=Acc_x)grx_box(56,Y0min+172,75,Y0min+177,GREEN);
278
      else  grx_box(56,Y0min+172,75,Y0min+177,COL_SFONDO);
279
      if (1.125<=Acc_x)  grx_box(56,Y0min+165,75,Y0min+170,GREEN);
280
      else  grx_box(56,Y0min+165,75,Y0min+170,COL_SFONDO);
281
      if (1.250<=Acc_x)grx_box(56,Y0min+158,75,Y0min+163,GREEN);
282
      else  grx_box(56,Y0min+158,75,Y0min+163,COL_SFONDO);
283
      if (1.375<=Acc_x)  grx_box(56,Y0min+151,75,Y0min+156,GREEN);
284
      else  grx_box(56,Y0min+151,75,Y0min+156,COL_SFONDO);
285
      if (1.5<=Acc_x)grx_box(56,Y0min+144,75,Y0min+149,GREEN);
286
      else  grx_box(56,Y0min+144,75,Y0min+149,COL_SFONDO);
287
      if (1.625<=Acc_x)  grx_box(56,Y0min+137,75,Y0min+142,YELLOW);
288
      else  grx_box(56,Y0min+137,75,Y0min+142,COL_SFONDO);
289
      if (1.750<=Acc_x)grx_box(56,Y0min+130,75,Y0min+135,YELLOW);
290
      else  grx_box(56,Y0min+130,75,Y0min+135,COL_SFONDO);
291
      if (1.875<=Acc_x)  grx_box(56,Y0min+123,75,Y0min+128,RED);
292
      else  grx_box(56,Y0min+123,75,Y0min+128,COL_SFONDO);
293
      if (2<=Acc_x)grx_box(56,Y0min+116,75,Y0min+121,RED);
294
      else  grx_box(56,Y0min+116,75,Y0min+121,COL_SFONDO);
295
      if (2.125<=Acc_x)  grx_box(56,Y0min+109,75,Y0min+114,RED);
296
      else  grx_box(56,Y0min+109,75,Y0min+114,COL_SFONDO);
297
      //####################### ACCELERAZIONE Y  #############################         
298
      if ( 2.5<=Acc_y)  {  grx_box(81,Y0min+340,100,Y0min+345,RED);
299
      grx_box(81+5,Y0min+340+1,100-5,Y0min+345-1,BLUE);
300
      }
301
      else    grx_box(81,Y0min+340,100,Y0min+345,COL_SFONDO);
302
      if ( 2.200<=Acc_y)      grx_box(81,Y0min+333,100,Y0min+338,RED);
303
      else    grx_box(81,Y0min+333,100,Y0min+338,COL_SFONDO);
304
      if ( 1.950<=Acc_y)  grx_box(81,Y0min+326,100,Y0min+331,RED);
305
      else    grx_box(81,Y0min+326,100,Y0min+331,COL_SFONDO);
306
      if ( 1.750<=Acc_y)  grx_box(81,Y0min+319,100,Y0min+324,YELLOW);
307
      else    grx_box(81,Y0min+319,100,Y0min+324,COL_SFONDO);
308
      if ( 1.625<=Acc_y)  grx_box(81,Y0min+312,100,Y0min+317,YELLOW);
309
      else    grx_box(81,Y0min+312,100,Y0min+317,COL_SFONDO);
310
      if ( 1.5<=Acc_y)    grx_box(81,Y0min+305,100,Y0min+310,GREEN);
311
      else    grx_box(81,Y0min+305,100,Y0min+310,COL_SFONDO);
312
      if ( 1.375<=Acc_y)  grx_box(81,Y0min+298,100,Y0min+303,GREEN);
313
      else    grx_box(81,Y0min+298,100,Y0min+303,COL_SFONDO);
314
      if ( 1.250<=Acc_y)  grx_box(81,Y0min+291,100,Y0min+296,GREEN);
315
      else    grx_box(81,Y0min+291,100,Y0min+296,COL_SFONDO);
316
      if ( 1.125<=Acc_y)  grx_box(81,Y0min+284,100,Y0min+289,GREEN);
317
      else    grx_box(81,Y0min+284,100,Y0min+289,COL_SFONDO);
318
      if ( 1<=Acc_y)      grx_box(81,Y0min+277,100,Y0min+282,GREEN);
319
      else    grx_box(81,Y0min+277,100,Y0min+282,COL_SFONDO);
320
      if ( 0.875<=Acc_y)  grx_box(81,Y0min+270,100,Y0min+275,GREEN);
321
      else    grx_box(81,Y0min+270,100,Y0min+275,COL_SFONDO);
322
      if ( 0.750<=Acc_y)  grx_box(81,Y0min+263,100,Y0min+268,GREEN);
323
      else    grx_box(81,Y0min+263,100,Y0min+268,COL_SFONDO);
324
      if ( 0.625<=Acc_y)  grx_box(81,Y0min+256,100,Y0min+261,GREEN);
325
      else    grx_box(81,Y0min+256,100,Y0min+261,COL_SFONDO);
326
      if ( 0.5<=Acc_y)    grx_box(81,Y0min+249,100,Y0min+254,GREEN);
327
      else    grx_box(81,Y0min+249,100,Y0min+254,COL_SFONDO);
328
      if ( 0.375<=Acc_y)  grx_box(81,Y0min+242,100,Y0min+247,GREEN);
329
      else    grx_box(81,Y0min+242,100,Y0min+247,COL_SFONDO);
330
      if ( 0.25<=Acc_y)  grx_box(81,Y0min+235,100,Y0min+240,GREEN);
331
      else    grx_box(81,Y0min+235,100,Y0min+240,COL_SFONDO);
332
      if ( 0.125<=Acc_y)  grx_box(81,Y0min+228,100,Y0min+233,GREEN);
333
      else    grx_box(81,Y0min+228,100,Y0min+233,COL_SFONDO);
334
      //#############  ------
335
      if ( -0.125>=Acc_y)   grx_box(81,Y0min+221,100,Y0min+226,GREEN);
336
      else    grx_box(81,Y0min+221,100,Y0min+226,COL_SFONDO);
337
      if ( -0.250>=Acc_y)   grx_box(81,Y0min+214,100,Y0min+219,GREEN);
338
      else    grx_box(81,Y0min+214,100,Y0min+219,COL_SFONDO);
339
      if ( -0.375>=Acc_y)       grx_box(81,Y0min+207,100,Y0min+212,GREEN);
340
      else    grx_box(81,Y0min+207,100,Y0min+212,COL_SFONDO);
341
      if (-0.5>=Acc_y)    grx_box(81,Y0min+200,100,Y0min+205,GREEN);
342
      else    grx_box(81,Y0min+200,100,Y0min+205,COL_SFONDO);
343
      if ( -0.625>=Acc_y)   grx_box(81,Y0min+193,100,Y0min+198,GREEN);
344
      else    grx_box(81,Y0min+193,100,Y0min+198,COL_SFONDO);
345
      if (-0.750>=Acc_y)        grx_box(81,Y0min+186,100,Y0min+191,GREEN);
346
      else    grx_box(81,Y0min+186,100,Y0min+191,COL_SFONDO);
347
      if (-0.875>=Acc_y)    grx_box(81,Y0min+179,100,Y0min+184,GREEN);
348
      else    grx_box(81,Y0min+179,100,Y0min+184,COL_SFONDO);
349
      if (-1>=Acc_y)    grx_box(81,Y0min+172,100,Y0min+177,GREEN);
350
      else    grx_box(81,Y0min+172,100,Y0min+177,COL_SFONDO);
351
      if (-1.125>=Acc_y)        grx_box(81,Y0min+165,100,Y0min+170,YELLOW);
352
      else    grx_box(81,Y0min+165,100,Y0min+170,COL_SFONDO);
353
      if (-1.250>=Acc_y)    grx_box(81,Y0min+158,100,Y0min+163,YELLOW);
354
      else    grx_box(81,Y0min+158,100,Y0min+163,COL_SFONDO);
355
      if (-1.375>=Acc_y)    grx_box(81,Y0min+151,100,Y0min+156,YELLOW);
356
      else    grx_box(81,Y0min+151,100,Y0min+156,COL_SFONDO);
357
      if (-1.5>=Acc_y)        grx_box(81,Y0min+144,100,Y0min+149,YELLOW);
358
      else    grx_box(81,Y0min+144,100,Y0min+149,COL_SFONDO);
359
      if (-1.625>=Acc_y)    grx_box(81,Y0min+137,100,Y0min+142,RED);
360
      else    grx_box(81,Y0min+137,100,Y0min+142,COL_SFONDO);
361
      if (-1.750>=Acc_y)    grx_box(81,Y0min+130,100,Y0min+135,RED);
362
      else    grx_box(81,Y0min+130,100,Y0min+135,COL_SFONDO);
363
      if (-1.875>=Acc_y)       grx_box(81,Y0min+123,100,Y0min+128,RED);
364
      else    grx_box(81,Y0min+123,100,Y0min+128,COL_SFONDO);
365
      if (-2>=Acc_y)   grx_box(81,Y0min+116,100,Y0min+121,RED);
366
      else    grx_box(81,Y0min+116,100,Y0min+121,COL_SFONDO);
367
      if (-2.3>=Acc_y)   grx_box(81,Y0min+109,100,Y0min+114,RED);
368
      else    grx_box(81,Y0min+109,100,Y0min+114,COL_SFONDO);
369
      //####################### VELOCITA X #############################         
370
      //if ( -21.25>=Velocita_x)grx_box(56,Y0min+340+250,75,Y0min+345+250,RED);
371
      //else  grx_box(55,Y0min+340+250,75,Y0min+345+250,COL_SFONDO);
372
      if ( -20>=Velocita_x)    grx_box(56,Y0min+333+250,75,Y0min+338+250,RED);
373
      else  grx_box(56,Y0min+333+250,75,Y0min+338+250,COL_SFONDO);
374
      if ( -18.75>=Velocita_x)grx_box(56,Y0min+326+250,75,Y0min+331+250,RED);
375
      else  grx_box(56,Y0min+326+250,75,Y0min+331+250,COL_SFONDO);
376
      if ( -17.50>=Velocita_x)grx_box(56,Y0min+319+250,75,Y0min+324+250,YELLOW);
377
      else  grx_box(56,Y0min+319+250,75,Y0min+324+250,COL_SFONDO);
378
      if ( -16.25>=Velocita_x)grx_box(56,Y0min+312+250,75,Y0min+317+250,YELLOW);
379
      else  grx_box(56,Y0min+312+250,75,Y0min+317+250,COL_SFONDO);
380
      if ( -15>=Velocita_x)  grx_box(56,Y0min+305+250,75,Y0min+310+250,GREEN);
381
      else  grx_box(56,Y0min+305+250,75,Y0min+310+250,COL_SFONDO);
382
      if ( -13.75>=Velocita_x)grx_box(56,Y0min+298+250,75,Y0min+303+250,GREEN);
383
      else  grx_box(56,Y0min+298+250,75,Y0min+303+250,COL_SFONDO);
384
      if ( -12.50>=Velocita_x)grx_box(56,Y0min+291+250,75,Y0min+296+250,GREEN);
385
      else  grx_box(56,Y0min+291+250,75,Y0min+296+250,COL_SFONDO);
386
      if ( -11.25>=Velocita_x)grx_box(56,Y0min+284+250,75,Y0min+289+250,GREEN);
387
      else  grx_box(56,Y0min+284+250,75,Y0min+289+250,COL_SFONDO);
388
      if ( -10>=Velocita_x)    grx_box(56,Y0min+277+250,75,Y0min+282+250,GREEN);
389
      else  grx_box(56,Y0min+277+250,75,Y0min+282+250,COL_SFONDO);
390
      if ( -8.75>=Velocita_x)grx_box(56,Y0min+270+250,75,Y0min+275+250,GREEN);
391
      else  grx_box(56,Y0min+270+250,75,Y0min+275+250,COL_SFONDO);
392
      if ( -7.50>=Velocita_x)grx_box(56,Y0min+263+250,75,Y0min+268+250,GREEN);
393
      else  grx_box(56,Y0min+263+250,75,Y0min+268+250,COL_SFONDO);
394
      if ( -6.25>=Velocita_x)grx_box(56,Y0min+256+250,75,Y0min+261+250,GREEN);
395
      else  grx_box(56,Y0min+256+250,75,Y0min+261+250,COL_SFONDO);
396
      if ( -5>=Velocita_x)  grx_box(56,Y0min+249+250,75,Y0min+254+250,GREEN);
397
      else  grx_box(56,Y0min+249+250,75,Y0min+254+250,COL_SFONDO);
398
      if ( -3.75>=Velocita_x)grx_box(56,Y0min+242+250,75,Y0min+247+250,GREEN);
399
      else  grx_box(56,Y0min+242+250,75,Y0min+247+250,COL_SFONDO);
400
      if ( -2.50>=Velocita_x)grx_box(56,Y0min+235+250,75,Y0min+240+250,GREEN);
401
      else  grx_box(56,Y0min+235+250,75,Y0min+240+250,COL_SFONDO);
402
      if ( -1.25>=Velocita_x)grx_box(56,Y0min+228+250,75,Y0min+233+250,GREEN);
403
      else  grx_box(56,Y0min+228+250,75,Y0min+233+250,COL_SFONDO);
404
      //#############  ------ 
405
      if ( 1.25<=Velocita_x) grx_box(56,Y0min+221+250,75,Y0min+226+250,GREEN);
406
      else  grx_box(56,Y0min+221+250,75,Y0min+226+250,COL_SFONDO);
407
      if ( 2.50<=Velocita_x) grx_box(56,Y0min+214+250,75,Y0min+219+250,GREEN);
408
      else  grx_box(56,Y0min+214+250,75,Y0min+219+250,COL_SFONDO);
409
      if ( 3.75<=Velocita_x) grx_box(56,Y0min+207+250,75,Y0min+212+250,GREEN);
410
      else  grx_box(56,Y0min+207+250,75,Y0min+212+250,COL_SFONDO);
411
      if (5<=Velocita_x)    grx_box(56,Y0min+200+250,75,Y0min+205+250,GREEN);
412
      else  grx_box(56,Y0min+200+250,75,Y0min+205+250,COL_SFONDO);
413
      if ( 6.25<=Velocita_x) grx_box(56,Y0min+193+250,75,Y0min+198+250,GREEN);
414
      else  grx_box(56,Y0min+193+250,75,Y0min+198+250,COL_SFONDO);
415
      if (7.50<=Velocita_x)  grx_box(56,Y0min+186+250,75,Y0min+191+250,GREEN);
416
      else  grx_box(56,Y0min+186+250,75,Y0min+191+250,COL_SFONDO);
417
      if (8.75<=Velocita_x)  grx_box(56,Y0min+179+250,75,Y0min+184+250,GREEN);
418
      else  grx_box(56,Y0min+179+250,75,Y0min+184+250,COL_SFONDO);
419
      if (10<=Velocita_x)      grx_box(56,Y0min+172+250,75,Y0min+177+250,GREEN);
420
      else  grx_box(56,Y0min+172+250,75,Y0min+177+250,COL_SFONDO);
421
      if (11.25<=Velocita_x)  grx_box(56,Y0min+165+250,75,Y0min+170+250,GREEN);
422
      else  grx_box(56,Y0min+165+250,75,Y0min+170+250,COL_SFONDO);
423
      if (12.50<=Velocita_x)  grx_box(56,Y0min+158+250,75,Y0min+163+250,GREEN);
424
      else  grx_box(56,Y0min+158+250,75,Y0min+163+250,COL_SFONDO);
425
      if (13.75<=Velocita_x)  grx_box(56,Y0min+151+250,75,Y0min+156+250,GREEN);
426
      else  grx_box(56,Y0min+151+250,75,Y0min+156+250,COL_SFONDO);
427
      if (15<=Velocita_x)    grx_box(56,Y0min+144+250,75,Y0min+149+250,GREEN);
428
      else  grx_box(56,Y0min+144+250,75,Y0min+149+250,COL_SFONDO);
429
      if (16.25<=Velocita_x)  grx_box(56,Y0min+137+250,75,Y0min+142+250,YELLOW);
430
      else  grx_box(56,Y0min+137+250,75,Y0min+142+250,COL_SFONDO);
431
      if (17.50<=Velocita_x)  grx_box(56,Y0min+130+250,75,Y0min+135+250,YELLOW);
432
      else  grx_box(56,Y0min+130+250,75,Y0min+135+250,COL_SFONDO);
433
      if (18.75<=Velocita_x)  grx_box(56,Y0min+123+250,75,Y0min+128+250,RED);
434
      else  grx_box(56,Y0min+123+250,75,Y0min+128+250,COL_SFONDO);
435
      if (20<=Velocita_x)      grx_box(56,Y0min+116+250,75,Y0min+121+250,RED);
436
      else  grx_box(56,Y0min+116+250,75,Y0min+121+250,COL_SFONDO);
437
      if (21.25<=Velocita_x)  grx_box(56,Y0min+109+250,75,Y0min+114+250,RED);
438
      else  grx_box(56,Y0min+109+250,75,Y0min+114+250,COL_SFONDO);
439
 
440
      //####################### VELOCITA Y #############################         
441
      // if ( 160<=Velocita_y)grx_box(81,Y0min+340+250,100,Y0min+345+250,RED);
442
      // else       grx_box(81,Y0min+340+250,100,Y0min+345+250,COL_SFONDO);
443
      if ( 40<=Velocita_y)   grx_box(81,Y0min+333+250,100,Y0min+338+250,RED);
444
      else       grx_box(81,Y0min+333+250,100,Y0min+338+250,COL_SFONDO);
445
      if ( 37.5<=Velocita_y)grx_box(81,Y0min+326+250,100,Y0min+331+250,RED);
446
      else       grx_box(81,Y0min+326+250,100,Y0min+331+250,COL_SFONDO);
447
      if ( 35<=Velocita_y)grx_box(81,Y0min+319+250,100,Y0min+324+250,YELLOW);
448
      else       grx_box(81,Y0min+319+250,100,Y0min+324+250,COL_SFONDO);
449
      if ( 32.5<=Velocita_y)grx_box(81,Y0min+312+250,100,Y0min+317+250,YELLOW);
450
      else       grx_box(81,Y0min+312+250,100,Y0min+317+250,COL_SFONDO);
451
      if ( 30<=Velocita_y)   grx_box(81,Y0min+305+250,100,Y0min+310+250,GREEN);
452
      else       grx_box(81,Y0min+305+250,100,Y0min+310+250,COL_SFONDO);
453
      if ( 27.5<=Velocita_y)grx_box(81,Y0min+298+250,100,Y0min+303+250,GREEN);
454
      else       grx_box(81,Y0min+298+250,100,Y0min+303+250,COL_SFONDO);
455
      if ( 25<=Velocita_y)grx_box(81,Y0min+291+250,100,Y0min+296+250,GREEN);
456
      else       grx_box(81,Y0min+291+250,100,Y0min+296+250,COL_SFONDO);
457
      if ( 22.5<=Velocita_y)grx_box(81,Y0min+284+250,100,Y0min+289+250,GREEN);
458
      else       grx_box(81,Y0min+284+250,100,Y0min+289+250,COL_SFONDO);
459
      if ( 20<=Velocita_y)   grx_box(81,Y0min+277+250,100,Y0min+282+250,GREEN);
460
      else       grx_box(81,Y0min+277+250,100,Y0min+282+250,COL_SFONDO);
461
      if ( 17.5<=Velocita_y) grx_box(81,Y0min+270+250,100,Y0min+275+250,GREEN);
462
      else       grx_box(81,Y0min+270+250,100,Y0min+275+250,COL_SFONDO);
463
      if ( 15<=Velocita_y) grx_box(81,Y0min+263+250,100,Y0min+268+250,GREEN);
464
      else       grx_box(81,Y0min+263+250,100,Y0min+268+250,COL_SFONDO);
465
      if ( 12.5<=Velocita_y) grx_box(81,Y0min+256+250,100,Y0min+261+250,GREEN);
466
      else       grx_box(81,Y0min+256+250,100,Y0min+261+250,COL_SFONDO);
467
      if ( 10<=Velocita_y)    grx_box(81,Y0min+249+250,100,Y0min+254+250,GREEN);
468
      else       grx_box(81,Y0min+249+250,100,Y0min+254+250,COL_SFONDO);
469
      if ( 7.5<=Velocita_y) grx_box(81,Y0min+242+250,100,Y0min+247+250,GREEN);
470
      else       grx_box(81,Y0min+242+250,100,Y0min+247+250,COL_SFONDO);
471
      if ( 5<=Velocita_y) grx_box(81,Y0min+235+250,100,Y0min+240+250,GREEN);
472
      else       grx_box(81,Y0min+235+250,100,Y0min+240+250,COL_SFONDO);
473
      if ( 2.5<=Velocita_y) grx_box(81,Y0min+228+250,100,Y0min+233+250,GREEN);
474
      else       grx_box(81,Y0min+228+250,100,Y0min+233+250,COL_SFONDO);
475
      //#############  ------
476
      if (-2.5>=Velocita_y)  grx_box(81,Y0min+221+250,100,Y0min+226+250,GREEN);
477
      else       grx_box(81,Y0min+221+250,100,Y0min+226+250,COL_SFONDO);
478
      if (-5>=Velocita_y)  grx_box(81,Y0min+214+250,100,Y0min+219+250,GREEN);
479
      else       grx_box(81,Y0min+214+250,100,Y0min+219+250,COL_SFONDO);
480
      if (-7.5>=Velocita_y)  grx_box(81,Y0min+207+250,100,Y0min+212+250,GREEN);
481
      else       grx_box(81,Y0min+207+250,100,Y0min+212+250,COL_SFONDO);
482
      if (-10>=Velocita_y)      grx_box(81,Y0min+200+250,100,Y0min+205+250,GREEN);
483
      else       grx_box(81,Y0min+200+250,100,Y0min+205+250,COL_SFONDO);
484
      if (-12.5>=Velocita_y)  grx_box(81,Y0min+193+250,100,Y0min+198+250,GREEN);
485
      else      grx_box(81,Y0min+193+250,100,Y0min+198+250,COL_SFONDO);
486
      if (-15>=Velocita_y)   grx_box(81,Y0min+186+250,100,Y0min+191+250,GREEN);
487
      else       grx_box(81,Y0min+186+250,100,Y0min+191+250,COL_SFONDO);
488
      if (-17.5>=Velocita_y)   grx_box(81,Y0min+179+250,100,Y0min+184+250,GREEN);
489
      else       grx_box(81,Y0min+179+250,100,Y0min+184+250,COL_SFONDO);
490
      if (-20>=Velocita_y)     grx_box(81,Y0min+172+250,100,Y0min+177+250,GREEN);
491
      else       grx_box(81,Y0min+172+250,100,Y0min+177+250,COL_SFONDO);
492
      if (-22.5>=Velocita_y)  grx_box(81,Y0min+165+250,100,Y0min+170+250,GREEN);
493
      else       grx_box(81,Y0min+165+250,100,Y0min+170+250,COL_SFONDO);
494
      if (-25>=Velocita_y)  grx_box(81,Y0min+158+250,100,Y0min+163+250,GREEN);
495
      else       grx_box(81,Y0min+158+250,100,Y0min+163+250,COL_SFONDO);
496
      if (-27.5>=Velocita_y)  grx_box(81,Y0min+151+250,100,Y0min+156+250,GREEN);
497
      else       grx_box(81,Y0min+151+250,100,Y0min+156+250,COL_SFONDO);
498
      if (-30>=Velocita_y)     grx_box(81,Y0min+144+250,100,Y0min+149+250,GREEN);
499
      else       grx_box(81,Y0min+144+250,100,Y0min+149+250,COL_SFONDO);
500
      if (-32.5>=Velocita_y)  grx_box(81,Y0min+137+250,100,Y0min+142+250,YELLOW);
501
      else       grx_box(81,Y0min+137+250,100,Y0min+142+250,COL_SFONDO);
502
      if (-35>=Velocita_y)  grx_box(81,Y0min+130+250,100,Y0min+135+250,YELLOW);
503
      else       grx_box(81,Y0min+130+250,100,Y0min+135+250,COL_SFONDO);
504
      if (-37.5>=Velocita_y)  grx_box(81,Y0min+123+250,100,Y0min+128+250,RED);
505
      else       grx_box(81,Y0min+123+250,100,Y0min+128+250,COL_SFONDO);
506
      if (-40>=Velocita_y)     grx_box(81,Y0min+116+250,100,Y0min+121+250,RED);
507
      else       grx_box(81,Y0min+116+250,100,Y0min+121+250,COL_SFONDO);
508
      if (-42.5>=Velocita_y)  grx_box(81,Y0min+109+250,100,Y0min+114+250,RED);
509
      else       grx_box(81,Y0min+109+250,100,Y0min+114+250,COL_SFONDO);
510
 
511
 
512
      sem_post(&mutex);
513
 
514
 
515
      task_endcycle();
516
    }
517
}
518
 
519