Skip to content

Commit

Permalink
Performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
OK9UWU committed Apr 9, 2024
1 parent 3e40b51 commit 2b80687
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src-core/common/tracking/obj_tracker/object_tracker_rotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ namespace satdump
{
if (sat_current_pos.el > 0)
{
if(!rotator_rounding)
if (!rotator_rounding)
{
rot_current_req_pos.az = sat_current_pos.az;
rot_current_req_pos.el = sat_current_pos.el;
}
else
{
rot_current_req_pos.az = (round(sat_current_pos.az*rotator_decimal_multiplier))/rotator_decimal_multiplier;
rot_current_req_pos.el = (round(sat_current_pos.el*rotator_decimal_multiplier))/rotator_decimal_multiplier;
rot_current_req_pos.az = (round(sat_current_pos.az * rotator_decimal_multiplier)) / rotator_decimal_multiplier;
rot_current_req_pos.el = (round(sat_current_pos.el * rotator_decimal_multiplier)) / rotator_decimal_multiplier;
}
}
else if (rotator_park_while_idle)
Expand Down Expand Up @@ -123,33 +123,37 @@ namespace satdump
ImGui::Spacing();

ImGui::Checkbox("Park while idle", &rotator_park_while_idle);

if (rotator_park_while_idle)
{
ImGui::InputFloat("Park Az##Rot Az", &rotator_park_position.az);
ImGui::InputFloat("Park El##Rot El", &rotator_park_position.el);
ImGui::InputDouble("Unpark Time##Rot Unpark Time", &rotator_unpark_at_minus);
}

ImGui::Checkbox("AZ EL Decimal rounding", &rotator_rounding);
if (rotator_rounding)

if (rotator_rounding && ImGui::InputInt("Decimal Place Precision", &rotator_decimal_precision, 1, 3))
{
ImGui::InputInt("Decimal Place Precision", &rotator_decimal_precision,1,3);
if (rotator_decimal_precision > 3){
if (rotator_decimal_precision > 3)
{
rotator_decimal_precision = 3;
}
else if (rotator_decimal_precision == 0){
else if (rotator_decimal_precision == 0)
{
rotator_decimal_precision = 1;
}
switch (rotator_decimal_precision)
{
case 1:
rotator_decimal_multiplier = 10;
break;
case 2:
rotator_decimal_multiplier = 100;
break;
case 3:
rotator_decimal_multiplier = 1000;
break;
case 1:
rotator_decimal_multiplier = 10;
break;
case 2:
rotator_decimal_multiplier = 100;
break;
case 3:
rotator_decimal_multiplier = 1000;
break;
}
}
}
Expand Down

0 comments on commit 2b80687

Please sign in to comment.