Skip to content

Commit

Permalink
Fixed missing enumerated definitions when two fields use same global
Browse files Browse the repository at this point in the history
enumeration.
  • Loading branch information
zepinto committed Dec 15, 2013
1 parent b2b1715 commit fd69611
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src-generated/pt/lsts/imc/DesiredPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ public long value() {
}

public enum END_Z_UNITS {
;
NONE(0),
DEPTH(1),
ALTITUDE(2),
HEIGHT(3);

protected long value;

Expand Down
5 changes: 4 additions & 1 deletion src-generated/pt/lsts/imc/Elevator.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ public long value() {
}

public enum END_Z_UNITS {
;
NONE(0),
DEPTH(1),
ALTITUDE(2),
HEIGHT(3);

protected long value;

Expand Down
5 changes: 4 additions & 1 deletion src-generated/pt/lsts/imc/PathControlState.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ public long value() {
}

public enum END_Z_UNITS {
;
NONE(0),
DEPTH(1),
ALTITUDE(2),
HEIGHT(3);

protected long value;

Expand Down
8 changes: 5 additions & 3 deletions src-generator/pt/lsts/imc/generator/ClassGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,11 @@ else if (type.getFieldType(field) == IMCFieldType.TYPE_UINT16
bw.write("\tpublic enum " + field.toUpperCase() + " {\n");
boolean first = true;
for (String name : enum_vals.keySet()) {
if (generatedEnumDefs.contains(name))
continue;
generatedEnumDefs.add(name);
//if (generatedEnumDefs.contains(name)) {
// System.out.println("Message "+msgName+": "+name);
// continue;
//}
//generatedEnumDefs.add(name);
if (!first)
bw.write(",\n");
bw.write("\t\t" + name.toUpperCase() + "(" + enum_vals.get(name) + ")");
Expand Down

0 comments on commit fd69611

Please sign in to comment.