@@ -36,6 +36,10 @@ MsrTally g_parsemsr_tally;
3636StnTally g_parsestn_tally;
3737UINT32 g_fileOrder;
3838
39+ // boost::random::mt19937 rng;
40+ // boost::random::uniform_real_distribution<double> stdev(0.0, 3.0);
41+ // boost::random::uniform_real_distribution<double> pertu(0.0, 1.0);
42+
3943// int compare_chararray(const void *a, const void *b)
4044// {
4145// const char* a1 = *(const char**)a;
@@ -650,7 +654,7 @@ void dna_import::ParseXML(const string& fileName, vdnaStnPtr* vStations, PUINT32
650654 return ;
651655 }
652656 stringstream ss;
653- ss << " ParseInputFile (): An ios_base failure was encountered while parsing " << fileName << " ." << endl << " " << f.what ();
657+ ss << " ParseXML (): An ios_base failure was encountered while parsing " << fileName << " ." << endl << " " << f.what ();
654658 SignalExceptionParse (static_cast <string>(ss.str ()), 0 );
655659 }
656660 catch (const std::system_error& e)
@@ -668,13 +672,13 @@ void dna_import::ParseXML(const string& fileName, vdnaStnPtr* vStations, PUINT32
668672 return ;
669673 }
670674 stringstream ss;
671- ss << " ParseInputFile (): An ios_base failure was encountered while parsing " << fileName << " ." << endl << " " << e.what ();
675+ ss << " ParseXML (): An ios_base failure was encountered while parsing " << fileName << " ." << endl << " " << e.what ();
672676 SignalExceptionParse (static_cast <string>(ss.str ()), 0 );
673677 }
674678 catch (const XMLInteropException& e)
675679 {
676680 stringstream ss;
677- ss << " ParseInputFile (): An exception was encountered while parsing " << fileName << " ." << endl << " " << e.what ();
681+ ss << " ParseXML (): An exception was encountered while parsing " << fileName << " ." << endl << " " << e.what ();
678682 SignalExceptionParse (static_cast <string>(ss.str ()), 0 );
679683 }
680684 catch (const ::xml_schema::parsing& e)
@@ -696,13 +700,13 @@ void dna_import::ParseXML(const string& fileName, vdnaStnPtr* vStations, PUINT32
696700 catch (const ::xml_schema::exception& e)
697701 {
698702 stringstream ss;
699- ss << " ParseInputFile (): An xml_schema exception was encountered while parsing " << fileName << " ." << endl << " " << e.what ();
703+ ss << " ParseXML (): An xml_schema exception was encountered while parsing " << fileName << " ." << endl << " " << e.what ();
700704 SignalExceptionParse (static_cast <string>(ss.str ()), 0 );
701705 }
702706 catch (...)
703707 {
704708 stringstream ss;
705- ss << " ParseInputFile (): An unknown error was encountered while parsing " << fileName << " ." << endl;
709+ ss << " ParseXML (): An unknown error was encountered while parsing " << fileName << " ." << endl;
706710 SignalExceptionParse (ss.str (), 0 );
707711 }
708712
@@ -1204,6 +1208,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12041208 import_file_mutex.unlock ();
12051209 }
12061210 catch (const runtime_error& e) {
1211+ import_file_mutex.unlock ();
12071212 throw XMLInteropException (e.what (), 0 );
12081213 }
12091214
@@ -1231,12 +1236,14 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12311236 ss << " ParseDNA(): An ios_base failure was encountered when attempting to read stations file " << fileName << " ." << endl << " " << f.what ();
12321237 throw XMLInteropException (ss.str (), 0 );
12331238 }
1234- catch (const XMLInteropException& f) {
1239+ catch (const XMLInteropException& f)
1240+ {
12351241 stringstream ss;
1242+ ss << " ParseInputFile(): An exception was encountered while parsing " << fileName << " ." << endl;
12361243 ss << " - line " << m_lineNo;
1237- ss << " , column " << m_columnNo << endl;
1244+ ss << " , column " << m_columnNo << endl;
12381245 ss << " - " << f.what ();
1239- throw XMLInteropException ( ss.str (), 0 );
1246+ SignalExceptionParse ( static_cast <string>( ss.str () ), 0 );
12401247 }
12411248 catch (...) {
12421249 if (ifsInputFILE_->eof ())
@@ -1273,12 +1280,14 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12731280 ss << " ParseDNA(): An ios_base failure was encountered when attempting to read measurements file " << fileName << " ." << endl << " " << f.what ();
12741281 throw XMLInteropException (ss.str (), 0 );
12751282 }
1276- catch (const XMLInteropException& f) {
1283+ catch (const XMLInteropException& f)
1284+ {
12771285 stringstream ss;
1278- ss << endl << " - line " << m_lineNo;
1279- ss << " , column " << m_columnNo << endl;
1286+ ss << " ParseInputFile(): An exception was encountered while parsing " << fileName << " ." << endl;
1287+ ss << " - line " << m_lineNo;
1288+ ss << " , column " << m_columnNo << endl;
12801289 ss << " - " << f.what ();
1281- throw XMLInteropException ( ss.str (), 0 );
1290+ SignalExceptionParse ( static_cast <string>( ss.str () ), 0 );
12821291 }
12831292 catch (...) {
12841293 if (ifsInputFILE_->eof ())
@@ -2858,7 +2867,7 @@ void dna_import::ParseDNAMSRDirections(string& sBuf, dnaMsrPtr& msr_ptr, bool ig
28582867 msr_ptr->SetTarget (ParseTargetValue (sBuf , " ParseDNAMSRDirections" ));
28592868
28602869 // Number of directions
2861- UINT32 dirnCount;
2870+ UINT32 dirnCount, dirnCountLessIgnored ;
28622871 msr_ptr->SetTotal (ParseMsrCountValue (sBuf , dirnCount, " ParseDNAMSRDirections" ));
28632872 msr_ptr->GetDirections_ptr ()->reserve (dirnCount);
28642873
@@ -2889,19 +2898,37 @@ void dna_import::ParseDNAMSRDirections(string& sBuf, dnaMsrPtr& msr_ptr, bool ig
28892898 dirnTmp.SetClusterID (msr_ptr->GetClusterID ());
28902899 }
28912900
2901+ bool subignoreMsr;
2902+ dirnCountLessIgnored = dirnCount;
2903+
2904+ if (dirnCount == 0 )
2905+ throw XMLInteropException (" Zero direction count." , m_lineNo);
2906+
28922907 for (UINT32 dirn=0 ; dirn<dirnCount; ++dirn)
28932908 {
2894- dirnTmp.SetFirst (msr_ptr->GetFirst ());
2895- dirnTmp.SetIgnore (ignoreMsr);
2896- g_parsemsr_tally.D ++;
2897-
28982909 m_lineNo++;
28992910 // Obtain exclusive use of the input file pointer
29002911 import_file_mutex.lock ();
29012912 getline ((*ifsInputFILE_), sBuf );
29022913 // release file pointer mutex
29032914 import_file_mutex.unlock ();
29042915
2916+ // get ignore flag for sub direction and remove accordingly
2917+ subignoreMsr = iequals (" *" , sBuf .substr (dml_.msr_ignore , dmw_.msr_ignore ));
2918+
2919+ if (subignoreMsr)
2920+ {
2921+ dirnCountLessIgnored--;
2922+ if (dirnCountLessIgnored == 0 )
2923+ throw XMLInteropException (" There aren't any non-ignored directions in the set." , m_lineNo);
2924+ msr_ptr->SetTotal (dirnCountLessIgnored);
2925+ continue ;
2926+ }
2927+
2928+ dirnTmp.SetFirst (msr_ptr->GetFirst ());
2929+ dirnTmp.SetIgnore (ignoreMsr);
2930+ g_parsemsr_tally.D ++;
2931+
29052932 // Second target station
29062933 dirnTmp.SetTarget (ParseTarget2Value (sBuf , " ParseDNAMSRDirections" ));
29072934
@@ -5585,7 +5612,7 @@ void dna_import::MapMeasurementStations(vdnaMsrPtr* vMeasurements, pvASLPtr vAss
55855612 if (_it_msr->get ()->GetIgnore ())
55865613 vIgnoredMsrs->push_back (static_cast <UINT32>(std::distance (vMeasurements->begin (), _it_msr)));
55875614
5588- // 1. Handle nested type measurements (D, G, X, Y) separately
5615+ // 1. Handle nested type measurements (G, X, Y) separately
55895616 switch (_it_msr->get ()->GetTypeC ())
55905617 {
55915618 case ' G' : // GPS Baseline (treat as single-baseline cluster)
0 commit comments