Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature object config with injection and osi#365

Merged
LukasWikander merged 20 commits into
devfrom
feature_object_config_with_injection_and_OSI
Jun 29, 2021
Merged

Feature object config with injection and osi#365
LukasWikander merged 20 commits into
devfrom
feature_object_config_with_injection_and_OSI

Conversation

@fridarei

Copy link
Copy Markdown
Contributor

In object config class, added support for:
injectorIDs=6,7
isOsiCompatible=false

@fridarei fridarei requested review from LukasWikander and sepast June 29, 2021 06:37
Comment thread common/CMakeLists.txt
Comment thread common/objectconfig.cpp
Comment on lines +157 to +161
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());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I agree. Will figure something out.

Comment thread common/objectconfig.cpp
Comment on lines +174 to +178
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());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment thread common/objectconfig.cpp
Comment on lines +201 to +205
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());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The injection map can be initialized to empty if the setting is not found

Comment thread common/objectconfig.cpp Outdated
Comment thread common/objectconfig.cpp Outdated
return 0;
}

void loadObjectFiles() {

@LukasWikander LukasWikander Jun 29, 2021

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@LukasWikander LukasWikander left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superb!

@LukasWikander

Copy link
Copy Markdown
Collaborator

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 :/

@LukasWikander LukasWikander merged commit 29a3ec1 into dev Jun 29, 2021
@LukasWikander LukasWikander deleted the feature_object_config_with_injection_and_OSI branch June 29, 2021 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants