26 #include <QtCore/QFile>
27 #include <QtCore/QList>
28 #include <QtCore/QRegExp>
29 #include <QtCore/QTextStream>
133 "::effectiveSize(): the driver is NULL for the lCode \"" +
lCode_ +
"\"");
144 "::effectiveSize(): the type SD_NumChans is not used in this format; the lCode is \"" +
151 "::effectiveSize(): the type SD_2NumChans is not used in this format; the lCode is \"" +
168 "::effectiveSize(): uknown special dimension \"" + QString(
"").setNum(d) +
"\" for the lCode \"" +
203 const QString dtype2char[] = {
"NO",
"C1",
"I2",
"I4",
"I8",
"R4",
"R8"};
204 return dtype2char[tp];
212 const QString scope2char[] = {
"NON",
"SES",
"SCA",
"STA",
"BAS"};
213 return scope2char[sc];
231 "::allocateSpace(): the descriptor is NULL");
238 int numOfElements=descriptor_->totalMaxSize();
239 if (numOfElements<=0)
242 "::allocateSpace(): cannot allocate space for the descriptor \"" + descriptor_->getLCode() +
243 "\": the size, " + QString(
"").setNum(numOfElements) +
", is unusable");
248 data_ =
new C[numOfElements];
249 memset((
void*)data_, 0, numOfElements*
sizeof(C));
270 "::isEmpty(): the data are not allocated yet");
274 for (
int i=0; i<descriptor_->totalMaxSize(); i++)
275 if (*(data_ + i) != C(0))
288 "::getValue(): the descriptor is NULL");
292 ( idx1<descriptor_->d1() &&
293 idx2<descriptor_->d2() &&
294 idx3<descriptor_->d3() &&
295 idx4<descriptor_->d4() )?
297 descriptor_->d1()*idx2 +
298 descriptor_->d1()*descriptor_->d2()*idx3 +
299 descriptor_->d1()*descriptor_->d2()*descriptor_->d3()*idx4) : (C)0;
310 "::value(): the descriptor is NULL");
313 if (idx1<0 || descriptor_->d1()<=idx1)
315 QString().sprintf(
"::value(): the first index, %d, is out of range [0:%d] ",
316 idx1, descriptor_->d1()) + descriptor_->getLCode());
317 if (idx2<0 || descriptor_->d2()<=idx2)
319 QString().sprintf(
"::value(): the second index, %d, is out of range [0:%d] ",
320 idx2, descriptor_->d2()) + descriptor_->getLCode());
321 if (idx3<0 || descriptor_->d3()<=idx3)
323 QString().sprintf(
"::value(): the third index, %d, is out of range [0:%d] ",
324 idx3, descriptor_->d3()) + descriptor_->getLCode());
325 if (idx4<0 || descriptor_->d4()<=idx4)
327 QString().sprintf(
"::value(): the fourth index, %d, is out of range [0:%d] ",
328 idx4, descriptor_->d4()) + descriptor_->getLCode());
330 return *(data_ + idx1 +
331 descriptor_->d1()*idx2 +
332 descriptor_->d1()*descriptor_->d2()*idx3 +
333 descriptor_->d1()*descriptor_->d2()*descriptor_->d3()*idx4);
350 "::allocateSpace(): the descriptor is NULL");
358 if (numOfElements<=0)
361 "::allocateSpace(): cannot allocate space for the descriptor \"" +
descriptor_->
getLCode() +
362 "\": the size, " + QString(
"").setNum(numOfElements) +
", is unusable");
366 data_ =
new QString[numOfElements];
367 for (
int i=0; i<numOfElements; i++)
392 QString emptyStr(d1, QChar(
' '));
397 for (
int i=0; i<numOfElements; i++)
398 if (*(
data_ + i) != emptyStr)
411 "::getValue(): the descriptor is NULL");
415 ( idx2<descriptor_->d2() &&
416 idx3<descriptor_->d3() &&
417 idx4<descriptor_->d4() )?
431 "::value(): the descriptor is NULL");
434 if (idx2<0 || descriptor_->d2()<=idx2)
436 QString().sprintf(
"::value(): the second index, %d, is out of range [0:%d] ",
439 if (idx3<0 || descriptor_->d3()<=idx3)
441 QString().sprintf(
"::value(): the third index, %d, is out of range [0:%d] ",
444 if (idx4<0 || descriptor_->d4()<=idx4)
446 QString().sprintf(
"::value(): the fourth index, %d, is out of range [0:%d] ",
450 return *(
data_ + idx2 +
468 ts << prefix <<
" " <<
content_ <<
"\n";
484 for (
int i=0; i<size(); i++)
496 int numOfReadRecords, num2read;
497 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+(.*)", Qt::CaseInsensitive);
501 numOfReadRecords = 0;
505 numOfReadRecords = 1;
506 for (
int i=0; i<num2read; i++)
510 if (
true || re.indexIn(str) != -1)
525 "::importData(): cannot parse a string \"" + str +
"\" as a record of " +
prefix_ +
528 numOfReadRecords += num2read;
530 "::importData(): read " + QString(
"").setNum(numOfReadRecords) +
" records of the section " +
536 "::importData(): error reading the section_length string: \"" + str +
"\"");
540 std::cout <<
" SgAgvSection::importData finished, prefix=[" << qPrintable(
prefix_) <<
"]"
545 return numOfReadRecords;
554 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+@section_length:\\s+(\\d+)\\s+.*",
555 Qt::CaseInsensitive);
558 if (re.indexIn(str) != -1)
561 idx = re.cap(1).toInt(&isOk);
564 num2read = re.cap(2).toInt(&isOk);
568 "::parseSectionLengthString(): section parsing the length string is ok: idx=" +
569 QString(
"").setNum(idx) +
", num2read=" + QString(
"").setNum(num2read));
572 "::parseSectionLengthString(): the current index, " + QString(
"").setNum(
idx_ + 1) +
573 ", does not match the index from input, " + QString(
"").setNum(idx));
581 "::parseSectionLengthString(): cannot parse the length string \"" + str +
"\"");
599 for (
int i=0; i<size(); i++)
608 for (
int i=0; i<inputFileNames.size(); i++)
610 append(
new SgAgvRecord(
this, inputFileNames.at(i)));
613 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
617 "::fillDataStructures(): the input driver is NULL, nothing to do");
625 int numOfWritenRecords=0;
626 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
628 ts << prfx <<
" @section_length: " << size() <<
" files\n";
630 for (
int i=0; i<size(); i++)
631 numOfWritenRecords += at(i)->exportData(ts, prfx);
633 return numOfWritenRecords + 1;
649 for (
int i=0; i<size(); i++)
655 append(
new SgAgvRecord(
this,
"DEF_TYPE: 1 CHARACTER ASCII"));
656 append(
new SgAgvRecord(
this,
"DEF_TYPE: 2 INTEGER*2 IEEE-231"));
657 append(
new SgAgvRecord(
this,
"DEF_TYPE: 3 INTEGER*4 IEEE-231"));
658 append(
new SgAgvRecord(
this,
"DEF_TYPE: 4 REAL*4 IEEE 754-1985"));
659 append(
new SgAgvRecord(
this,
"DEF_TYPE: 5 REAL*8 IEEE 754-1985"));
660 append(
new SgAgvRecord(
this,
"DEF_TYPE: 6 INTEGER*8 IEEE-231"));
661 append(
new SgAgvRecord(
this,
"DEF_CLASS: 81 Session"));
662 append(
new SgAgvRecord(
this,
"DEF_CLASS: 82 Scan"));
663 append(
new SgAgvRecord(
this,
"DEF_CLASS: 83 Station"));
664 append(
new SgAgvRecord(
this,
"DEF_CLASS: 84 Baseline"));
676 drvVersion->
name() +
" released on " +
689 "::fillDataStructures(): the input driver is NULL, some information is missed");
692 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
700 int numOfWritenRecords=0;
701 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
703 ts << prfx <<
" @section_length: " << size() <<
" keywords\n";
705 for (
int i=0; i<size(); i++)
706 numOfWritenRecords += at(i)->exportData(ts, prfx);
708 return numOfWritenRecords + 1;
720 QRegExp reVer(
"^GVH_VERSION:\\s+(.+)(?: released on | release of )\\s*(.*)",
721 Qt::CaseInsensitive);
727 QRegExp reGen(
"^GENERATOR:\\s+(.+)(?: released on | v | Version of )\\s*(.*)",
728 Qt::CaseInsensitive);
731 QRegExp reCat(
"^CREATED_AT:\\s+(\\d{4}\\.\\d{2}\\.\\d{2}-\\d{2}:\\d{2}:\\d{2})"
732 "\\s*([A-Z0-9:+-]*)",
733 Qt::CaseInsensitive);
736 QRegExp reCby(
"^CREATED_BY:\\s+(.+)\\s+\\(\\s*(.+)\\s*\\)\\s*(.*)",
737 Qt::CaseInsensitive);
738 QRegExp reOth(
"^(DEF_TYPE|DEF_CLASS):.*",
739 Qt::CaseInsensitive);
740 int numOfReadRecords;
747 for (
int i=0; i<size(); i++)
749 const QString& str=at(i)->content();
751 if (reOth.indexIn(str) != -1)
754 else if (reVer.indexIn(str) != -1)
765 "::importData(): content style has been set to ACS_NATIVE");
777 else if (reGen.indexIn(str) != -1)
793 QRegExp reAft(
"\\s*(\\d+)\\.?(\\d*)(.*)\\s*(\\d{4}\\.\\d{2}\\.\\d{2})\\s*AFTER\\s*nuSolve",
794 Qt::CaseInsensitive);
795 QRegExp reDte(
"\\s*(.*)\\s*(\\d{4}\\.\\d{2}\\.\\d{2})\\s*",
796 Qt::CaseInsensitive);
798 QRegExp reVr(
"\\s*(\\d+)\\.?(\\d*)(.*)\\s*",
799 Qt::CaseInsensitive);
806 if (reAft.indexIn(res) != -1)
809 if (reAft.captureCount() == 4)
814 else if (reAft.captureCount() == 3)
816 else if (reAft.captureCount() == 2)
820 "::importData(): do not know what to do with \"" + reAft.cap(0) +
"\"");
824 n = reAft.cap(1).toInt(&isOk);
829 n = res.toInt(&isOk);
834 else if (reDte.indexIn(res) != -1)
840 if (reVr.indexIn(res) != -1)
842 if (reVr.cap(1).size())
844 n = reVr.cap(1).toInt(&isOk);
848 if (reVr.cap(2).size())
850 n = reVr.cap(2).toInt(&isOk);
854 if (reVr.cap(3).size())
863 "::importData(): content style has been set to ACS_GVH_VDB");
869 "::importData(): content style has been set to ACS_GVH_DBH");
875 "::importData(): content style has been set to ACS_GVH_PIMA");
879 "::importData(): cannot determine content style from a string \"" + str +
"\"");
882 else if (reCat.indexIn(str) != -1)
887 if (res.size() && res !=
"UTC")
889 "::importData(): got a non standard time zone: \"" + res +
"\", need to fix this");
891 else if (reCby.indexIn(str) != -1 && ids)
894 if (reCby.cap(2).size())
896 res = reCby.cap(3).simplified();
897 if (res.startsWith(
"of "))
905 "::importData(): got unknown keyword: \"" + str +
"\"");
915 std::cout <<
" SgAgvPreaSection::importData finished"
920 return numOfReadRecords;
936 for (
int i=0; i<size(); i++)
952 for (
int i=0; i<
history->size() - 1 ; i++)
957 if (t < hRec->getEpoch() || v != hRec->
getVersion())
975 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
985 int numOfWritenRecords=0;
987 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
989 ts << prfx <<
" @section_length: " <<
headerByIdx_.size() <<
" chapters\n";
992 for (
int i=0; i<size(); i++)
995 if (chapterIdx < rec->getSubIdx())
998 ts << prfx <<
" @@chapter: " << chapterIdx + 1
1000 <<
" records, max_len: " <<
maxLenByIdx_.value(chapterIdx)
1003 numOfWritenRecords++;
1005 numOfWritenRecords += at(i)->exportData(ts, prfx);
1009 std::cout <<
"SgAgvTextSection::exportData: done"
1014 return numOfWritenRecords + 1;
1024 int numOfReadRecords, numChapter2read, numRecord2read, idx;
1025 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+(.*)", Qt::CaseInsensitive);
1030 numOfReadRecords = 0;
1031 str = ts.readLine();
1034 numOfReadRecords = 1;
1035 for (
int i=0; i<numChapter2read; i++)
1037 str = ts.readLine();
1041 for (
int j=0; j<numRecord2read; j++)
1043 str = ts.readLine();
1044 if (re.indexIn(str) != -1)
1046 idx = re.cap(1).toInt(&isOk);
1049 if (idx !=
idx_ + 1)
1051 "::importData(): the current index, " + QString(
"").setNum(
idx_ + 1) +
1052 ", does not match the index from input, " + QString(
"").setNum(idx));
1059 "::importData(): cannot parse a string \"" + str +
"\" as a record of " +
prefix_ +
1062 numOfReadRecords += numRecord2read;
1066 "::importData(): parsing chapter string has failed: \"" + str +
"\"");
1069 "::importData(): read " + QString(
"").setNum(numOfReadRecords) +
" records of the section " +
1075 "::importData(): error reading the section_length string: \"" + str +
"\"");
1079 std::cout <<
" SgAgvTextSection::importData finished"
1084 return numOfReadRecords;
1095 QRegExp re(
prefix_ +
"\\.(\\d+)\\s+@*@chapter:\\s+(\\d+)\\s+(\\d+)\\s+records,\\s+.*",
1096 Qt::CaseInsensitive);
1097 QRegExp reVer(
".*\\s+Version\\s+(\\d+)\\s+(\\d{4}\\.\\d{2}\\.\\d{2}-\\d{2}:\\d{2}:\\d{2}).*",
1098 Qt::CaseInsensitive);
1102 if (re.indexIn(str) != -1)
1104 int idx, chapterIdx;
1105 idx = re.cap(1).toInt(&isOk);
1108 chapterIdx = re.cap(2).toInt(&isOk);
1111 num2read = re.cap(3).toInt(&isOk);
1115 "::parseChapterInitString(): parsing the chapter string is ok: idx=" +
1116 QString(
"").setNum(idx) +
", chapterIdx=" + QString(
"").setNum(chapterIdx) +
1117 ", num2read=" + QString(
"").setNum(num2read));
1118 if (reVer.indexIn(str) != -1)
1121 histVer_ = reVer.cap(1).toInt(&isOk);
1125 "::parseChapterInitString(): cannot figure out version and epoch from the string \"" +
1136 "::parseChapterInitString(): cannot parse the chapter string \"" + str +
"\"");
1156 for (
int i=0; i<size(); i++)
1161 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
mandatoryDatumByKey().begin();
1169 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
datumByKey().begin();
1178 "::fillDataStructures(): collected " + QString(
"").setNum(size()) +
" records");
1186 const char* scope2char[] = {
"NON",
"SES",
"SCA",
"STA",
"BAS"};
1187 const char* dtype2char[] = {
"NO",
"C1",
"I2",
"I4",
"I8",
"R4",
"R8"};
1189 QString(
"").sprintf(
"%-8s %3s %2s %3d %3d ",
1204 QRegExp re(
"(\\S+)\\s+([A-Z]{3})\\s+([CIR][1248])\\s+(\\d+)\\s+(\\d+)\\s+(.*)",
1205 Qt::CaseInsensitive);
1207 QString lCode(
""), descr(
""), str(
"");
1214 if (re.indexIn(rec->
content()) != -1)
1216 lCode = re.cap(1).leftJustified(8,
' ');
1217 descr = re.cap(6).simplified();
1222 else if (str ==
"SCA")
1224 else if (str ==
"STA")
1226 else if (str ==
"BAS")
1234 else if (str ==
"I2")
1236 else if (str ==
"I4")
1238 else if (str ==
"I8")
1240 else if (str ==
"R4")
1242 else if (str ==
"R8")
1247 d1 = re.cap(4).toInt(&isOk);
1250 d2 = re.cap(5).toInt(&isOk);
1258 "::agvRecord2datumDescriptor(): cannot create datumDescriptor from for a TOC record \"" +
1263 "::agvRecord2datumDescriptor(): cannot parse a TOC record \"" + rec->
content() +
"\"");
1274 int numOfWritenRecords=0;
1275 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
1277 ts << prfx <<
" @section_length: " << size() <<
" lcodes\n";
1279 for (
int i=0; i<size(); i++)
1280 numOfWritenRecords += at(i)->exportData(ts, prfx);
1283 std::cout <<
"SgAgvTocsSection::exportData: done"
1288 return numOfWritenRecords + 1;
1296 int numOfReadRecords;
1301 std::cout <<
" SgAgvTocsSection::importData: (" <<
idx_ <<
") begin\n";
1304 for (
int i=0; i<size(); i++)
1311 std::cout <<
" SgAgvTocsSection::importData: (" <<
idx_ <<
") end"
1316 return numOfReadRecords;
1333 for (
int i=0; i<size(); i++)
1338 "::fillDataStructures(): there are " +
1340 " registered entries for output");
1350 int numOfWritenRecords=0, num2write=0;
1353 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
mandatoryDatumByKey().begin();
1355 if (it.value()->getHasData())
1356 num2write += it.value()->totalSize();
1359 std::cout <<
"SgAgvDataSection::exportData: calced num of mandatory records"
1364 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
datumByKey().begin();
1366 if (it.value()->getHasData())
1367 num2write += it.value()->totalSize();
1370 std::cout <<
"SgAgvDataSection::exportData: calced num of other records"
1376 QString prfx(
prefix_ +
"." + QString(
"").setNum(
idx_ + 1));
1377 ts << prfx <<
" @section_length: " << num2write <<
" records\n";
1380 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
mandatoryDatumByKey().begin();
1382 numOfWritenRecords +=
writeDatumOpt(ts, it.value(), prfx, drv);
1386 std::cout <<
"SgAgvDataSection::exportData: wrote mandatory records"
1391 for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=drv->
datumByKey().begin();
1393 numOfWritenRecords +=
writeDatumOpt(ts, it.value(), prfx, drv);
1397 std::cout <<
"SgAgvDataSection::exportData: wrote other records"
1400 std::cout <<
"SgAgvDataSection::exportData: done"
1405 return numOfWritenRecords + 1;
1414 int numOfWritenRecords=0;
1417 return numOfWritenRecords;
1419 QString content(
"");
1426 for (
int l=0; l<d4; l++)
1430 for (
int k=0; k<d3; k++)
1431 for (
int j=0; j<d2; j++)
1441 << dd->
getLCode().leftJustified(8,
' ') <<
" "
1442 << QString(
"").setNum(k + 1) <<
" "
1443 << QString(
"").setNum(l + 1) <<
" 1 "
1444 << QString(
"").setNum(j + 1) <<
" "
1448 numOfWritenRecords++;
1454 for (
int l=0; l<d4; l++)
1458 for (
int k=0; k<d3; k++)
1459 for (
int j=0; j<d2; j++)
1460 for (
int i=0; i<d1; i++)
1470 << dd->
getLCode().leftJustified(8,
' ') <<
" "
1472 << QString(
"").setNum(k + 1) <<
" "
1473 << QString(
"").setNum(l + 1) <<
" "
1474 << QString(
"").setNum(i + 1) <<
" "
1475 << QString(
"").setNum(j + 1) <<
" "
1479 numOfWritenRecords++;
1483 return numOfWritenRecords;
1492 int numOfWritenRecords=0;
1495 return numOfWritenRecords;
1497 QString content(
"N/A");
1514 for (
int l=0; l<d4; l++)
1518 for (
int k=0; k<d3; k++)
1519 for (
int j=0; j<d2; j++)
1521 content = dstr->
getValue(j, k, l).trimmed();
1522 content.replace(
' ',
'_');
1523 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1524 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" 1 "
1525 << QString(
"").setNum(j + 1) <<
" " << content <<
"\n";
1526 numOfWritenRecords++;
1532 for (
int l=0; l<d4; l++)
1536 for (
int k=0; k<d3; k++)
1537 for (
int j=0; j<d2; j++)
1538 for (
int i=0; i<d1; i++)
1540 content.setNum(dsin->
getValue(i, j, k, l));
1541 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1542 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1543 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1546 numOfWritenRecords++;
1552 for (
int l=0; l<d4; l++)
1556 for (
int k=0; k<d3; k++)
1557 for (
int j=0; j<d2; j++)
1558 for (
int i=0; i<d1; i++)
1560 content.setNum(dint->
getValue(i, j, k, l));
1561 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1562 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1563 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1565 numOfWritenRecords++;
1571 for (
int l=0; l<d4; l++)
1575 for (
int k=0; k<d3; k++)
1576 for (
int j=0; j<d2; j++)
1577 for (
int i=0; i<d1; i++)
1579 content.setNum(dlin->
getValue(i, j, k, l));
1580 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1581 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1582 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1584 numOfWritenRecords++;
1590 for (
int l=0; l<d4; l++)
1594 for (
int k=0; k<d3; k++)
1595 for (
int j=0; j<d2; j++)
1596 for (
int i=0; i<d1; i++)
1598 content.setNum(dflt->
getValue(i, j, k, l),
'E', 7);
1599 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1600 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1601 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1603 numOfWritenRecords++;
1609 for (
int l=0; l<d4; l++)
1613 for (
int k=0; k<d3; k++)
1614 for (
int j=0; j<d2; j++)
1615 for (
int i=0; i<d1; i++)
1617 content.setNum(ddbl->
getValue(i, j, k, l),
'E', 15);
1618 ts << prfx <<
" " << dd->
getLCode().leftJustified(8,
' ') <<
" "
1619 << QString(
"").setNum(k + 1) <<
" " << QString(
"").setNum(l + 1) <<
" "
1620 << QString(
"").setNum(i + 1) <<
" " << QString(
"").setNum(j + 1) <<
" "
1622 numOfWritenRecords++;
1631 return numOfWritenRecords;
1639 int numOfReadRecords;
1641 std::cout <<
" SgAgvDataSection::importData: (" <<
idx_ <<
") start\n";
1652 "::importData(): parsing the mandatory records have failed");
1653 return numOfReadRecords;
1658 std::cout <<
" SgAgvDataSection::importData: allocating data: (" <<
idx_ <<
") done"
1666 std::cout <<
" SgAgvDataSection::importData: digesting data: (" <<
idx_ <<
") done"
1669 std::cout <<
" SgAgvDataSection::importData finished"
1674 return numOfReadRecords;
1704 int numOfWritenRecords;
1707 numOfWritenRecords = 0;
1716 ts <<
"CHUN." <<
idx_ + 1 <<
" @chunk_size: " << numOfWritenRecords <<
" records\n";
1719 std::cout <<
"SgAgvChunk::exportData: done"
1720 << qPrintable(QString(
"").sprintf(
", dt= %.2f ms", (
SgMJD::currentMJD() - startEpoch_)*86400000.0))
1730 int numOfReadRecords;
1735 str = ts.readLine();
1739 std::cout <<
" SgAgvChunk::importData: (" <<
idx_ <<
") start\n";
1741 numOfReadRecords = 1;
1750 str = ts.readLine();
1757 "::importData(): read " + QString(
"").setNum(numOfReadRecords) +
" records of the chunk #" +
1758 QString(
"").setNum(
idx_));
1761 std::cout <<
" SgAgvChunk::importData: (" <<
idx_ <<
") done"
1762 << qPrintable(QString(
"").sprintf(
", dt= %.2f ms", (
SgMJD::currentMJD() - startEpoch)*86400000.0))
1768 "::importData(): error parsing the ending string: \"" + str +
"\"");
1773 "::importData(): error parsing the magic string: \"" + str +
"\"");
1785 QRegExp reMagicDate(
magicPrefix_ +
"\\s*(\\d+)\\.(\\d+)\\.(\\d+).*",
1786 Qt::CaseInsensitive);
1787 QRegExp reMagicStr(
magicPrefix_ +
"\\s*(.+)", Qt::CaseInsensitive);
1788 if (reMagicDate.indexIn(str) != -1)
1791 vYr = reMagicDate.cap(1).toInt(&isOk);
1794 vMn = reMagicDate.cap(2).toInt(&isOk);
1797 vDy = reMagicDate.cap(3).toInt(&isOk);
1811 "::parseMagicString(): cannot extract a date from format string \"" + str +
"\"");
1814 if (reMagicStr.indexIn(str) != -1)
1822 "::parseMagicString(): cannot extract a version from format string \"" + str +
"\"");
1835 QRegExp reClosingStr(
"CHUN\\.(\\d+)\\s+@chunk_size:\\s+(\\d+)\\s+records.*",
1836 Qt::CaseInsensitive);
1838 if (reClosingStr.indexIn(str) != -1)
1846 "::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, 7, 5, "Tuscarora (rc1)", SgMJD(2022, 2, 18, 17, 34))
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