Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 27-07-2014, 14:09   #91
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

Pavel,

I have tried to understand code and fix it but many times it is beyond me. I can trace to the problem areas to help.

Why aren't there more windows experienced programmers helping? I know they exist, and quite frankly I don't think it should all fall on you and Sean and Dave. I wish I had the skills to help. We need some of those guys with windows C++ programming skills to step up to these problems and help!
__________________

rgleason is online now   Reply With Quote
Old 28-08-2014, 05:03   #92
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

Salty Paws Do you have any suggestions how go fix the compile issues under msvc++? I'd like to get it working for windows users too!

Sent from my SCH-I545 using Cruisers Sailing Forum mobile app
__________________

rgleason is online now   Reply With Quote
Old 01-09-2014, 19:44   #93
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

Tried a new git pull. These are the Errors with associated problem code generally connected with muparser and MSVC++ muParser programming interface
Many of these 8 errors are grouped together, and solving 3 problems will probably get it working.

===============
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\tchar.h(2388): warning C4005: '_T' : macro redefinition
[..\calculator_pi\build\calculator_pi.vcxproj]
..\src\calculatorgui_impl.cpp(469): warning C4800: 'wxChoice *' : forcing value to bool 'true' or 'false' (performance warning)
----------------
Code:
/* Generic text macros to be used with string literals and character constants.
   Will also allow symbolic constants that resolve to same. */

#define _T(x)       __T(x)    <---Error Line 2388
#define _TEXT(x)    __T(x)


#ifdef  __cplusplus
}   /* ... extern "C" */
#endif

#endif  /* _INC_TCHAR */
===============
ERROR ..\src\calculatorgui_impl.cpp(338): error C2664: 'mu::ParserBase:efineConst' : cannot convert parameter 1 from 'const char [3]' to 'const mu::string_type &' [..\calculator_pi\build\calculator_pi.vcxproj]
-----------
oid Dlg::OnFunction( void )
{
388 if(NULL == m_pFunctiondialog){ <-------Line 388 Error
//FunDlg *m_pFunctiondialog = new FunDlg(this);
m_pFunctiondialog = new FunDlg(this);
m_pFunctiondialog->Plugin_Dialog = this;
}
m_pFunctiondialog->Show(!m_pFunctiondialog->IsShown());
}

===================
ERROR ..\src\calculatorgui_impl.cpp(339): error C2664: 'mu::ParserBase:efineConst' : cannot convert parameter 1 from 'const char [2]' to 'const mu::string_type &' [..\calculator_pi\build\calculator_pi.vcxproj]
ERROR ..\src\calculatorgui_impl.cpp(340): error C2664: 'mu::ParserBase:efineConst' : cannot convert parameter 1 from 'const char [4]' to 'const mu::string_type &' [..\calculator_pi\build\calculator_pi.vcxproj]
ERROR ..\src\calculatorgui_impl.cpp(341): error C2664: 'mu::ParserBase::SetVarFactory' : cannot convert parameter 1 from 'mu::value_type *(__cdecl *)(const char *,void *)' to 'mu::facfun_type' [..\calculator_pi\build\calculator_pi.vcxproj]
--------------------
Code:
Dlg::Dlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DlgDef( parent, id, title, pos, size, style )
{

    MuParser.ClearConst();
    MuParser.DefineConst("pi", 3.141592653589793238462643);
    MuParser.DefineConst("e", 2.718281828459045235360287);  <---Line 339 Error 
    MuParser.DefineConst("dtr",0.0174532925199433) ;      <----Line 340  Error
    MuParser.SetVarFactory(AddVariable,&MuParser);        <----Line 341 Error

    this->m_listCtrl->Show(false);

    this->m_Overview->Layout();
    this->Layout();
    this->Fit();
    this->m_Overview->Fit();
    this->m_Overview->Layout();
    this->SetSize(wh);
    i_counter=0;
    item_counter=0;
    MemoryFull=false;
    m_pHelpdialog=NULL;
    m_pFunctiondialog=NULL; //So we can check that the Function Function dialog has been opened.
}
==============
ERROR ..\src\calculatorgui_impl.cpp(557): error C2664: 'mu::ParserBase::SetExpr' : cannot convert parameter 1 from 'const char *' to 'const mu::string_type &' [..\calculator_pi\build\calculator_pi.vcxproj]
---------------
Code:
MuParser.SetExpr(static_cast<const char*>(Text.mb_str())); //Typecast to mu::stringtype
        double Muparser_result=0;
        try
        {
            Muparser_result = MuParser.Eval();//Get the result
            mystring=wxT("ans=")+double2wxT(Muparser_result);//set ans string (borrow the mystring);
            mystring.Replace(wxT(","),wxT("."),TRUE);
            
           // MuParser.SetExpr((mu::string_type) mystring.mb_str()); //This works in linux, but causes compiler error in windows
  
  Error Line 557--> MuParser.SetExpr(static_cast<const char*>(mystring.mb_str())); //Store the answer in ans
            mystring=Report_Value(Muparser_result,m_iCalc_Reporting);//Format result as per setting.
            Muparser_result = MuParser.Eval();//Evaluate for ans

        }
================
ERROR ..\src\calculatorgui_impl.cpp(716): error C2664: 'mu::ParserBase::SetExpr' : cannot convert parameter 1 from 'const char *' to 'const mu::string_type &' [..\calculator_pi\build\calculator_pi.vcxproj]
ERROR ..\src\calculatorgui_impl.cpp(720): error C2664: 'mu::ParserBase::SetExpr' : cannot convert parameter 1 from 'const char *' to 'const mu::string_type &' [..\calculator_pi\build\calculator_pi.vcxproj]
----------------
Code:
switch(in_mode) {
        case 0:
            //printf("Precise (Default)\n");
            return wxString::Format(wxT("%15.15g"), in_Value);
            break;
        case 1:
            //printf("Precise, thousands separator\n");
            //setlocale(LC_ALL,""); //Causes Serious errors in OPENCPN, rounding all tracks waypoints and incoming data.
            return ThousandSeparator(wxString::Format(wxT("%'.15g"), in_Value));
            //return Temp_String;
            break;

        case 2:
            //printf("Succinct\n");
            return wxString::Format(wxT("%15.7g"), in_Value);
            break;
        case 3:
            //printf("Succinct, thousands separator\n");
            return ThousandSeparator(wxString::Format(wxT("%15.7g"), in_Value));
            break;
        case 4:
            //printf("Scientific\n");
            return wxString::Format(wxT("%.15le"), in_Value);
            break;
        case 5:
            //printf("Humanise\n");
            try{
                Temp_String=wxT("log10(abs(")+double2wxT(in_Value)+wxT("))/3");
 Error Line 716 --->  MuParser.SetExpr(static_cast<const char*>(Temp_String.mb_str()));
                human_magnitude=(int) MuParser.Eval();
                if (in_Value<1) {human_magnitude--;}
                Temp_String=double2wxT(in_Value)+wxT("*10^(-3*")+double2wxT((double)human_magnitude)+wxT(")");
 Error Line 720 --->  MuParser.SetExpr(static_cast<const char*>(Temp_String.mb_str()));
                result=MuParser.Eval();
                if (in_Value==0) {human_magnitude=0;}
                switch(human_magnitude){
                    case 8:Temp_String=wxT("yotta");break;
rgleason is online now   Reply With Quote
Old 02-09-2014, 06:59   #94
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

Compile Errors above, summarized in the document attached.
Attached Files
File Type: doc calculator-errors-notes.doc (8.4 KB, 33 views)
rgleason is online now   Reply With Quote
Old 20-09-2014, 17:30   #95
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

Here is the most recent calculator dll that compiled properly (for Windows). Remove the .doc and put file in plugin directory.
Attached Files
File Type: doc calculator_win32_pi18_v15_ov3.0_pi.dll.doc (299.5 KB, 37 views)
rgleason is online now   Reply With Quote
Old 26-11-2014, 14:01   #96
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,520
Re: Calculator_pi New Finished Plugin for OpenCPN

Hello SaltyPaws,

I downloaded the plugin windows version "Calculator" from the opencpnorg website.

I observed that the language file, which is located in the crowdin website is not the same as the one used in this plugin.

Usually it is enough for me to ask Pavel Kalyan to update the language file and everything is in order.
Pavel told me that the "official" source code of the plugin contains the language file that is in the crowdin site. So it can not update I asked.

In other words, if I understand correctly, the official source code does not match the compiled version for windows present in the opencpnorg website.

SaltyPaws, you can help us solve this problem.

Thank by advance.

Gilletarom
Gilletarom is offline   Reply With Quote
Old 04-03-2018, 09:57   #97
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

I've updated and expanded & formated this plugin's documentation:
https://opencpn.org/wiki/dokuwiki/do...ins:calculator

Mike has fixed this powerful calculator for windows. It is ready for all kinds of marine and nautical calculations, which can be added to the plugin!

PS: Mke, FYI I've removed the separate win documentation on the beta page.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (86).jpg
Views:	37
Size:	310.0 KB
ID:	165453  
rgleason is online now   Reply With Quote
Old 05-03-2018, 13:24   #98
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,520
Re: Calculator_pi New Finished Plugin for OpenCPN

Hello Mike,

Everything in its time. Now, I switched to beta testing on "Calculator", in the Windows version.
I have not done a lot of testing yet. However, I find that the language file that is in Crowdin is not recent and that many items are not there.
In short, there is a lot of work to update the language file for translators.

But this can only be done if crowdin is updated.

Can you with the help of Hakkan, do this update?

Thank by advance.
Gilletarom is offline   Reply With Quote
Old 05-03-2018, 14:48   #99
Registered User

Join Date: May 2012
Posts: 472
Re: Calculator_pi New Finished Plugin for OpenCPN

G ...

I will get this sorted tomorrow.

Mike
Rasbats is offline   Reply With Quote
Old 05-03-2018, 23:45   #100
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 2,156
Re: Calculator_pi New Finished Plugin for OpenCPN

Mike..
I can build a new POT and load to Crowdin if you like, no problem. But which Git is the recent code, Rasbat or SaltyPaws?
Hakan is offline   Reply With Quote
Old 06-03-2018, 01:23   #101
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,520
Re: Calculator_pi New Finished Plugin for OpenCPN

Quote:
Originally Posted by Hakan View Post
Mike..
I can build a new POT and load to Crowdin if you like, no problem. But which Git is the recent code, Rasbat or SaltyPaws?
My old PC ASUS on Linux having definitely given up, I have not tested the version SaltyPaws. So, my request only concerns the Rasbat version.

It may be necessary to set up two files for Calculator in the crowdin. A file for the rasbat version and a file for the SaltyPaws version ?????

I say in advance that the translation will not be done quickly. The Calculator plugin is the most difficult to translate because there are many technical items. I will use the help of other translators to try to be certain of the quality of the translation.
Gilletarom is offline   Reply With Quote
Old 06-03-2018, 02:11   #102
Registered User

Join Date: May 2012
Posts: 472
Re: Calculator_pi New Finished Plugin for OpenCPN

Need to wait a short time. SaltyPaws has given us a possible way forward for cross-compiling Win/Lin.

Walbert ...
Nothing was changed to make any translation differences from the original version. I am having trouble making a POT file for my Windows fork. Please can you update Hakan with a new POT file.

Thanks.
Mike
Rasbats is offline   Reply With Quote
Old 06-03-2018, 03:19   #103
Registered User

Join Date: May 2012
Posts: 472
Re: Calculator_pi New Finished Plugin for OpenCPN

Rasbats version 1.8 implements the cross-compiling suggested by SaltyPaws. Tested on Windows and Ubuntu 16.04.

https://github.com/Rasbats/calculator_pi/releases

Still working on the translations problem.

Mike
Rasbats is offline   Reply With Quote
Old 06-03-2018, 03:37   #104
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 10,547
Re: Calculator_pi New Finished Plugin for OpenCPN

SaltyPaws is good for linux.
Rasbats is windows.
SaltyPaws repos needs update PR too.
We are working on merging the code again. I am going to ask saltypaws to make rasbats a collaborator
rgleason is online now   Reply With Quote
Old 06-03-2018, 04:01   #105
Registered User

Join Date: May 2012
Posts: 472
Re: Calculator_pi New Finished Plugin for OpenCPN

The translation problem was because of the files being referenced in POTFILES.in. Hope I have not missed any important ones.

My 'calculator_pi.pot' file on GitHub should now be useable. Not pretty!

Walbert ...
I have made a pull request for these changes.

Mike
__________________

Rasbats is offline   Reply With Quote
Reply

Tags
opencpn

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 09:56.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.