26 #include <QtCore/QFile>
27 #include <QtCore/QList>
28 #include <QtCore/QRegExp>
29 #include <QtCore/QTextStream>
132 "::effectiveSize(): the driver is NULL for the lCode \"" +
lCode_ +
"\"");
143 "::effectiveSize(): the type SD_NumChans is not used in this format; the lCode is \"" +
150 "::effectiveSize(): the type SD_2NumChans is not used in this format; the lCode is \"" +
167 "::effectiveSize(): uknown special dimension \"" + QString(
"").setNum(d) +
"\" for the lCode \"" +
202 const QString dtype2char[] = {
"NO",
"C1",
"I2",
"I4",
"I8",
"R4",
"R8"};
203 return dtype2char[tp];
211 const QString scope2char[] = {
"NON",
"SES",
"SCA",
"STA",
"BAS"};
212 return scope2char[sc];
230 "::allocateSpace(): the descriptor is NULL");
237 int numOfElements=descriptor_->totalMaxSize();
238 if (numOfElements<=0)
241 "::allocateSpace(): cannot allocate space for the descriptor \"" + descriptor_->getLCode() +
242 "\": the size, " + QString(
"").setNum(numOfElements) +
", is unusable");
247 data_ =
new C[numOfElements];
248 memset((
void*)data_, 0, numOfElements*
sizeof(C));
269 "::isEmpty(): the data are not allocated yet");
273 for (
int i=0; i<descriptor_->totalMaxSize(); i++)
274 if (*(data_ + i) != C(0))
287 "::getValue(): the descriptor is NULL");
291 ( idx1<descriptor_->d1() &&
292 idx2<descriptor_->d2() &&
293 idx3<descriptor_->d3() &&
294 idx4<descriptor_->d4() )?
296 descriptor_->d1()*idx2 +
297 descriptor_->d1()*descriptor_->d2()*idx3 +
298 descriptor_->d1()*descriptor_->d2()*descriptor_->d3()*idx4) : (C)0;
309 "::value(): the descriptor is NULL");
312 if (idx1<0 || descriptor_->d1()<=idx1)
314 QString().sprintf(
"::value(): the first index, %d, is out of range [0:%d] ",
315 idx1, descriptor_->d1()) + descriptor_->getLCode());
316 if (idx2<0 || descriptor_->d2()<=idx2)
318 QString().sprintf(
"::value(): the second index, %d, is out of range [0:%d] ",
319 idx2, descriptor_->d2()) + descriptor_->getLCode());
320 if (idx3<0 || descriptor_->d3()<=idx3)
322 QString().sprintf(
"::value(): the third index, %d, is out of range [0:%d] ",
323 idx3, descriptor_->d3()) + descriptor_->getLCode());
324 if (idx4<0 || descriptor_->d4()<=idx4)
326 QString().sprintf(
"::value(): the fourth index, %d, is out of range [0:%d] ",
327 idx4, descriptor_->d4()) + descriptor_->getLCode());
329 return *(data_ + idx1 +
330 descriptor_->d1()*idx2 +
331 descriptor_->d1()*descriptor_->d2()*idx3 +
332 descriptor_->d1()*descriptor_->d2()*descriptor_->d3()*idx4);
349 "::allocateSpace(): the descriptor is NULL");
357 if (numOfElements<=0)
360 "::allocateSpace(): cannot allocate space for the descriptor \"" +
descriptor_->
getLCode() +
361 "\": the size, " + QString(
"").setNum(numOfElements) +
", is unusable");
365 data_ =
new QString[numOfElements];
366 for (
int i=0; i<numOfElements; i++)
391 QString emptyStr(d1, QChar(
' '));
396 for (
int i=0; i<numOfElements; i++)
397 if (*(
data_ + i) != emptyStr)
410 "::getValue(): the descriptor is NULL");
414 ( idx2<descriptor_->d2() &&
415 idx3<descriptor_->d3() &&
416 idx4<descriptor_->d4() )?
430 "::value(): the descriptor is NULL");
433 if (idx2<0 || descriptor_->d2()<=idx2)
435 QString().sprintf(
"::value(): the second index, %d, is out of range [0:%d] ",
438 if (idx3<0 || descriptor_->d3()<=idx3)
440 QString().sprintf(
"::value(): the third index, %d, is out of range [0:%d] ",
443 if (idx4<0 || descriptor_->d4()<=idx4)
445 QString().sprintf(
"::value(): the fourth index, %d, is out of range [0:%d] ",
449 return *(
data_ + idx2 +
467 ts << prefix <<
" " <<
content_ <<
"\n";
483 for (
int i=0; i<size(); i++)
495 int numOfReadRecords, num2read;
496 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+(.*)", Qt::CaseInsensitive);
500 numOfReadRecords = 0;
504 numOfReadRecords = 1;
505 for (
int i=0; i<num2read; i++)
509 if (
true || re.indexIn(str) != -1)
524 "::importData(): cannot parse a string \"" + str +
"\" as a record of " +
prefix_ +
527 numOfReadRecords += num2read;
529 "::importData(): read " + QString(
"").setNum(numOfReadRecords) +
" records of the section " +
535 "::importData(): error reading the section_length string: \"" + str +
"\"");
539 std::cout <<
" SgAgvSection::importData finished, prefix=[" << qPrintable(
prefix_) <<
"]"
544 return numOfReadRecords;
553 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+@section_length:\\s+(\\d+)\\s+.*",
554 Qt::CaseInsensitive);
557 if (re.indexIn(str) != -1)
560 idx = re.cap(1).toInt(&isOk);
563 num2read = re.cap(2).toInt(&isOk);
567 "::parseSectionLengthString(): section parsing the length string is ok: idx=" +
568 QString(
"").setNum(idx) +
", num2read=" + QString(
"").setNum(num2read));
571 "::parseSectionLengthString(): the current index, " + QString(
"").setNum(
idx_ + 1) +
572 ", does not match the index from input, " + QString(
"").setNum(idx));
580 "::parseSectionLengthString(): cannot parse the length string \"" + str +
"\"");
598 for (
int i=0; i<size(); i++)
607 for (
int i=0; i<inputFileNames.size(); i++)
609 append(
new SgAgvRecord(
this, inputFileNames.at(i)));
612 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
616 "::fillDataStructures(): the input driver is NULL, nothing to do");
624 int numOfWritenRecords=0;
625 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
627 ts << prfx <<
" @section_length: " << size() <<
" files\n";
629 for (
int i=0; i<size(); i++)
630 numOfWritenRecords += at(i)->exportData(ts, prfx);
632 return numOfWritenRecords + 1;
648 for (
int i=0; i<size(); i++)
654 append(
new SgAgvRecord(
this,
"DEF_TYPE: 1 CHARACTER ASCII"));
655 append(
new SgAgvRecord(
this,
"DEF_TYPE: 2 INTEGER*2 IEEE-231"));
656 append(
new SgAgvRecord(
this,
"DEF_TYPE: 3 INTEGER*4 IEEE-231"));
657 append(
new SgAgvRecord(
this,
"DEF_TYPE: 4 REAL*4 IEEE 754-1985"));
658 append(
new SgAgvRecord(
this,
"DEF_TYPE: 5 REAL*8 IEEE 754-1985"));
659 append(
new SgAgvRecord(
this,
"DEF_TYPE: 6 INTEGER*8 IEEE-231"));
660 append(
new SgAgvRecord(
this,
"DEF_CLASS: 81 Session"));
661 append(
new SgAgvRecord(
this,
"DEF_CLASS: 82 Scan"));
662 append(
new SgAgvRecord(
this,
"DEF_CLASS: 83 Station"));
663 append(
new SgAgvRecord(
this,
"DEF_CLASS: 84 Baseline"));
675 drvVersion->
name() +
" released on " +
688 "::fillDataStructures(): the input driver is NULL, some information is missed");
691 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
699 int numOfWritenRecords=0;
700 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
702 ts << prfx <<
" @section_length: " << size() <<
" keywords\n";
704 for (
int i=0; i<size(); i++)
705 numOfWritenRecords += at(i)->exportData(ts, prfx);
707 return numOfWritenRecords + 1;
719 QRegExp reVer(
"^GVH_VERSION:\\s+(.+)(?: released on | release of )\\s*(.*)",
720 Qt::CaseInsensitive);
726 QRegExp reGen(
"^GENERATOR:\\s+(.+)(?: released on | v | Version of )\\s*(.*)",
727 Qt::CaseInsensitive);
730 QRegExp reCat(
"^CREATED_AT:\\s+(\\d{4}\\.\\d{2}\\.\\d{2}-\\d{2}:\\d{2}:\\d{2})"
731 "\\s*([A-Z0-9:+-]*)",
732 Qt::CaseInsensitive);
735 QRegExp reCby(
"^CREATED_BY:\\s+(.+)\\s+\\(\\s*(.+)\\s*\\)\\s*(.*)",
736 Qt::CaseInsensitive);
737 QRegExp reOth(
"^(DEF_TYPE|DEF_CLASS):.*",
738 Qt::CaseInsensitive);
739 int numOfReadRecords;
746 for (
int i=0; i<size(); i++)
748 const QString& str=at(i)->content();
750 if (reOth.indexIn(str) != -1)
753 else if (reVer.indexIn(str) != -1)
764 "::importData(): content style has been set to ACS_NATIVE");
776 else if (reGen.indexIn(str) != -1)
792 QRegExp reAft(
"\\s*(\\d+)\\.?(\\d*)(.*)\\s*(\\d{4}\\.\\d{2}\\.\\d{2})\\s*AFTER\\s*nuSolve",
793 Qt::CaseInsensitive);
794 QRegExp reDte(
"\\s*(.*)\\s*(\\d{4}\\.\\d{2}\\.\\d{2})\\s*",
795 Qt::CaseInsensitive);
797 QRegExp reVr(
"\\s*(\\d+)\\.?(\\d*)(.*)\\s*",
798 Qt::CaseInsensitive);
805 if (reAft.indexIn(res) != -1)
808 if (reAft.captureCount() == 4)
813 else if (reAft.captureCount() == 3)
815 else if (reAft.captureCount() == 2)
819 "::importData(): do not know what to do with \"" + reAft.cap(0) +
"\"");
823 n = reAft.cap(1).toInt(&isOk);
828 n = res.toInt(&isOk);
833 else if (reDte.indexIn(res) != -1)
839 if (reVr.indexIn(res) != -1)
841 if (reVr.cap(1).size())
843 n = reVr.cap(1).toInt(&isOk);
847 if (reVr.cap(2).size())
849 n = reVr.cap(2).toInt(&isOk);
853 if (reVr.cap(3).size())
862 "::importData(): content style has been set to ACS_GVH_VDB");
868 "::importData(): content style has been set to ACS_GVH_DBH");
874 "::importData(): content style has been set to ACS_GVH_PIMA");
878 "::importData(): cannot determine content style from a string \"" + str +
"\"");
881 else if (reCat.indexIn(str) != -1)
886 if (res.size() && res !=
"UTC")
888 "::importData(): got a non standard time zone: \"" + res +
"\", need to fix this");
890 else if (reCby.indexIn(str) != -1 && ids)
893 if (reCby.cap(2).size())
895 res = reCby.cap(3).simplified();
896 if (res.startsWith(
"of "))
904 "::importData(): got unknown keyword: \"" + str +
"\"");
914 std::cout <<
" SgAgvPreaSection::importData finished"
919 return numOfReadRecords;
935 for (
int i=0; i<size(); i++)
951 for (
int i=0; i<
history->size() - 1 ; i++)
956 if (t < hRec->getEpoch() || v != hRec->
getVersion())
974 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
984 int numOfWritenRecords=0;
986 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
988 ts << prfx <<
" @section_length: " <<
headerByIdx_.size() <<
" chapters\n";
991 for (
int i=0; i<size(); i++)
994 if (chapterIdx < rec->getSubIdx())
997 ts << prfx <<
" @@chapter: " << chapterIdx + 1
999 <<
" records, max_len: " <<
maxLenByIdx_.value(chapterIdx)
1002 numOfWritenRecords++;
1004 numOfWritenRecords += at(i)->exportData(ts, prfx);
1008 std::cout <<
"SgAgvTextSection::exportData: done"
1013 return numOfWritenRecords + 1;
1023 int numOfReadRecords, numChapter2read, numRecord2read, idx;
1024 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+(.*)", Qt::CaseInsensitive);
1029 numOfReadRecords = 0;
1030 str = ts.readLine();
1033 numOfReadRecords = 1;
1034 for (
int i=0; i<numChapter2read; i++)
1036 str = ts.readLine();
1040 for (
int j=0; j<numRecord2read; j++)
1042 str = ts.readLine();
1043 if (re.indexIn(str) != -1)
1045 idx = re.cap(1).toInt(&isOk);
1048 if (idx !=
idx_ + 1)
1050 "::importData(): the current index, " + QString(
"").setNum(
idx_ + 1) +
1051 ", does not match the index from input, " + QString(
"").setNum(idx));
1058 "::importData(): cannot parse a string \"" + str +
"\" as a record of " +
prefix_ +
1061 numOfReadRecords += numRecord2read;
1065 "::importData(): parsing chapter string has failed: \"" + str +
"\"");
1068 "::importData(): read " + QString(
"").setNum(numOfReadRecords) +
" records of the section " +
1074 "::importData(): error reading the section_length string: \"" + str +
"\"");
1078 std::cout <<
" SgAgvTextSection::importData finished"
1083 return numOfReadRecords;
1094 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+@*@chapter:\\s+(\\d+)\\s+(\\d+)\\s+records,\\s+.*",
1095 Qt::CaseInsensitive);
1096 QRegExp reVer(
".*\\s+Version\\s+(\\d+)\\s+(\\d{4}\\.\\d{2}\\.\\d{2}-\\d{2}:\\d{2}:\\d{2}).*",
1097 Qt::CaseInsensitive);
1101 if (re.indexIn(str) != -1)
1103 int idx, chapterIdx;
1104 idx = re.cap(1).toInt(&isOk);
1107 chapterIdx = re.cap(2).toInt(&isOk);
1110 num2read = re.cap(3).toInt(&isOk);
1114 "::parseChapterInitString(): parsing the chapter string is ok: idx=" +
1115 QString(
"").setNum(idx) +
", chapterIdx=" + QString(
"").setNum(chapterIdx) +
1116 ", num2read=" + QString(
"").setNum(num2read));
1117 if (reVer.indexIn(str) != -1)
1120 histVer_ = reVer.cap(1).toInt(&isOk);
1124 "::parseChapterInitString(): cannot figure out version and epoch from the string \"" +
1135 "::parseChapterInitString(): cannot parse the chapter string \"" + str +
"\"");
1155 for (
int i=0; i<size(); i++)
1160 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
mandatoryDatumByKey().begin();
1168 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
datumByKey().begin();
1177 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
1185 const char* scope2char[] = {
"NON",
"SES",
"SCA",
"STA",
"BAS"};
1186 const char* dtype2char[] = {
"NO",
"C1",
"I2",
"I4",
"I8",
"R4",
"R8"};
1188 QString(
"").sprintf(
"%-8s %3s %2s %3d %3d ",
1203 QRegExp re(
"(\\S+)\\s+([A-Z]{3})\\s+([CIR][1248])\\s+(\\d+)\\s+(\\d+)\\s+(.*)",
1204 Qt::CaseInsensitive);
1206 QString lCode(
""), descr(
""), str(
"");
1213 if (re.indexIn(rec->
content()) != -1)
1215 lCode = re.cap(1).leftJustified(8,
' ');
1216 descr = re.cap(6).simplified();
1221 else if (str ==
"SCA")
1223 else if (str ==
"STA")
1225 else if (str ==
"BAS")
1233 else if (str ==
"I2")
1235 else if (str ==
"I4")
1237 else if (str ==
"I8")
1239 else if (str ==
"R4")
1241 else if (str ==
"R8")
1246 d1 = re.cap(4).toInt(&isOk);
1249 d2 = re.cap(5).toInt(&isOk);
1257 "::agvRecord2datumDescriptor(): cannot create datumDescriptor from for a TOC record \"" +
1262 "::agvRecord2datumDescriptor(): cannot parse a TOC record \"" + rec->
content() +
"\"");
1273 int numOfWritenRecords=0;
1274 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
1276 ts << prfx <<
" @section_length: " << size() <<
" lcodes\n";
1278 for (
int i=0; i<size(); i++)
1279 numOfWritenRecords += at(i)->exportData(ts, prfx);
1282 std::cout <<
"SgAgvTocsSection::exportData: done"
1287 return numOfWritenRecords + 1;
1295 int numOfReadRecords;
1300 std::cout <<
" SgAgvTocsSection::importData: (" <<
idx_ <<
") begin\n";
1303 for (
int i=0; i<size(); i++)
1310 std::cout <<
" SgAgvTocsSection::importData: (" <<
idx_ <<
") end"
1315 return numOfReadRecords;
1332 for (
int i=0; i<size(); i++)
1337 "::fillDataStructures(): there are " +
1339 " registered entries for output");
1349 int numOfWritenRecords=0, num2write=0;
1352 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
mandatoryDatumByKey().begin();
1354 if (it.value()->getHasData())
1355 num2write += it.value()->totalSize();
1358 std::cout <<
"SgAgvDataSection::exportData: calced num of mandatory records"
1363 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
datumByKey().begin();
1365 if (it.value()->getHasData())
1366 num2write += it.value()->totalSize();
1369 std::cout <<
"SgAgvDataSection::exportData: calced num of other records"
1375 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
1376 ts << prfx <<
" @section_length: " << num2write <<
" records\n";
1379 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
mandatoryDatumByKey().begin();
1381 numOfWritenRecords +=
writeDatumOpt(ts, it.value(), prfx, drv);
1385 std::cout <<
"SgAgvDataSection::exportData: wrote mandatory records"
1390 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
datumByKey().begin();
1392 numOfWritenRecords +=
writeDatumOpt(ts, it.value(), prfx, drv);
1396 std::cout <<
"SgAgvDataSection::exportData: wrote other records"
1399 std::cout <<
"SgAgvDataSection::exportData: done"
1404 return numOfWritenRecords + 1;
1413 int numOfWritenRecords=0;
1416 return numOfWritenRecords;
1418 QString content(
"");
1425 for (
int l=0; l<d4; l++)
1429 for (
int k=0; k<d3; k++)
1430 for (
int j=0; j<d2; j++)
1440 << dd->
getLCode().leftJustified(8,
' ') <<
" "
1441 << QString(
"").setNum(k + 1) <<
" "
1442 << QString(
"").setNum(l + 1) <<
" 1 "
1443 << QString(
"").setNum(j + 1) <<
" "
1447 numOfWritenRecords++;
1453 for (
int l=0; l<d4; l++)
1457 for (
int k=0; k<d3; k++)
1458 for (
int j=0; j<d2; j++)
1459 for (
int i=0; i<d1; i++)
1469 << dd->
getLCode().leftJustified(8,
' ') <<
" "
1471 << QString(
"").setNum(k + 1) <<
" "
1472 << QString(
"").setNum(l + 1) <<
" "
1473 << QString(
"").setNum(i + 1) <<
" "
1474 << QString(
"").setNum(j + 1) <<
" "
1478 numOfWritenRecords++;
1482 return numOfWritenRecords;
1491 int numOfWritenRecords=0;
1494 return numOfWritenRecords;
1496 QString content(
"N/A");
1513 for (
int l=0; l<d4; l++)
1517 for (
int k=0; k<d3; k++)
1518 for (
int j=0; j<d2; j++)
1520 content = dstr->
getValue(j, k, l).trimmed();
1521 content.replace(
' ',
'_');
1522 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1523 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" 1 "
1524 << QString(
"").setNum(j + 1) <<
" " << content <<
"\n";
1525 numOfWritenRecords++;
1531 for (
int l=0; l<d4; l++)
1535 for (
int k=0; k<d3; k++)
1536 for (
int j=0; j<d2; j++)
1537 for (
int i=0; i<d1; i++)
1539 content.setNum(dsin->
getValue(i, j, k, l));
1540 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1541 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1542 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1545 numOfWritenRecords++;
1550 for (
int l=0; l<d4; l++)
1554 for (
int k=0; k<d3; k++)
1555 for (
int j=0; j<d2; j++)
1556 for (
int i=0; i<d1; i++)
1558 content.setNum(dint->
getValue(i, j, k, l));
1559 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1560 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1561 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1563 numOfWritenRecords++;
1569 for (
int l=0; l<d4; l++)
1573 for (
int k=0; k<d3; k++)
1574 for (
int j=0; j<d2; j++)
1575 for (
int i=0; i<d1; i++)
1577 content.setNum(dlin->
getValue(i, j, k, l));
1578 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1579 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1580 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1582 numOfWritenRecords++;
1588 for (
int l=0; l<d4; l++)
1592 for (
int k=0; k<d3; k++)
1593 for (
int j=0; j<d2; j++)
1594 for (
int i=0; i<d1; i++)
1596 content.setNum(dflt->
getValue(i, j, k, l),
'E', 7);
1597 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1598 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1599 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1601 numOfWritenRecords++;
1607 for (
int l=0; l<d4; l++)
1611 for (
int k=0; k<d3; k++)
1612 for (
int j=0; j<d2; j++)
1613 for (
int i=0; i<d1; i++)
1615 content.setNum(ddbl->
getValue(i, j, k, l),
'E', 15);
1616 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1617 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1618 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1620 numOfWritenRecords++;
1629 return numOfWritenRecords;
1637 int numOfReadRecords;
1639 std::cout <<
" SgAgvDataSection::importData: (" <<
idx_ <<
") start\n";
1650 "::importData(): parsing the mandatory records have failed");
1651 return numOfReadRecords;
1656 std::cout <<
" SgAgvDataSection::importData: allocating data: (" <<
idx_ <<
") done"
1664 std::cout <<
" SgAgvDataSection::importData: digesting data: (" <<
idx_ <<
") done"
1667 std::cout <<
" SgAgvDataSection::importData finished"
1672 return numOfReadRecords;
1702 int numOfWritenRecords;
1705 numOfWritenRecords = 0;
1714 ts <<
"CHUN." <<
idx_ + 1 <<
" @chunk_size: " << numOfWritenRecords <<
" records\n";
1717 std::cout <<
"SgAgvChunk::exportData: done"
1718 << qPrintable(QString(
"").sprintf(
", dt= %.2f ms", (
SgMJD::currentMJD() - startEpoch_)*86400000.0))
1728 int numOfReadRecords;
1733 str = ts.readLine();
1737 std::cout <<
" SgAgvChunk::importData: (" <<
idx_ <<
") start\n";
1739 numOfReadRecords = 1;
1748 str = ts.readLine();
1755 "::importData(): read " + QString(
"").setNum(numOfReadRecords) +
" records of the chunk #" +
1756 QString(
"").setNum(
idx_));
1759 std::cout <<
" SgAgvChunk::importData: (" <<
idx_ <<
") done"
1760 << qPrintable(QString(
"").sprintf(
", dt= %.2f ms", (
SgMJD::currentMJD() - startEpoch)*86400000.0))
1766 "::importData(): error parsing the ending string: \"" + str +
"\"");
1771 "::importData(): error parsing the magic string: \"" + str +
"\"");
1783 QRegExp reMagicDate(
magicPrefix_ +
"\\s*(\\d+)\\.(\\d+)\\.(\\d+).*",
1784 Qt::CaseInsensitive);
1785 QRegExp reMagicStr(
magicPrefix_ +
"\\s*(.+)", Qt::CaseInsensitive);
1786 if (reMagicDate.indexIn(str) != -1)
1789 vYr = reMagicDate.cap(1).toInt(&isOk);
1792 vMn = reMagicDate.cap(2).toInt(&isOk);
1795 vDy = reMagicDate.cap(3).toInt(&isOk);
1809 "::parseMagicString(): cannot extract a date from format string \"" + str +
"\"");
1812 if (reMagicStr.indexIn(str) != -1)
1820 "::parseMagicString(): cannot extract a version from format string \"" + str +
"\"");
1833 QRegExp reClosingStr(
"CHUN\\.(\\d+)\\s+@chunk_size:\\s+(\\d+)\\s+records.*",
1834 Qt::CaseInsensitive);
1836 if (reClosingStr.indexIn(str) != -1)
1844 "::parseEndString(): cannot recognize the ending string \"" + str +
"\"");
@ ADS_SESSION
session scope
@ ADS_BASELINE
baseline scope
@ ADS_STATION
station scope
const SgMJD tZero(1957, 10, 4)
SgVersion libraryVersion("SgLib", 0, 8, 2, "Compton Peak (rc2)", SgMJD(2023, 4, 3, 10, 59))
static const QString magicPrefix_
void exportData(QTextStream &ts, SgAgvDriver *drv)
QString className() const
bool parseEndString(const QString &str)
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
bool parseMagicString(const QString &str)
void importData(QTextStream &ts, SgAgvDriver *drv)
int importData(QTextStream &ts, SgAgvDriver *drv)
int writeDatumOpt(QTextStream &ts, SgAgvDatumDescriptor *dd, const QString &prfx, SgAgvDriver *drv)
int writeDatum(QTextStream &ts, SgAgvDatumDescriptor *dd, const QString &prfx, SgAgvDriver *drv)
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
QString className() const
int exportData(QTextStream &ts, SgAgvDriver *drv)
AgvDataType getDataType() const
static QString dataType2str(AgvDataType)
QString className() const
unsigned int getExpectance() const
const QString & getLCode() const
const QString & getDescription() const
int effectiveSize(int d) const
AgvDataScope getDataScope() const
static QString dataScope2str(AgvDataScope)
const QString & getValue(int idx2, int idx3, int idx4) const
QString className() const
QString & value(int idx2, int idx3, int idx4)
SgAgvDatumDescriptor * descriptor_
C getValue(int idx1, int idx2, int idx3, int idx4) const
C & value(int idx1, int idx2, int idx3, int idx4)
QMap< QString, SgAgvDatumDescriptor * > & datumByKey()
int getNumOfStnPts(int idx) const
QString data2str(SgAgvDatumDescriptor *dd, int idx1, int idx2, int idx3, int idx4)
bool addDatumDescriptor(SgAgvDatumDescriptor *dd)
QMap< QString, SgAgvDatum< float > * > & r4Data()
void setExpectedStyle(AgvContentStyle stl)
QMap< QString, SgAgvDatumString * > & c1Data()
QMap< QString, SgAgvDatum< int > * > & i4Data()
const QMap< QString, int > & getNumOfObsByStn() const
int getNumOfBands() const
QMap< QString, SgAgvDatumDescriptor * > & mandatoryDatumByKey()
void figureOutImplicitDimensions(const QList< SgAgvRecord * > *)
QMap< QString, SgAgvDatum< long int > * > & i8Data()
int getNumOfScans() const
QMap< QString, SgAgvDatum< short int > * > & i2Data()
int getMaxNumPerStn() const
QMap< QString, SgAgvDatum< double > * > & r8Data()
void digestDataNoRegEx(const QList< SgAgvRecord * > *)
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
QString className() const
int exportData(QTextStream &ts, SgAgvDriver *drv)
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
QString className() const
int exportData(QTextStream &ts, SgAgvDriver *drv)
int importData(QTextStream &ts, SgAgvDriver *drv)
int exportData(QTextStream &ts, const QString &prefix)
const QString & content() const
int exportData(QTextStream &ts, SgAgvDriver *)
bool parseSectionLengthString(const QString &str, int &num2read)
int importData(QTextStream &ts, SgAgvDriver *drv)
QString className() const
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
SgVlbiHistory & history()
QMap< int, QString > headerByIdx_
QMap< int, int > maxLenByIdx_
int exportData(QTextStream &ts, SgAgvDriver *drv)
int importData(QTextStream &ts, SgAgvDriver *drv)
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
QString className() const
bool parseChapterInitString(const QString &str, int &num2read)
QMap< int, int > numByIdx_
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
SgAgvDatumDescriptor * agvRecord2datumDescriptor(SgAgvRecord *rec)
int importData(QTextStream &ts, SgAgvDriver *drv)
QString className() const
int exportData(QTextStream &ts, SgAgvDriver *drv)
SgAgvRecord * datumDescriptor2agvRecord(SgAgvDatumDescriptor *dd)
const QString & getAcAbbrevName() const
void setAcAbbrevName(const QString &)
const QString & getUserEmailAddress() const
void setUserEmailAddress(const QString &)
void setUserName(const QString &)
const QString & getUserName() const
void setDriverVersion(const SgVersion &)
virtual const QList< QString > listOfInputFiles() const =0
const SgIdentities * getCurrentIdentities() const
const SgVersion * getCurrentDriverVersion() const
SgIdentities * getInputIdentities() const
void setDateOfCreation(const SgMJD &t)
virtual void write(LogLevel, quint32, const QString &, bool=false)
bool fromString(Format format, const QString &str, bool isReset=true)
@ F_YYYYMMDD
Another format for a date: 02 Apr, 2010.
@ F_DDMonYYYY
Date: 2010 Apr 02.
@ F_Date
RFC2822 date format realized by Qt (Qt::RFC2822Date)
@ F_SOLVE_SPLFL
That was used in ECC.dat files: 2010.04.02-17.02.
QString toString(Format format=F_Verbose) const
static SgMJD currentMJD()
void setCodeName(const QString &)
const SgMJD & getReleaseEpoch() const
const QString & getSoftwareName() const
void setReleaseEpoch(const SgMJD &)
QString name(NameFormat fmt=NF_Human) const
void setSoftwareName(const QString &)
bool parseString(const QString &str)
SgVlbiHistory & history()
const SgMJD & getEpoch() const
const QString & getText() const
const QString & getName() const
SgVlbiBand * primaryBand()
const SgIoDriver * getInputDriver() const