kopia lustrzana https://github.com/fellesverkstedet/fabmodules
Integrate new GCC driver into build+GUI
Currently only PNG -> GCC is set upmaster
rodzic
c272371ebf
commit
ad73683abd
|
@ -4,7 +4,7 @@ set(PROGRAMS vol_gif vol_stl gif_info gif_png gif_stl stl_info stl_png stl_path
|
|||
png_size png_scale png_distances png_offset png_grb png_drl
|
||||
png_path png_halftone svg_path
|
||||
path_eps path_dxf path_png path_rml path_sbp path_g path_camm
|
||||
path_epi path_uni path_oms path_ord
|
||||
path_epi path_uni path_gcc path_oms path_ord
|
||||
path_join path_array path_info path_time
|
||||
CACHE STRING "Core program list")
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
//
|
||||
// path_epi.c
|
||||
// convert path to Epilog lasercutter .epi
|
||||
// path_gcc.c
|
||||
// convert path to GCC lasercutter .gcc
|
||||
// Based on path_epi.c
|
||||
//
|
||||
// Neil Gershenfeld 8/18/13
|
||||
// (c) Massachusetts Institute of Technology 2013
|
||||
// Jon Nordby 9/1/14
|
||||
// (c) Jon Nordby, Fellesverkstedet 2014
|
||||
//
|
||||
// This work may be reproduced, modified, distributed,
|
||||
// performed, and displayed for any purpose, but must
|
||||
|
@ -15,9 +18,12 @@
|
|||
|
||||
#include "fab.h"
|
||||
|
||||
void fab_write_epi(struct fab_vars *v, char *output_file_name, int power, int speed, int focus, float ox, float oy, char loc, int rate, int max_power) {
|
||||
void fab_write_gcc(struct fab_vars *v, char *output_file_name,
|
||||
int power, int speed, int focus,
|
||||
float ox, float oy, char loc,
|
||||
int rate, int max_power) {
|
||||
//
|
||||
// write path to Epilog lasercutter file
|
||||
// write path to GCC lasercutter file
|
||||
//
|
||||
FILE *output_file;
|
||||
int i,x,y,z,current_z,layer_power,nsegs=0,npts=0;
|
||||
|
@ -127,9 +133,9 @@ int main(int argc, char **argv) {
|
|||
// command line args
|
||||
//
|
||||
if (!((argc == 3) || (argc == 4) || (argc == 5) || (argc == 6) || (argc == 8) || (argc == 9) || (argc == 10) || (argc == 11))) {
|
||||
printf("command line: path_epi in.path out.epi [power [speed [focus [x y [ location [rate [max_power]]]]]]]\n");
|
||||
printf("command line: path_gcc in.path out.gcc [power [speed [focus [x y [ location [rate [max_power]]]]]]]\n");
|
||||
printf(" in.path = input path file\n");
|
||||
printf(" out.epi= output Epilog lasercutter file\n");
|
||||
printf(" out.gcc= output GCC lasercutter file\n");
|
||||
printf(" power = percent power, for minimum z value (optional, 0-100, default 50)\n");
|
||||
printf(" speed = percent speed (optional, 0-100, default 50)\n");
|
||||
printf(" focus = autofocus (optional, 0=off | 1=on, default on)\n");
|
||||
|
@ -175,8 +181,8 @@ int main(int argc, char **argv) {
|
|||
//
|
||||
fab_read_path(&v,argv[1]);
|
||||
//
|
||||
// write .epi
|
||||
// write .gcc
|
||||
//
|
||||
fab_write_epi(&v,argv[2],power,speed,focus,ox,oy,loc,rate,max_power);
|
||||
fab_write_gcc(&v,argv[2],power,speed,focus,ox,oy,loc,rate,max_power);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ set(GUIs fab fab.html fabserver
|
|||
make_math_camm make_math_epi make_math_g make_math_ord make_math_eps
|
||||
make_math_uni make_math_rml make_math_sbp make_math_grb
|
||||
make_math_drl
|
||||
make_png_png make_png_eps make_png_epi make_png_uni make_png_grb
|
||||
make_png_png make_png_eps make_png_epi make_png_uni make_png_grb make_png_gcc
|
||||
make_png_epi_halftone make_png_uni_halftone make_png_rml make_png_sbp
|
||||
make_png_ord make_png_camm make_png_plt make_png_g make_png_drl
|
||||
make_png_oms
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# make_png_epi
|
||||
# .png to .epi GUI wrapper
|
||||
# make_png_gcc
|
||||
# .png to .gcc GUI wrapper
|
||||
# Basd on make_png_epi
|
||||
#
|
||||
# Neil Gershenfeld
|
||||
# CBA MIT 1/24/11
|
||||
#
|
||||
# (c) Massachusetts Institute of Technology 2011
|
||||
# Permission granted for experimental and personal use;
|
||||
# license for commercial sale available from MIT.
|
||||
#
|
||||
# # Jon Nordby 9/1/14
|
||||
# (c) Jon Nordby, Fellesverkstedet 2014
|
||||
|
||||
# imports
|
||||
#
|
||||
import wx,sys
|
||||
|
@ -17,11 +19,11 @@ from fab_set import fab_frame
|
|||
from panel_control import control_panel
|
||||
from panel_png import png_panel
|
||||
from panel_png_path import png_path_panel
|
||||
from panel_path_epi import path_epi_panel
|
||||
from panel_path_gcc import path_gcc_panel
|
||||
#
|
||||
# command line
|
||||
#
|
||||
print "command line: make_png_epi [input_file [size]]"
|
||||
print "command line: make_png_gcc [input_file [size]]"
|
||||
print " input_file = input .png file (optional)"
|
||||
print " size = image panel size (optional)"
|
||||
#
|
||||
|
@ -31,11 +33,11 @@ app = wx.App()
|
|||
#
|
||||
# add panels to frame
|
||||
#
|
||||
frame = fab_frame("make_png_epi",sys.argv)
|
||||
frame = fab_frame("make_png_gcc",sys.argv)
|
||||
frame.control_panel = control_panel(frame)
|
||||
frame.sizer.Add(frame.control_panel,(0,0),span=(1,3),flag=wx.ALIGN_CENTER_HORIZONTAL)
|
||||
frame.epi_panel = path_epi_panel(frame)
|
||||
frame.sizer.Add(frame.epi_panel,(1,2))
|
||||
frame.gcc_panel = path_gcc_panel(frame)
|
||||
frame.sizer.Add(frame.gcc_panel,(1,2))
|
||||
frame.path_panel = png_path_panel(frame)
|
||||
frame.sizer.Add(frame.path_panel,(1,1))
|
||||
frame.png_panel = png_panel(frame)
|
||||
|
@ -43,7 +45,7 @@ frame.sizer.Add(frame.png_panel,(1,0))
|
|||
#
|
||||
# set defaults
|
||||
#
|
||||
frame.set_png_epi()
|
||||
frame.set_png_gcc()
|
||||
#
|
||||
# fit and show frame
|
||||
#
|
||||
|
|
|
@ -9,7 +9,7 @@ set(PYs fab_mods.py fab_set.py panel_control.py
|
|||
panel_png_drl.py panel_path.py
|
||||
panel_path_rml.py panel_path_plt.py panel_path_oms.py
|
||||
panel_path_sbp.py panel_path_ord.py panel_path_camm.py
|
||||
panel_path_epi.py panel_path_uni.py panel_path_g.py
|
||||
panel_path_epi.py panel_path_uni.py panel_path_g.py panel_path_gcc.py
|
||||
panel_path_eps.py panel_path_snap.py panel_path_dxf.py
|
||||
panel_stl.py panel_stl_png.py
|
||||
panel_svg.py panel_svg_path.py
|
||||
|
|
|
@ -76,6 +76,9 @@ def set_workflows(frame,formats,workflows):
|
|||
frame.processes.Append("Universal halftone (.uni)")
|
||||
workflows["image (.png) : Universal halftone (.uni)"] = "make_png_uni_halftone"
|
||||
#
|
||||
frame.processes.Append("GCC lasercutter (.gcc)")
|
||||
workflows["image (.png) : GCC lasercutter (.gcc)"] = "make_png_gcc"
|
||||
#
|
||||
frame.processes.Append("Resonetics excimer (.oms)")
|
||||
workflows["image (.png) : Resonetics excimer (.oms)"] = "make_png_oms"
|
||||
workflows["drawing (.svg) : Resonetics excimer (.oms)"] = "make_svg_oms"
|
||||
|
|
|
@ -66,6 +66,39 @@ class fab_frame(wx.Frame):
|
|||
= "self.epi_panel.power_2D.SetValue('75');\
|
||||
self.epi_panel.speed_2D.SetValue('25');"
|
||||
#
|
||||
# set .png .epi defaults
|
||||
#
|
||||
def set_png_gcc(self):
|
||||
self.defaults = {}
|
||||
self.control_panel.defaults.Append('cardboard')
|
||||
self.defaults["cardboard"]\
|
||||
= "self.png_path_panel.diameter_rough.SetValue('0.25');\
|
||||
self.png_path_panel.error_rough.SetValue('1.5');\
|
||||
self.png_path_panel.diameter_finish.SetValue('0.25');\
|
||||
self.png_path_panel.clearance_diameter_finish.SetValue('0.25');\
|
||||
self.png_path_panel.error_finish.SetValue('1.5');\
|
||||
self.png_path_panel.diameter_2D.SetValue('0.25');\
|
||||
self.png_path_panel.error_2D.SetValue('1.5');\
|
||||
self.gcc_panel.power_2D.SetValue('25');\
|
||||
self.gcc_panel.speed_2D.SetValue('75');\
|
||||
self.gcc_panel.min_power_3D.SetValue('5');\
|
||||
self.gcc_panel.max_power_3D.SetValue('25');\
|
||||
self.gcc_panel.speed_3D.SetValue('75');"
|
||||
self.control_panel.defaults.Append('acrylic')
|
||||
self.defaults["acrylic"]\
|
||||
= "self.png_path_panel.diameter_rough.SetValue('0.25');\
|
||||
self.png_path_panel.error_rough.SetValue('1.5');\
|
||||
self.png_path_panel.diameter_finish.SetValue('0.25');\
|
||||
self.png_path_panel.clearance_diameter_finish.SetValue('0.25');\
|
||||
self.png_path_panel.error_finish.SetValue('1.5');\
|
||||
self.png_path_panel.diameter_2D.SetValue('0.25');\
|
||||
self.png_path_panel.error_2D.SetValue('1.5');\
|
||||
self.gcc_panel.power_2D.SetValue('75');\
|
||||
self.gcc_panel.speed_2D.SetValue('25');\
|
||||
self.gcc_panel.min_power_3D.SetValue('25');\
|
||||
self.gcc_panel.max_power_3D.SetValue('75');\
|
||||
self.gcc_panel.speed_3D.SetValue('25');"
|
||||
#
|
||||
# set .cad .epi defaults
|
||||
#
|
||||
def set_cad_epi(self):
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
#
|
||||
# panel_path_epi.py
|
||||
# make .epi from .path
|
||||
# panel_path_gcc.py
|
||||
# make .gcc from .path
|
||||
# Based on panel_path_epi.py
|
||||
#
|
||||
# Neil Gershenfeld 8/19/13
|
||||
# (c) Massachusetts Institute of Technology 2013
|
||||
# Jon Nordby 9/1/14
|
||||
# (c) Jon Nordby, Fellesverkstedet 2014
|
||||
#
|
||||
# This work may be reproduced, modified, distributed,
|
||||
# performed, and displayed for any purpose, but must
|
||||
|
@ -20,18 +23,18 @@ import wx,os,string
|
|||
#
|
||||
# panel class
|
||||
#
|
||||
class path_epi_panel(wx.Panel):
|
||||
class path_gcc_panel(wx.Panel):
|
||||
def __init__(self,parent):
|
||||
self.parent = parent
|
||||
self.parent.path_file = ''
|
||||
#
|
||||
# make epi
|
||||
# make gcc
|
||||
#
|
||||
def make_epi(event):
|
||||
def make_gcc(event):
|
||||
if (self.parent.path_file == ''):
|
||||
print 'panel_path_epi: oops -- need path file'
|
||||
print 'panel_path_gcc: oops -- need path file'
|
||||
return
|
||||
self.parent.epi_file = self.parent.tmp+self.parent.rootname+'.epi'
|
||||
self.parent.gcc_file = self.parent.tmp+self.parent.rootname+'.gcc'
|
||||
if (string.find(self.parent.path_type,"2D") != -1):
|
||||
power = self.power_2D.GetValue()
|
||||
if (self.focus_2D.GetValue()):
|
||||
|
@ -50,7 +53,7 @@ class path_epi_panel(wx.Panel):
|
|||
loc = 'r'
|
||||
speed = self.speed_2D.GetValue()
|
||||
rate = self.rate_2D.GetValue()
|
||||
command = 'path_epi '+'\"'+self.parent.path_file+'\"'+' '+'\"'+self.parent.epi_file+'\"'+' '+power+' '+speed+' '+focus+' '+ox+' '+oy+' '+loc+' '+' '+rate
|
||||
command = 'path_gcc '+'\"'+self.parent.path_file+'\"'+' '+'\"'+self.parent.gcc_file+'\"'+' '+power+' '+speed+' '+focus+' '+ox+' '+oy+' '+loc+' '+' '+rate
|
||||
print command
|
||||
os.system(command)
|
||||
self.button.Show()
|
||||
|
@ -75,20 +78,20 @@ class path_epi_panel(wx.Panel):
|
|||
loc = 'r'
|
||||
speed = self.speed_3D.GetValue()
|
||||
rate = self.rate_3D.GetValue()
|
||||
command = 'path_epi '+'\"'+self.parent.path_file+'\"'+' '+'\"'+self.parent.epi_file+'\"'+' '+min_power+' '+speed+' '+focus+' '+ox+' '+oy+' '+loc+' '+' '+rate+' '+max_power
|
||||
command = 'path_gcc '+'\"'+self.parent.path_file+'\"'+' '+'\"'+self.parent.gcc_file+'\"'+' '+min_power+' '+speed+' '+focus+' '+ox+' '+oy+' '+loc+' '+' '+rate+' '+max_power
|
||||
print command
|
||||
os.system(command)
|
||||
self.button.Show()
|
||||
self.parent.Layout()
|
||||
self.parent.Fit()
|
||||
else:
|
||||
print "panel_path_epi: oops -- don't recognize path type"
|
||||
print "panel_path_gcc: oops -- don't recognize path type"
|
||||
return
|
||||
#
|
||||
# send
|
||||
#
|
||||
def fab_send(event):
|
||||
command = 'fab_send '+'\"'+self.parent.epi_file+'\"'
|
||||
command = 'fab_send '+'\"'+self.parent.gcc_file+'\"'
|
||||
print command
|
||||
os.system(command)
|
||||
#
|
||||
|
@ -100,7 +103,7 @@ class path_epi_panel(wx.Panel):
|
|||
#
|
||||
# label
|
||||
#
|
||||
label = wx.StaticText(self,label='to: epi')
|
||||
label = wx.StaticText(self,label='to: gcc')
|
||||
bold_font = wx.Font(10,wx.DEFAULT,wx.NORMAL,wx.BOLD)
|
||||
label.SetFont(bold_font)
|
||||
self.sizer.Add(label,(0,0),flag=wx.ALIGN_CENTER_HORIZONTAL)
|
||||
|
@ -115,8 +118,8 @@ class path_epi_panel(wx.Panel):
|
|||
#
|
||||
# controls
|
||||
#
|
||||
make = wx.Button(self,label='make .epi')
|
||||
make.Bind(wx.EVT_BUTTON,make_epi)
|
||||
make = wx.Button(self,label='make .gcc')
|
||||
make.Bind(wx.EVT_BUTTON,make_gcc)
|
||||
self.sizer.Add(make,(2,0),flag=wx.ALIGN_CENTER_HORIZONTAL)
|
||||
#
|
||||
# 2D panel
|
||||
|
|
|
@ -21,6 +21,7 @@ commands = {
|
|||
'.drl': 'gerbv "$file"',
|
||||
'.dxf': 'gedit "$file"',
|
||||
'.epi': 'printer=laser; lprm -P$printer -; lpr -P$printer "$file"',
|
||||
'.gcc': 'printer=laser; lprm -P$printer -; lpr -P$printer "$file"',
|
||||
'.uni': 'port=/dev/lp0; cat "$file" > $port',
|
||||
'.stl': 'meshlab "$file"',
|
||||
'.ord': 'gedit "$file"',
|
||||
|
|
Ładowanie…
Reference in New Issue