Skip to content

Commit

Permalink
Add counter for CC modes in MaCh3Modes object
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrow257 committed Feb 21, 2025
1 parent be2c3cb commit e427a6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion manager/MaCh3Modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ MaCh3Modes::MaCh3Modes(std::string const &filename) {

std::string GetMaCh3ModeName(const int Index);
NModes = 0;

nCCModes = 0;

Title = config["Title"].as<std::string>();
Generator = config["GeneratorName"].as<std::string>();

Expand All @@ -24,6 +25,10 @@ MaCh3Modes::MaCh3Modes(std::string const &filename) {
config[names[i]]["GeneratorMaping"].as<std::vector<int>>(),
config[names[i]]["IsNC"].as<bool>(),
config[names[i]]["SplineSuffix"].as<std::string>());

if (!config[names[i]]["IsNC"].as<bool>()) {
nCCModes += 1;
}
}
// Add unknown category, it's better to have garbage category where all undefined modes will go rather than get random crashes
DeclareNewMode("UNKNOWN_BAD",
Expand Down
4 changes: 4 additions & 0 deletions manager/MaCh3Modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class MaCh3Modes {
MaCh3Modes_t GetModeFromGenerator(const int Index);
/// @brief Get class name
inline std::string GetName()const {return "MaCh3Modes";};
/// @brief Return count of CC modes
inline int GetNCCModes()const {return nCCModes;};

private:
/// @brief KS: Make sure we don't have two modes with the same name
Expand Down Expand Up @@ -95,4 +97,6 @@ class MaCh3Modes {
std::string Generator;
/// KS: Number of modes, keep in mind actual number is +1 greater due to unknown category
int NModes;
/// DB: Number of CC modes
int nCCModes;
};

0 comments on commit e427a6c

Please sign in to comment.