Functions | Variables
pymavlink.generator.mavgen_swift Namespace Reference

Functions

def append_static_code (filename, outf)
 
def camel_case_from_underscores (string)
 
def generate (basename, xml_list)
 
def generate_enums (directory, filelist, xml_list, enums, msgs)
 
def generate_enums_type_info (enums, msgs)
 
def generate_header (outf, filelist, xml_list, filename)
 
def generate_mavlink (directory, filelist, xml_list, msgs)
 
def generate_message_crc_extra_array (outf, msgs)
 
def generate_message_lengths_array (outf, msgs)
 
def generate_message_mappings_array (outf, msgs)
 
def generate_messages (directory, filelist, xml_list, msgs)
 
def generate_messages_type_info (msgs)
 
def get_enum_raw_type (enum, msgs)
 
def lower_camel_case_from_underscores (string)
 

Variables

list abbreviations = ["MAV", "PX4", "UDB", "PPZ", "PIXHAWK", "SLUGS", "FP", "ASLUAV", "VTOL", "ROI", "UART", "UDP", "IMU", "IMU2", "3D", "RC", "GPS", "GPS1", "GPS2", "NED", "RTK", "ADSB"]
 
list swift_keywords
 
dictionary swift_types
 
 t = mavtemplate.MAVTemplate()
 

Detailed Description

Parse a MAVLink protocol XML file and generate Swift implementation

Copyright Max Odnovolyk 2015
Released under GNU GPL version 3 or later

Function Documentation

def pymavlink.generator.mavgen_swift.append_static_code (   filename,
  outf 
)
Open and copy static code from specified file

Definition at line 132 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.camel_case_from_underscores (   string)
Generate a CamelCase string from an underscore_string

Definition at line 183 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate (   basename,
  xml_list 
)
Generate complete MAVLink Swift implemenation

Definition at line 301 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_enums (   directory,
  filelist,
  xml_list,
  enums,
  msgs 
)
Iterate through all enums and create Swift equivalents

Definition at line 62 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_enums_type_info (   enums,
  msgs 
)
Add camel case swift names for enums an entries, descriptions and sort enums alphabetically

Definition at line 207 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_header (   outf,
  filelist,
  xml_list,
  filename 
)
Generate Swift file header with source files list and creation date

Definition at line 46 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_mavlink (   directory,
  filelist,
  xml_list,
  msgs 
)

Definition at line 32 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_message_crc_extra_array (   outf,
  msgs 
)
Add array with CRC extra values to detect incompatible XML changes

Definition at line 170 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_message_lengths_array (   outf,
  msgs 
)
Create array with message lengths to validate known message lengths

Definition at line 156 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_message_mappings_array (   outf,
  msgs 
)
Create array for mapping message Ids to proper structs

Definition at line 144 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_messages (   directory,
  filelist,
  xml_list,
  msgs 
)
Generate Swift structs to represent all MAVLink messages

Definition at line 96 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.generate_messages_type_info (   msgs)
Add proper formated variable names, initializers and type names to use in templates

Definition at line 252 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.get_enum_raw_type (   enum,
  msgs 
)
Search appropirate raw type for enums in messages fields

Definition at line 87 of file mavgen_swift.py.

def pymavlink.generator.mavgen_swift.lower_camel_case_from_underscores (   string)
Generate a lower-cased camelCase string from an underscore_string

Definition at line 197 of file mavgen_swift.py.

Variable Documentation

list pymavlink.generator.mavgen_swift.abbreviations = ["MAV", "PX4", "UDB", "PPZ", "PIXHAWK", "SLUGS", "FP", "ASLUAV", "VTOL", "ROI", "UART", "UDP", "IMU", "IMU2", "3D", "RC", "GPS", "GPS1", "GPS2", "NED", "RTK", "ADSB"]

Definition at line 13 of file mavgen_swift.py.

list pymavlink.generator.mavgen_swift.swift_keywords
Initial value:
1 = ["associatedtype", "class", "deinit", "enum", "extension", "fileprivate", "func", "import", "init", "inout", "internal", "let", "open", "operator", "private", "protocol",
2  "public", "static", "struct", "subscript", "typealias", "var", "break" "case", "continue", "default", "defer", "do", "else", "fallthrough", "for", "guard", "if", "in", "repeat", "return", "switch",
3  "where", "while", "Any", "catch", "false", "is", "nil", "rethrows", "super", "self", "Self", "throw", "throws", "true", "try"]

Definition at line 14 of file mavgen_swift.py.

dictionary pymavlink.generator.mavgen_swift.swift_types
Initial value:
1 = {'char' : ("String", '"\\0"', "string(at: %u, length: %u)", "set(%s, at: %u, length: %u)"),
2  'uint8_t' : ("UInt8", 0, "number(at: %u)", "set(%s, at: %u)"),
3  'int8_t' : ("Int8", 0, "number(at: %u)", "set(%s, at: %u)"),
4  'uint16_t' : ("UInt16", 0, "number(at: %u)", "set(%s, at: %u)"),
5  'int16_t' : ("Int16", 0, "number(at: %u)", "set(%s, at: %u)"),
6  'uint32_t' : ("UInt32", 0, "number(at: %u)", "set(%s, at: %u)"),
7  'int32_t' : ("Int32", 0, "number(at: %u)", "set(%s, at: %u)"),
8  'uint64_t' : ("UInt64", 0, "number(at: %u)", "set(%s, at: %u)"),
9  'int64_t' : ("Int64", 0, "number(at: %u)", "set(%s, at: %u)"),
10  'float' : ("Float", 0, "number(at: %u)", "set(%s, at: %u)"),
11  'double' : ("Double", 0, "number(at: %u)", "set(%s, at: %u)"),
12  'uint8_t_mavlink_version' : ("UInt8", 0, "number(at: %u)", "set(%s, at: %u)")}

Definition at line 17 of file mavgen_swift.py.

pymavlink.generator.mavgen_swift.t = mavtemplate.MAVTemplate()

Definition at line 30 of file mavgen_swift.py.



mavlink
Author(s): Lorenz Meier
autogenerated on Sun Jul 7 2019 03:22:08