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 03-04-2011, 15:57   #1
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Logbook Plug-in

Here is a new plugin for OpenCPN. It's often requested: a logbook plugin.

This is version 0.1 so be indulgent. It'll be enhanced upon request and suggestions.

The purpose is very simple: it receive NMEA sentences and writes values into a file on a regular interval. (Warning: It doesn't work with libgps/gpsd input because it's not NMEA, sorry)

For now, the sentences list cannot be changed, it's:
Date;Lat;Lon;COG;SOG;HDM;HDT;STW;AWA;AWS;TWA;TWS;D epth;Temp

The file is written in csv format (separator: semi-colon) That file can be opened with LibreOffice or any spreadsheet software of your choice. Then you're able to create nice graphs, stats...

The interval in minutes can be set from 1 to 60. I think it's enough. Smaller interval would create a very big file. There's no log rotation logic. The plugin just append to the end of the file. If the plugin is enabled, then it works automatically on the background when OpenCPN runs. No hassle

If any sentence is not received or the data is outdated (received more than 60 seconds ago) this field is empty.

I already coded min, max & average calculation for the sentences but it cannot be saved for now. I dunno how I can create a simple interface to select fields. Ideas welcome.

Please test and report. I'll try to provide .dll & .so tomorrow. Here's a compressed patch file (remove the .doc extension)

You should add:
Code:
add_subdirectory (logbook_pi)
to plugins/CMakeLists.txt to build this plugin.

Please test and report.

PS: I'll send a cmake patch to Dave to include any subdir in plugins/ (to avoid patch error if this file is changed by several plugins). Remove all add_subdirectory(...) and replace with:
Code:
FILE(GLOB PLUGINS *_pi)

FOREACH(PLUGIN ${PLUGINS})
     add_subdirectory (${PLUGIN})
ENDFOREACH(PLUGIN)
Attached Files
File Type: doc 0040-Logbook-plugin-0.1.patch.gz.doc (45.3 KB, 659 views)
SethDart is offline   Reply With Quote
Old 04-04-2011, 01:13   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,208
Re: Logbook plugin

SethDart,
works well . Compiled plugin for Windows attached - just change the extension from .doc to .dll and place in the plugin folder.
Quote:
For now, the sentences list cannot be changed, it's:
Date;Lat;Lon;COG;SOG;HDM;HDT;STW;AWA;AWS;TWA;TWS;D epth;Temp
I would probably keep it like this as it has a couple of nice aspects - the column list is the same across all the rows and you can depend on it while writing macros, creating graphs etc.
Deleting an unneeded column later in Calc or Excel is a matter of seconds...

What I would vote for is a plain numeric format for lat/lon at least as an option - will make doing later calculations easier.
And maybe not printing the header row on every start when the file already contains it in the first line would also make automatic tasks with the log easier.

Thanks

Pavel
Attached Files
File Type: doc logbook_pi.doc (118.0 KB, 470 views)
nohal is offline   Reply With Quote
Old 04-04-2011, 04:18   #3
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: Logbook Plugin : Icône ?

Hello,

Quick test:

After clicking "Permettre" and closed the toolbox, no icon in the icon bar.

Not knowing if this is normal at this stage of development, I said.

Merci SethDart.

A ta disposition.

Gilletarom.
Gilletarom is offline   Reply With Quote
Old 04-04-2011, 04:22   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,208
Re: Logbook Plugin

Gilletarom,
this plugin does not have a toolbar icon as it doesn't need one.
It just logs the data all the time when turned on in the toolbox...

Pavel
nohal is offline   Reply With Quote
Old 04-04-2011, 04:26   #5
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: Logbook Plugin : Icône ?

Quote:
Originally Posted by Gilletarom View Post
After clicking "Permettre" and closed the toolbox, no icon in the icon bar.
Please read my message again :
Quote:
Originally Posted by SethDart View Post
If the plugin is enabled, then it works automatically on the background when OpenCPN runs
There's no need for any button. If the plugin is enabled, it runs in the background and write to the log file at defined interval. To disable it, just disable the plugin. Very easy.
SethDart is offline   Reply With Quote
Old 04-04-2011, 04:49   #6
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: Logbook Plugin Test with GPS connected

Second test.

NavMonPc I used to simulate a connection to run the GPS. I stopped the test soon enough.

Here attached the cvs file that was created.

I guess if there are several times the line in column header, it indicates the different launches of OpenCPN.

I observe that:
- latitude in the column, there seems to be now,
- In column longitude, there are always "37" ... ?
- In column COG, there is the latitude,
- SOG in the column, there is "N" probably as North

Also attach the test file for GPS that NavMonPc read. It is ia text file zipped because very large and with changing the extension to .doc

Best regards

Gilletarom

Second essai.
J'ai utilisé NavMonPc pour simuler une connection GPS et faire tourner le GPS. J'ai arrêté l'essai assez vite.
Voici en pièce jointe le fichier cvs qui a été créé.
Je suppose que s'il y a plusieurs fois la ligne d'en tête de colonne, cela indique les différents lancements d'openCPN.

J'observe que :
- dans la colonne latitude, il semble y avoir l'heure,
- dans la colonne longitude, il y a toujours "37" ... ?
- dans la colonne COG, il y a la latitude,
- dans la colonne SOG, il y a "N" sans doute comme nord

Ci joint aussi le fichier d'essai du GPS que NavMonPc lit. Il est sous forme d'un fichier texte zippé car très gros et avec changement de l'extension en .doc pour que ça passe.
Attached Files
File Type: doc Essai.csv.doc (1.3 KB, 188 views)
File Type: doc PacCupStart_bis.zip.doc (297.9 KB, 200 views)
Gilletarom is offline   Reply With Quote
Old 04-04-2011, 05:01   #7
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: Logbook Plugin

When you open the csv file, only use semi-colon as separator, not space. That's your problem here.
SethDart is offline   Reply With Quote
Old 04-04-2011, 05:10   #8
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: Logbook Plugin : Icône ?

Hello SethDart and Pavel

Quote:
Originally Posted by SethDart View Post
Please read my message again :


There's no need for any button. If the plugin is enabled, it runs in the background and write to the log file at defined interval. To disable it, just disable the plugin. Very easy.
Laziness to read ... Yet it will be good for my English ...

Thank you for your answers.

Because this plugin do not need the icon to start or stop, once started, I guess he will forget.

But then the cvs file will eventually become very big. It might be preferable to either reset or to create a new one every time with a date and time in name, for example.

And if it runs continuously, it still holds just over the machine. I do not know if it's an energy or not.
Without being able to tell if it is "energy intensive" I raise. And more so qu'OpenCPN begins to have a lot to do if we run more plug-in.

Gilletarom
----------
Parce que ce plug-in n'a pas besoin d'icône pour le lancer ou arrêter, une fois lancé, je suppose qu'il se fera oublier.

Mais alors, le fichier cvs finira par devenir bien gros. Il serait peut être préférable soit de le ré-initialiser soit d'en créer un nouveau à chaque fois avec une date et heure dans le nom par exemple.

Et s'il tourne en permanence, il occupe encore un peu plus la machine. Je ne sais pas si c'est consommateur d'énergie ou pas.
A défaut d'être capable de dire si c'est "énergétivore" je soulève la question.
Et ce d'autant plus qu'OpenCPN commence à avoir beaucoup de choses à faire si on lance plusieurs plug-in.
Gilletarom is offline   Reply With Quote
Old 04-04-2011, 06:06   #9
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: Logbook Plugin : Icône ?

Quote:
Originally Posted by Gilletarom View Post
Because this plugin do not need the icon to start or stop, once started, I guess he will forget.
That's exactly the purpose of this plugin! You configure it once and it runs indefinitely. (Paper) logbook is a must have on a boat. With this plugin, it's done automatically. No need to remember pushing just another button to enable it. [In fact, there's already a logbook line inserted in opencpn log file, but not as easy to extract as this plugin, IMHO ;-)]

Quote:
Originally Posted by Gilletarom View Post
But then the cvs file will eventually become very big. It might be preferable to either reset or to create a new one every time with a date and time in name, for example.
Well, it's a very simple text file. If you configure it with an reasonable interval of say 30 minutes, it'd take decades to fill nowadays HDD (or even memory sticks)

I said in my message that there's no log rotation mecanism for now. Just because there are so many choices available: some would require the log file to be truncated to X size or X days, some would ask to create one new file every X days (and maybe delete files older than...). Some would require to empty the file... I choose to just append the file.

You can rotate it on your own. It's opened and closed on every write. Just schedule the rotation of your choice and it should work.

Quote:
Originally Posted by Gilletarom View Post
And if it runs continuously, it still holds just over the machine. I do not know if it's an energy or not.
Without being able to tell if it is "energy intensive" I raise. And more so qu'OpenCPN begins to have a lot to do if we run more plug-in.
Sure it's just another NMEA stream processing plugin and it'll take some horsepower and some memory but not much. It just read NMEA stream, decode some of the sentences and store the value in memory. Once in a while, it write these values to a file. That's all.

Ans as it's a plugin, you can enable or disable it at you convenience... to save power
SethDart is offline   Reply With Quote
Old 04-04-2011, 07:20   #10
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,988
Re: Logbook Plugin

Hello,

Quote:
Originally Posted by SethDart View Post
When you open the csv file, only use semi-colon as separator, not space. That's your problem here.

Just a supplement. It is not enough to choose the semi-colon separator.

OpenOffice Calc spreadsheet also gives the possibility to choose the text delimiter. There are two possible choices: ' and " .

We must also choose the character ' as separator text.
So the indication obtained is similar to that of a traditional type xls file with a spreadsheet with columns well spotted.

Best regards

Gilletarom.
Gilletarom is offline   Reply With Quote
Old 04-04-2011, 07:33   #11
Registered User

Join Date: Nov 2010
Location: Lafayette, Louisiana
Boat: Ketch, Hardin 45
Posts: 440
Images: 6
Re: Logbook Plugin

I do it the OLD FASHION WAY, By picking up a pen and logging the data & observations in my log book.
boasun is offline   Reply With Quote
Old 04-04-2011, 07:45   #12
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Logbook Plugin

Quote:
Originally Posted by boasun View Post
I do it the OLD FASHION WAY, By picking up a pen and logging the data & observations in my log book.
Furthermore I miss the pencil in this Loogbook Plugin to write comments such as: who is on watch, what's the weather and so on...
CarCode is online now   Reply With Quote
Old 04-04-2011, 10:07   #13
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: Logbook Plugin

Quote:
Originally Posted by CarCode View Post
Furthermore I miss the pencil in this Loogbook Plugin to write comments such as: who is on watch, what's the weather and so on...
Interesting idea. I didn't tought about this feature.

How can this be set by user? I don't want to show a dialog every X minutes before writing the log.

Ideas welcome
SethDart is offline   Reply With Quote
Old 04-04-2011, 10:24   #14
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,208
Re: Logbook Plugin

Maybe that's what the toolbar icon could be used for - after clicking at it a dialog could be shown and on it's OK, save the entered data with the next record.
nohal is offline   Reply With Quote
Old 04-04-2011, 10:40   #15
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Logbook Plugin

Quote:
Originally Posted by SethDart View Post
Interesting idea. I didn't tought about this feature.
How can this be set by user? I don't want to show a dialog every X minutes before writing the log.
Ideas welcome
A user has send his ideas some times ago, but sadly it is in german. After all I guess it might be better to use something else than csv, but its depends of the habits by the programmer. A daily file in a logbook folder will do and a list displaying the daily file with not too much fields where is a comment field for editing also with embedded links for photos etc. opens at user request. I suppose a quarter hour minimum will be sufficient with the option to 1 hour max. for a line in quarter hour steps.
Attached Files
File Type: pdf Logbuch01.pdf (55.0 KB, 1131 views)
CarCode is online now   Reply With Quote
Reply


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
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31
Apelco xcd 350 Transducer Plug Pinout sdowney717 Marine Electronics 2 11-07-2011 19:01
Wiring a Male Serial Plug elhix Marine Electronics 0 07-07-2011 04:32

Advertise Here


All times are GMT -7. The time now is 05:28.


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.