当前位置: 首页>>代码示例>>C++>>正文


C++ LoadingBar::SetMessage方法代码示例

本文整理汇总了C++中LoadingBar::SetMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ LoadingBar::SetMessage方法的具体用法?C++ LoadingBar::SetMessage怎么用?C++ LoadingBar::SetMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LoadingBar的用法示例。


在下文中一共展示了LoadingBar::SetMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: load_data

/***************************************************************************
 Load star catalogue data from files.
 If a file is not found, it will be skipped.
***************************************************************************/
void HipStarMgr::load_data(const InitParser &baseConf, LoadingBar& lb)
{
	// Please do not init twice:
	assert(max_geodesic_grid_level < 0);

	cout << "Loading star data..." << endl;

	InitParser conf;
	conf.load(AppSettings::Instance()->getDataRoot() + "/stars/default/stars.ini");
				         
	for (int i=0; i<100; i++)
	{
		char key_name[64];
		sprintf(key_name,"cat_file_name_%02d",i);
		const string cat_file_name = conf.get_str("stars",key_name,"").c_str();
		if (!cat_file_name.empty()) {
			lb.SetMessage(_("Loading catalog ") + cat_file_name);
			ZoneArray *const z = ZoneArray::create(*this,cat_file_name,lb);
			if (z)
			{
				if (max_geodesic_grid_level < z->level)
				{
					max_geodesic_grid_level = z->level;
				}
				ZoneArray *&pos(zone_arrays[z->level]);
				if (pos)
				{
					cerr << cat_file_name << ", " << z->level
						 << ": duplicate level" << endl;
					delete z;
				}
				else
				{
					pos = z;
				}
			}
		}
	}

	for (int i=0; i<=NR_OF_HIP; i++)
	{
		hip_index[i].a = 0;
		hip_index[i].z = 0;
		hip_index[i].s = 0;
	}
	for (ZoneArrayMap::const_iterator it(zone_arrays.begin());
	                it != zone_arrays.end();it++)
	{
		it->second->updateHipIndex(hip_index);
	}

	const string cat_hip_sp_file_name = conf.get_str("stars","cat_hip_sp_file_name","").c_str();
	if (cat_hip_sp_file_name.empty())
	{
		cerr << "ERROR: stars:cat_hip_sp_file_name not found" << endl;
	}
	else
	{
		try
		{
			spectral_array.initFromFile(AppSettings::Instance()->getDataRoot() +
										"/stars/default/" + cat_hip_sp_file_name);
		}
		catch (std::exception& e)
		{
			cerr << "ERROR while loading data from "
			     << ("stars/default/" + cat_hip_sp_file_name)
		    	 << ": " << e.what();
		}
	}

	const string cat_hip_cids_file_name = conf.get_str("stars","cat_hip_cids_file_name","").c_str();
	if (cat_hip_cids_file_name.empty())
	{
		cerr << "ERROR: stars:cat_hip_cids_file_name not found" << endl;
	}
	else
	{
		try
		{
			component_array.initFromFile(AppSettings::Instance()->getDataRoot() +
										 "/stars/default/" + cat_hip_cids_file_name);
		}
		catch (std::exception& e)
		{
			cerr << "ERROR while loading data from "
			     << ("stars/default/" + cat_hip_cids_file_name)
		    	 << ": " << e.what() << endl;
		}
	}

	last_max_search_level = max_geodesic_grid_level;
	cout << "finished, max_geodesic_level: " << max_geodesic_grid_level << endl;
}
开发者ID:bmeaut,项目名称:RemotableNightshade,代码行数:98,代码来源:hip_star_mgr.cpp


注:本文中的LoadingBar::SetMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。