Skip to content

Commit

Permalink
fix the nickname (should've still been enum)
Browse files Browse the repository at this point in the history
  • Loading branch information
karenhaining committed Aug 16, 2024
1 parent b9ed967 commit 393e1d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/camp/generators/create_gen_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def write_agent_nickname_definitions(self, outfile):

ns = self.c_norm_name.upper()
enum_name = cu.make_enum_name_from_str(ns)
outfile.write("#define {0} {1}\n".format(enum_name, self.c_norm_name))
outfile.write("#define {0} {1}\n".format(enum_name, self.adm.enum))

#
# Function for formatting the description field in the tables.
Expand Down Expand Up @@ -292,14 +292,15 @@ def write_metadata_definitions(self, outfile):
defines = "" # the #defines and for all metadata (string)

# Create the strings for the #defines and preceeding commented table
enum = 0
for obj in self.adm.metadata_list.items:
#hex_str = format(obj.enum, '#04x')
hex_str = format(enum, '#04x')
ari_str = cu.make_ari_name(self.c_norm_name, cs.META, obj)

table = table + self.format_table_entry(False, obj.name, ari_str, obj.name, obj.arg)#obj.description, obj.type, obj.value)

defines = defines + "// \"{}\"\n".format(obj.name)
#defines = defines + "#define {0} {1}\n".format(ari_str, hex_str)
defines = defines + "#define {0} {1}\n".format(ari_str, hex_str)
enum += 1

# Write everything to file
self.write_definition_table_header(outfile, f"{self.c_norm_name.upper()} META-DATA DEFINITIONS", True)
Expand Down

0 comments on commit 393e1d4

Please sign in to comment.