Feature object config with injection and osi#365
Conversation
| if (UtilGetObjectFileSetting(OBJECT_SETTING_TURNING_DIAMETER, objectFile.c_str(), | ||
| objectFile.string().length(), | ||
| setting, sizeof (setting)) == -1) { | ||
| throw std::invalid_argument("Cannot find Turning diameter setting in file " + objectFile.string()); | ||
| } |
There was a problem hiding this comment.
We should handle the absence of these parameters in a better way, such as having a variable showing it is unknown or similar, when it is not present in the config file.
There was a problem hiding this comment.
Good point. I agree. Will figure something out.
| if (UtilGetObjectFileSetting(OBJECT_SETTING_MAX_SPEED, objectFile.c_str(), | ||
| objectFile.string().length(), | ||
| setting, sizeof (setting)) == -1) { | ||
| throw std::invalid_argument("Cannot find Max speed setting in file " + objectFile.string()); | ||
| } |
| if (UtilGetObjectFileSetting(OBJECT_SETTING_INJECTOR_IDS, objectFile.c_str(), | ||
| objectFile.string().length(), | ||
| setting, sizeof (setting)) == -1) { | ||
| throw std::invalid_argument("Cannot find Injector IDs setting in file " + objectFile.string()); | ||
| } |
There was a problem hiding this comment.
The injection map can be initialized to empty if the setting is not found
| return 0; | ||
| } | ||
|
|
||
| void loadObjectFiles() { |
There was a problem hiding this comment.
This function (loadObjectFiles) could be made available via objectconfig.hpp and return a std::map<uint32_t,ObjectConfig>. That way, we wouldn't need to re-write it at multiple locations.
Co-authored-by: Lukas <[email protected]>
Co-authored-by: Lukas <[email protected]>
Co-authored-by: Lukas <[email protected]>
|
I've fixed the comments and some build errors I've also found in feature_OSIConnection. Pretty annoying cmake problems that took some time to solve so forgive the bad git form :/ |
In object config class, added support for:
injectorIDs=6,7
isOsiCompatible=false