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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
|
diff -uNr Framework/Makefile /home/ldapusers/istpischn/EF_P2/Framework/Makefile
--- Framework/Makefile 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/Makefile 2010-04-26 10:49:19.000000000 +0200
@@ -110,6 +110,7 @@
$(BINDIR)/CMiniCommander.o \
$(BINDIR)/CMiniComDriver.o \
$(BINDIR)/CMaxiComReceiver.o \
+$(BINDIR)/CHmiGlDataContainer.o \
$(BINDIR)/main.o \
$(TARGETOBJS)
diff -uNr Framework/src/base/CContext.cpp /home/ldapusers/istpischn/EF_P2/Framework/src/base/CContext.cpp
--- Framework/src/base/CContext.cpp 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/base/CContext.cpp 2010-04-26 10:47:30.000000000 +0200
@@ -17,6 +17,7 @@
const char* TUNER_COMPONENT_NAME = "TunerComponent";
const char* NAVI_COMPONENT_NAME = "NaviComponent";
const char* CD_COMPONENT_NAME = "CdComponent";
+const char* HMIGL_COMPONENT_NAME = "HmiGlComponent";
const Int32 CContext::ADMIN_STACK_SIZE = 1000;
const Int32 CContext::MDISP_STACK_SIZE = 1000;
@@ -33,6 +34,7 @@
const CThread::EPriority CContext::TUNER_PRIORITY = CThread::PRIORITY_NORM;
const CThread::EPriority CContext::NAVI_PRIORITY = CThread::PRIORITY_NORM;
const CThread::EPriority CContext::CD_PRIORITY = CThread::PRIORITY_NORM;
+const CThread::EPriority CContext::HMIGL_PRIORITY = CThread::PRIORITY_NORM;
const CThread::EPriority CContext::DEFAULT_PRIORITY = CThread::PRIORITY_NORM;
// these are the values defining the cpu/thread affinities;
@@ -44,6 +46,7 @@
const Int32 CContext::TUNER_AFFINITY = 4;
const Int32 CContext::NAVI_AFFINITY = 5;
const Int32 CContext::CD_AFFINITY = 6;
+const Int32 CContext::HMIGL_AFFINITY = 6;
const Int32 CContext::DEFAULT_AFFINITY = 7;
const Int32 ADMIN_NORMALQUEUESIZE = 100; // Number of Messages
@@ -52,6 +55,7 @@
const Int32 TUNER_NORMALQUEUESIZE = 100;
const Int32 NAVI_NORMALQUEUESIZE = 100;
const Int32 CD_NORMALQUEUESIZE = 100;
+const Int32 HMIGL_NORMALQUEUESIZE = 100;
const Int32 ADMIN_SYSTEMQUEUESIZE = 100;
const Int32 MDISP_SYSTEMQUEUESIZE = 100;
@@ -59,6 +63,7 @@
const Int32 TUNER_SYSTEMQUEUESIZE = 100;
const Int32 NAVI_SYSTEMQUEUESIZE = 100;
const Int32 CD_SYSTEMQUEUESIZE = 100;
+const Int32 HMIGL_SYSTEMQUEUESIZE = 100;
const Int32 ADMIN_INTERNALQUEUESIZE = 4;
const Int32 MDISP_INTERNALQUEUESIZE = 4;
@@ -66,6 +71,7 @@
const Int32 TUNER_INTERNALQUEUESIZE = 4;
const Int32 NAVI_INTERNALQUEUESIZE = 4;
const Int32 CD_INTERNALQUEUESIZE = 4;
+const Int32 HMIGL_INTERNALQUEUESIZE = 4;
const Int32 ADMIN_DCSIZE = 0;
const Int32 MDISP_DCSIZE = 0;
@@ -73,6 +79,7 @@
const Int32 TUNER_DCSIZE = MAKE_ALIGNMENT_SIZE(sizeof(CTunerDataContainer)); // in Byte
const Int32 NAVI_DCSIZE = 0; // das wird ersetzt, wenn die Containter eingefuehrt werden
const Int32 CD_DCSIZE = 0;
+const Int32 HMIGL_DCSIZE = MAKE_ALIGNMENT_SIZE(sizeof(CHmiGlDataContainer)); // in Byte;
const Int32 ADMIN_WDLIMIT = 2;
const Int32 MDISP_WDLIMIT = 2;
@@ -80,6 +87,7 @@
const Int32 TUNER_WDLIMIT = 2;
const Int32 NAVI_WDLIMIT = 2;
const Int32 CD_WDLIMIT = 2;
+const Int32 HMIGL_WDLIMIT = 2;
/// Groessenberechnungen durch den Compiler
@@ -107,9 +115,11 @@
CD_CONTEXT_SIZE = HEADER_SIZE + QUEUE_SIZE(CD_NORMALQUEUESIZE)
+ QUEUE_SIZE(CD_SYSTEMQUEUESIZE) + QUEUE_SIZE(CD_INTERNALQUEUESIZE)
+ CD_DCSIZE,
-
+ HMIGL_CONTEXT_SIZE = HEADER_SIZE + QUEUE_SIZE(HMIGL_NORMALQUEUESIZE)
+ + QUEUE_SIZE(HMIGL_SYSTEMQUEUESIZE) + QUEUE_SIZE(HMIGL_INTERNALQUEUESIZE)
+ + HMIGL_DCSIZE,
TOTAL_SIZE = ADMIN_CONTEXT_SIZE + MDISP_CONTEXT_SIZE + HMI_CONTEXT_SIZE
- + TUNER_CONTEXT_SIZE + NAVI_CONTEXT_SIZE + CD_CONTEXT_SIZE
+ + TUNER_CONTEXT_SIZE + NAVI_CONTEXT_SIZE + CD_CONTEXT_SIZE + HMIGL_CONTEXT_SIZE
};
static const CContextDescription sDescriptionTable[] =
@@ -136,7 +146,10 @@
NAVI_DCSIZE, NAVI_WDLIMIT, NAVI_CONTEXT_SIZE },
{ CD_INDEX, CD_COMPONENT_NAME, CContext::CD_AFFINITY, CContext::CD_STACK_SIZE,
CContext::CD_PRIORITY, CD_NORMALQUEUESIZE, CD_SYSTEMQUEUESIZE,
- CD_INTERNALQUEUESIZE, CD_DCSIZE, CD_WDLIMIT, CD_CONTEXT_SIZE } };
+ CD_INTERNALQUEUESIZE, CD_DCSIZE, CD_WDLIMIT, CD_CONTEXT_SIZE },
+{ HMIGL_INDEX, HMIGL_COMPONENT_NAME, CContext::HMIGL_AFFINITY, CContext::GL_STACK_SIZE,
+ CContext::HMIGL_PRIORITY, HMIGL_NORMALQUEUESIZE, HMIGL_SYSTEMQUEUESIZE,
+ HMIGL_INTERNALQUEUESIZE, HMIGL_DCSIZE, HMIGL_WDLIMIT, HMIGL_CONTEXT_SIZE } };
CComponentContext CContext::sContextTable[NUM_OF_COMPONENTS]; // wg. static
@@ -199,6 +212,11 @@
return sContextTable[CD_INDEX];
}
+CComponentContext& CContext::getHmiGlContext(void)
+{
+ return sContextTable[HMIGL_INDEX];
+}
+
CComponentContext& CContext::getContext(Component_Index Index)
{
return sContextTable[Index];
diff -uNr Framework/src/base/CContext.h /home/ldapusers/istpischn/EF_P2/Framework/src/base/CContext.h
--- Framework/src/base/CContext.h 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/base/CContext.h 2010-04-26 10:47:33.000000000 +0200
@@ -33,6 +33,10 @@
#include "CTunerDataContainer.h"
#endif
+#ifndef _CHMIGLDATACONTAINER_H
+ #include "CHmiGlDataContainer.h"
+#endif
+
#ifndef _FWASSERTION_H
#include "FWAssertion.h" // for assertion
#endif
@@ -57,6 +61,7 @@
TUNER_INDEX,
NAVI_INDEX,
CD_INDEX,
+ HMIGL_INDEX,
/**
* Das hat immer als letzter Eintrag nach den adressierbaren
* Komponenten zu folgen!
@@ -104,6 +109,7 @@
static CComponentContext& getTunerContext(void);
static CComponentContext& getNaviContext(void);
static CComponentContext& getCdContext(void);
+ static CComponentContext& getHmiGlContext(void);
static CComponentContext& getContext(Component_Index Index);
static const Int32 ADMIN_STACK_SIZE;
@@ -121,6 +127,7 @@
static const CThread::EPriority TUNER_PRIORITY;
static const CThread::EPriority NAVI_PRIORITY;
static const CThread::EPriority CD_PRIORITY;
+ static const CThread::EPriority HMIGL_PRIORITY;
static const CThread::EPriority DEFAULT_PRIORITY;
static const Int32 ADMIN_AFFINITY;
@@ -129,6 +136,7 @@
static const Int32 TUNER_AFFINITY;
static const Int32 NAVI_AFFINITY;
static const Int32 CD_AFFINITY;
+ static const Int32 HMIGL_AFFINITY;
static const Int32 DEFAULT_AFFINITY;
diff -uNr Framework/src/commander/CMiniCommander.h /home/ldapusers/istpischn/EF_P2/Framework/src/commander/CMiniCommander.h
--- Framework/src/commander/CMiniCommander.h 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/commander/CMiniCommander.h 2010-04-26 11:40:29.000000000 +0200
@@ -14,7 +14,7 @@
#include <termios.h>
-#ifdef __SH__
+#ifdef __QNX__
#define MC_DEVICE "/dev/ser1"
#else
#define MC_DEVICE "/dev/ttyS0"
diff -uNr Framework/src/components/CAdminComponent.cpp /home/ldapusers/istpischn/EF_P2/Framework/src/components/CAdminComponent.cpp
--- Framework/src/components/CAdminComponent.cpp 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/components/CAdminComponent.cpp 2010-04-26 10:25:16.000000000 +0200
@@ -101,7 +101,7 @@
/*
* GL thread for graphics
*/
- CHmiGLThread gl;
+ CHmiGLThread gl(CContext::getHmiGlContext());
CThread GLThread(gl, "GLThread", CContext::GL_STACK_SIZE,
CContext::DEFAULT_PRIORITY, CContext::HMI_AFFINITY, false);
GLThread.start();
diff -uNr Framework/src/components/CHmiComponent.cpp /home/ldapusers/istpischn/EF_P2/Framework/src/components/CHmiComponent.cpp
--- Framework/src/components/CHmiComponent.cpp 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/components/CHmiComponent.cpp 2010-04-26 10:48:37.000000000 +0200
@@ -49,6 +49,9 @@
void CHmiComponent::handleKeyEvent(const CMessage& _m) {
const IcmKeyCode keycode = (IcmKeyCode) _m.getOpcode(); // could be used for giving the 'x times-pressed' count
+ char newtitle[CHmiGlDataContainer::MAX_LINE_LENGTH];
+ char newlines[CHmiGlDataContainer::NUM_LINES][CHmiGlDataContainer::MAX_LINE_LENGTH];
+ CHmiGlDataContainer* hmiGlContPtr = static_cast<CHmiGlDataContainer*>( &(CContext::getHmiGlContext().getContainer()) );
switch (keycode) {
case CD_KEY: {
@@ -59,6 +62,23 @@
* to the GL component and setting its parameters in
* the DC.
*/
+
+ strcpy(newtitle,"CD MENU");
+ strcpy(newlines[CHmiGlDataContainer::LINE_ONE],"CD ONE");
+ strcpy(newlines[CHmiGlDataContainer::LINE_TWO],"TRACK ONE");
+ strcpy(newlines[CHmiGlDataContainer::LINE_THREE],"GUESS A TRACK TITLE");
+ strcpy(newlines[CHmiGlDataContainer::LINE_FOUR],"ONE SECOND PLAYED");
+ color4f cdBgCol = {0.0f,1.0f,0.0f,1.0f};
+ hmiGlContPtr->setTitle(newtitle);
+ for(Int32 actLine=0;actLine<CHmiGlDataContainer::NUM_LINES;actLine++)
+ {
+ hmiGlContPtr->setLine(static_cast<CHmiGlDataContainer::LINES>(actLine),newlines[actLine]);
+ }
+ hmiGlContPtr->setBackgroundColor(cdBgCol);
+ CMessage updMsg(CMessage::Internal_App_Type);
+ updMsg.setSenderID(HMI_INDEX);
+ updMsg.setReceiverID(HMIGL_INDEX);
+ CContext::getMDispContext().getInternalQueue().add(updMsg,false);
}
break;
@@ -70,6 +90,22 @@
* to the GL component and setting its parameters in
* the DC.
*/
+ strcpy(newtitle,"TUNER MENU");
+ strcpy(newlines[CHmiGlDataContainer::LINE_ONE],"SUPER STATION");
+ strcpy(newlines[CHmiGlDataContainer::LINE_TWO],"FREQ X MHZ");
+ strcpy(newlines[CHmiGlDataContainer::LINE_THREE],"RDS SAYS NICE WEATHER TODAY");
+ strcpy(newlines[CHmiGlDataContainer::LINE_FOUR],"");
+ color4f tunerBgCol = {0.0f,0.0f,1.0f,1.0f};
+ hmiGlContPtr->setTitle(newtitle);
+ for(Int32 actLine=0;actLine<CHmiGlDataContainer::NUM_LINES;actLine++)
+ {
+ hmiGlContPtr->setLine(static_cast<CHmiGlDataContainer::LINES>(actLine),newlines[actLine]);
+ }
+ hmiGlContPtr->setBackgroundColor(tunerBgCol);
+ CMessage updMsg(CMessage::Internal_App_Type);
+ updMsg.setSenderID(HMI_INDEX);
+ updMsg.setReceiverID(HMIGL_INDEX);
+ CContext::getMDispContext().getInternalQueue().add(updMsg,false);
}
break;
diff -uNr Framework/src/gl/CHmiGlDataContainer.cpp /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGlDataContainer.cpp
--- Framework/src/gl/CHmiGlDataContainer.cpp 1970-01-01 01:00:00.000000000 +0100
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGlDataContainer.cpp 2010-04-26 10:44:21.000000000 +0200
@@ -0,0 +1,53 @@
+/*
+ * CHmiGlDataContainer.cpp
+ *
+ * Created on: 21.04.2010
+ * Author: sven
+ */
+#include "CHmiGlDataContainer.h"
+
+void CHmiGlDataContainer::setTitle(const char *atitle)
+{
+ mMutex.take(true);
+ memset(mTitle,'\0',MAX_LINE_LENGTH);
+ strcpy(mTitle,atitle);
+ mMutex.give();
+}
+void CHmiGlDataContainer::setLine(const CHmiGlDataContainer::LINES lineIdx, const char *abody)
+{
+ mMutex.take(true);
+ memset(mLines[lineIdx],'\0',MAX_LINE_LENGTH);
+ strcpy(mLines[lineIdx],abody);
+ mMutex.give();
+}
+void CHmiGlDataContainer::setBackgroundColor(color4f& bgCol)
+{
+ mMutex.take(true);
+ for (UInt16 i=0;i<4;i++) {
+ mBackgroundColor[i] = bgCol[i];
+ }
+ mMutex.give();
+}
+bool CHmiGlDataContainer::getTitle(char* atitle)
+{
+ mMutex.take(true);
+ strcpy(atitle,mTitle);
+ mMutex.give();
+ return true;
+}
+bool CHmiGlDataContainer::getLine(const CHmiGlDataContainer::LINES lineIdx, char* aline)
+{
+ mMutex.take(true);
+ strcpy(aline,mLines[lineIdx]);
+ mMutex.give();
+ return true;
+}
+bool CHmiGlDataContainer::getBackgroundColor(color4f& aBgColor)
+{
+ mMutex.take(true);
+ for (UInt16 i=0;i<4;i++) {
+ aBgColor[i] = mBackgroundColor[i];
+ }
+ mMutex.give();
+ return true;
+}
diff -uNr Framework/src/gl/CHmiGlDataContainer.h /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGlDataContainer.h
--- Framework/src/gl/CHmiGlDataContainer.h 1970-01-01 01:00:00.000000000 +0100
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGlDataContainer.h 2010-04-26 10:47:50.000000000 +0200
@@ -0,0 +1,54 @@
+/*
+ * CHmiGlDataContainer.h
+ *
+ * Created on: 21.04.2010
+ * Author: sven
+ */
+#ifndef _CHMIGLDATACONTAINER_H
+#define _CHMIGLDATACONTAINER_H
+
+#ifdef QNX
+#ifdef EGL
+#include <GLES/gl.h>
+#include <GLES/egl.h>
+#include <gf/gf3d.h>
+#elif GFX
+#include "gfx.h" // QNX GF-Framework and freetype library
+#endif
+#elif LINUX
+#include <GL/gl.h>
+#include <GL/glut.h>
+#endif
+
+#ifndef _CMUTEX_H
+ #include "CMutex.h"
+#endif
+#ifndef CCONTAINER_H_
+ #include "CContainer.h"
+#endif
+
+#include <string.h>
+
+typedef GLfloat color4f[4];
+
+class CHmiGlDataContainer : public CContainer
+{
+public:
+ enum LINES {
+ LINE_ONE, LINE_TWO, LINE_THREE, LINE_FOUR, NUM_LINES
+ };
+ const static Int32 MAX_LINE_LENGTH=60;
+ void setTitle(const char*);
+ void setLine(const CHmiGlDataContainer::LINES, const char*);
+ void setBackgroundColor(color4f&);
+ bool getTitle(char*);
+ bool getLine(const CHmiGlDataContainer::LINES, char*);
+ bool getBackgroundColor(color4f&);
+private:
+ CMutex mMutex;
+ char mTitle[MAX_LINE_LENGTH];
+ char mLines[NUM_LINES][MAX_LINE_LENGTH];
+ color4f mBackgroundColor;
+};
+
+#endif /* CHMIGLDATACONTAINER_H_ */
diff -uNr Framework/src/gl/CHmiGLThread.cpp /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGLThread.cpp
--- Framework/src/gl/CHmiGLThread.cpp 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGLThread.cpp 2010-04-26 11:13:19.000000000 +0200
@@ -28,7 +28,19 @@
GLbyte allindices[] = { 0, 1, 2, 0, 2, 3 };
AGraphicsDriver* CHmiGLThread::graphics = NULL;
+CHmiGLThread* CHmiGLThread::sInstancePtr = NULL;
+CHmiGLThread::CHmiGLThread(CComponentContext& context)
+ :mContext(context), mDispatcher(context.getNormalQueue(),
+ context.getSystemQueue(), context.getInternalQueue(),
+ context.getTriggerSemaphore())
+ {
+ mDispatcher.setHandler(*this);
+ CHmiGLThread::sInstancePtr = this;
+ }
+CHmiGLThread::~CHmiGLThread()
+{
+}
void CHmiGLThread::init()
{
DEBUG_PRINT("entered");
@@ -75,7 +87,9 @@
counter++;
DEBUG_PRINT("entered (counter=%i)",counter)
-
+ DEBUG_PRINT("calling dispatch");
+ CHmiGLThread::getInstancePtr()->mDispatcher.dispatch(true);
+ DEBUG_PRINT("after dispatch");
// /*
// * Define the vertices which
// * build a panel
@@ -98,7 +112,7 @@
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLineWidth(2.0);
-
+/*
if (counter % 2) {
glColor4f(1.0, 0.0, 0.0, 1.0);
DEBUG_PRINT("color is red")
@@ -106,6 +120,11 @@
glColor4f(0.0, 1.0, 0.0, 1.0);
DEBUG_PRINT("color is green")
}
+*/
+ CHmiGlDataContainer* hmiGlContPtr = static_cast<CHmiGlDataContainer*>(&(CHmiGLThread::getInstancePtr()->mContext.getContainer()));
+ color4f bg;
+ hmiGlContPtr->getBackgroundColor(bg);
+ glColor4f(bg[0],bg[1],bg[2],bg[3]);
glEnableClientState( GL_VERTEX_ARRAY);
glVertexPointer(2, GL_SHORT, 0, verticeArray);
@@ -113,15 +132,46 @@
(GLubyte *) allindices);
// draw some text below and above the pane
- char msg[80];
- sprintf(msg, "Text below (cnt=%d)",counter);
+ //char msg[80];
+ //sprintf(msg, "Text below (cnt=%d)",counter);
+
+ //glColor4f(1.0, 1.0, 1.0, 1.0);
- glColor4f(1.0, 1.0, 1.0, 1.0);
- graphics->renderText(border, 0, msg);
- graphics->renderText(border, height - border, "Text above",CFTRender::FONT_SIZE_MINI);
+ char title[CHmiGlDataContainer::MAX_LINE_LENGTH];
+ char lines[CHmiGlDataContainer::NUM_LINES][CHmiGlDataContainer::MAX_LINE_LENGTH];
+ hmiGlContPtr->getTitle(title);
+ DEBUG_PRINT("Title: %s",title);
+ for(Int32 actLine = CHmiGlDataContainer::LINE_ONE;
+ actLine < CHmiGlDataContainer::NUM_LINES;
+ actLine++) {
+ hmiGlContPtr->getLine(static_cast<CHmiGlDataContainer::LINES>(actLine),lines[actLine]);
+ DEBUG_PRINT("Line %d: %s",actLine,lines[actLine]);
+ }
+
+ //graphics->renderText(border, 0, msg);
+ graphics->renderText(border, 0, title);
+ for(Int32 actLine = CHmiGlDataContainer::LINE_ONE;
+ actLine < CHmiGlDataContainer::NUM_LINES;
+ actLine++) {
+ graphics->renderText(border,(WINDOW_HEIGHT - border - 30) - (30*actLine),lines[actLine]);
+ }
+ //graphics->renderText(border, height - border, "Text above",CFTRender::FONT_SIZE_MINI);
graphics->finishDraw(); // dependency to graphics driver
glFinish();
+/* DEBUG_PRINT("calling dispatch");
+ CHmiGLThread::getInstancePtr()->mDispatcher.dispatch(true);
+ DEBUG_PRINT("after dispatch");*/
+
+}
+void CHmiGLThread::handleMessage(const CMessage& msg)
+{
+ DEBUG_PRINT("handle Message");
+}
+
+CHmiGLThread* CHmiGLThread::getInstancePtr(void)
+{
+ return sInstancePtr;
}
diff -uNr Framework/src/gl/CHmiGLThread.h /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGLThread.h
--- Framework/src/gl/CHmiGLThread.h 2010-04-22 17:05:16.000000000 +0200
+++ /home/ldapusers/istpischn/EF_P2/Framework/src/gl/CHmiGLThread.h 2010-04-26 10:34:18.000000000 +0200
@@ -20,9 +20,11 @@
#include <stdio.h>
#include <unistd.h>
-class CHmiGLThread : public IRunnable
+class CHmiGLThread : public IRunnable, public IMessageHandler
{
public:
+ CHmiGLThread(CComponentContext&);
+ ~CHmiGLThread();
virtual void init();
virtual void run();
virtual void stop();
@@ -30,6 +32,7 @@
virtual void prepareForShutdown() {}
virtual void reRun() {}
virtual void goToStandby() {}
+ virtual void handleMessage(const CMessage& msg);
/* must be static so it can
* be called from the C-function
@@ -37,8 +40,13 @@
* CHmiGLThread.cpp
*/
static void draw();
+ static CHmiGLThread* getInstancePtr();
static AGraphicsDriver* graphics;
+ private:
+ CComponentContext& mContext;
+ CDispatcher mDispatcher;
+ static CHmiGLThread* sInstancePtr;
};
#endif // CHMIGLTHREAD_H_
|