Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 added features? #120

Closed
tarmon01 opened this issue Feb 1, 2020 · 16 comments
Closed

2 added features? #120

tarmon01 opened this issue Feb 1, 2020 · 16 comments

Comments

@tarmon01
Copy link

tarmon01 commented Feb 1, 2020

Hi,
This is an excellent program. Two added features though would help me a lot.

  1. would be to only allow a single copy of the program to be run . ie if it’s already running , don’t open another copy of the program and 2) a way to open a Gcode file automatically when the program is started, (or called again like in 1) above.

This would allow a smooth way of sending the gcode file from the generating program to your program.

I can probably figure a clunky way to do it with python for 1) and a macro recorder for 2) but it sure would be better solution in your program directly.

Thanks,
-TomH-

@martin2250
Copy link
Owner

Hi Tom,

that's a great idea! That way, we could also use a file association to open gcode files by double-clicking. Right now I'm short on time, so I don't know when I'll get around to implementing this. If you (or someone else) want to take care of this in a PR, I'll gladly accept it.

Cheers
Martin

@martin2250
Copy link
Owner

Implemented it in 8440f04
Cheers!

@tarmon01
Copy link
Author

tarmon01 commented Mar 20, 2020 via email

@deHarro
Copy link
Contributor

deHarro commented Mar 21, 2020

Hi Martin, tarmon!

When I double click on a xxx.nc file in windows file explorer (I associated *.nc files with OCP in Win 8.1), OCP gets started, but the file is not loaded.
Have I to do something further to make it work like expected?
Thanks!

Harald

@martin2250
Copy link
Owner

Hi Harald,

I'll have to test that later. I only tested drag'n'dropping files onto OCP, which worked. I assumed that file associations work the same way...

Martin

@deHarro
Copy link
Contributor

deHarro commented Mar 21, 2020

Hi Martin,
no hurry... ;-)

D&D already worked since 2018 (or so :) this is nothing new.
I understood that from Toms question/proposal you implemented something like I explained isn't working... Obviously I misunderstood his Idea.
But it's ok for me.

Harald

@tarmon01
Copy link
Author

tarmon01 commented Mar 21, 2020 via email

@martin2250
Copy link
Owner

Hi Harald, Tom,

Harald, I tested drag'n'drop with the last released version and it didn't work. Still I have to admit, you almost convinced me that I implemented it before and forgot about it 😉

Also I tested associating OCP with .nc files, which works flawlessly (at least on Windows 10).

Tom, your second request is a lot harder unfortunately. OpenCNCPilot ignores work offsets completely, it processes all coordinates relative to the current work offset (the "sum" of G54-G57+G92+G43). So when I allow G54 etc, the position of the tool above the height map is no longer well defined (should it be calculated in absolute machine coordinates, in the current G54... or G92?). Just passing through these commands could lead to some funny behaviour.

G49, G43 should be ok to add as these commands only affect the Z axis IIRC. M-codes are already passed through.

Martin

@tarmon01
Copy link
Author

tarmon01 commented Mar 22, 2020 via email

@deHarro
Copy link
Contributor

deHarro commented Mar 22, 2020

Hi Martin,
you are right, on my Win10 milling PC it works as expected.
Thanks to MS there seems to be a different behavior on Win 8.1, which is my development system running with.
This is absolutely no killer for me, you don't have to put work into getting it running on Win 8, too.

Harald

@tarmon01
Yes, I replaced the complete code by the new files in place, there is no older version on the PC. Thanks anyway for the hint :-)

Harald

@deHarro
Copy link
Contributor

deHarro commented Mar 22, 2020

Hi Martin, Tom,

I just tested the new version of OCP on my office PC (Win 8.1).

Keeping eyes open and beeing concentrated on the job (double clicking the xxx.nc file and staring at the screen) I realized, that directly after the double click, there appears a window which very quickly is replaced (actually superimposed) by the OCP GUI.
Nearly every one of my .NC files contains one or more g-codes OCP doesn't want to deal with. So it pops up a warning message.
Sadly, this message window is not topmost (on my PCs), so I missed it and claimed OCP is not loading the file.
After quitting the message box, the file is loaded as expected.
-> your implementation is perfect ;-)

In the given case the messagebox raises:
"1 > ignoring zero-length move from line number 1931"
which seems to be safe enough to being ignored.

Other messages often deal with tool change codes (T1..T5)
"1 > ignoring unknown word (letter): "T1". (line 38)
2 > ignoring unknown word (letter): "T2". (line 61)
3 > ignoring unknown word (letter): "T3". (line 90)
4 > ignoring unknown word (letter): "T4". (line 182)
5 > ignoring unknown word (letter): "T1". (line 196)"
or this
"1 > ignoring unknown command G94. (line 10)"

This behavior again leads me to my already raised proposal:
Perhaps you can implement a user definable list of g-codes, where the user - on it's own responsibility - can enter codes, OCP should ignore silently.

To circumnavigate those messages, I searched and found some locations where I could change the generating tool (namely Estlcam), so G94 should be no point anymore.

The Tx commands came from pcb-gcode ULP of EAGLE. There I now am using a drill file which tells pcb-gcode to always use the same drill bit for all occuring diameters. So no tool change commands any more.

Harald

@deHarro
Copy link
Contributor

deHarro commented Mar 22, 2020

Perhaps you can implement a user definable list of g-codes, where the user - on it's own responsibility - can enter codes, OCP should ignore silently.

All the above mentioned warnings have no negative impact on the milling process, I proved this for me, I usually click on ignore and do the job without errors or unpredictabilities.

Harald

@martin2250
Copy link
Owner

Hi Harald, Tom,

good workaround, though I can see that it's pretty annoying to do. I like Haralds idea of giving the user the option to accept the responsibility. I think the easiest way to do that would be to just copy lines that contain unknown commands verbatim to the output file. Also I think it would be best if you had to establish the position of the tool again after commands that lead to an indeterminate position, that means after a G38 or G54 etc. you'd have to use G0 moves to unambiguously position the tool in all three axes before using G1/2/3 etc again (just like you currently have to do at the start of a file).

Macros and all other settings are stored as an xml file in %appdata%/martin2250/OpenCNCPilot. You shouldn't loose your settings when upgrading to a more recent version though.

Martin

@deHarro
Copy link
Contributor

deHarro commented Mar 25, 2020

Hi Martin,

you'd have to use G0 moves to unambiguously position the tool in all three axes before using G1/2/3 etc again (just like you currently have to do at the start of a file).

that sounds pretty good.
I do not use home switches, but perhaps someone else does, so I would ask:
Will homing also "rearm" OCP?

You shouldn't loose your settings when upgrading to a more recent version though.

That I can confirm.
You changed the behavior of OCP some versions ago and since then I had no problems with vanishing macros.

Harald

@tarmon01
Copy link
Author

tarmon01 commented Mar 25, 2020 via email

@martin2250
Copy link
Owner

@deHarro, @tarmon01 I've explained what I mean by "use G0 moves to unambiguously position the tool" better in #125, you don't have to home your machine and it won't raise an alarm.

Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants