Skip to content

Commit

Permalink
Merge pull request #124 from art-daq/rrivera/featureAddTreeViewDiffMode
Browse files Browse the repository at this point in the history
Rrivera/feature add tree view diff mode
  • Loading branch information
rrivera747 committed Nov 8, 2023
2 parents d62d3f2 + a371d53 commit 8cdec0d
Show file tree
Hide file tree
Showing 25 changed files with 1,295 additions and 377 deletions.
6 changes: 6 additions & 0 deletions otsdaq/ConfigurationInterface/ConfigurationInterface.icc
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ void get(TableBase*& table,
catch(...)
{
__SS__ << "Unknown error occurred while getting and filling Table \"" << tableName << "\" version:" << version << std::endl;
try { throw; } //one more try to printout extra info
catch(const std::exception &e)
{
ss << "Exception message: " << e.what();
}
catch(...){}
__SS_THROW__;
}

Expand Down
632 changes: 514 additions & 118 deletions otsdaq/ConfigurationInterface/ConfigurationManager.cc

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion otsdaq/ConfigurationInterface/ConfigurationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ class ConfigurationManager
friend class GatewaySupervisor;

public:

typedef std::map<std::string,
std::pair<
std::pair<std::string, TableGroupKey>,
std::map<std::string, TableVersion> /* memberMap */
>> lastGroupLoad_t;

//==============================================================================
// Static members
static const unsigned int PROCESSOR_COUNT;
Expand Down Expand Up @@ -117,7 +124,7 @@ class ConfigurationManager

void loadTableGroup (
const std::string& configGroupName,
TableGroupKey tableGroupKey,
const TableGroupKey& tableGroupKey,
bool doActivate = false,
std::map<std::string, TableVersion>* groupMembers = 0,
ProgressBar* progressBar = 0,
Expand All @@ -130,6 +137,15 @@ class ConfigurationManager
std::map<std::string /*name*/, std::string /*alias*/>* groupAliases = 0,
ConfigurationManager::LoadGroupType onlyLoadIfBackboneOrContext = ConfigurationManager::LoadGroupType::ALL_TYPES,
bool ignoreVersionTracking = false);
void copyTableGroupFromCache (
const ConfigurationManager& cacheConfigMgr,
const std::map<std::string, TableVersion>& groupMembers,
const std::string& configGroupName = "",
const TableGroupKey& tableGroupKey = TableGroupKey(TableGroupKey::INVALID),
bool doActivate = false,
bool ignoreVersionTracking = false);
std::pair<std::string /* groupName */, TableGroupKey>
getGroupOfLoadedTable (const std::string& tableName) const;
void loadMemberMap (const std::map<std::string /*name*/, TableVersion /*version*/>& memberMap, std::string* accumulateWarnings = 0);
TableGroupKey loadConfigurationBackbone (void);

Expand Down Expand Up @@ -161,6 +177,7 @@ const T* retPtr = dynamic_cast<const T*>(srcPtr); if(retPtr == nullptr) { __SS__
const std::map<std::string /*groupType*/,
std::pair<std::string /*groupName*/,
TableGroupKey>>& getFailedTableGroups (void) const {return lastFailedGroupLoad_;}
const lastGroupLoad_t& getLastTableGroups (void) const {return lastGroupLoad_;}
const std::string& getActiveGroupName (const ConfigurationManager::GroupType& type = ConfigurationManager::GroupType::CONFIGURATION_TYPE) const;
TableGroupKey getActiveGroupKey (const ConfigurationManager::GroupType& type = ConfigurationManager::GroupType::CONFIGURATION_TYPE) const;

Expand All @@ -173,6 +190,8 @@ const T* retPtr = dynamic_cast<const T*>(srcPtr); if(retPtr == nullptr) { __SS__

std::vector<std::pair<std::string /*childName*/,
ConfigurationTree>> getChildren (std::map<std::string, TableVersion>* memberMap = 0, std::string* accumulatedTreeErrors = 0) const;
std::map<std::string /*childName*/,
ConfigurationTree> getChildrenMap (std::map<std::string, TableVersion>* memberMap = 0, std::string* accumulatedTreeErrors = 0) const;
std::string getFirstPathToNode (const ConfigurationTree& node, const std::string& startPath = "/") const;

std::map<std::string, TableVersion> getActiveVersions (void) const;
Expand Down Expand Up @@ -227,6 +246,9 @@ const T* retPtr = dynamic_cast<const T*>(srcPtr); if(retPtr == nullptr) { __SS__

std::map<std::string,
std::pair<std::string, TableGroupKey>> lastFailedGroupLoad_;
lastGroupLoad_t lastGroupLoad_;



std::map<std::string, TableBase*> nameToTableMap_;

Expand Down
6 changes: 6 additions & 0 deletions otsdaq/ConfigurationInterface/ConfigurationManagerRW.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ const std::map<std::string, TableInfo>& ConfigurationManagerRW::getAllTableInfo(
catch(...)
{
__SS__ << "An unknown fatal error occurred reading the info for all table groups." << __E__;
try { throw; } //one more try to printout extra info
catch(const std::exception &e)
{
ss << "Exception message: " << e.what();
}
catch(...){}
__GEN_COUT_ERR__ << "\n" << ss.str();
if(accumulatedWarnings)
*accumulatedWarnings += ss.str();
Expand Down
Loading

0 comments on commit 8cdec0d

Please sign in to comment.