Problem with relative addressing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
33 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
investing less than half an hour into Search function can save hours or days of waiting for a solution
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
investing less than half an hour into Search function can save hours or days of waiting for a solution
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?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Philip
In reply to this post by LordOfBikes
I have discovered a quirk to this problem.  I can move a negative distance by using subtraction.

@5-1,12
@6-7,0
@0,10-15

And

@0-56,0-25

The first two examples moves the X coordinate 1 unit to the left while the third line moves the Y coordinate 5 units down.  The fourth example subtracts from zero.  Perhaps Muparser is viewing the negative sign as a subtraction sign?

Also, did I mention that the CALC command does not work.  Returns "Unknown command: calc"
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

LordOfBikes
Administrator
Good finding Philip and thanks for sharing this workaround!

I'm stuck with some other jobs, didn't make any progress on this sadly.

Concerning the CALC command, I think it is cal, three letters, lower case, this works for me in latest 2.2.0rc.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Philip
Hi All,

I installed Linux Mint 18.3 on a different laptop.  I then installed LibreCAD.

Version: 2.2.0-alpha
Compiler: GNU GCC 5.4.0
Compiled on: May 31 2017
Qt Version: 5.5.1
Boost Version: 1.58.0
System: Linux Mint 18.3

Same issue here as described before.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Philip
In reply to this post by LordOfBikes
Armin,

I just installed Linux Mint on a spare laptop I had.  How do I install Librecad 2.2.0-rc1-19?  I can get an older version or 2.2.0-Alpha and I don't want either one of those.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

LordOfBikes
Administrator
Philip,

we currently don't have a binary package or auto build on Linux for latest code base.
So the only way would be to build from source.

It's not that hard on Linux, find the instructions in the wiki at https://wiki.librecad.org/index.php?title=Build_from_source#Building_LibreCAD_2.0_on_Linux

Hope it works, I haven't checked the commands for a while. If you run into issues, don't hesitate to ask.
Maybe you wanna try Zulip Chat or #librecad IRC channel if you need help.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Problem with relative addressing

Philip
Thanks Armin.

Version: 2.2.0-rc1-31-gac524db
Compiler: GNU GCC 5.4.0
Compiled on: Jun 19 2018
Qt Version: 5.5.1
Boost Version: 1.58.0
System: Linux Mint 18.3

The issue with relative addressing is still here.
12