Skip to content

Commit e50c1ba

Browse files
committed
Fix defects with printing adjusted LLh msrs
1 parent c77d417 commit e50c1ba

File tree

2 files changed

+65
-15
lines changed

2 files changed

+65
-15
lines changed

dynadjust/dynadjust/dnaadjust/dnaadjust.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6158,7 +6158,7 @@ void dna_adjust::UpdateDesignNormalMeasMatrices_Y(pit_vmsr_t _it_msr, UINT32& de
61586158
stn1 = GetBlkMatrixElemStn1(block, _it_msr);
61596159

61606160
// Convert to cartesian reference frame?
6161-
if (coordType == LLH_type_i || coordType == LLh_type_i)
6161+
if (coordType == LLH_type_i || coordType == LLh_type_i)
61626162
{
61636163
// This section (and others in this function where coordType == LLH_type_i)
61646164
// will only be performed once because this measurement will be converted
@@ -6183,11 +6183,13 @@ void dna_adjust::UpdateDesignNormalMeasMatrices_Y(pit_vmsr_t _it_msr, UINT32& de
61836183
tmp_msr->preAdjMeas = tmp_msr->term1;
61846184

61856185
// Reduce to ellipsoid height
6186-
if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
6186+
if (coordType == LLH_type_i)
61876187
{
6188-
tmp_msr->preAdjCorr = stn1_it->geoidSep;
6189-
ellipsoidHeight += tmp_msr->preAdjCorr;
6190-
}
6188+
if (fabs(stn1_it->geoidSep) > PRECISION_1E4) {
6189+
tmp_msr->preAdjCorr = stn1_it->geoidSep;
6190+
ellipsoidHeight += tmp_msr->preAdjCorr;
6191+
}
6192+
}
61916193

61926194
// convert
61936195
GeoToCart<double>(latitude, longitude, ellipsoidHeight,
@@ -6199,7 +6201,7 @@ void dna_adjust::UpdateDesignNormalMeasMatrices_Y(pit_vmsr_t _it_msr, UINT32& de
61996201
snprintf((*_it_msr)->coordType, sizeof((*_it_msr)->coordType), "%s", XYZ_type);
62006202

62016203
// retain original reference frame
6202-
(*_it_msr)->station3 = coordType;
6204+
(*_it_msr)->station3 = coordType;
62036205
}
62046206

62056207
// If this method is called via PrepareAdjustment() and the adjustment
@@ -6238,14 +6240,14 @@ void dna_adjust::UpdateDesignNormalMeasMatrices_Y(pit_vmsr_t _it_msr, UINT32& de
62386240
(*_it_msr)++;
62396241

62406242
// measurements matrix Y
6241-
if (coordType == LLH_type_i || coordType == LLh_type_i)
6243+
if (coordType == LLH_type_i || coordType == LLh_type_i)
62426244
{
62436245
// Update bms record
62446246
(*_it_msr)->term1 = y;
62456247
snprintf((*_it_msr)->coordType, sizeof((*_it_msr)->coordType), "%s", XYZ_type);
62466248

62476249
// retain original reference frame
6248-
(*_it_msr)->station3 = coordType;
6250+
(*_it_msr)->station3 = coordType;
62496251
}
62506252

62516253
// If this method is called via PrepareAdjustment() and the adjustment
@@ -9552,8 +9554,12 @@ void dna_adjust::ReduceYLLHMeasurementsforPrinting(vmsr_t& y_msr, matrix_2d& mpo
95529554
}
95539555

95549556
// Reduce ellipsoidal height to orthometric height
9555-
if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
9556-
height -= stn1_it->geoidSep;
9557+
_COORD_TYPE_ coordType(CDnaStation::GetCoordTypeC(_it_y_msr->coordType));
9558+
if (coordType == LLH_type_i)
9559+
{
9560+
if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
9561+
height -= stn1_it->geoidSep;
9562+
}
95579563

95589564
// Assign computed values
95599565
_it_y_msr->measAdj = latitude;

dynadjust/dynadjust/dnaadjust/dnaadjust_printer.cpp

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,18 @@ void DynAdjustPrinter::PrintCompMeasurements_YLLH(it_vmsr_t& _it_msr, UINT32& de
961961
CopyClusterMsr<vmsr_t>(adjust_.bmsBinaryRecords_, _it_msr, y_msr);
962962

963963
it_vmsr_t _it_y_msr(y_msr.begin());
964-
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
964+
965+
// determine coord type
966+
switch (_it_msr->station3)
967+
{
968+
case LLh_type_i:
969+
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLh_type);
970+
break;
971+
case LLH_type_i:
972+
default:
973+
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
974+
break;
975+
}
965976

966977
UINT32 cluster_msr, cluster_count(_it_y_msr->vectorCount1), covariance_count;
967978
matrix_2d mpositions(cluster_count * 3, 1);
@@ -1022,7 +1033,17 @@ void DynAdjustPrinter::PrintCompMeasurements_YLLH(it_vmsr_t& _it_msr, UINT32& de
10221033

10231034
// Print height
10241035
_it_y_msr++;
1025-
PrintComparativeMeasurements<LinearMeasurement>('H', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
1036+
switch (_it_msr->station3)
1037+
{
1038+
case LLh_type_i:
1039+
PrintComparativeMeasurements<LinearMeasurement>('h', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
1040+
break;
1041+
case LLH_type_i:
1042+
default:
1043+
PrintComparativeMeasurements<LinearMeasurement>('H', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
1044+
break;
1045+
}
1046+
10261047

10271048
// skip covariances until next point
10281049
_it_y_msr += covariance_count * 3;
@@ -2112,6 +2133,7 @@ double DynAdjustPrinter::CalculateLinearPrecision(const it_vmsr_t& it_msr, char
21122133
case 'Z': // XYZ
21132134
case 'u': // ENU
21142135
case 'H': // LLH (Lat and Lon cardinals are printed in PrintMeasurementsAngular)
2136+
case 'h':
21152137
return sqrt(it_msr->term4);
21162138
case 's': // AED (Azimuth and vertical angle cardinals are printed in PrintMeasurementsAngular)
21172139
switch (adjust_.projectSettings_.o._adj_gnss_units) {
@@ -2310,6 +2332,7 @@ void DynAdjustPrinter::PrintMeasurementValue<LinearMeasurement>(char cardinal, c
23102332
case 'Y':
23112333
case 'Z':
23122334
case 'H':
2335+
case 'h':
23132336
case 'n':
23142337
case 'u':
23152338
case 's':
@@ -2410,6 +2433,7 @@ void DynAdjustPrinter::PrintMeasurementCorrection(const char cardinal, const it_
24102433
break;
24112434
case 'P':
24122435
case 'L':
2436+
case 'h':
24132437
adjust_.adj_file << std::setw(PACORR) << std::setprecision(adjust_.PRECISION_SEC_MSR) << std::fixed << std::right << 0.0;
24142438
break;
24152439
default: // X, Y, Z
@@ -2445,7 +2469,18 @@ void DynAdjustPrinter::PrintAdjMeasurements_YLLH(it_vmsr_t& _it_msr)
24452469
CopyClusterMsr<vmsr_t>(adjust_.bmsBinaryRecords_, _it_msr, y_msr);
24462470

24472471
it_vmsr_t _it_y_msr(y_msr.begin());
2448-
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
2472+
2473+
// determine coord type
2474+
switch (_it_msr->station3)
2475+
{
2476+
case LLh_type_i:
2477+
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLh_type);
2478+
break;
2479+
case LLH_type_i:
2480+
default:
2481+
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
2482+
break;
2483+
}
24492484

24502485
UINT32 covr, cluster_msr, cluster_count(_it_y_msr->vectorCount1), covariance_count;
24512486
matrix_2d mpositions(cluster_count * 3, 1);
@@ -2574,8 +2609,17 @@ void DynAdjustPrinter::PrintAdjMeasurements_YLLH(it_vmsr_t& _it_msr)
25742609
PrintAdjMeasurementsAngular('L', _it_y_msr);
25752610

25762611
// Print height
2577-
_it_y_msr++;
2578-
PrintAdjMeasurementsLinear('H', _it_y_msr);
2612+
_it_y_msr++;
2613+
switch (_it_msr->station3)
2614+
{
2615+
case LLh_type_i:
2616+
PrintAdjMeasurementsLinear('h', _it_y_msr);
2617+
break;
2618+
case LLH_type_i:
2619+
default:
2620+
PrintAdjMeasurementsLinear('H', _it_y_msr);
2621+
break;
2622+
}
25792623

25802624
// skip covariances until next point
25812625
_it_y_msr += covariance_count * 3;

0 commit comments

Comments
 (0)