1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

uavobjgen: fix order of struct fields in autogen matlab code

Matlab needs field order to match in struct assignment.
This moves the instanceId field after the timestamp in all
encodings.
This commit is contained in:
Stacey Sheldon 2011-12-14 23:10:08 -05:00
parent a19bbb7ea3
commit 624562aa07

View File

@ -142,13 +142,13 @@ bool UAVObjectGeneratorMatlab::process_object(ObjectInfo* info)
//=================================================================//
//Generate function description comment
matlabFunctionsCode.append("function [" + objectName + "] = " + functionCall + "\n");
matlabFunctionsCode.append("\t" + objectName + ".timestamp = timestamp;\n");
matlabFunctionsCode.append("\tif " + isSingleInst + "\n");
matlabFunctionsCode.append("\t\theaderSize = 8;\n");
matlabFunctionsCode.append("\telse\n");
matlabFunctionsCode.append("\t\t" + objectName + ".instanceID = fread(fid, 1, 'uint16');\n");
matlabFunctionsCode.append("\t\theaderSize = 10;\n");
matlabFunctionsCode.append("\tend\n\n");
matlabFunctionsCode.append("\t" + objectName + ".timestamp = timestamp;\n");
// Generate functions code, actual fields of the object
QString funcfields;