Build system: Add support for airframes config file

This commit is contained in:
Lorenz Meier
2015-07-28 23:45:30 +02:00
parent f226e808b2
commit 4471b18117
3 changed files with 21 additions and 0 deletions

12
Tools/airframes.xml Normal file
View File

@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<airframes>
<airframe_group name="StandardPlane">
<airframe name="Multiplex Easystar 1/2" id="2100"/>
<airframe name="Generic AERT" id="2101"/>
</airframe_group>
<airframe_group name="QuadRotorX">
<airframe name="Generic 10 inch Quad" id="4001"/>
<airframe name="DJI F330 8 inch Quad" id="4010"/>
<airframe name="DJI F450 10 inch Quad" id="4011"/>
</airframe_group>
</airframes>

View File

@@ -74,6 +74,7 @@ parser.add_argument("--summary", action="store", help="set a brief description")
parser.add_argument("--description", action="store", help="set a longer description")
parser.add_argument("--git_identity", action="store", help="the working directory to check for git identity")
parser.add_argument("--parameter_xml", action="store", help="the parameters.xml file")
parser.add_argument("--airframe_xml", action="store", help="the airframes.xml file")
parser.add_argument("--image", action="store", help="the firmware image")
args = parser.parse_args()
@@ -107,6 +108,11 @@ if args.parameter_xml != None:
bytes = f.read()
desc['parameter_xml_size'] = len(bytes)
desc['parameter_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8')
if args.airframe_xml != None:
f = open(args.airframe_xml, "rb")
bytes = f.read()
desc['airframe_xml_size'] = len(bytes)
desc['airframe_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8')
if args.image != None:
f = open(args.image, "rb")
bytes = f.read()