ModulesManager #37

Merged
modulatingforce merged 22 commits from modulesmanager into main 2024-03-22 21:34:08 -04:00
Showing only changes of commit 1b44ec4f4c - Show all commits

View file

@ -180,7 +180,8 @@ pub struct Routine {}
pub struct ModulesManager {
// statusdb: Arc<RwLock<HashMap<ModType, Vec<ModStatusType>>>>,
statusdb: Arc<RwLock<HashMap<(ModType,ModGroup), Vec<StatusType>>>>,
// statusdb: Arc<RwLock<HashMap<(ModType,ModGroup), Vec<StatusType>>>>,
statusdb: Arc<RwLock<HashMap<ModType, (ModGroup, Vec<StatusType>)>>>,
pub botactions: Arc<RwLock<HashMap<ModType, Vec<BotAction>>>>,
}
@ -374,11 +375,11 @@ impl ModulesManager {
let mut dbt = self.statusdb.write().await;
//
let statusvector = dbt.entry((in_module.clone(),in_modgroup.clone())).or_insert(Vec::new());
let statusvector = dbt.entry(in_module.clone()).or_insert((in_modgroup.clone(),Vec::new()));
match in_modgroup {
ModGroup::Core => statusvector.push(StatusType::Enabled(StatusLvl::Instance)) , // Pushes the Module as Enabled at Instance Level
ModGroup::Custom => statusvector.push(StatusType::Disabled(StatusLvl::Instance)),
ModGroup::Core => statusvector.1.push(StatusType::Enabled(StatusLvl::Instance)) , // Pushes the Module as Enabled at Instance Level
ModGroup::Custom => statusvector.1.push(StatusType::Disabled(StatusLvl::Instance)),
}
// statusvector.push(ModStatusType::Enabled(StatusLvl::Instance)); // Pushes the Module as Enabled at Instance Level