Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 02-10-2018, 05:54   #916
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 242
Images: 3
Re: Logbook Konni for OpenCPN

In the post 867, I proposed that the Logbook could read the phrase nmea of ​​fuel consumption.
Very kindely, Ptulp has changed the program so that the consumption is read.

I am aware that it is not possible to ask each time for particular changes to the program, which is why I want to try to edit this plugin myself.
Indeed, since this request, I have had to change my fuel gauge and I installed a capacitive gauge that gives me numerically the capacity of the fuel that stays in my tank and I can translate it into nmea with an arduino program.

By taking again the nmea sentence of consumption of fuel which Ptulp integrated in the program ($ IIXDR, V, 00.0, L (or G), FUEL, * checksum), I think to replace in my case the value V (consumption) by the value read by my capacitive gauge, which is thus the rest of fuel.

This data "V" should not be written in the column "Fuel" but in the column "FuelTotal", which will be initially at 0.

At each reading of the capacitive gauge, the remaining fuel from the tank will fit into the FuelTotal column.
It's enough for me.

Question 1 :
If in Logbook.cpp, I replace the whole block of lines 640 to 657 with the following statement (lines 636-637)
(see in the attached image)
// XDR Volume MODIFIE
if (m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("V")) {
sVolume = wxString::Format( _T( "%4.2f " ),xdrdata );


In this case, will the V number (of the Nmea sentence) be written in the FuelTotal column and no longer in the Fuel column ?

Is this the only change to the program for this ?

Question 2 :
But, on the other hand, how can I turn the LogBook_pi into an executable exe of windows?

I read and re-read all the documentation available, I installed the programs indicated but all the tutorials (as far as I understood) explain how to integrate a plugin in OpenCPN but does not explain how to transform a plugin_pi into a windows executable...

Is it possible, in telegraphic style, to tell me the tools and how to proceed to get a windows exe ?
Attached Thumbnails
Click image for larger version

Name:	Logbook nmea.jpg
Views:	114
Size:	311.5 KB
ID:	178341  
Schnapsy is offline   Reply With Quote
Old 02-10-2018, 09:36   #917
Registered User

Join Date: Feb 2012
Location: Austria
Posts: 320
Re: Logbook Konni for OpenCPN

1. WARNING: to measure the remaining fuel in the tank is not a reliable way to calculate consumption! - sea state has a much to high impact on error margin.
I rather prefer to keep consumption from measuring throughput/flow ! - AND alternatively as an option (if no such XDR NMEA sentences are received) to set an ini parameter for consumption per hour (per engine) - which is then used to calculate fuel level.

Maybe the capacitive measure could be used for less frequent measurements and get recorded under comments.

2. I also wondered if it would not be better to "lift" the logbook_pi out of ocpn and make it a separate program. Guess it would only need to get the connections and NMEA functions duplicated form ocpn. Maybe there is some more code missing but I know from other projects that to convert from a dll to an exe is not a trivial task. - Anyhow I would vote for it.
skipperearly is offline   Reply With Quote
Old 03-10-2018, 00:39   #918
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 242
Images: 3
Re: Logbook Konni for OpenCPN

Quote:
Originally Posted by skipperearly View Post
1. WARNING: to measure the remaining fuel in the tank is not a reliable way to calculate consumption! - sea state has a much to high impact on error margin.

I do not want to measure consumption with my new gauge, but simply display the rest of fuel.

Measuring consumption - with an old engine - can only be done with rough calculations or - but it is expensive - by putting a special flow meter on the arrival and fuel return.
I only want to display in the logbook the rest of fuel, it allows me to anticipate the moment when I have to fill the tank and secondarily, with the accumulation of logbook informations, estimate my consumption fuel oil on a defined route according to an established weather.
I sail on a fifty and that is useful to me.

Hence my two questions (see previous message) :

1 - are the changes I made in logbook.cpp sufficient to display the remaining fuel in the FuelTotal column ?

2 - how to turn logbook_pi into an exe windows executable ?
Schnapsy is offline   Reply With Quote
Old 03-10-2018, 01:47   #919
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Logbook Konni for OpenCPN

Quote:
Originally Posted by Schnapsy View Post
Question 1 :
If in Logbook.cpp, I replace the whole block of lines 640 to 657 with the following statement (lines 636-637)
(see in the attached image)
// XDR Volume MODIFIE
if (m_NMEA0183.Xdr.TransducerInfo[i].TransducerType == _T("V")) {
sVolume = wxString::Format( _T( "%4.2f " ),xdrdata );


In this case, will the V number (of the Nmea sentence) be written in the FuelTotal column and no longer in the Fuel column ?

Is this the only change to the program for this ?

Question 2 :
But, on the other hand, how can I turn the LogBook_pi into an executable exe of windows?
For Question 1 :
Your code will only change the value of FUEL.
You will need the below code to enter the NMEA data in the FUELTOTAL column I think.
I didn't tested it.

For Question 2:
The plugin code is heavily dependant on the OpenCPN code.
Without significant coding it is not possible to run standalone.


Peter.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2018-10-03 at 10.34.29.png
Views:	107
Size:	66.4 KB
ID:	178373  
ptulp is offline   Reply With Quote
Old 03-10-2018, 03:47   #920
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 242
Images: 3
Re: Logbook Konni for OpenCPN

Hello Peter,

Thank you for your reply.
I found at this link " http://www.cruisersforum.com/forums/...pn-196133.html " how to edit and modify a plugin.
I will try taking into account your remarks.

By cons, my question 2 does not relate to a plugin independent from opencpn.
I have probably misunderstood my question.

In fact, I would like to know how to transform the block "logbook_pi (layouts, cmake, data, po, src, etc ...)" in "logbook_pi - win32.exe" to be able to install it in OpenCPN ...
Schnapsy is offline   Reply With Quote
Old 03-10-2018, 04:26   #921
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Logbook Konni for OpenCPN

Quote:
Originally Posted by Schnapsy View Post
Hello Peter,

Thank you for your reply.
I found at this link " http://www.cruisersforum.com/forums/...pn-196133.html " how to edit and modify a plugin.
I will try taking into account your remarks.

By cons, my question 2 does not relate to a plugin independent from opencpn.
I have probably misunderstood my question.

In fact, I would like to know how to transform the block "logbook_pi (layouts, cmake, data, po, src, etc ...)" in "logbook_pi - win32.exe" to be able to install it in OpenCPN ...
Well I can only build for MacOS and Linux.
I never build for Windows.
Maybe somebody can help you with the setup for Windows to build a standalone package for the plugin.

Peter
ptulp is offline   Reply With Quote
Old 04-10-2018, 04:27   #922
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Logbook Konni for OpenCPN

Schnapsy, you need to build a development environment to compile Opencpn for Windows.
Look under the Development Manual.
https://opencpn.org/wiki/dokuwiki/do...piling_windows


Then you need to learn how to compile plugins.
rgleason is offline   Reply With Quote
Old 04-10-2018, 22:17   #923
Registered User

Join Date: Sep 2012
Location: Baikal
Posts: 581
Re: Logbook Konni for OpenCPN

Didn't find where to set up a metric measurement system for speed and distance?
Baikal is offline   Reply With Quote
Old 05-10-2018, 20:32   #924
Registered User

Join Date: Feb 2012
Location: Austria
Posts: 320
Re: Logbook Konni for OpenCPN

Quote:
Originally Posted by Baikal View Post
Didn't find where to set up a metric measurement system for speed and distance?
preferences - abbreviations - set depth, speed etc units
skipperearly is offline   Reply With Quote
Old 05-10-2018, 22:45   #925
Registered User

Join Date: Sep 2012
Location: Baikal
Posts: 581
Re: Logbook Konni for OpenCPN

Quote:
Originally Posted by skipperearly View Post
preferences - abbreviations - set depth, speed etc units
Speed can be chosen only for the wind!
Otherwise, it is only possible to substitute its values for units of measurement, BUT all calculations and records go in miles and knots.
It’s strange why plugins don’t pick up CPN units
I would like to see the choice of the metric system for speed, distance, volume (liters).
Baikal is offline   Reply With Quote
Old 08-10-2018, 08:07   #926
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 242
Images: 3
Re: Logbook Konni for OpenCPN

Quote:
Originally Posted by rgleason View Post
Schnapsy, you need to build a development environment to compile Opencpn for Windows.
Look under the Development Manual.
https://opencpn.org/wiki/dokuwiki/do...piling_windows
Then you need to learn how to compile plugins.

Rick,

Can you confirm that forking and then compiling an external plugin with VS2017, wxWidgets 3.1.1 and Cmake 3.1.1.4, this plugin can not work on OCN 4.8.4 ?
I thought I read something like that but I do not remember where.

If so, it explains that my compilation of logbookkonni_pi-1.3006-win32.exe that I have succeeded does not work ...

Currently, when I try to install this plugin that I compiled, nothing appears in OCN 4.8.4 and then, when I want to reinstall an old functional version of this plugin, I have an error message.
I will reinstall OCN and try to compile this plugin with VS2013.

Another question
: Is it necessary to build a development environment before compile an external plugin or is it possible to directly compile a plugin (without compiling OCN in advance) ?
Schnapsy is offline   Reply With Quote
Old 08-10-2018, 18:51   #927
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Logbook Konni for OpenCPN

Schnapsy,


Yes, you are correct. Those plugins compiled with wxwidgets 3.1.1 and VS2017 should work only with the next version version of Opencpn which would be the v4.99 series which will become v5.0 etc.


So try downloading the v4.99 version. I believe Dave has provided an exe for that so you don't need to compile it, but you can compile it and it should work.



Quote:
Originally Posted by Schnapsy View Post
Rick,

Can you confirm that forking and then compiling an external plugin with VS2017, wxWidgets 3.1.1 and Cmake 3.1.1.4, this plugin can not work on OCN 4.8.4 ?
I thought I read something like that but I do not remember where.

If so, it explains that my compilation of logbookkonni_pi-1.3006-win32.exe that I have succeeded does not work ...


---Try it with v4.99


Currently, when I try to install this plugin that I compiled, nothing appears in OCN 4.8.4 and then, when I want to reinstall an old functional version of this plugin, I have an error message.
I will reinstall OCN and try to compile this plugin with VS2013.


---- Sorry but that would be what you want to do if using it with v4.8.4 or v4.8.6 You will also need to use wxWidgets 3.0.2


Another question : Is it necessary to build a development environment before compile an external plugin or is it possible to directly compile a plugin (without compiling OCN in advance) ?

Look at this Dev page which needs some updates at the end, but wxwidgets changes are what causes discontinuity in the operation of plugins. Every time there is a wxWidgets change, we need to start over and compile new PI, and those PI will only be forward compatible. The older versions left behind will no longer work on the new version of OpenCPN that uses a newer wxWidgets version.
https://opencpn.org/wiki/dokuwiki/do...n_api_versions

That is why wxWidgets upgrades are kept to major changes and more infrequent.
rgleason is offline   Reply With Quote
Old 09-10-2018, 05:35   #928
Registered User
 
Schnapsy's Avatar

Join Date: Jan 2018
Location: Dunkirk, France
Boat: ETAP 30i
Posts: 242
Images: 3
Re: Logbook Konni for OpenCPN

@Rick
I finally succeeded ...
But the result does not correspond to what is usually done.

Indeed, after compilation of the package, I get an .exe which - when I run it - asks me to create a shortcut (I choose Opencpn) and that's it. The po file (language) is also installed.
I think this process is due to the fact that I installed and uninstalled (with Revo and ccleaner) VS2017 and VS2013 multiple times, and because that, traces remained.
What is certain, is that the changes I made on the file logbook.cpp are well taken into account.
In my opinion, for me, the best is to wait for the release of OCN 5 and at that time, I will do it again a correct installation of all tools to compile.


@Peter (ptulp)
Many thanks for explaining the changes to do to the logbook.cpp file.
I finally did not remove the whole block of lines 640 to 657 as I indicated above, it created too many error messages.

In addition to the changes you explained, I just changed the line 651 "dVolume += xdrdata" by "dVolume = xdrdata" to get the rest of fuel in the right column transmitted by the gauge.

Now, in the logbook, I have the rest of fuel that appears and beside - by difference - the amount consumed during the trip.
Exactly what I wanted.

Thanks again.

P.S. Do you think it would be possible to display in the Logbook the nmea data of the speed and angle of the current that are calculated by the Tactics plugin ?
Schnapsy is offline   Reply With Quote
Old 09-10-2018, 05:54   #929
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Logbook Konni for OpenCPN

If you have forked the gir repos, I could try it.

Exe are made with NSIS
https://opencpn.org/wiki/dokuwiki/do...g_windows#nsis

If you have parallel installs of OpenCPN you have to pick the right one to install into. At the prompt just remove the last letter of opencp_ and all the choices will come up.
rgleason is offline   Reply With Quote
Old 07-11-2018, 03:33   #930
Registered User

Join Date: Feb 2012
Location: Austria
Posts: 320
Re: Logbook Konni for OpenCPN

On my resent transfer I had the opportunity to use Ocpn on a MS Surface with the tough i/f used in tablet mode.

There I noticed that some of the logbook dialogues do not allow to enable input e.g setting timer details. Neither column width changes nor resizing of dialog s can be invoked through the tough interface (BTW I had this optioned enabled in ocpn) - dont know if this is caused by the high resolution of the surface or the tough i/f support of the dialogues.

I solved the issues for myself by editing the ini files manually but want to draw attention to this to the developers.

Unfortunately I forgot to take screenshots but I hope this description may encourage other surface users to check and report with more details.
skipperearly is offline   Reply With Quote
Reply

Tags
opencpn


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logbook Plug-in SethDart OpenCPN 113 04-06-2022 11:21
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


All times are GMT -7. The time now is 22:35.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.