tom-r / tactics_pi

a performance enhancement of dashboard_pi for OpenCPN
16 stars 14 forks source link

layline damping factor set to 1 causes failure #52

Open rgleason opened 2 years ago

rgleason commented 2 years ago

When Preferences > Parameters > Layline Damping factor is set to 1 it causes Opencpn to fail, also if show polar is on it does not show, and if show laylines is on the laylines are incorrect and only show one brown layline.

Obviously there is some calculation that does not work if layline damping is 1. Therefore I am going to change the range in just the text to be 0.025 -0.99 rather than 0.025-1

but there should be further corrections made with bounds checking and fix the calculation!

Note: It does not appear that "layline width damping factor" has this problem.

rgleason commented 2 years ago

All I have done is change the range allowed in the message!

Tactics_pi.cpp

Line 3593:     //---Layline damping factor -----------------
Line 3594:     wxStaticText* itemStaticText18 = new wxStaticText(itemPanelNotebook03, wxID_ANY, _("Layline damping factor [0.025-1]:  "),

Changed to

Tactics_pi.cpp

Line 3593:     //---Layline damping factor -----------------
Line 3594:     wxStaticText* itemStaticText18 = new wxStaticText(itemPanelNotebook03, wxID_ANY, _("Layline damping factor [0.025-0.99]:  "),
rgleason commented 2 years ago

https://github.com/rgleason/tactics_pi/commit/8f943d18556a4b0e21bef44902f53294733cceaf