forked from RedhawkSDR/Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainch13.html
252 lines (230 loc) · 12.2 KB
/
mainch13.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head><title>13 Runtime Environment Inspection</title>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8"">
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
<!-- html,2,next,javascript,charset="utf-8" -->
<meta name="src" content="main.tex">
<meta name="date" content="2013-03-12 19:46:00">
<link rel="stylesheet" type="text/css" href="main.css">
<script type="text/javascript" src="scripts/shCore.js"></script>
<script type="text/javascript" src="scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="scripts/shBrushJava.js"></script>
<script type="text/javascript" src="scripts/shBrushPython.js"></script>
<script type="text/javascript" src="scripts/shBrushBash.js"></script>
<script type="text/javascript" src="scripts/shBrushXml.js"></script>
<link href="styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
</head><body
>
<script>
function f() {
document.getElementById('main_content_wrap').focus();
}
if (window.addEventListener) {
window.addEventListener("load", f, false);
} else if (window.attachEvent) {
window.attachEvent("onload", f);
}
</script>
<div class="header">
<ul class="navbar">
<li><a class="logo-small" href="index.html"><img src="images/RedHawk_Logo_ALT_B_121px.png"/></a></li> <li><a href="index.html">Home</a></li>
<li><a href="gettingstarted/main.html">Getting Started</a></li>
<li><a class="active" href="main.html">Documentation</a></li>
<li><a href="download.html">Download</a></li>
<li><a href="support.html">Support</a></li>
</ul>
<div class="pattern right"></div>
<a id="forkme_banner" href="https://github.com/redhawksdr">View on GitHub</a>
</div>
<!-- Custom MAIN CONTENT -->
<div id="main_content_wrap" tabindex="0" class="outer">
<section id="main_content" class="inner">
<!--l. 1--><div class="crosslinks"><p class="noindent">[<a
href="mainch14.html" >next</a>] [<a
href="mainch12.html" >prev</a>] [<a
href="mainch12.html#tailmainch12.html" >prev-tail</a>] [<a
href="#tailmainch13.html">tail</a>] [<a
href="main.html#mainch13.html" >up</a>] </p></div>
<h2 class="chapterHead"><span class="titlemark">Chapter 13</span><br /><a
id="x15-19500013"></a>Runtime Environment Inspection</h2>
<h3 class="sectionHead"><span class="titlemark">13.1 </span> <a
id="x15-19600013.1"></a>Introduction</h3>
<!--l. 6--><p class="noindent" >During runtime, there are a large number of operations that are handled under the hood by the
REDHAWK Core Framework. At times though, it becomes necessary to take a closer look at
these underlying parts to ensure that they are working properly or to inspect what kind
of a state they are currently in. REDHAWK provides tools to help accomplish this
task.
<!--l. 10--><p class="noindent" >
<h3 class="sectionHead"><span class="titlemark">13.2 </span> <a
id="x15-19700013.2"></a>REDHAWK Module</h3>
<!--l. 12--><p class="noindent" >A Python module called REDHAWK is provided with the capability to interact with running
<a
href="mainli2.html#glo:domain">Domains</a>, <a
href="mainli2.html#glo:device">Devices</a>, <a
href="mainli2.html#glo:waveformapplication">Waveforms</a> and <a
href="mainli2.html#glo:component">Components</a>. This allows for individual control and assessment
over all aspects of a runtime environment.
<!--l. 15--><p class="noindent" >In order to use the REDHAWK utility module, begin a Python session from a terminal and enter
the following command:
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
$ python
Python 2.6.6 (r266:84292, Aug 28 2012, 10:55:56)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> from ossie.utils import redhawk
]]></script>
<!--l. 26--><p class="noindent" >
<h4 class="subsectionHead"><span class="titlemark">13.2.1 </span> <a
id="x15-19800013.2.1"></a>Attach</h4>
<!--l. 28--><p class="noindent" >The module provides the ability to attach to a running <a
href="mainli2.html#glo:domain">Domain</a>.
<!--l. 30--><p class="noindent" >This allows the user access to the underlying <a
href="mainap3.html#api">API</a> of the <a
href="mainli2.html#glo:domainmanager">Domain Manager</a> in addition to other
useful functionality:
<ul class="itemize1">
<li class="itemize"><span
class="cmtt-12">createApplication() </span>- install/create a particular <a
href="mainli2.html#glo:waveformapplication">Waveform</a>
</li>
<li class="itemize"><span
class="cmtt-12">removeApplication() </span>- release a particular <a
href="mainli2.html#glo:waveformapplication">Waveform</a></li></ul>
<!--l. 37--><p class="noindent" >To attach to an existing <a
href="mainli2.html#glo:domain">Domain</a>, the name must be passed as an argument.
<!--l. 39--><p class="noindent" >Assuming the <a
href="mainli2.html#glo:domain">Domain</a> name is <span
class="cmtt-12">MY</span><span
class="cmtt-12">_DOMAIN</span>, start a Python script and enter:
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
>>> domain = redhawk.attach("MY_DOMAIN")
]]></script>
<!--l. 45--><p class="noindent" >Once attached to the running <a
href="mainli2.html#glo:domain">Domain</a>, <a
href="mainli2.html#glo:waveformapplication">Waveforms</a> that are installed in the <span
class="cmtt-12">$SDRROOT </span>can easily be
launched using the <span
class="cmtt-12">createApplication() </span>function:
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
>>> wave =
domain.createApplication("/waveforms/wave/wave.sad.xml")
]]></script>
<!--l. 52--><p class="noindent" >Upon success, the above call returns an <span
class="cmtt-12">Application </span>object which gives access to the external
resource <a
href="mainap3.html#api">API</a>. This allows for manual operation of the <a
href="mainli2.html#glo:application">Application</a>. In addition, functions exist to
allow the user to connect and disconnect <a
href="mainli2.html#glo:port">Ports</a>. Finally, in order to inspect the current conditions
of the <a
href="mainli2.html#glo:waveformapplication">Waveform</a>, an <a
href="mainap3.html#api">API</a> function call is available. This shows any external <a
href="mainli2.html#glo:port">Ports</a>, <a
href="mainli2.html#glo:component">Components</a>
that are in the <a
href="mainli2.html#glo:application">Application</a>, and their Properties.
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
>>> wave
<ossie.utils.redhawk.core.App object at 0x2bfb350>
>>> wave.api()
Waveform [wave_025_090314360_1]
---------------------------------------------------
External Ports ==============
Provides (Input) Ports ==============
Port Name Port Interface
--------- --------------
external_in IDL:BULKIO/dataChar
Uses (Output) Ports ==============
Port Name Port Interface
--------- --------------
external_out IDL:BULKIO/UsesPortStatisticsProvider
Components ==============
1. Sink
2. Source (Assembly Controller)
Properties ==============
Property Name (Data Type) [Default Value] Current Value
------------- ----------- --------------- -------------
sample_size (long/SL/32t) None None
]]></script>
<!--l. 89--><p class="noindent" >Once finished, the <a
href="mainli2.html#glo:waveformapplication">Waveform</a> needs to be removed from the <a
href="mainli2.html#glo:domain">Domain</a> by using the
<span
class="cmtt-12">removeApplication() </span>method:
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
>>> domain.removeApplication(wave)
]]></script>
<!--l. 95--><p class="noindent" >
<h4 class="subsectionHead"><span class="titlemark">13.2.2 </span> <a
id="x15-19900013.2.2"></a>Kick Start</h4>
<!--l. 97--><p class="noindent" >The kick <a
href="mainli2.html#glo:domain">Domain</a> feature allows for an easy way to launch <a
href="mainli2.html#glo:domain">Domain</a> and <a
href="mainli2.html#glo:devicemanager">Device Managers</a> from
within a Python script. With no arguments, the function will launch and return the <a
href="mainli2.html#glo:domainmanager">Domain
Manager</a> that is installed in <span
class="cmtt-12">$SDRROOT</span>. Additionally, all <a
href="mainli2.html#glo:devicemanager">Device Managers</a> in <span
class="cmtt-12">$SDRROOT/dev/nodes</span>
will be started.
<!--l. 101--><p class="noindent" >Other arguments to the function exist to control different aspects to how the <a
href="mainli2.html#glo:domain">Domain</a> is started. A
list of specific <a
href="mainli2.html#glo:devicemanager">Device Managers</a> to start can be passed if the user does not want to start all
available. If the <span
class="cmtt-12">$SDRROOT </span>that the user wishes to use is not in the standard location, a path can be
supplied to direct the function to the desired place in the file system. Standard out and logging to
a file can also be set.
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
>>> domain = redhawk.kickDomain()
INFO:DomainManager - Starting Domain Manager
INFO:DeviceManager - Starting Device Manager with
/nodes/DevMgr_localhost.localdomain/DeviceManager.dcd.xml
INFO:DomainManager - Starting ORB!
INFO:DeviceManager_impl - Connecting to Domain Manager
MY_DOMAIN/MY_DOMAIN
INFO:DeviceManager - Starting ORB!
>>> INFO:DCE:9d9bcc38-d654-43b1-8b74-1dc024318b6f:Registering
Device
INFO:DeviceManager_impl - Registering device GPP_localhost_
localdomain on
Device Manager DevMgr_localhost.localdomain
INFO:DeviceManager_impl - Initializing device GPP_localhost_
localdomain on
Device Manager DevMgr_localhost.localdomain
INFO:DeviceManager_impl - Registering device GPP_localhost_
localdomain on
Domain Manager
>>> domain
<ossie.utils.redhawk.core.Domain object at 0x2da6710>
]]></script>
<!--l. 132--><p class="noindent" >The ability to search for <a
href="mainli2.html#glo:domain">Domains</a> is also available through the scan function which searches the
<a
href="mainli2.html#glo:namingservice">Naming Service</a>.
<script type="syntaxhighlighter" class="brush: python"><![CDATA[
>>> redhawk.scan()
['MY_DOMAIN']
]]></script>
<!--l. 1--><div class="crosslinks"><p class="noindent">[<a
href="mainch14.html" >next</a>] [<a
href="mainch12.html" >prev</a>] [<a
href="mainch12.html#tailmainch12.html" >prev-tail</a>] [<a
href="mainch13.html" >front</a>] [<a
href="main.html#mainch13.html" >up</a>] </p></div>
<!--l. 1--><p class="noindent" ><a
id="tailmainch13.html"></a>
<div class=license>
<hr>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png" /></a><br /><span xmlns:dct="http:// purl.org/dc/terms/" property="dct:title">REDHAWK Documentation</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
</div>
</body></html>