comparison framework/SVFileReader.cpp @ 229:8c13e8219903 debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:40 +0100
parents 67cea66bd588
children 8aace2d9f1c2
comparison
equal deleted inserted replaced
228:67cea66bd588 229:8c13e8219903
440 return false; 440 return false;
441 } 441 }
442 442
443 QString name = attributes.value("name"); 443 QString name = attributes.value("name");
444 444
445 std::cerr << "SVFileReader::readModel: model name \"" << name << "\"" << std::endl; 445 DEBUG << "SVFileReader::readModel: model name \"" << name << "\"" << endl;
446 446
447 READ_MANDATORY(int, sampleRate, toInt); 447 READ_MANDATORY(int, sampleRate, toInt);
448 448
449 QString type = attributes.value("type").trimmed(); 449 QString type = attributes.value("type").trimmed();
450 bool mainModel = (attributes.value("mainModel").trimmed() == "true"); 450 bool mainModel = (attributes.value("mainModel").trimmed() == "true");
952 { 952 {
953 bool ok = false; 953 bool ok = false;
954 954
955 READ_MANDATORY(int, frame, toInt); 955 READ_MANDATORY(int, frame, toInt);
956 956
957 // std::cerr << "SVFileReader::addPointToDataset: frame = " << frame << std::endl; 957 // DEBUG << "SVFileReader::addPointToDataset: frame = " << frame << endl;
958 958
959 SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *> 959 SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *>
960 (m_currentDataset); 960 (m_currentDataset);
961 961
962 if (sodm) { 962 if (sodm) {
1014 if (tm) { 1014 if (tm) {
1015 // std::cerr << "Current dataset is a text model" << std::endl; 1015 // std::cerr << "Current dataset is a text model" << std::endl;
1016 float height = 0.0; 1016 float height = 0.0;
1017 height = attributes.value("height").trimmed().toFloat(&ok); 1017 height = attributes.value("height").trimmed().toFloat(&ok);
1018 QString label = attributes.value("label"); 1018 QString label = attributes.value("label");
1019 // std::cerr << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label << ", ok = " << ok << std::endl; 1019 // DEBUG << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label << ", ok = " << ok << endl;
1020 tm->addPoint(TextModel::Point(frame, height, label)); 1020 tm->addPoint(TextModel::Point(frame, height, label));
1021 return ok; 1021 return ok;
1022 } 1022 }
1023 1023
1024 PathModel *pm = dynamic_cast<PathModel *>(m_currentDataset); 1024 PathModel *pm = dynamic_cast<PathModel *>(m_currentDataset);
1025 1025
1026 if (pm) { 1026 if (pm) {
1027 // std::cerr << "Current dataset is a path model" << std::endl; 1027 // std::cerr << "Current dataset is a path model" << std::endl;
1028 int mapframe = attributes.value("mapframe").trimmed().toInt(&ok); 1028 int mapframe = attributes.value("mapframe").trimmed().toInt(&ok);
1029 // std::cerr << "SVFileReader::addPointToDataset: PathModel: frame = " << frame << ", mapframe = " << mapframe << ", ok = " << ok << std::endl; 1029 // DEBUG << "SVFileReader::addPointToDataset: PathModel: frame = " << frame << ", mapframe = " << mapframe << ", ok = " << ok << endl;
1030 pm->addPoint(PathModel::Point(frame, mapframe)); 1030 pm->addPoint(PathModel::Point(frame, mapframe));
1031 return ok; 1031 return ok;
1032 } 1032 }
1033 1033
1034 ImageModel *im = dynamic_cast<ImageModel *>(m_currentDataset); 1034 ImageModel *im = dynamic_cast<ImageModel *>(m_currentDataset);
1035 1035
1036 if (im) { 1036 if (im) {
1037 // std::cerr << "Current dataset is an image model" << std::endl; 1037 // std::cerr << "Current dataset is an image model" << std::endl;
1038 QString image = attributes.value("image"); 1038 QString image = attributes.value("image");
1039 QString label = attributes.value("label"); 1039 QString label = attributes.value("label");
1040 // std::cerr << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image << ", label = " << label << ", ok = " << ok << std::endl; 1040 // DEBUG << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image << ", label = " << label << ", ok = " << ok << endl;
1041 im->addPoint(ImageModel::Point(frame, image, label)); 1041 im->addPoint(ImageModel::Point(frame, image, label));
1042 return ok; 1042 return ok;
1043 } 1043 }
1044 1044
1045 std::cerr << "WARNING: SV-XML: Point element found in non-point dataset" << std::endl; 1045 std::cerr << "WARNING: SV-XML: Point element found in non-point dataset" << std::endl;
1183 if (type == "transform") { 1183 if (type == "transform") {
1184 m_currentTransformIsNewStyle = true; 1184 m_currentTransformIsNewStyle = true;
1185 return true; 1185 return true;
1186 } else { 1186 } else {
1187 m_currentTransformIsNewStyle = false; 1187 m_currentTransformIsNewStyle = false;
1188 std::cerr << "NOTE: SV-XML: Reading old-style derivation element" 1188 DEBUG << "NOTE: SV-XML: Reading old-style derivation element"
1189 << std::endl; 1189 << endl;
1190 } 1190 }
1191 1191
1192 QString transformId = attributes.value("transform"); 1192 QString transformId = attributes.value("transform");
1193 1193
1194 m_currentTransform.setIdentifier(transformId); 1194 m_currentTransform.setIdentifier(transformId);
1366 } 1366 }
1367 1367
1368 bool 1368 bool
1369 SVFileReader::readMeasurement(const QXmlAttributes &attributes) 1369 SVFileReader::readMeasurement(const QXmlAttributes &attributes)
1370 { 1370 {
1371 std::cerr << "SVFileReader::readMeasurement: inLayer " 1371 DEBUG << "SVFileReader::readMeasurement: inLayer "
1372 << m_inLayer << ", layer " << m_currentLayer << std::endl; 1372 << m_inLayer << ", layer " << m_currentLayer << endl;
1373 1373
1374 if (!m_inLayer) { 1374 if (!m_inLayer) {
1375 std::cerr << "WARNING: SV-XML: Measurement found outside layer" << std::endl; 1375 std::cerr << "WARNING: SV-XML: Measurement found outside layer" << std::endl;
1376 return false; 1376 return false;
1377 } 1377 }