mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:50:04 +00:00 
			
		
		
		
	Fix Level 3 Products Widget product selection status
This commit is contained in:
		
							parent
							
								
									4325f352b1
								
							
						
					
					
						commit
						14545fd83a
					
				
					 3 changed files with 22 additions and 7 deletions
				
			
		|  | @ -266,12 +266,18 @@ Level3ProductCategory GetLevel3Category(const std::string& categoryName) | |||
| Level3ProductCategory GetLevel3CategoryByProduct(const std::string& productName) | ||||
| { | ||||
|    auto result = std::find_if( | ||||
|       level3CategoryDefaultAwipsId_.cbegin(), | ||||
|       level3CategoryDefaultAwipsId_.cend(), | ||||
|       [&](const std::pair<Level3ProductCategory, std::string>& pair) -> bool | ||||
|       { return pair.second == productName; }); | ||||
|       level3CategoryProductList_.cbegin(), | ||||
|       level3CategoryProductList_.cend(), | ||||
|       [&]( | ||||
|          const std::pair<Level3ProductCategory, std::vector<std::string>>& pair) | ||||
|          -> bool | ||||
|       { | ||||
|          return std::find(pair.second.cbegin(), | ||||
|                           pair.second.cend(), | ||||
|                           productName) != pair.second.cend(); | ||||
|       }); | ||||
| 
 | ||||
|    if (result != level3CategoryDefaultAwipsId_.cend()) | ||||
|    if (result != level3CategoryProductList_.cend()) | ||||
|    { | ||||
|       return result->first; | ||||
|    } | ||||
|  | @ -281,6 +287,13 @@ Level3ProductCategory GetLevel3CategoryByProduct(const std::string& productName) | |||
|    } | ||||
| } | ||||
| 
 | ||||
| Level3ProductCategory GetLevel3CategoryByAwipsId(const std::string& awipsId) | ||||
| { | ||||
|    std::string productName = GetLevel3ProductByAwipsId(awipsId); | ||||
| 
 | ||||
|    return GetLevel3CategoryByProduct(productName); | ||||
| } | ||||
| 
 | ||||
| const std::string& GetLevel3Palette(int16_t productCode) | ||||
| { | ||||
|    auto it = level3Palette_.find(productCode); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat