Skip to content

Commit

Permalink
Merge pull request #44 from LuAPi/updatesummaryvar-improvments
Browse files Browse the repository at this point in the history
UpdateSummaryVar improvements
  • Loading branch information
pmnewman authored Jun 14, 2018
2 parents 4c2b9c7 + c4042e0 commit 19d06a9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Core/libMOOS/DB/MOOSDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,12 +1205,11 @@ void CMOOSDB::UpdateSummaryVar()
ss<<std::left<<std::setw(2);
ss<<p->second.m_cDataType<<" ";

ss<<std::left<<std::setw(20);
switch(p->second.m_cDataType)
{
ss<<std::left<<std::setw(25);
case MOOS_DOUBLE:
ss<<p->second.m_dfVal<<" ";break;
ss<<p->second.m_dfVal;
break;
case MOOS_STRING:
{
unsigned int s = p->second.m_sVal.size();
Expand All @@ -1221,22 +1220,20 @@ void CMOOSDB::UpdateSummaryVar()

break;
}
ss<<p->second.m_sVal<<" ";break;
case MOOS_BINARY_STRING:
{
unsigned int s = p->second.m_sVal.size();
std::string bss;
if(s<1024)
bss = MOOSFormat("*binary* %-4d B ",s);
bss = MOOSFormat("*binary* %-4d B",s);
else if(s<1024*1024)
bss = MOOSFormat("*binary* %.3f KB ",s/(1024.0));
bss = MOOSFormat("*binary* %.3f KB",s/(1024.0));
else
bss = MOOSFormat("*binary* %.3f MB ",s/(1024.0*1024.0));
bss = MOOSFormat("*binary* %.3f MB",s/(1024.0*1024.0));

ss<<bss;
break;
}

}


Expand Down

0 comments on commit 19d06a9

Please sign in to comment.