mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 18:51:17 -06:00
Small bug fix
This commit is contained in:
@@ -41,6 +41,7 @@ IswaGroup::IswaGroup(std::string name, IswaManager::CygnetType type)
|
||||
,_dataOptions("dataOptions", "Data Options")
|
||||
// ,_id(id)
|
||||
,_type(type)
|
||||
,_registered(false)
|
||||
// ,_dataProcessor(nullptr)
|
||||
{
|
||||
setName(name);
|
||||
@@ -94,6 +95,9 @@ IswaGroup::~IswaGroup(){
|
||||
// }
|
||||
|
||||
void IswaGroup::registerOptions(const std::vector<properties::SelectionProperty::Option>& options){
|
||||
if(!_registered)
|
||||
registerProperties();
|
||||
|
||||
if(_type == IswaManager::CygnetType::Data){
|
||||
if(_dataOptions.options().empty()){
|
||||
for(auto option : options){
|
||||
@@ -168,11 +172,13 @@ void IswaGroup::registerProperties(){
|
||||
_delete.onChange([this]{
|
||||
clearGroup();
|
||||
});
|
||||
_registered = true;
|
||||
}
|
||||
|
||||
void IswaGroup::unregisterProperties(){
|
||||
// _dataOptions.removeOptions();
|
||||
OsEng.gui()._iswa.unregisterProperties(name());
|
||||
_registered = false;
|
||||
// _type = IswaManager::CygnetType::NoType;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ private:
|
||||
std::shared_ptr<DataProcessor> _dataProcessor;
|
||||
//std::vector<IswaCygnet* > _cygnets;
|
||||
IswaManager::CygnetType _type;
|
||||
bool _registered;
|
||||
};
|
||||
|
||||
} //namespace openspace
|
||||
|
||||
@@ -133,17 +133,15 @@ void GuiIswaComponent::render() {
|
||||
|
||||
int cdfOption = _cdfOptionsMap[groupName];
|
||||
if(cdfOptionValue != cdfOption){
|
||||
// std::cout << cdfOptionValue << ", " << cdfOption << std::endl;
|
||||
if(cdfOptionValue > 0){
|
||||
if(cdfOptionValue >= 0){
|
||||
groupName = cdfs[cdfOptionValue].group;
|
||||
// std::cout << groupName << std::endl;
|
||||
std::cout << groupName << std::endl;
|
||||
OsEng.scriptEngine().queueScript("openspace.iswa.removeGroup('"+groupName+"');");
|
||||
}
|
||||
|
||||
std::string path = cdfs[cdfOption].path;
|
||||
std::string date = cdfs[cdfOption].date;
|
||||
groupName = cdfs[cdfOption].group;
|
||||
// std::cout << path << ", " << date << ", " << groupName << std::endl;
|
||||
OsEng.scriptEngine().queueScript("openspace.iswa.addKameleonPlanes('"+groupName+"',"+std::to_string(cdfOption)+");");
|
||||
OsEng.scriptEngine().queueScript("openspace.time.setTime('"+date+"');");
|
||||
OsEng.scriptEngine().queueScript("openspace.time.setDeltaTime(0);");
|
||||
|
||||
Reference in New Issue
Block a user