dRonin
adbada4
dRonin GCS
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Groups
Pages
uavobjecttemplate.py
Go to the documentation of this file.
1
##
2
##############################################################################
3
#
4
# @file $(NAMELC).py
5
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6
# @brief Implementation of the $(NAME) object. This file has been
7
# automatically generated by the UAVObjectGenerator.
8
#
9
# @note Object definition file: $(XMLFILE).
10
# This is an automatically generated file.
11
# DO NOT modify manually.
12
#
13
# @see The GNU Public License (GPL) Version 3
14
#
15
#############################################################################/
16
#
17
# This program is free software; you can redistribute it and/or modify
18
# it under the terms of the GNU General Public License as published by
19
# the Free Software Foundation; either version 3 of the License, or
20
# (at your option) any later version.
21
#
22
# This program is distributed in the hope that it will be useful, but
23
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25
# for more details.
26
#
27
# You should have received a copy of the GNU General Public License along
28
# with this program; if not, see <http://www.gnu.org/licenses/>
29
#
30
31
32
import
uavobject
33
34
import
struct
35
from
collections
import
namedtuple
36
37
# This is a list of instances of the data fields contained in this object
38
_fields = $(DATAFIELDS)
39
40
class
$(NAME)(
uavobject.UAVObject
):
41
## Object constants
42
OBJID = $(OBJID)
43
NAME =
"$(NAME)"
44
METANAME =
"$(NAME)Meta"
45
ISSINGLEINST = $(ISSINGLEINST)
46
ISSETTINGS = $(ISSETTINGS)
47
48
def
__init__
(self):
49
uavobject.UAVObject.__init__
(self,
50
self.
OBJID
,
51
self.
NAME
,
52
self.
METANAME
,
53
0,
54
self.
ISSINGLEINST
)
55
56
for
f
in
_fields:
57
self.
add_field
(f)
58
59
def
__str__
(self):
60
s = (
"0x%08X (%10u) %-30s %3u bytes format '%s'\n"
61
% (self.
OBJID
, self.
OBJID
, self.
NAME
, self.
get_struct
().size, self.
get_struct
().format))
62
for
f
in
self.
get_tuple
()._fields:
63
s += (
"\t%s\n"
% f)
64
return
(s)
65
66
def
main
():
67
# Instantiate the object and dump out some interesting info
68
x = $(NAME)()
69
print
(x)
70
71
if
__name__ ==
"__main__"
:
72
#import pdb ; pdb.run('main()')
73
main
()
uavobjecttemplate.NAME.__init__
def __init__
Definition:
uavobjecttemplate.py:48
uavobject.UAVObject.__init__
def __init__
Definition:
uavobject.py:43
uavobjecttemplate.NAME.METANAME
string METANAME
Definition:
uavobjecttemplate.py:44
uavobject.UAVObject
Definition:
uavobject.py:42
uavobjecttemplate.NAME.NAME
string NAME
Definition:
uavobjecttemplate.py:43
uavobjecttemplate.NAME.ISSINGLEINST
tuple ISSINGLEINST
Definition:
uavobjecttemplate.py:45
uavobject.UAVObject.get_tuple
def get_tuple
Definition:
uavobject.py:63
uavobject.UAVObject.add_field
def add_field
Definition:
uavobject.py:54
uavobjecttemplate.main
def main
Definition:
uavobjecttemplate.py:66
uavobjecttemplate.NAME.OBJID
tuple OBJID
Object constants.
Definition:
uavobjecttemplate.py:42
uavobject.UAVObject.get_struct
def get_struct
Definition:
uavobject.py:57
uavobjecttemplate.NAME.__str__
def __str__
Definition:
uavobjecttemplate.py:59
ground
gcs
src
plugins
uavobjects
uavobjecttemplate.py
Generated by
1.8.6