From 624562aa07bf5bb358eac76c21b21a190f60f1bb Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Wed, 14 Dec 2011 23:10:08 -0500 Subject: [PATCH] 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. --- .../generators/matlab/uavobjectgeneratormatlab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatlab.cpp b/ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatlab.cpp index dca762de2..5b45f482e 100644 --- a/ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatlab.cpp +++ b/ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatlab.cpp @@ -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;