Skip to content

Commit

Permalink
[yarpdatasetplayer] updated
Browse files Browse the repository at this point in the history
Skip the Stamp line in info.log
  • Loading branch information
pattacini committed Jul 7, 2019
1 parent 37ca1fd commit 6a5e543
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/yarpdataplayer/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int Utilities::getRecSubDirList(string dir, vector<string> &names, vector<string
/**********************************************************/
bool Utilities::checkLogValidity(const char *filename)
{
bool check = false;
bool check = true;
fstream str;
str.open (filename, ios_base::in);//, ios::binary);

Expand All @@ -234,17 +234,14 @@ bool Utilities::checkLogValidity(const char *filename)
int itr = 0;
while( getline( str, line ) && itr < 3){
Bottle b( line );
if (itr >= 0){
if ( b.size() < 1){
check = false;
} else {
check = true;
}
if ( b.size() == 0){
check = false;
break;
}
itr++;
}
str.close();
fprintf (stdout, "The size of the file is %d \n",itr );
fprintf (stdout, "The file contains at least %d non-empty lines\n",itr );
}
return check;
}
Expand All @@ -260,13 +257,13 @@ bool Utilities::setupDataFromParts(partsData &part)
if (str.is_open()){
string line;
int itr = 0;
while( getline( str, line ) && (itr <= 1) ){
while( getline( str, line ) && (itr <= 2) ){
Bottle b( line );
if (itr == 0){
part.type = b.get(1).toString();
part.type.erase(part.type.size() -1 ); // remove the ";" character
}
if (itr == 1){
if (itr == 2){
part.portName = b.get(1).toString();
LOG( "the name of the port is %s\n",part.portName.c_str());
}
Expand Down

0 comments on commit 6a5e543

Please sign in to comment.