本文整理汇总了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;
}