summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DnC/tests/RobotAssembly/RobotManager/RobotManager_exec.cpp
blob: 17aa1a3b8bea5a5edf79dbf75d3705b0b3d38c37 (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
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
// $Id$
// RobotManager_exec.cpp

#include "RobotManager_exec.h"

// RobotManager_exec_i
//
//
RobotManager_Impl::RobotManager_exec_i::~RobotManager_exec_i ()
{
}

// consumes  ProcessPallet ProcessPalletCommands;
void 
RobotManager_Impl::RobotManager_exec_i::push_ProcessPalletCommands (RobotAssembly::ProcessPallet *ev ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{

	//	 eventtype ProcessPallet {
	//		public ProcessingOrderType ProcessingOrder;
	//		public WorkOrder Order;
	//	 };
	
	RobotAssembly::WorkOrder myWorkOrder = ev->Order();
	// myProcessingOrderType should have value BeginProcessingPallet
	RobotAssembly::ProcessingOrderType myProcessingOrderType = ev->ProcessingOrder(); 

	ACE_DEBUG ((LM_DEBUG, "RobotManager - In push_ProcessPalletCommands event sink (7e)\n"));

	// Simulate call 8e - this code should be move to the RMController once the GUI is added
	//  eventtype PalletProcessingStatus {
    //		public StatusType Status;
	//		public WorkOrder Order;
	//	};
	// 8e publishes PalletProcessingStatus ProcessingStatus;
	RobotAssembly::PalletProcessingStatus_var palletProcessingStatus_event = new OBV_RobotAssembly::PalletProcessingStatus;
	palletProcessingStatus_event->Order(myWorkOrder);
	palletProcessingStatus_event->Status(RobotAssembly::palletProcessed);
	this->context_->push_ProcessingStatus(palletProcessingStatus_event ACE_ENV_ARG_PARAMETER);

}

RobotAssembly::CCM_RMController_ptr 
RobotManager_Impl::RobotManager_exec_i::get_Controller (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
	ACE_DEBUG ((LM_DEBUG, "RobotManager_Impl::RobotManager_exec.i::get_Controller called\n "));
	return (new RMController_Impl (*this));
}
		
//	provides RMController Controller;
void 
RobotManager_Impl::RMController_Impl::SetProcessingStatus (RobotAssembly::ProcessingOrderType Status ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
}

//    ProcessingOrderType GetProcessingStatus();
RobotAssembly::ProcessingOrderType 
RobotManager_Impl::RMController_Impl::GetProcessingStatus (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
	RobotAssembly::ProcessingOrderType returnType;
	return returnType;
}

//    string getHost();
char * 
RobotManager_Impl::RMController_Impl::getHost (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
	return "getHost";
}





// Operations from Components::SessionComponen
void
RobotManager_Impl::RobotManager_exec_i::set_session_context (Components::SessionContext_ptr ctx
																						 ACE_ENV_ARG_DECL)
																						 ACE_THROW_SPEC ((CORBA::SystemException,
																						 Components::CCMException))
{
	ACE_DEBUG ((LM_DEBUG, "RobotManager_Impl::RobotManager_exec_i::set_session_context\n"));
	
	this->context_ = RobotManager_Impl::RobotManager_Exec_Context::_narrow (ctx ACE_ENV_ARG_PARAMETER);
	
	ACE_CHECK;
	
	if (CORBA::is_nil (this->context_.in ()))
		
		ACE_THROW (CORBA::INTERNAL ());
	// Urm, we actually discard exceptions thown from this operation.
}

void
RobotManager_Impl::RobotManager_exec_i::ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
				Components::CCMException))
{
	ACE_DEBUG ((LM_DEBUG,"RobotManager_Impl::RobotManager_exec_i::ciao_preactivate\n"));
}

void
RobotManager_Impl::RobotManager_exec_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
				Components::CCMException))
{
	ACE_DEBUG ((LM_DEBUG,"RobotManager_Impl::RobotManager_exec_i::ccm_activate\n"));
}

void
RobotManager_Impl::RobotManager_exec_i::ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
				Components::CCMException))
{
	ACE_DEBUG ((LM_DEBUG,"RobotManager_Impl::RobotManager_exec_i::ciao_postactivate\n"));
}


void
RobotManager_Impl::RobotManager_exec_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
				Components::CCMException))
{
	ACE_DEBUG ((LM_DEBUG, "RobotManager_Impl::RobotManager_exec_i::ccm_passivate\n"));
}

void
RobotManager_Impl::RobotManager_exec_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
				Components::CCMException))
{
	ACE_DEBUG ((LM_DEBUG, "RobotManager_Impl::RobotManager_exec_i::ccm_remove\n"));
}


// RobotManagerHome_exec_i
//
//
RobotManager_Impl::RobotManagerHome_exec_i::RobotManagerHome_exec_i ()
{
}

RobotManager_Impl::RobotManagerHome_exec_i::~RobotManagerHome_exec_i ()
{
}

::Components::EnterpriseComponent_ptr
RobotManager_Impl::RobotManagerHome_exec_i::create (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
				Components::CCMException))
{
	return new RobotManager_Impl::RobotManager_exec_i;
}


extern "C" ROBOTMANAGER_EXEC_Export ::Components::HomeExecutorBase_ptr
createRobotManagerHome_Impl (void)
{
	return new RobotManager_Impl::RobotManagerHome_exec_i ();
}