Commit 26dc7eaa by maarten

progress improvement

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@285 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 9b5ef754
......@@ -151,8 +151,8 @@ BondMap::BondMap(const Structure& p)
cif::tie(asymId, seqId) = r.get("asym_id", "seq_id");
vector<Atom> rAtoms;
for (auto a: db["atom_site"].find(cif::Key("label_asym_id") == asymId and cif::Key("label_seq_id") == seqId))
rAtoms.push_back(p.getAtomById(a["id"].as<string>()));
copy_if(atoms.begin(), atoms.end(), back_inserter(rAtoms),
[&](auto& a) { return a.labelAsymId() == asymId and a.labelSeqId() == seqId; });
for (size_t i = 0; i + 1 < rAtoms.size(); ++i)
{
......@@ -171,8 +171,10 @@ BondMap::BondMap(const Structure& p)
cif::tie(asymId) = r.get("asym_id");
vector<Atom> rAtoms;
for (auto a: db["atom_site"].find(cif::Key("label_asym_id") == asymId))
rAtoms.push_back(p.getAtomById(a["id"].as<string>()));
copy_if(atoms.begin(), atoms.end(), back_inserter(rAtoms),
[&](auto& a) { return a.labelAsymId() == asymId; });
// for (auto a: db["atom_site"].find(cif::Key("label_asym_id") == asymId))
// rAtoms.push_back(p.getAtomById(a["id"].as<string>()));
for (size_t i = 0; i + 1 < rAtoms.size(); ++i)
{
......
......@@ -424,11 +424,13 @@ struct ProgressImpl
void ProgressImpl::Run()
{
bool printedAny = false;
try
{
for (;;)
{
boost::this_thread::sleep(boost::posix_time::seconds(1));
boost::this_thread::sleep(boost::posix_time::seconds(5));
boost::mutex::scoped_lock lock(mMutex);
......@@ -436,11 +438,13 @@ void ProgressImpl::Run()
break;
PrintProgress();
printedAny = true;
}
}
catch (...) {}
PrintDone();
if (printedAny)
PrintDone();
}
void ProgressImpl::PrintProgress()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment