Rev 965 | Rev 1047 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 965 | Rev 1046 | ||
|---|---|---|---|
| Line 75... | Line 75... | ||
| 75 | $commandType = $command->att('module'); |
75 | $commandType = $command->att('module'); |
| 76 | $commandType =~ tr/a-z/A-Z/; |
76 | $commandType =~ tr/a-z/A-Z/; |
| 77 | } |
77 | } |
| 78 | 78 | ||
| 79 | print MYFILE "#define CAN_MODULE_CMD_" . $commandType . "_" . $commandName . " " . $command->att('id') . "\n"; |
79 | print MYFILE "#define CAN_MODULE_CMD_" . $commandType . "_" . $commandName . " " . $command->att('id') . "\n"; |
| - | 80 | } |
|
| - | 81 | ||
| - | 82 | print MYFILE "\n"; |
|
| - | 83 | print MYFILE "//------------------------------- //\n"; |
|
| - | 84 | print MYFILE "// Command enum value definitions //\n"; |
|
| - | 85 | print MYFILE "//------------------------------- //\n"; |
|
| - | 86 | print MYFILE "\n"; |
|
| - | 87 | ||
| - | 88 | foreach my $command ($root->first_child('commands')->children('command')) |
|
| - | 89 | { |
|
| - | 90 | my $commandName = $command->att('name'); |
|
| - | 91 | $commandName =~ tr/a-z/A-Z/; |
|
| - | 92 | my $commandType = $command->att('type'); |
|
| - | 93 | $commandType =~ tr/a-z/A-Z/; |
|
| - | 94 | ||
| - | 95 | if ($commandType eq "SPECIFIC") |
|
| - | 96 | { |
|
| - | 97 | $commandType = $command->att('module'); |
|
| - | 98 | $commandType =~ tr/a-z/A-Z/; |
|
| - | 99 | } |
|
| - | 100 | ||
| - | 101 | if ($command->first_child('variables')) |
|
| - | 102 | { |
|
| - | 103 | foreach my $variable ($command->first_child('variables')->children('variable')) |
|
| - | 104 | { |
|
| - | 105 | my $variableName = $variable->att('name'); |
|
| - | 106 | $variableName =~ tr/a-z/A-Z/; |
|
| - | 107 | my $variableType = $variable->att('type'); |
|
| - | 108 | $variableType =~ tr/a-z/A-Z/; |
|
| - | 109 | ||
| - | 110 | if ($variableType eq "ENUM") |
|
| - | 111 | { |
|
| - | 112 | foreach my $value ($variable->children('value')) |
|
| - | 113 | { |
|
| - | 114 | my $valueName = $value->att('name'); |
|
| - | 115 | $valueName =~ tr/a-z/A-Z/; |
|
| - | 116 | ||
| - | 117 | print MYFILE "#define CAN_MODULE_CMD_ENUM_" . $commandType . "_" . $commandName . "_" . $variableName . "_" . $valueName . " " . $value->att('id') . "\n"; |
|
| - | 118 | } |
|
| - | 119 | } |
|
| - | 120 | } |
|
| - | 121 | } |
|
| 80 | } |
122 | } |
| 81 | 123 | ||
| 82 | print MYFILE "\n"; |
124 | print MYFILE "\n"; |
| 83 | print MYFILE "//------------------- //\n"; |
125 | print MYFILE "//------------------- //\n"; |
| 84 | print MYFILE "// Module definitions //\n"; |
126 | print MYFILE "// Module definitions //\n"; |