Skip to content

Commit

Permalink
2.24: patch by geodesist.ru@cr2
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Feb 19, 2023
1 parent 7274026 commit 963c309
Show file tree
Hide file tree
Showing 5 changed files with 1,074 additions and 17 deletions.
6 changes: 3 additions & 3 deletions lib/gnu_gama/g3/g3_model_revision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ bool Model::revision(Angle* angle)

if ( from == 0 ) return angle->set_active(false);
if ( from->unused() ) return angle->set_active(false);
if (!from->has_xyz() ) return angle->set_active(false);
if (!from->has_position() ) return angle->set_active(false);

if ( left == 0 ) return angle->set_active(false);
if ( left->unused() ) return angle->set_active(false);
if (!left->has_xyz() ) return angle->set_active(false);
if (!left->has_position() ) return angle->set_active(false);

if ( right == 0 ) return angle->set_active(false);
if ( right->unused() ) return angle->set_active(false);
if (!right->has_xyz()) return angle->set_active(false);
if (!right->has_position() ) return angle->set_active(false);

active_obs->push_back(angle);

Expand Down
55 changes: 44 additions & 11 deletions lib/gnu_gama/g3/g3_model_write_xml_adjustment_results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,21 +327,54 @@ void Model::write_xml_adjusted_cov_xyz(std::ostream& out,
out.setf(format);
}


void Model::write_xml_adjusted(std::ostream& out, const Angle* /*a*/,
int /*index*/)
void Model::write_xml_adjusted(std::ostream& out, const Angle* a, int index)
{
out << "\n<angle> ";
out << " </angle>\n";
const std::ios_base::fmtflags format = out.setf(std::ios_base::fixed,
std::ios_base::floatfield);
double rd = adj->r()(index)/Angular().scale();

out << "\n<angle> "
<< "<from>" << a->from << "</from> "
<< "<left>" << a->left << "</left> "
<< "<right>" << a->right << "</right> "
<< "<from_dh>" << a->from_dh << "</from_dh> "
<< "<left_dh>" << a->left_dh << "</left_dh> "
<< "<right_dh>" << a->right_dh << "</right_dh> "
<< "<ind>" << index << "</ind>"
<< "\n <observed>" << setw(13) << a->obs()*RAD_TO_DEG
<< " </observed>";
out << "\n";
out << " <residual>" << setw(13) << rd*RAD_TO_DEG
<< " </residual>";
out << "\n";
out << " <adjusted>" << setw(13) << (a->obs()+rd)*RAD_TO_DEG
<< " </adjusted>";
out << "\n";
out << "</angle>\n";
}



void Model::write_xml_adjusted(std::ostream& out, const Azimuth* /*a*/,
int /*index*/)
void Model::write_xml_adjusted(std::ostream& out, const Azimuth* a, int index)
{
out << "\n<azimuth> ";
out << " </azimuth>\n";
const std::ios_base::fmtflags format = out.setf(std::ios_base::fixed,
std::ios_base::floatfield);
double rd = adj->r()(index)/Angular().scale();

out << "\n<azimuth> "
<< "<from>" << a->from << "</from> "
<< "<to>" << a->to << "</to> "
<< "<from_dh>" << a->from_dh << "</from_dh> "
<< "<to_dh>" << a->to_dh << "</to_dh> "
<< "<ind>" << index << "</ind>"
<< "\n <observed>" << setw(13) << a->obs()*RAD_TO_DEG
<< " </observed>";
out << "\n";
out << " <residual>" << setw(13) << rd*RAD_TO_DEG
<< " </residual>";
out << "\n";
out << " <adjusted>" << setw(13) << (a->obs()+rd)*RAD_TO_DEG
<< " </adjusted>";
out << "\n";
out << "</azimuth>\n";
}


Expand Down
10 changes: 7 additions & 3 deletions lib/gnu_gama/xml/dataparser_g3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,12 +1040,15 @@ int DataParser::g3_obs_azimuth(const char *name)
{
istringstream istr(sval);
istr >> val;
g3->scale.push_back(1.0);
}
else
g3->scale.push_back(3.0864); // ss --> cc

Azimuth* azimuth = new Azimuth;
azimuth->from = from;
azimuth->to = to;
azimuth->set(val);
azimuth->set(val * GON_TO_RAD);
azimuth->from_dh = optional(g3->from_dh);
azimuth->to_dh = optional(g3->to_dh);
g3->obs_cluster->observation_list.push_back(azimuth);
Expand Down Expand Up @@ -1334,12 +1337,13 @@ int DataParser::g3_obs_angle(const char *name)
angle->right = right;
angle->set(val*GON_TO_RAD);
angle->from_dh = optional(g3->from_dh);
angle->left_dh = optional(g3->to_dh);
angle->right_dh = optional(g3->to_dh);
angle->left_dh = optional(g3->left_dh);
angle->right_dh = optional(g3->right_dh);
g3->obs_cluster->observation_list.push_back(angle);

return end_tag(name);
}

return error("### bad <angle>");
}

Loading

0 comments on commit 963c309

Please sign in to comment.