CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
622 stars 143 forks source link

Treat single apostrophe as comment marker #423

Closed PashaWNN closed 4 months ago

PashaWNN commented 4 months ago

I am using CAMotics to test out my programs made in Fusion 360 using NC postprocessor. The NC postprocessor uses single hyphen as a comment delimiter. Comments look like this:

G0 G17 G90
G0 G40 G49 G80
G21
'When using Fusion for Personal Use, the feedrate of rapid
'moves is reduced to match the feedrate of cutting moves,
'which can increase machining time. Unrestricted rapid moves
'are available with a Fusion Subscription.
G28 G91 Z0
G90
'Trace3
T2

So now I have to manually remove all the comments from the G-Code to be able to run it in CAMotics. Here is the fix for this.

PashaWNN commented 4 months ago

Do I need to add anything else to make it appropriate for merging? I've looked through repo to find unit tests directory to add tests with no luck.

jcoffland commented 4 months ago

I've made a bit more compact change that does the same thing. See 7ff807c7ad0e4296dea87fae56d9203ba2d5a0d4.

PashaWNN commented 4 months ago

Thanks. I'm not a professional C++ developer, so just made it that way so I'm sure it will work without need to compile and test it. :)