Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,39 @@ build_gcc/
build/
bin/
doc/
*/vcpkg/
*/vcpkg_installed/
*/Release/
*/Debug/

*.sln
*.vcxproj
*.vcxproj.filters

*.suo
*.VC.db
*.VC.opendb
*.json
*.sqlite
*.ipch
*.pch
*.db-shm
*.db-wal
*.user
/.idea/
.vscode/*
.cache
.DS_Store
*.cache
*.DS_Store
*.pdb
*.ipdb
*.iobj
*.ilk
*.obj
*.log
*.tlog
*.recipe
*.res
*.FileListAbsolute.txt

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
6 changes: 5 additions & 1 deletion dynadjust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ endif()
# XercesC
# ----------------------------------------------------------------------------

find_package(XercesC REQUIRED)
if (WIN32)
find_package(XercesC REQUIRED PATHS ./vcpkg_installed/x64-windows)
else()
find_package(XercesC REQUIRED)
endif()
message(STATUS "Found XercesC (${XercesC_INCLUDE_DIRS} ${XercesC_LIBRARIES})")

# ----------------------------------------------------------------------------
Expand Down
26 changes: 16 additions & 10 deletions dynadjust/dynadjust/dnaadjust/dnaadjust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6158,7 +6158,7 @@ void dna_adjust::UpdateDesignNormalMeasMatrices_Y(pit_vmsr_t _it_msr, UINT32& de
stn1 = GetBlkMatrixElemStn1(block, _it_msr);

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

// Reduce to ellipsoid height
if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
if (coordType == LLH_type_i)
{
tmp_msr->preAdjCorr = stn1_it->geoidSep;
ellipsoidHeight += tmp_msr->preAdjCorr;
}
if (fabs(stn1_it->geoidSep) > PRECISION_1E4) {
tmp_msr->preAdjCorr = stn1_it->geoidSep;
ellipsoidHeight += tmp_msr->preAdjCorr;
}
}

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

// retain original reference frame
(*_it_msr)->station3 = coordType;
(*_it_msr)->station3 = coordType;
}

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

// measurements matrix Y
if (coordType == LLH_type_i || coordType == LLh_type_i)
if (coordType == LLH_type_i || coordType == LLh_type_i)
{
// Update bms record
(*_it_msr)->term1 = y;
snprintf((*_it_msr)->coordType, sizeof((*_it_msr)->coordType), "%s", XYZ_type);

// retain original reference frame
(*_it_msr)->station3 = coordType;
(*_it_msr)->station3 = coordType;
}

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

// Reduce ellipsoidal height to orthometric height
if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
height -= stn1_it->geoidSep;
_COORD_TYPE_ coordType(CDnaStation::GetCoordTypeC(_it_y_msr->coordType));
if (coordType == LLH_type_i)
{
if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
height -= stn1_it->geoidSep;
}

// Assign computed values
_it_y_msr->measAdj = latitude;
Expand Down
87 changes: 67 additions & 20 deletions dynadjust/dynadjust/dnaadjust/dnaadjust_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ void DynAdjustPrinter::PrintAdjMeasurements<LinearMeasurement>(
PrintAdjMeasurementStatistics(cardinal, it_msr, initialise_dbindex);
}

// Template specializations for comparative measurements
// Template specializations for computed measurements
template<>
void DynAdjustPrinter::PrintComparativeMeasurements<AngularMeasurement>(
void DynAdjustPrinter::PrintComputedMeasurements<AngularMeasurement>(
char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr) {
// Print computed angular measurements
PrintMeasurementValue<AngularMeasurement>(cardinal, computed, correction, it_msr, false);
Expand All @@ -159,7 +159,7 @@ void DynAdjustPrinter::PrintComparativeMeasurements<AngularMeasurement>(
}

template<>
void DynAdjustPrinter::PrintComparativeMeasurements<LinearMeasurement>(
void DynAdjustPrinter::PrintComputedMeasurements<LinearMeasurement>(
char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr) {
// Check if adjustment is questionable for linear measurements
if (!adjust_.isAdjustmentQuestionable_) {
Expand All @@ -183,12 +183,12 @@ void DynAdjustPrinter::PrintComparativeMeasurements<LinearMeasurement>(
// Compatibility methods for maintaining the original method names
void DynAdjustPrinter::PrintCompMeasurementsLinear(const char cardinal, const double& computed,
const double& correction, const it_vmsr_t& it_msr) {
PrintComparativeMeasurements<LinearMeasurement>(cardinal, computed, correction, it_msr);
PrintComputedMeasurements<LinearMeasurement>(cardinal, computed, correction, it_msr);
}

void DynAdjustPrinter::PrintCompMeasurementsAngular(const char cardinal, const double& computed,
const double& correction, const it_vmsr_t& it_msr) {
PrintComparativeMeasurements<AngularMeasurement>(cardinal, computed, correction, it_msr);
PrintComputedMeasurements<AngularMeasurement>(cardinal, computed, correction, it_msr);
}

void DynAdjustPrinter::PrintMeasurementsAngular(const char cardinal, const double& measurement,
Expand Down Expand Up @@ -844,7 +844,7 @@ void DynAdjustPrinter::PrintCompMeasurements_D(it_vmsr_t& _it_msr, UINT32& desig

// Print angular measurement, taking care of user requirements for
// type, format and precision
PrintComparativeMeasurements<AngularMeasurement>(' ', computed, _it_msr->measCorr, _it_msr);
PrintComputedMeasurements<AngularMeasurement>(' ', computed, _it_msr->measCorr, _it_msr);

design_row++;
_it_msr++;
Expand Down Expand Up @@ -961,7 +961,18 @@ void DynAdjustPrinter::PrintCompMeasurements_YLLH(it_vmsr_t& _it_msr, UINT32& de
CopyClusterMsr<vmsr_t>(adjust_.bmsBinaryRecords_, _it_msr, y_msr);

it_vmsr_t _it_y_msr(y_msr.begin());
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);

// determine coord type
switch (_it_msr->station3)
{
case LLh_type_i:
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLh_type);
break;
case LLH_type_i:
default:
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
break;
}

UINT32 cluster_msr, cluster_count(_it_y_msr->vectorCount1), covariance_count;
matrix_2d mpositions(cluster_count * 3, 1);
Expand Down Expand Up @@ -1014,15 +1025,25 @@ void DynAdjustPrinter::PrintCompMeasurements_YLLH(it_vmsr_t& _it_msr, UINT32& de
std::left << std::setw(STATION) << " "; // third station

// Print latitude
PrintComparativeMeasurements<AngularMeasurement>('P', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
PrintComputedMeasurements<AngularMeasurement>('P', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);

// Print longitude
_it_y_msr++;
PrintComparativeMeasurements<AngularMeasurement>('L', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
PrintComputedMeasurements<AngularMeasurement>('L', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);

// Print height
_it_y_msr++;
PrintComparativeMeasurements<LinearMeasurement>('H', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
switch (_it_msr->station3)
{
case LLh_type_i:
PrintComputedMeasurements<LinearMeasurement>('h', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
break;
case LLH_type_i:
default:
PrintComputedMeasurements<LinearMeasurement>('H', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
break;
}


// skip covariances until next point
_it_y_msr += covariance_count * 3;
Expand Down Expand Up @@ -1054,7 +1075,7 @@ void DynAdjustPrinter::PrintCompMeasurements_A(const UINT32& block, it_vmsr_t& _

// Print angular measurement, taking care of user requirements for
// type, format and precision
PrintComparativeMeasurements<AngularMeasurement>(' ', computed, correction, _it_msr);
PrintComputedMeasurements<AngularMeasurement>(' ', computed, correction, _it_msr);

design_row++;
}
Expand All @@ -1081,7 +1102,7 @@ void DynAdjustPrinter::PrintCompMeasurements_BKVZ(const UINT32& block, it_vmsr_t

// Print angular measurement, taking care of user requirements for
// type, format and precision
PrintComparativeMeasurements<AngularMeasurement>(' ', computed, correction, _it_msr);
PrintComputedMeasurements<AngularMeasurement>(' ', computed, correction, _it_msr);

design_row++;
}
Expand Down Expand Up @@ -2112,6 +2133,7 @@ double DynAdjustPrinter::CalculateLinearPrecision(const it_vmsr_t& it_msr, char
case 'Z': // XYZ
case 'u': // ENU
case 'H': // LLH (Lat and Lon cardinals are printed in PrintMeasurementsAngular)
case 'h':
return sqrt(it_msr->term4);
case 's': // AED (Azimuth and vertical angle cardinals are printed in PrintMeasurementsAngular)
switch (adjust_.projectSettings_.o._adj_gnss_units) {
Expand Down Expand Up @@ -2310,6 +2332,7 @@ void DynAdjustPrinter::PrintMeasurementValue<LinearMeasurement>(char cardinal, c
case 'Y':
case 'Z':
case 'H':
case 'h':
case 'n':
case 'u':
case 's':
Expand Down Expand Up @@ -2410,6 +2433,7 @@ void DynAdjustPrinter::PrintMeasurementCorrection(const char cardinal, const it_
break;
case 'P':
case 'L':
case 'h':
adjust_.adj_file << std::setw(PACORR) << std::setprecision(adjust_.PRECISION_SEC_MSR) << std::fixed << std::right << 0.0;
break;
default: // X, Y, Z
Expand Down Expand Up @@ -2445,7 +2469,18 @@ void DynAdjustPrinter::PrintAdjMeasurements_YLLH(it_vmsr_t& _it_msr)
CopyClusterMsr<vmsr_t>(adjust_.bmsBinaryRecords_, _it_msr, y_msr);

it_vmsr_t _it_y_msr(y_msr.begin());
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);

// determine coord type
switch (_it_msr->station3)
{
case LLh_type_i:
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLh_type);
break;
case LLH_type_i:
default:
snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
break;
}

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

// Print height
_it_y_msr++;
PrintAdjMeasurementsLinear('H', _it_y_msr);
_it_y_msr++;
switch (_it_msr->station3)
{
case LLh_type_i:
PrintAdjMeasurementsLinear('h', _it_y_msr);
break;
case LLH_type_i:
default:
PrintAdjMeasurementsLinear('H', _it_y_msr);
break;
}

// skip covariances until next point
_it_y_msr += covariance_count * 3;
Expand Down Expand Up @@ -3578,7 +3622,7 @@ void DynAdjustPrinter::PrintCompMeasurements_GXY(const UINT32& block, it_vmsr_t&
}

// Print linear measurement, taking care of user requirements for precision
PrintComparativeMeasurements<LinearMeasurement>('X', computed, correction, _it_msr);
PrintComputedMeasurements<LinearMeasurement>('X', computed, correction, _it_msr);

design_row++;
_it_msr++;
Expand All @@ -3597,7 +3641,7 @@ void DynAdjustPrinter::PrintCompMeasurements_GXY(const UINT32& block, it_vmsr_t&
}

// Print linear measurement, taking care of user requirements for precision
PrintComparativeMeasurements<LinearMeasurement>('Y', computed, correction, _it_msr);
PrintComputedMeasurements<LinearMeasurement>('Y', computed, correction, _it_msr);

design_row++;
_it_msr++;
Expand All @@ -3616,7 +3660,7 @@ void DynAdjustPrinter::PrintCompMeasurements_GXY(const UINT32& block, it_vmsr_t&
}

// Print linear measurement, taking care of user requirements for precision
PrintComparativeMeasurements<LinearMeasurement>('Z', computed, correction, _it_msr);
PrintComputedMeasurements<LinearMeasurement>('Z', computed, correction, _it_msr);

design_row++;

Expand Down Expand Up @@ -3955,6 +3999,9 @@ void DynAdjustPrinter::PrintAdjStation(std::ostream& os,

PropagateVariances_LocalCart(var_cart, var_local,
estLatitude, estLongitude, false);

// add geoid model height uncertainty
var_local.elementadd(2, 2, (stn_it->geoidSepUnc * stn_it->geoidSepUnc));

// Use uncertainty formatting helper
PrintStationUncertainties(os, var_local);
Expand Down Expand Up @@ -4768,7 +4815,7 @@ void DynAdjustPrinter::PrintCompMeasurements_HR(const UINT32& block, it_vmsr_t&
}

// Print linear measurement, taking care of user requirements for precision
PrintComparativeMeasurements<LinearMeasurement>(' ', computed, correction, _it_msr);
PrintComputedMeasurements<LinearMeasurement>(' ', computed, correction, _it_msr);

design_row++;
}
Expand Down Expand Up @@ -4797,7 +4844,7 @@ void DynAdjustPrinter::PrintCompMeasurements_IJPQ(const UINT32& block, it_vmsr_t

// Print angular measurement, taking care of user requirements for
// type, format and precision
PrintComparativeMeasurements<AngularMeasurement>(' ', computed, correction, _it_msr);
PrintComputedMeasurements<AngularMeasurement>(' ', computed, correction, _it_msr);

design_row++;
}
Expand Down
10 changes: 5 additions & 5 deletions dynadjust/dynadjust/dnaadjust/dnaadjust_printer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ class DNAADJUST_API DynAdjustPrinter {
template <typename MeasurementType>
void PrintAdjMeasurements(char cardinal, const it_vmsr_t& it_msr, bool initialise_dbindex = true);

// Template-based comparative measurement printing
// Template-based computed measurement printing
template <typename MeasurementType>
void PrintComparativeMeasurements(char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr);
void PrintComputedMeasurements(char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr);

// Compatibility methods - delegate to template implementations
void PrintCompMeasurementsLinear(const char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr);
Expand Down Expand Up @@ -305,7 +305,7 @@ void DynAdjustPrinter::PrintAdjMeasurements(char cardinal, const it_vmsr_t& it_m
}

template <typename MeasurementType>
void DynAdjustPrinter::PrintComparativeMeasurements(char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr) {
void DynAdjustPrinter::PrintComputedMeasurements(char cardinal, const double& computed, const double& correction, const it_vmsr_t& it_msr) {
// Default implementation - will be replaced by explicit specializations
static_assert(sizeof(MeasurementType) == 0, "Must use specialization");
}
Expand Down Expand Up @@ -335,11 +335,11 @@ void DynAdjustPrinter::PrintAdjMeasurements<LinearMeasurement>(char cardinal, co
bool initialise_dbindex);

template <>
void DynAdjustPrinter::PrintComparativeMeasurements<AngularMeasurement>(char cardinal, const double& computed,
void DynAdjustPrinter::PrintComputedMeasurements<AngularMeasurement>(char cardinal, const double& computed,
const double& correction, const it_vmsr_t& it_msr);

template <>
void DynAdjustPrinter::PrintComparativeMeasurements<LinearMeasurement>(char cardinal, const double& computed,
void DynAdjustPrinter::PrintComputedMeasurements<LinearMeasurement>(char cardinal, const double& computed,
const double& correction, const it_vmsr_t& it_msr);

// Stage 4: Station coordinate formatting specializations
Expand Down
Loading