OpenCPN,  selon Shoreline
Plan du site   --->  Les compléments  --->   La calculette
P_14 Calculette
Validité :  4.8.4
  • Au 04/03/2018, la version 1.6 est utilisable sous openCPN 4.8.4 :
    • Windows : est pas disponible.
    • Linux : est disponible
    • Mac : n'est pas disponible.
  • Les explications ci dessous, datent d'une version plus ancienne de ce complément.
Fonction. Téléchargement :
  • Ce complément est une calculette, de type scientifique, permettant,entre autre, de procéder à des calculs spécifiques du monde maritime, mais pas seulement.
Up
  • Notez que les versions Windows et Linux ne sont pas rigoureusement identiques.

Activation du complément :
Après l'installation d'OpenCPN, la barre d'icônes du haut de l'écran, ne comporte pas l'icône de l'outil "Calculator"

L'outil "Calculator", c'est son nom, n'est pas en service.
Up
  • Mise en service de l'outil "Calculator" :
  • Aller dans les "Options", onglet "Compléments",
  • Cliquer sur l'icône "Calculator".
Up



  • Ensuite cliquez sur "Préférences"
  • Faites vos choix :
  • Validez par "Ok".
Up
  • A ce stade, l'outil est activé et l'icône est affichée:
Up

L'icône "Calculator" est présente dans la barre d'icônes.
L'icône "Calculator"
et son infobulle.

Les affichages



Up
  • Deux états d'affichage de cette calculette selon que la case "Aide" est cochée ou non.
  • On peut s'attendre à une évolution de l'affichage pour des versions ultérieures.
  • La zone blanche sert à entrer des formules mathématiques.
  • Les opérateurs, les opérations et les fonctions usuelles sont disponibles :
    • Les opérateurs et les opérations :
      • |  <<   >>
      • =  <>  <  >  <=  >=
      • + -
      • *  /  %  ||
      • ^  (Utilisez "^(1/2)" pour les racines carrées)
      • ! (Factorielle, mais attention, par exemple, pour "factorielle 5" entrez "5!"
    • Les fonctions usuelles :
      • Abs, Exp, Sign, Log, Log10
      • Sin, Cos, Tan, ASin, ACos, ATan
        • Par défaut, le calcul est en radian.
        • Par exemple Sin(90) donne "Ans = 0.893997" parce qu'il s'agit de 90 radians.
          • Rappel : 2 * pi = 360°. Donc, 1° = 2*Pi/360 = Pi/180
          • Donc pour calculer un sinus en degré, deux méthodes :
            • Utiliser la formule Sin(Val*Pi/180) où "Val" est la mesure en degré de l'angle.
            • Utiliser la formule Sin(Val*dtr) où dtr est une variable interne au plug-in.
  • Les variables usuelles :
    • "Pi"  (3,14159.....)
    • "e"   (2,71828.....)
    • "dtr" = Pi/180
    • "Ans" contient à tout moment le résultat du dernier calcul effectué.
  • Variables personnelles :
    • Exemples :
      • MaVariable1=10*Pi
      • MaVariable2=e/Ans
      • Etc ...
    • Les variables personnelles disparaissent lorsque vous fermez OpenCPN
    • Elles restent utilisables durant une même session d'OpenCPN, même si vous fermer "Calculator" entre temps.
Up



Calculator Plugin for OpenCPN by SaltyPaws aka Walbert Schulpen.
Calculator muparser Windows fix by Mike R –Thank you Mike!
Goals

This is a light weight yet powerful calculator plugin for OpenCPN which includes functions to solve nautical questions.

    Would you like to know your hull speed?
    Increase of draft due to heel.
    More functions can be added by the author.

Key features are:

    Storing results in variables
    Shows historic calculations
    Full complement of nautical functions
    Screen footprint can be optimized & minimized as required

Adding formulas is easy. If your favorite nautical equation is missing, please let me know your equation via flyspray, and I will add it.
Requirements

OpenCPN 4.2.0 and above.
Linux or Windows

Source code

This plugin is available for Linux and Windows. They are in separate github repositories. The Windows version has been fixed to work with muparser. At some stage it is hoped to merge them.

Windows version:
https://github.com/Rasbats/calculator_pi/releases (link)

Linux version:
https://github.com/SaltyPaws/calculator_pi (link)
Initial announcement on the Cruisers Forum

http://www.cruisersforum.com/forums/f134/plugin-calculator (link)
Also discussed here

http://www.cruisersforum.com/forums/f134/plugin-calculator-windows-version-178199.html (link)
Use

The calculator plugin allows you to carry out all nautical calculations, without having to leave the OpenCPN environment. The scientific calculator is capable of working with, and retaining variables.
* When starting the plugin for the first time, go to to find the plugin tab. Click on the calculator plugin, then the “Enable” button.

    Back in the OpenCPN menu the calculator icon brings up the calculator.
    Tick the “Help” tickbox to bring up a comprehensive help screen. Unticking the help button brings you back to the calculator only interface and resizes the menu to the original size.
    Enter calculations in the box and press enter or “Calculate” for evaluation. Press the up or down button, to retrieve historic input and results (max 30).

Help

Type help in the calculator to get these instructions.
Examples

Examples of expressions that work in the calculator are: (comments are in brackets, some results depend on other example calculations):
Hull speed:

    LWL=48 (water line length in feet)
    vhull=1.34*LWL^(1/2) (hull speed in knots)

Conversions:

    ftm=0.3048 (feet to meters)
    km_to_nm=0.539957 (Kilometers to nautical Mile)
    ftm*LWL (waterline length in meters)

Distance to horizon

    R=6378.1*1000 (Radius of the earth in m)
    H=2.5 (Height of the eye above sea-level in m)
    d = R * acos(R/(R + h)) (Distance to horizon in m)
    ans*km_to_nm (Distance to horizon in nm)

Distance to lighthouse

    H1=200 (height of lighthouse in m)
    d1 = R*acos(R/(R + H1)) (Distance to horizon in m)
    distance=d1+d (visibility range of lighthouse in m)

Useful Notes

    Ans is the result of the previous calculation
    Variables can be defined (e.g. myvariable=10/8*cos(dtr*90) or yourvariable=Ans)
    % modulus - Divides the value of one expression by the value of another, and returns the remainder.
    ! factorial
    Sign Returns .-1 for negative numbers and 1 for positive numbers
    Factorial Variables: Pi, e
    dtr is the conversion factor from degrees to radians

Built-in functions

The following table gives an overview of the functions supported by the default implementation. It lists the function names, the number of arguments and a brief description.
Name     Argc.     Explanation
TRIGONOMETRY         default entry use radians e.g. sin(dtr*90) to calculate in degrees
sin     1     sine function
cos     1     cosine function
tan     1     tangens function
asin     1     arcus sine function
acos     1     arcus cosine function
atan     1     arcus tangens function
sinh     1     hyperbolic sine function
cosh     1     hyperbolic cosine
tanh     1     hyperbolic tangens function
asinh     1     hyperbolic arcus sine function
acosh     1     hyperbolic arcus tangens function
atanh     1     hyperbolic arcur tangens function
LOGARITHMIC        
log2     1     logarithm to the base 2
log10     1     logarithm to the base 10
log     1     logarithm to the base 10
ln     1     logarithm to base e (2.71828…)
OTHER        
exp     1     e raised to the power of x
sqrt     1     square root of a value
sign     1     sign function -1 if x<0; 1 if x>0
rint     1     round to nearest integer
abs     1     absolute value
min     var.     min of all arguments
max     var.     max of all arguments
sum     var.     sum of all arguments
avg     var.     mean value of all arguments
Built-in binary operators

The following table lists the default binary operators supported by the parser.
Operator     Meaning     Priority
=     assignment     -1
&&     logical and     1
||     logical or     2
⇐     less or equal     4
>=     greater or equal     4
!=     not equal     4
==     equal     4
>     greater than     4
<     less than     4
+     addition     5
-     subtraction     5
*     multiplication     6
/     division     6
^     raise x to the power of y     7
^     use ^(1/2) for square root     7

* The assignment operator is special since it changes one of its arguments and can only by applied to variables.
Other operators
MuParser

muParser has built in support for the if.. then.. else operator. It uses lazy evaluation in order to make sure only the necessary branch of the expression is evaluated.
Operator     Meaning
?:     if then else operator
Variables:
pi, e     well known
ans     the result of the previous calculation
dtr     conversion factor from degrees to radians
Define variables     e.g. myvariable=10/8*cos(dtr*90) or yourvariable=ans
clear     removes results in the history and leaves defined variables in tact
User Interface:

Type these commands in the command window:
history     Toggle the history panel
showhelp     Show/Hide the Help button
showcalculate     Show/Hide the Calculate button
showhistory     Show/Hide the history toggle
help     show the help menu
Settings/Plugins/Preferences:

    Show/Hide Calculate
    Help and History toggle buttons
    History Settings: max Results -this is the number of results that will be stored in the history pull down. The history pulldown will contain five times this value.
    Log to opencpn: Enable/Disable logging of results to opencpn logfile.

Other:

    Error handling supported
    MuParser has been compiled with C++ Double for internal precision.

Compiling

You have to be able to compile OpenCPN itself - Get the info atDevolpers Manual

    git clone https://github.com/SaltyPaws/Calc_pi_muparser.git

Build out of OpenCPN branch!

in folder calculator_pi

    mkdir build
    cd build
    cmake ..
    make
    sudo make installf

After using wxformbuilder to modify the interface, use degreefix.sh, to facilitate the windows build. When updating the Excel file with formulas and conversions, convert to cpp code by running the supplied perl script
Changes to version 1.6

    Added Willson Fetch Equation
    Added wind speed to Beaufort equation
    Changed to MuParser math interface
    Added History pulldown box, improved history box behaviour
    Added reporting modes (1000 separator, SI prefixes, accuracy)
    Added function button in OpenCPN toolbar, with option to switch off from plugin settings
    Minor tweaks and fixes

SaltyPaws aka Walbert Schulpen
Support for Diagrams

I believe the plugin supports small jpg & png images for the purpose of better visualization. What is needed to implement this system is some diagrams and more knowledge about the plugin. Rgleason
Early Executables

Earlier compiled library files can be downloaded/uploaded here. https://sourceforge.net/projects/opencpnplugins/
License

The plugin is licensed under the terms of GPL v2 or, at your will, later. The MuParser files are by Ingo Berg and is open source. For full licence, please see the muparser source files.


Up



 
Aller au Tutoriel_PC.htm
  Haut de page
Moteur de recherche.
    
Recherche sur le web          Recherche sur opencpn.shoreline.fr
 
Copyright : Ce site web est protégé contre toute utilisation commerciale.
Dernière modification de cette page :