-
Couldn't load subscription status.
- Fork 3
Plugin Adaptation
Follow this link for extra detail on the source code changes
Make the following changes to the plugin source code.
-
Use API 16: Update the source code to use API 16.
-
Change the method for finding the data directory: Use GetPluginDataDir instead of GetpDataDir Examples of code changes are shown here.
-
These changes should be enough for most plugins. However, more exotic plugins might need to consider the more complete list at https://github.com/leamas/OpenCPN/wiki/Plugin-adaptation
Files can be updated using git or (partly) with GUI tools. The GUI method uses less of the command line which can be an advantage for some users. However, the git method offers other advantages:
- The commands could easily be copy-pasted and works on all platforms.
- The shipdriver sources are always updated
- The permissions problem which otherwise hits Windows users is avoided.
-
Create a shipdriver remote, used to "fetch" files updated to latest version:
$ git remote add shipdriver https://github.com/Rasbats/shipdriver_pi.git $ git remote update shipdriver -
Update all directories with the shipdriver templates. Use actual plugin name, not tidefinder-plugin.
$ git rm -rf .circleci build-deps ci flatpak libs mingw cmake $ git checkout shipdriver/master .circleci build-deps ci flatpak libs mingw cmake $ git mv shipdriver-plugin.xml.in tidefinder-plugin.xml.in (problem even with the source) $ git commit -m "Initial import of shipdriver directories" $ git push -
Update plain files.
$ git checkout shipdriver/master \ .cmake-format.yaml .drone.yml appveyor.yml config.h.in COPYING $ git commit -m "Initial import of shipdriver files." -
Update files which should be edited. This part requires that the previous version is available. One could use backup copies, use git to make a diff against previous version, use an editor with git support. YMMV. In any case, make sure that current version is available by other means before updating these files using:
$ git checkout shipdriver/master README.md CMakeLists.txt \ shipdriver-plugin.xml.in flatpak/org.opencpn.OpenCPN.Plugin.shipdriver.yaml $ git mv flatpak/org.opencpn.OpenCPN.Plugin.shipdriver.yaml \ flatpak/org.opencpn.OpenCPN.Plugin.TideFinder.yamlUse the actaul plugin name instead of TideFinder. Then, proceed to Editing files as described in this section
Use the ShipDriver files/directories to make the changes required. In order to do this, clone the github repository, and make sure the clone is updated.

- .circleci
- build-deps
- ci
- flatpak (rename org.opencpn.OpenCPN.Plugin.ShipDriver.yaml as org.opencpn.OpenCPN.Plugin.TideFinder.yaml)
- libs
- mingw
- cmake
- .cmake-format.yaml
- .drone.yml
- appveyor.yml
- config.h.in
- COPYING
- shipdriver-plugin.xml.in (rename as TideFinder-plugin.xml.in)
Windows users need to consider permission problems on these files as described in https://github.com/Rasbats/managed_plugins/wiki/Cloud-Service-Changes#now-check-the-cloud-services-for-errors
- README.md
- CMakeLists.txt
- org.opencpn.OpenCPN.Plugin.TideFinder.yaml (in the flatpak directory)
It may be easiest to use two text editor windows, one showing the TideFinder file with the other showing ShipDriver.
-
README.md
Change the description, building instructions and copyright notice (important!), make other edits as necessary.
-
CMakeLists.txt
A draft copy using ShipMaker CMakeLists.txt can be used as a template for the new file. Edit the draft copy and substitute TideFinder for ShipDriver. Then delete the original TideFinder file and rename the draft copy CMakeLists.txt.

Remove 'src/ocpn_plugin.h' from the source files. This is in the libs/api-16 directory and used later, when building.
-
org.opencpn.OpenCPN.Plugin.TideFinder.yaml
This file is found in the 'flatpak' directory. Just 3 name substitutions.