- Posts: 19306
- Thank you received: 0
g-code replacement filter?
tjamscad wrote: Great, so how do i tell LinuxCNC to use this filter program? Will it just know?
You need to add an entry in the correct part of the INI file:
www.linuxcnc.org/docs/html/config/ini_co...sub_filter_section_a
Please Log in to join the conversation.
andypugh wrote:
tjamscad wrote: Great, so how do i tell LinuxCNC to use this filter program? Will it just know?
You need to add an entry in the correct part of the INI file:
www.linuxcnc.org/docs/html/config/ini_co...sub_filter_section_a
How do I tell it to be called up? This is what is in the .ini now
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
So, I write this program and name it convert.py. Where do I put it in the file tree and how do i list it in the .ini section?
Please Log in to join the conversation.
tjamscad wrote: How do I tell it to be called up? This is what is in the .ini now
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python?
Looking at image-to-gcode as an example: Put your new filter program (which would need to be some sort of executable file) in the same place as image-to-gcode, which lives in /usr/bin/ with most other executable programs. Lets assume that the file is called gcodefilter andyou want to leave .ngc files unfiltered, and convert .tap files
PROGRAM_EXTENSION = .tap Some Comment Here if You Want
then you need to tell the system which filter to use:
.tap = gcodefilter
And that should be it.
Please Log in to join the conversation.
I am sure I will be asking more later but for now.
My new .ini
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .ngc gcode file
PROGRAM_EXTENSION = .txt possible gcode file
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
ngc = gcodeconvert.txt
txt = gcodeconvert.txt
and filter just for testing "y0" is changed to "stop"
#!/bin/bash
sed -e 's/\(y0\)\([0-1000000]*\)/stop\2/' $1
Please Log in to join the conversation.
tjamscad wrote: ngc = gcodeconvert.txt
txt = gcodeconvert.txt
Having a .txt extension on an executable file is a little bit unusual.
Please Log in to join the conversation.
andypugh wrote:
tjamscad wrote: ngc = gcodeconvert.txt
txt = gcodeconvert.txt
Having a .txt extension on an executable file is a little bit unusual.
That is true, I just told Ubuntu to make it executable. Should it be something else?
Please Log in to join the conversation.
Linux doesn't really care. It just looks funny.tjamscad wrote:
andypugh wrote: Having a .txt extension on an executable file is a little bit unusual.
That is true, I just told Ubuntu to make it executable. Should it be something else?
Please Log in to join the conversation.
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .ngc gcode file
PROGRAM_EXTENSION = .txt possible gcode file
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
ngc = convert.py
txt = convert.py
Please Log in to join the conversation.
