mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-11-04 02:30:06 +00:00 
			
		
		
		
	Radar Product Model missing initial signals from manager
This commit is contained in:
		
							parent
							
								
									1e58cc29e5
								
							
						
					
					
						commit
						06e33001f7
					
				
					 2 changed files with 20 additions and 7 deletions
				
			
		| 
						 | 
					@ -938,17 +938,29 @@ void RadarProductManager::UpdateAvailableProducts()
 | 
				
			||||||
std::shared_ptr<RadarProductManager>
 | 
					std::shared_ptr<RadarProductManager>
 | 
				
			||||||
RadarProductManager::Instance(const std::string& radarSite)
 | 
					RadarProductManager::Instance(const std::string& radarSite)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					   std::shared_ptr<RadarProductManager> instance        = nullptr;
 | 
				
			||||||
 | 
					   bool                                 instanceCreated = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   {
 | 
				
			||||||
      std::lock_guard<std::mutex> guard(instanceMutex_);
 | 
					      std::lock_guard<std::mutex> guard(instanceMutex_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (!instanceMap_.contains(radarSite))
 | 
					      if (!instanceMap_.contains(radarSite))
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
         instanceMap_[radarSite] =
 | 
					         instanceMap_[radarSite] =
 | 
				
			||||||
            std::make_shared<RadarProductManager>(radarSite);
 | 
					            std::make_shared<RadarProductManager>(radarSite);
 | 
				
			||||||
 | 
					         instanceCreated = true;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      instance = instanceMap_[radarSite];
 | 
				
			||||||
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   if (instanceCreated)
 | 
				
			||||||
 | 
					   {
 | 
				
			||||||
      emit RadarProductManagerNotifier::Instance().RadarProductManagerCreated(
 | 
					      emit RadarProductManagerNotifier::Instance().RadarProductManagerCreated(
 | 
				
			||||||
         radarSite);
 | 
					         radarSite);
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   return instanceMap_[radarSite];
 | 
					   return instance;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // namespace manager
 | 
					} // namespace manager
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,6 +48,8 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
 | 
				
			||||||
      this,
 | 
					      this,
 | 
				
			||||||
      [=](const std::string& radarSite)
 | 
					      [=](const std::string& radarSite)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
 | 
					         logger_->debug("Adding radar site: {}", radarSite);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
         const QModelIndex rootIndex =
 | 
					         const QModelIndex rootIndex =
 | 
				
			||||||
            self_->createIndex(rootItem_->row(), 0, rootItem_.get());
 | 
					            self_->createIndex(rootItem_->row(), 0, rootItem_.get());
 | 
				
			||||||
         const int rootChildren = rootItem_->child_count();
 | 
					         const int rootChildren = rootItem_->child_count();
 | 
				
			||||||
| 
						 | 
					@ -134,8 +136,7 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
 | 
				
			||||||
               self_->endInsertRows();
 | 
					               self_->endInsertRows();
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            Qt::QueuedConnection);
 | 
					            Qt::QueuedConnection);
 | 
				
			||||||
      },
 | 
					      });
 | 
				
			||||||
      Qt::QueuedConnection);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "radar_product_model.moc"
 | 
					#include "radar_product_model.moc"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue