try to fix spinde writing WARNING nc files will be a bit different after this, please test.

pull/35/head
vilemnovak 2016-02-22 23:56:45 +01:00
rodzic 1ff9d09451
commit f3531f3128
2 zmienionych plików z 19 dodań i 14 usunięć

Wyświetl plik

@ -11,8 +11,7 @@ class Creator(iso.Creator):
def program_begin(self, id, comment):
self.write( (';' + comment + '\n') )
def FORMAT_DWELL(self): return( self.SPACE() + self.DWELL() + ' X%f')
def TIME(self): return('X')
def SPINDLE_OFF(self): return('M05')
#optimize
@ -22,7 +21,7 @@ class Creator(iso.Creator):
def SPINDLE_DWELL(self,dwell):
w='\n'+self.BLOCK() % self.n+ self.DWELL() % dwell
return w
def SPINDLE_CW(self,dwell):
return('M03' + self.SPINDLE_DWELL(dwell) )
@ -36,8 +35,9 @@ class Creator(iso.Creator):
'''
def tool_change(self, id):
#print(self.SPACE())
#print(self.TOOL())
self.write(self.SPACE() + (self.TOOL() % id) + '\n')
self.write(self.SPACE() + self.s.str)
self.write('\n')
self.flush_nc()
self.t = id

Wyświetl plik

@ -1134,8 +1134,7 @@ def exportGcodePath(filename,vertslist,operations):
#work-plane, by now always xy,
c.set_plane(0)
c.flush_nc()
c.write_spindle()
c.flush_nc()
return c
c=startNewFile()
@ -1158,21 +1157,24 @@ def exportGcodePath(filename,vertslist,operations):
else:
spdir_clockwise=False
c.spindle(o.spindle_rpm,spdir_clockwise)
c.flush_nc()
#write tool, not working yet probably
#print (last_cutter)
if last_cutter!=[o.cutter_id,o.cutter_diameter,o.cutter_type,o.cutter_flutes]:
c.comment('Tool change - D = %s type %s flutes %s' % ( strInUnits(o.cutter_diameter,4),o.cutter_type, o.cutter_flutes))
c.tool_change(o.cutter_id)
c.flush_nc()
last_cutter=[o.cutter_id,o.cutter_diameter,o.cutter_type,o.cutter_flutes]
c.spindle(o.spindle_rpm,spdir_clockwise)
c.write_spindle()
c.flush_nc()
if m.spindle_start_time>0:
c.dwell(m.spindle_start_time)
c.flush_nc()
c.flush_nc()
# dhull c.feedrate(unitcorr*o.feedrate)
@ -1197,12 +1199,13 @@ def exportGcodePath(filename,vertslist,operations):
last=Vector((0.0,0.0,free_movement_height))#nonsense values so first step of the operation gets written for sure
lastrot=Euler((0,0,0))
duration=0.0
f=millfeedrate
f=0.1123456#nonsense value, so first feedrate always gets written
fadjustval = 1 # if simulation load data is Not present
downvector= Vector((0,0,-1))
plungelimit=(pi/2-o.plunge_angle)
#print('2')
for vi,vert in enumerate(verts):
@ -1302,21 +1305,23 @@ def exportGcodePath(filename,vertslist,operations):
findex+=1
c.file_close()
c=startNewFile()
c.spindle(o.spindle_rpm,spdir_clockwise)
c.flush_nc()
c.comment('Tool change - D = %s type %s flutes %s' % ( strInUnits(o.cutter_diameter,4),o.cutter_type, o.cutter_flutes))
c.tool_change(o.cutter_id)
c.spindle(o.spindle_rpm,spdir_clockwise)
c.feedrate(unitcorr*o.feedrate)
c.write_spindle()
c.flush_nc()
if m.spindle_start_time>0:
c.dwell(m.spindle_start_time)
c.flush_nc()
c.feedrate(unitcorr*o.feedrate)
c.rapid(x=last.x*unitcorr,y=last.y*unitcorr,z=free_movement_height*unitcorr)
c.rapid(x=last.x*unitcorr,y=last.y*unitcorr,z=last.z*unitcorr)
processedops=0
c.feedrate(unitcorr*o.feedrate)