Problem with relative addressing

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

LordOfBikes
Administrator
That's a good point Gary, many thanks for reporting this.
But Philip is on Windows, which is build with the bundled, probably older muparser.
Anyhow, I'll consider this for further investigations.
Also, muparser can handle extensive expressions and formulas, I really have no idea yet, what could fail on a string like "-5".

Armin
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Gary S
Does the debug information provide by the patch show values that have been sent to or returned from muparser?  Any value that was a '-' shows with a value of 0:
   li
   Command: li (line)
   0,0
   10,10
   @2,5
   relative cartesian input detected: [40322c35]
   comma: 2  X 2 [ok]  Y 5 [ok]
   @-5,2                                                                                   <-  x is -5
   relative cartesian input detected: [402d352c32]
   comma: 3  X 0 [fail]  Y 2 [ok]                                                  <- x reported with a value of 0
   Expression Syntax Error: no relative coordinate input
   @5,-2                                                                                   <-  y is -2
   relative cartesian input detected: [40352c2d32]
   comma: 2  X 5 [ok]  Y 0 [fail]                                                  <- y reported with a value of 0
   Expression Syntax Error: no relative coordinate input

Also, what is the significance of the first value shown, following 'comma: ' on the debug line? (e.g.  comma: 3  X 0 [fail]  Y 2 [ok] )
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

LordOfBikes
Administrator
Gary,

the output shows the string passed to muparser in hex notation, this is to see, if there are any code page issues. But the code 2d, for the negative sign, shows that this is ok.
The number following comma is the index of the comma [code 2c] in the string, to see, if the X and Y parts are detected correct.
The return value of muparser is 0 because of the fail flag. More isn't available from these muparser calls. I have to check if there is a kind of lastError() function with more valuable information about the error. Otherwise I have do follow the mupaser code myself and look what can happen.

Armin
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Gary S
Thanks for that information, Armin.  

I poked through the code a bit, and while it has been a long time I am able to follow it somewhat, however
#include appropriate disclaimer here...  :-)

Anyway, there is a muParserError class.  The header contains the error codes and '0' is
ecUNEXPECTED_OPERATOR    = 0,  ///< Unexpected binary operator found
.

Perhaps that helps.  If there is something I can help with, let me know...

G
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Gary S
In reply to this post by Gary S
To follow up on the versions that work and that do not...
   2.2.0 rc1             negative coordinates do not work, absolute or relative (e.g. -2,-5;  @-4,2.5; ...)
   2.2.2-alpha           negative coordinates do not work
   2.1.2                 negative coordinates work correctly
   2.0.9                 negative coordinates work correctly

This is when coordinates are entered via the command line.  If selecting points with the mouse left or down from the current point there is no problem...
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Oark64
Hi Gary S

I se you have done some investigation on the mater of negative coordinates not working.

I will contribute by telling you that I use version: 2.1.3 on Windows 10. Negative coordinates is not working in this version.

So, if negative coordinates work correctly on version 2.1.2 ther is maybe here you kan find som answer.

Hope this may help.

Here is my full version list:

Versjon: 2.1.3
Compiler: GNU GCC 4.9.1
Compiled on: Sep 23 2016
Qt Version: 5.4.1
Boost Version: 1.60.0
System: Windows
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Oark64
Hi

This is to redraw my post from some minuts ago.
I hope I have not created too much trouble for you but now negative numbers work.

Have you fixed anything?
12