diff --git a/generator/mavgen_javascript.py b/generator/mavgen_javascript.py index 34ad5bbf8..e99bd3604 100644 --- a/generator/mavgen_javascript.py +++ b/generator/mavgen_javascript.py @@ -257,7 +257,12 @@ def generate_classes(outf, msgs, xml): def field_descriptions(fields): ret = "" for f in fields: - ret += " * @param %s %s (%s)\n" % (f.name, f.description.strip(), f.type) + if f.array_length: + arraystr = "[%d]" % f.array_length + else: + arraystr = "" + if not f.omit_arg: + ret += " * @param %s %s (%s%s)\n" % (f.name, f.description.strip(), f.type, arraystr) return ret # now do all the messages @@ -321,12 +326,13 @@ def field_descriptions(fields): outf.write("\n}\n") # inherit methods from the base message class - outf.write("\n%s.messages.%s.prototype = new %s.message;\n" % ( get_mavhead(xml), m.name.lower() ,get_mavhead(xml) ) ) + outf.write("%s.messages.%s.prototype = new %s.message;\n\n" % ( get_mavhead(xml), m.name.lower() ,get_mavhead(xml) ) ) orderedfields = "var orderedfields = [ this." + ", this.".join(m.ordered_fieldnames) + "];"; # Implement the pack() function for this message + t.write(outf,"/** Pack the ${MNAME} message */\n" % m.name); t.write(outf, """ ${MAVHEAD}.messages.${MNAME}.prototype.pack = function(mav) { ${MORDERED}