blob: c622e5398e40fcba0681cdae0761fb6deafaa1dc (
plain)
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
|
#include "NavDisplay_exec.h"
/// Default constructor.
MyImpl::NavDisplay_exec_impl::NavDisplay_exec_impl (void)
: number_of_GPS_(1)
{
}
/// Default destructor.
MyImpl::NavDisplay_exec_impl::~NavDisplay_exec_impl (void)
{
}
// Operations from HUDisplay::NavDisplay
void
MyImpl::NavDisplay_exec_impl::push_Refresh (HUDisplay::tick *ev)
{
ACE_UNUSED_ARG (ev);
ACE_DEBUG ((LM_DEBUG,
"NavDisplay receives Refresh event from GPS supplier.\n"));
ACE_DEBUG ((LM_DEBUG,
"NavDisplay reads coordinates via GPS receptacle.\n"));
::HUDisplay::NavDisplay::GPSLocationConnections_var locs =
this->context_->get_connections_GPSLocation ();
for(CORBA::ULong i = 0; i < locs->length(); ++i)
{
HUDisplay::position_var loc = locs[i].objref;
if (CORBA::is_nil (loc.in ()))
{
throw CORBA::BAD_INV_ORDER ();
}
HUDisplay::GPS_position posxy = loc->posxy();
CORBA::Long x = posxy.pos_x % 500;
CORBA::Long y = posxy.pos_y % 300;
ACE_DEBUG ((LM_DEBUG,"NAVDISPLAY: Current Location is: (%u, %u)\n",
x,y));
}
}
//needed for GUI implementation if more then one GPS device is used.
CORBA::Long
MyImpl::NavDisplay_exec_impl::number_of_GPS ()
{
return this->number_of_GPS_;
}
void
MyImpl::NavDisplay_exec_impl::number_of_GPS (CORBA::Long number_of_GPS)
{
this->number_of_GPS_ = number_of_GPS;
}
// Operations from Components::SessionComponent
void
MyImpl::NavDisplay_exec_impl::set_session_context (
Components::SessionContext_ptr ctx)
{
//ACE_DEBUG ((LM_DEBUG,
// "MyImpl::NavDisplay_exec_impl::set_session_context\n"));
this->context_ =
HUDisplay::CCM_NavDisplay_Context::_narrow (ctx);
if (CORBA::is_nil (this->context_.in ()))
{
throw CORBA::INTERNAL ();
}
}
void
MyImpl::NavDisplay_exec_impl::configuration_complete (void)
{
}
void
MyImpl::NavDisplay_exec_impl::ccm_activate (void)
{
//ACE_DEBUG ((LM_DEBUG,
// "MyImpl::NavDisplay_exec_impl::ccm_activate\n"));
}
void
MyImpl::NavDisplay_exec_impl::ccm_remove (void)
{
//ACE_DEBUG ((LM_DEBUG,
// "MyImpl::NavDisplay_exec_impl::ccm_remove\n"));
}
/// Default ctor.
MyImpl::NavDisplayHome_exec_impl::NavDisplayHome_exec_impl (void)
{
}
/// Default dtor.
MyImpl::NavDisplayHome_exec_impl::~NavDisplayHome_exec_impl (void)
{
}
// Explicit home operations.
// Implicit home operations.
::Components::EnterpriseComponent_ptr
MyImpl::NavDisplayHome_exec_impl::create (void)
{
return new MyImpl::NavDisplay_exec_impl;
}
extern "C" NAVDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr
createNavDisplayHome_Impl (void)
{
return new MyImpl::NavDisplayHome_exec_impl;
}
|