Rev 976 | Rev 986 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 976 | Rev 981 | ||
|---|---|---|---|
| Line 68... | Line 68... | ||
| 68 | } |
68 | } |
| 69 | 69 | ||
| 70 | myDirectionFlag = translator.lookupDirectionFlag(bin2uint(myRawHeaderBin.substr(7, 1))); |
70 | myDirectionFlag = translator.lookupDirectionFlag(bin2uint(myRawHeaderBin.substr(7, 1))); |
| 71 | myModuleName = translator.lookupModuleName(bin2uint(myRawHeaderBin.substr(8, 8))); |
71 | myModuleName = translator.lookupModuleName(bin2uint(myRawHeaderBin.substr(8, 8))); |
| 72 | 72 | ||
| 73 | myModuleId = |
73 | myModuleId = bin2uint(myRawHeaderBin.substr(16, 8)); |
| 74 | 74 | ||
| 75 | int commandId = bin2uint(myRawHeaderBin.substr(24, 8)); |
75 | int commandId = bin2uint(myRawHeaderBin.substr(24, 8)); |
| 76 | myCommandName = translator.lookupCommandName(commandId, |
76 | myCommandName = translator.lookupCommandName(commandId, myModuleName); |
| 77 | 77 | ||
| 78 | string rawHexData = ""; |
78 | string rawHexData = ""; |
| 79 | for (int n = 4; n < parts.size(); n++) |
79 | for (int n = 4; n < parts.size(); n++) |
| 80 | { |
80 | { |
| 81 | rawHexData += parts[n]; |
81 | rawHexData += parts[n]; |
| Line 216... | Line 216... | ||
| 216 | } |
216 | } |
| 217 | else if (iter->second.getType() == "float") |
217 | else if (iter->second.getType() == "float") |
| 218 | { |
218 | { |
| 219 | json += iter->second.getValue(); |
219 | json += iter->second.getValue(); |
| 220 | } |
220 | } |
| 221 | else if (iter->second.getType() == "ascii") |
221 | else if (iter->second.getType() == "ascii" || iter->second.getType() == "hexstring") |
| 222 | { |
222 | { |
| 223 | json += "'" + iter->second.getValue() + "'"; |
223 | json += "'" + iter->second.getValue() + "'"; |
| 224 | } |
224 | } |
| 225 | 225 | ||
| 226 | json += " },"; |
226 | json += " },"; |
| Line 249... | Line 249... | ||
| 249 | } |
249 | } |
| 250 | else if (iter->second.getType() == "float") |
250 | else if (iter->second.getType() == "float") |
| 251 | { |
251 | { |
| 252 | json += iter->second.getValue(); |
252 | json += iter->second.getValue(); |
| 253 | } |
253 | } |
| 254 | else if (iter->second.getType() == "ascii") |
254 | else if (iter->second.getType() == "ascii" || iter->second.getType() == "hexstring") |
| 255 | { |
255 | { |
| 256 | json += "'" + escape(iter->second.getValue()) + "'"; |
256 | json += "'" + escape(iter->second.getValue()) + "'"; |
| 257 | } |
257 | } |
| 258 | 258 | ||
| 259 | json += ","; |
259 | json += ","; |