Cruisers Forum
 


Join CruisersForum Today

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

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,348
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, 06:03   #92
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,348
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, 20:44   #93
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,348
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, 07:59   #94
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,348
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, 25 views)
__________________
rgleason is online now   Reply With Quote
Old 20-09-2014, 18:30   #95
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,348
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, 26 views)
__________________
rgleason is online now   Reply With Quote
Old 26-11-2014, 15:01   #96
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 2,294
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
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 16:50.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.