mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-09 18:45:22 +02:00
Finished RigCTL server
This commit is contained in:
@ -97,6 +97,7 @@ void ModuleManager::createInstance(std::string name, std::string module) {
|
||||
inst.module = modules[module];
|
||||
inst.instance = inst.module.createInstance(name);
|
||||
instances[name] = inst;
|
||||
onInstanceCreated.emit(name);
|
||||
}
|
||||
|
||||
void ModuleManager::deleteInstance(std::string name) {
|
||||
@ -104,9 +105,11 @@ void ModuleManager::deleteInstance(std::string name) {
|
||||
spdlog::error("Tried to remove non-existant instance '{0}'", name);
|
||||
return;
|
||||
}
|
||||
onInstanceDelete.emit(name);
|
||||
Instance_t inst = instances[name];
|
||||
inst.module.deleteInstance(inst.instance);
|
||||
instances.erase(name);
|
||||
onInstanceDeleted.emit(name);
|
||||
}
|
||||
|
||||
void ModuleManager::deleteInstance(ModuleManager::Instance* instance) {
|
||||
@ -137,6 +140,14 @@ bool ModuleManager::instanceEnabled(std::string name) {
|
||||
return instances[name].instance->isEnabled();
|
||||
}
|
||||
|
||||
std::string ModuleManager::getInstanceModuleName(std::string name) {
|
||||
if (instances.find(name) == instances.end()) {
|
||||
spdlog::error("Cannot get module name of'{0}', instance doesn't exist", name);
|
||||
return false;
|
||||
}
|
||||
return std::string(instances[name].module.info->name);
|
||||
}
|
||||
|
||||
int ModuleManager::countModuleInstances(std::string module) {
|
||||
if (modules.find(module) == modules.end()) {
|
||||
spdlog::error("Cannot count instances of '{0}', Module doesn't exist", module);
|
||||
|
Reference in New Issue
Block a user