@@ -193,6 +193,9 @@ void dna_import::UpdateEpoch(const vifm_t* vinput_file_meta)
193193 // Do nothing
194194 return ;
195195
196+ if (dateFromString<date>(epoch) == timeImmemorial<date>())
197+ epoch = " " ;
198+
196199 m_strProjectDefaultEpoch = epoch;
197200
198201 // Set default epoch
@@ -223,6 +226,9 @@ void dna_import::InitialiseDatum(const string& reference_frame)
223226 m_strProjectDefaultEpsg = datum_.GetEpsgCode_s ();
224227 m_strProjectDefaultEpoch = datum_.GetEpoch_s ();
225228
229+ if (datum_.GetEpoch () == timeImmemorial<date>())
230+ m_strProjectDefaultEpoch = " " ;
231+
226232 // Update binary file meta
227233 // Note: the following rule applies each time a new file is loaded:
228234 // * This method (InitialiseDatum) is called (from dnaimportwrapper) before any files are loaded
@@ -1196,7 +1202,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
11961202 import_file_mutex.unlock ();
11971203 }
11981204 catch (const runtime_error& e) {
1199- SignalExceptionParse ( static_cast <string>( e.what () ), 0 );
1205+ throw XMLInteropException ( e.what (), 0 );
12001206 }
12011207
12021208 // Station file
@@ -1221,14 +1227,14 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12211227 }
12221228 stringstream ss;
12231229 ss << " ParseDNA(): An ios_base failure was encountered when attempting to read stations file " << fileName << " ." << endl << " " << f.what ();
1224- SignalExceptionParse (ss.str (), 0 );
1230+ throw XMLInteropException (ss.str (), 0 );
12251231 }
12261232 catch (const XMLInteropException& f) {
12271233 stringstream ss;
12281234 ss << " - line " << m_lineNo;
12291235 ss << " , column " << m_columnNo << endl;
12301236 ss << " - " << f.what ();
1231- SignalExceptionParse (ss.str (), 0 );
1237+ throw XMLInteropException (ss.str (), 0 );
12321238 }
12331239 catch (...) {
12341240 if (ifsInputFILE_->eof ())
@@ -1239,7 +1245,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12391245 }
12401246 stringstream ss;
12411247 ss << " ParseDNA(): An error was encountered when attempting to read stations file " << fileName << " ." ;
1242- SignalExceptionParse (ss.str (), 0 );
1248+ throw XMLInteropException (ss.str (), 0 );
12431249 }
12441250 }
12451251 else if (idt == msr_data ||
@@ -1263,14 +1269,14 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12631269 }
12641270 stringstream ss;
12651271 ss << " ParseDNA(): An ios_base failure was encountered when attempting to read measurements file " << fileName << " ." << endl << " " << f.what ();
1266- SignalExceptionParse (ss.str (), 0 );
1272+ throw XMLInteropException (ss.str (), 0 );
12671273 }
12681274 catch (const XMLInteropException& f) {
12691275 stringstream ss;
12701276 ss << endl << " - line " << m_lineNo;
12711277 ss << " , column " << m_columnNo << endl;
12721278 ss << " - " << f.what ();
1273- SignalExceptionParse (ss.str (), 0 );
1279+ throw XMLInteropException (ss.str (), 0 );
12741280 }
12751281 catch (...) {
12761282 if (ifsInputFILE_->eof ())
@@ -1283,7 +1289,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
12831289 ss << " ParseDNA(): An error was encountered when attempting to read measurements file " << fileName << " ." << endl;
12841290 ss << " - line " << m_lineNo;
12851291 ss << " , column " << m_columnNo << endl;
1286- SignalExceptionParse (ss.str (), 0 );
1292+ throw XMLInteropException (ss.str (), 0 );
12871293 }
12881294 }
12891295}
@@ -1312,7 +1318,6 @@ void dna_import::ParseDNASTN(vdnaStnPtr* vStations, PUINT32 stnCount, string* su
13121318
13131319 try {
13141320 getline ((*ifsInputFILE_), sBuf );
1315- stn_ptr.reset (new CDnaStation (datum_.GetName (), datum_.GetEpoch_s ()));
13161321 }
13171322 catch (...) {
13181323 if (ifsInputFILE_->eof ())
@@ -1342,6 +1347,9 @@ void dna_import::ParseDNASTN(vdnaStnPtr* vStations, PUINT32 stnCount, string* su
13421347 if (sBuf .compare (0 , 1 , " *" ) == 0 )
13431348 continue ;
13441349
1350+ // initialise new station
1351+ stn_ptr.reset (new CDnaStation (datum_.GetName (), datum_.GetEpoch_s ()));
1352+
13451353 stn_ptr->SetfileOrder (g_fileOrder++);
13461354
13471355 // name
@@ -1953,7 +1961,17 @@ void dna_import::ParseDNAMSRGPSBaselines(string& sBuf, dnaMsrPtr& msr_ptr, bool
19531961 // Get the epoch from the file
19541962 tmp = ParseEpochValue (sBuf , " ParseDNAMSRGPSBaselines" );
19551963
1956- if (!tmp.empty ())
1964+ if (tmp.empty ())
1965+ {
1966+ if (isEpsgWGS84Ensemble (epsgCodeFromName<UINT32, string>(msr_ptr->GetReferenceFrame ())))
1967+ {
1968+ // Set the cluster epoch
1969+ msr_ptr->SetEpoch (" " );
1970+ // Set the baseline epoch
1971+ bslTmp.SetEpoch (" " );
1972+ }
1973+ }
1974+ else
19571975 {
19581976 // Set the cluster epoch
19591977 msr_ptr->SetEpoch (tmp);
@@ -2176,7 +2194,17 @@ void dna_import::ParseDNAMSRGPSPoints(string& sBuf, dnaMsrPtr& msr_ptr, bool ign
21762194 // Get the epoch from the file
21772195 tmp = ParseEpochValue (sBuf , " ParseDNAMSRGPSPoints" );
21782196
2179- if (!tmp.empty ())
2197+ if (tmp.empty ())
2198+ {
2199+ if (isEpsgWGS84Ensemble (epsgCodeFromName<UINT32, string>(msr_ptr->GetReferenceFrame ())))
2200+ {
2201+ // Set the cluster epoch
2202+ msr_ptr->SetEpoch (" " );
2203+ // Set the baseline epoch
2204+ pntTmp.SetEpoch (" " );
2205+ }
2206+ }
2207+ else
21802208 {
21812209 // Set the cluster epoch
21822210 msr_ptr->SetEpoch (tmp);
@@ -2389,6 +2417,7 @@ string dna_import::ParseAngularValue(const string& sBuf, const string& calling_f
23892417{
23902418 string parsed_value, tmp;
23912419 double d;
2420+ UINT32 u;
23922421
23932422 // degrees value
23942423 try {
@@ -2402,10 +2431,10 @@ string dna_import::ParseAngularValue(const string& sBuf, const string& calling_f
24022431 // minutes value
24032432 try {
24042433 tmp = trimstr (sBuf .substr (dml_.msr_ang_m , dmw_.msr_ang_m ));
2405- d = DoubleFromString< double >(tmp);
2406- if (d < 10 && tmp. at ( 0 ) != ' 0 ' )
2434+ u = LongFromString<UINT32 >(tmp);
2435+ if (u < 10 )
24072436 parsed_value.append (" 0" );
2408- parsed_value.append (tmp);
2437+ parsed_value.append (StringFromT<UINT32>(u));
24092438 }
24102439 catch (...) {
24112440 SignalExceptionParseDNA (calling_function + " (): Could not extract minutes value from the record: " ,
0 commit comments