(2019-08-06, 09:06 AM)sideluxe Wrote:Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.probably old version of plugin
In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
Hi Sean,
i dont think its the version, i have the same error when using the latest avaiable plugin on my ubuntu 16.04 laptop.
The windows version og the plugin works right.
I only use the plugin to open the calibrate settings, which other way round does not work within the windows plugin, so i did not start to dig for the error source.
Ahoi!
Good to hear someone can confirm this.
I'm taking a stab at fixing it but it's going slow.
25 years ago was pretty good programmer but even then had minimal c++ experience.
I assume that the button is being created on line 284 of pypilot_pi/src/pypilotDialog.cpp.
AddButton(-angles[negind], m_fgControlAnglesNeg);
If I change to:
AddButton(-10, m_fgControlAnglesNeg);
The 3 negative boxes change to 429496.
Tried a few negative numbers and got the same.
If I change to:
AddButton( 10, m_fgControlAnglesNeg);
The 3 negative boxes come up as 10 as I expected.
Suspecting AddButton.
Running windows is not an option for me.
John
(2019-08-18, 12:17 AM)johnm Wrote:(2019-08-06, 09:06 AM)sideluxe Wrote:Quote:Next problem is in opencpn plugin the 3 port controls all read 429496 and do not work properly. The 3 starboard 1, 10, 110 work properly.probably old version of plugin
In Standby the buttons turned in the wrong direction.
In AP active mode direction is correct.
Hi Sean,
i dont think its the version, i have the same error when using the latest avaiable plugin on my ubuntu 16.04 laptop.
The windows version og the plugin works right.
I only use the plugin to open the calibrate settings, which other way round does not work within the windows plugin, so i did not start to dig for the error source.
Ahoi!
Good to hear someone can confirm this.
I'm taking a stab at fixing it but it's going slow.
25 years ago was pretty good programmer but even then had minimal c++ experience.
I assume that the button is being created on line 284 of pypilot_pi/src/pypilotDialog.cpp.
AddButton(-angles[negind], m_fgControlAnglesNeg);
If I change to:
AddButton(-10, m_fgControlAnglesNeg);
The 3 negative boxes change to 429496.
Tried a few negative numbers and got the same.
If I change to:
AddButton( 10, m_fgControlAnglesNeg);
The 3 negative boxes come up as 10 as I expected.
Suspecting AddButton.
Running windows is not an option for me.
John
Think I may have got it.
In AddButton changed %ld to %i.
Now angles buttons all display properly :-)
Not boat tested and may break 32 bit version.
void pypilotDialog::AddButton(int angle, wxSizer *sizer)
{
if(m_sAPMode.Contains("wind"))
angle = -angle;
/* wxButton *button = new wxButton( this, wxID_ANY, wxString::Format("%ld", angle)); */
wxButton *button = new wxButton( this, wxID_ANY, wxString::Format("%i", angle));
button->Connect( wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler( pypilotDialog::OnControlAngle ), NULL, this );
button->SetMaxSize(wxSize(60, -1));
sizer->Add( button, 0, wxALL, 5 );
}