Skip to content

Commit

Permalink
updated help links
Browse files Browse the repository at this point in the history
  • Loading branch information
danheeks committed Mar 3, 2014
1 parent d7ecbb8 commit 226e6b7
Show file tree
Hide file tree
Showing 19 changed files with 169 additions and 118 deletions.
2 changes: 0 additions & 2 deletions depth_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ def get_depths(self):
for i in range(1, layer_count):
depth += layer_depth
depths.insert(0, depth)

print 'depths = ', depths

return depths
29 changes: 24 additions & 5 deletions kurve_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ def add_CRC_end_line(curve,roll_on_curve,roll_off_curve,radius,direction,crc_end
crc_end_point.x = crc_end.x
crc_end_point.y = crc_end.y

using_area_for_offset = False

# profile command,
# direction should be 'left' or 'right' or 'on'
def profile(curve, direction = "on", radius = 1.0, offset_extra = 0.0, roll_radius = 2.0, roll_on = None, roll_off = None, depthparams = None, extend_at_start = 0.0, extend_at_end = 0.0, lead_in_line_len=0.0,lead_out_line_len= 0.0):
Expand All @@ -254,11 +256,28 @@ def profile(curve, direction = "on", radius = 1.0, offset_extra = 0.0, roll_radi
# get tool diameter
offset = radius + offset_extra
if use_CRC() == False or (use_CRC()==True and CRC_nominal_path()==True):
if direction == "right":
offset = -offset
offset_success = offset_curve.Offset(offset)
if offset_success == False:
raise Exception, "couldn't offset kurve " + str(offset_curve)
if math.fabs(offset) > 0.00005:
if direction == "right":
offset = -offset
offset_success = offset_curve.Offset(offset)
if offset_success == False:
global using_area_for_offset
if curve.IsClosed() and (using_area_for_offset == False):
cw = curve.IsClockwise()
using_area_for_offset = True
a = area.Area()
a.append(curve)
a.Offset(-offset)
for curve in a.getCurves():
curve_cw = curve.IsClockwise()
if cw != curve_cw:
curve.Reverse()
set_good_start_point(curve, False)
profile(curve, direction, 0.0, 0.0, roll_radius, roll_on, roll_off, depthparams, extend_at_start, extend_at_end, lead_in_line_len, lead_out_line_len)
using_area_for_offset = False
return
else:
raise Exception, "couldn't offset kurve " + str(offset_curve)

# extend curve
if extend_at_start > 0.0:
Expand Down
2 changes: 1 addition & 1 deletion nc/cutviewer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def tool_defn(self, id, name, params):
def tool_defn(self, id, params):
self.write('(TOOL/')
type = params['type']
if type == 0:#eDrill = 0,
Expand Down
16 changes: 13 additions & 3 deletions nc/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def __init__(self):
self.output_g98_and_g99 = True
self.g98_not_g99 = None # True for G98 ouput, False for G99 output
self.output_cutviewer_comments = False
self.current_fixture = None
self.output_fixtures = False
self.tool_defn_params = {}
############################################################################
## Codes

Expand Down Expand Up @@ -141,7 +144,7 @@ def END_CANNED_CYCLE(self): return('G80')
def TAP(self): return('G84')
def TAP_DEPTH(self, depth): return('K' + (self.fmt.string(depth)))
def INTERNAL_COOLANT_ON(self): return('M18')
def INTERNAL_COOLANT_OFF(self): return('M28')
def INTERNAL_COOLANT_OFF(self): return('M9')

def X(self): return('X')
def Y(self): return('Y')
Expand Down Expand Up @@ -196,6 +199,10 @@ def write_blocknum(self):
self.start_of_line = True

def write_spindle(self):
if self.output_fixtures:
if self.current_fixture == None:
self.write(self.SPACE() + 'G54')
self.current_fixture = 54
self.write(self.SPACE())
self.s.write(self)

Expand Down Expand Up @@ -308,6 +315,10 @@ def translate(self,x=None, y=None, z=None):
## Tools

def tool_change(self, id):
if self.output_cutviewer_comments:
import cutviewer
if id in self.tool_defn_params:
cutviewer.tool_defn(self, id, self.tool_defn_params[id])
if (self.t != None) and (self.z_for_g53 != None):
self.write_blocknum()
self.write('G53 Z' + str(self.z_for_g53) + '\n')
Expand All @@ -323,8 +334,7 @@ def tool_change(self, id):

def tool_defn(self, id, name='',params=None):
if self.output_cutviewer_comments:
import cutviewer
cutviewer.tool_defn(self, id, name, params)
self.tool_defn_params[id] = params
if self.output_tool_definitions:
self.write_blocknum()
self.write(self.SPACE() + self.TOOL_DEFINITION())
Expand Down
61 changes: 32 additions & 29 deletions nc/iso_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,124 +28,127 @@ def __init__(self, writer):
# then look for the 'comment' function towards the end of the file and add another elif

def ParseWord(self, word):
if (word[0] == 'A' or word[0] == 'a'):
word == word.upper()
if (word[0] == 'A'):
self.col = "axis"
self.a = eval(word[1:])
self.move = True
elif (word[0] == 'B' or word[0] == 'b'):
elif (word[0] == 'B'):
self.col = "axis"
self.b = eval(word[1:])
self.move = True
elif (word[0] == 'C' or word[0] == 'c'):
elif (word[0] == 'C'):
self.col = "axis"
self.c = eval(word[1:])
self.move = True
elif (word[0] == 'F' or word[0] == 'f'):
elif (word[0] == 'F'):
self.col = "axis"
self.writer.feedrate(word[1:])
elif (word[0] == 'H' or word[0] == 'h'):
elif (word[0] == 'H'):
self.col = "axis"
self.h = eval(word[1:])
self.move = True
elif (word == 'G0' or word == 'G00' or word == 'g0' or word == 'g00'):
elif (word == 'G0' or word == 'G00'):
self.path_col = "rapid"
self.col = "rapid"
self.arc = 0
elif (word == 'G1' or word == 'G01' or word == 'g1' or word == 'g01'):
elif (word == 'G1' or word == 'G01'):
self.path_col = "feed"
self.col = "feed"
self.arc = 0
elif (word == 'G2' or word == 'G02' or word == 'g2' or word == 'g02' or word == 'G12' or word == 'g12'):
elif (word == 'G2' or word == 'G02' or word == 'G12'):
self.path_col = "feed"
self.col = "feed"
self.arc = -1
elif (word == 'G3' or word == 'G03' or word == 'g3' or word == 'g03' or word == 'G13' or word == 'g13'):
elif (word == 'G3' or word == 'G03' or word == 'G13'):
self.path_col = "feed"
self.col = "feed"
self.arc = +1
elif (word == 'G10' or word == 'g10'):
elif (word == 'G10'):
self.no_move = True
elif (word == 'G53' or word == 'g53'):
elif (word == 'G53'):
self.no_move = True
elif (word == 'L1' or word == 'l1'):
elif (word == 'L1'):
self.no_move = True
elif (word == 'G61.1' or word == 'g61.1' or word == 'G61' or word == 'g61' or word == 'G64' or word == 'g64'):
elif (word == 'G61.1' or word == 'G61' or word == 'G64'):
self.no_move = True
elif (word == 'G20' or word == 'G70'):
self.col = "prep"
self.writer.imperial()
elif (word == 'G21' or word == 'G71'):
self.col = "prep"
self.writer.metric()
elif (word == 'G43' or word == 'g43'):
elif (word == 'G43'):
self.height_offset = True
self.move = True
self.path_col = "rapid"
self.col = "rapid"
elif (word == 'G81' or word == 'g81'):
elif (word == 'G80'):
self.drill_off = True
elif (word == 'G81'):
self.drill = True
self.no_move = True
self.path_col = "feed"
self.col = "feed"
elif (word == 'G82' or word == 'g82'):
elif (word == 'G82'):
self.drill = True;
self.no_move = True
self.path_col = "feed"
self.col = "feed"
elif (word == 'G83' or word == 'g83'):
elif (word == 'G83'):
self.drill = True
self.no_move = True
self.path_col = "feed"
self.col = "feed"
elif (word == 'G90' or word == 'g90'):
elif (word == 'G90'):
self.absolute()
elif (word == 'G91' or word == 'g91'):
elif (word == 'G91'):
self.incremental()
elif (word[0] == 'G') : col = "prep"
elif (word[0] == 'I' or word[0] == 'i'):
elif (word[0] == 'I'):
self.col = "axis"
self.i = eval(word[1:])
self.move = True
elif (word[0] == 'J' or word[0] == 'j'):
elif (word[0] == 'J'):
self.col = "axis"
self.j = eval(word[1:])
self.move = True
elif (word[0] == 'K' or word[0] == 'k'):
elif (word[0] == 'K'):
self.col = "axis"
self.k = eval(word[1:])
self.move = True
elif (word[0] == 'M') : self.col = "misc"
elif (word[0] == 'N') : self.col = "blocknum"
elif (word[0] == 'O') : self.col = "program"
elif (word[0] == 'P' or word[0] == 'p'):
elif (word[0] == 'P'):
if (self.no_move != True):
self.col = "axis"
self.p = eval(word[1:])
self.move = True
elif (word[0] == 'Q' or word[0] == 'q'):
elif (word[0] == 'Q'):
if (self.no_move != True):
self.col = "axis"
self.q = eval(word[1:])
self.move = True
elif (word[0] == 'R' or word[0] == 'r'):
elif (word[0] == 'R'):
self.col = "axis"
self.r = eval(word[1:])
self.move = True
elif (word[0] == 'S' or word[0] == 's'):
elif (word[0] == 'S'):
self.col = "axis"
self.writer.spindle(word[1:], (float(word[1:]) >= 0.0))
elif (word[0] == 'T') :
self.col = "tool"
self.writer.tool_change( eval(word[1:]) )
elif (word[0] == 'X' or word[0] == 'x'):
elif (word[0] == 'X'):
self.col = "axis"
self.x = eval(word[1:])
self.move = True
elif (word[0] == 'Y' or word[0] == 'y'):
elif (word[0] == 'Y'):
self.col = "axis"
self.y = eval(word[1:])
self.move = True
elif (word[0] == 'Z' or word[0] == 'z'):
elif (word[0] == 'Z'):
self.col = "axis"
self.z = eval(word[1:])
self.move = True
Expand Down
12 changes: 10 additions & 2 deletions nc/nc_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def Parse(self, name):
self.arc = 0
self.q = None
self.r = None
self.drilling = None

while (self.readline()):
self.a = None
Expand All @@ -87,6 +88,7 @@ def Parse(self, name):
self.move = False
self.height_offset = False
self.drill = False
self.drill_off = False
self.no_move = False

try:
Expand All @@ -101,8 +103,14 @@ def Parse(self, name):
if self.t != None:
if (self.m6 == True) or (self.need_m6_for_t_change == False):
self.writer.tool_change( self.t )

if (self.drill):

if self.drill:
self.drilling = True

if self.drill_off:
self.drilling = False

if self.drilling:
if self.z != None: self.drillz = self.z
self.writer.rapid(self.x, self.y, self.r)
self.writer.feed(self.x, self.y, self.drillz)
Expand Down
2 changes: 1 addition & 1 deletion src/CToolDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,5 @@ void CToolDlg::EnableAndSetCornerFlatAndAngle(CToolParams::eToolType type)

void CToolDlg::OnHelp( wxCommandEvent& event )
{
::wxLaunchDefaultBrowser(_T("http://heeks.net/tool"));
::wxLaunchDefaultBrowser(_T("http://heeks.net/help/tool"));
}
Loading

0 comments on commit 226e6b7

Please sign in to comment.