diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b50c65..9a237dbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,18 @@ CHANGELOG for FlatCAM beta ================================================= +21.07.2021 + +- when using the NCCAD9 preprocessor (for Kosy machines) at GCode save the .knc extension will be automatically preselected +- added a preprocessor for Roland MDX-540 + 20.07.2021 - in ParseDXF file fixed import of module due of changes in the latest version of ezdxf module - changes in Milling Plugin in the selection in the Tools Table - some updates of milling data structure - changes in handling the tool shape due of moving the parameter from the tool table in the tool parameters section - +a 18.07.2021 - modified the Geometry UI tools table. Replaced the comboboxes with labels. diff --git a/appObjects/FlatCAMCNCJob.py b/appObjects/FlatCAMCNCJob.py index ca27a7a2..2d5ab838 100644 --- a/appObjects/FlatCAMCNCJob.py +++ b/appObjects/FlatCAMCNCJob.py @@ -656,6 +656,8 @@ class CNCJobObject(FlatCAMObj, CNCjob): if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name: _filter_ = "RML1 Files .rol (*.rol);;All Files (*.*)" + elif 'nccad' in self.pp_excellon_name.lower() or 'nccad' in self.pp_geometry_name.lower(): + _filter_ = "KOSY Files .knc (*.knc);;All Files (*.*)" elif 'hpgl' in self.pp_geometry_name: _filter_ = "HPGL Files .plt (*.plt);;All Files (*.*)" else: diff --git a/app_Main.py b/app_Main.py index 300fa32c..c731d9d9 100644 --- a/app_Main.py +++ b/app_Main.py @@ -7780,7 +7780,7 @@ class App(QtCore.QObject): if len_objects == cnt: # all selected objects are of type CNCJOB therefore we issue a multiple save _filter_ = self.defaults['cncjob_save_filters'] + \ - ";;RML1 Files .rol (*.rol);;HPGL Files .plt (*.plt)" + ";;RML1 Files .rol (*.rol);;HPGL Files .plt (*.plt);;KNC Files .knc (*.knc)" dir_file_to_save = self.get_last_save_folder() + '/multi_save' @@ -9116,7 +9116,7 @@ class MenuFileHandlers(QtCore.QObject): # https://bobcadsupport.com/helpdesk/index.php?/Knowledgebase/Article/View/13/5/known-g-code-file-extensions _filter_ = "G-Code Files (*.txt *.nc *.ncc *.tap *.gcode *.cnc *.ecs *.fnc *.dnc *.ncg *.gc *.fan *.fgc" \ - " *.din *.xpi *.hnc *.h *.i *.ncp *.min *.gcd *.rol *.mpr *.ply *.out *.eia *.sbp *.mpf);;" \ + " *.din *.xpi *.hnc *.h *.i *.ncp *.min *.gcd *.rol *.knc *.mpr *.ply *.out *.eia *.sbp *.mpf);;" \ "All Files (*.*)" if name is None: diff --git a/preprocessors/NCCAD9.py b/preprocessors/NCCAD9.py index 5177598d..8758ea87 100644 --- a/preprocessors/NCCAD9.py +++ b/preprocessors/NCCAD9.py @@ -104,7 +104,7 @@ class NCCAD9(PreProc): gcode += ';X range: ' + '{: >9s}'.format(xmin) + ' ... ' + '{: >9s}'.format(xmax) + ' ' + units + '\n' gcode += ';Y range: ' + '{: >9s}'.format(ymin) + ' ... ' + '{: >9s}'.format(ymax) + ' ' + units + '\n\n' - gcode += ';Spindle Speed: %s RPM)\n' % str(p['spindlespeed']) + gcode += ';Spindle Speed: %s RPM\n' % str(p['spindlespeed']) gcode += ('G20' if p.units.upper() == 'IN' else 'G21') + "\n" gcode += 'G76 ;Reference-travel to the endswitches' diff --git a/preprocessors/Roland_MDX_540.py b/preprocessors/Roland_MDX_540.py new file mode 100644 index 00000000..b20c35c7 --- /dev/null +++ b/preprocessors/Roland_MDX_540.py @@ -0,0 +1,128 @@ +# ########################################################## +# FlatCAM: 2D Post-processing for Manufacturing # +# http://flatcam.org # +# File Author: Marius Adrian Stanciu (c) # +# Date: 3/10/2019 # +# MIT Licence # +# ########################################################## + +from appPreProcessor import * + + +# for Roland Preprocessors it is mandatory for the preprocessor name (python file and class name, both of them must be +# the same) to contain the following keyword, case-sensitive: 'Roland' without the quotes. +class Roland_MDX_540(PreProc): + + include_header = False + coordinate_format = "%.1f" + feedrate_format = '%.1f' + feedrate_rapid_format = '%.1f' + + def start_code(self, p): + gcode = ';;^IN;' + '\n' + gcode += '^PA;' + return gcode + + def startz_code(self, p): + return '' + + def lift_code(self, p): + if p.units.upper() == 'IN': + z = p.z_move / 25.4 + else: + z = p.z_move + gcode = self.feedrate_rapid_code(p) + '\n' + gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';' + return gcode + + def down_code(self, p): + if p.units.upper() == 'IN': + z = p.z_cut / 25.4 + else: + z = p.z_cut + gcode = self.feedrate_code(p) + '\n' + gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';' + return gcode + + def toolchange_code(self, p): + return '' + + def up_to_zero_code(self, p): + gcode = self.feedrate_code(p) + '\n' + gcode += self.position_code(p).format(**p) + ',' + 0 + ';' + return gcode + + def position_code(self, p): + if p.units.upper() == 'IN': + x = p.x / 25.4 + y = p.y / 25.4 + else: + x = p.x + y = p.y + return ('Z' + self.coordinate_format + ',' + self.coordinate_format) % (float(x * 100.0), float(y * 100.0)) + + def rapid_code(self, p): + if p.units.upper() == 'IN': + z = p.z_move / 25.4 + else: + z = p.z_move + gcode = self.feedrate_rapid_code(p) + '\n' + gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';' + return gcode + + def linear_code(self, p): + if p.units.upper() == 'IN': + z = p.z / 25.4 + else: + z = p.z + gcode = self.feedrate_code(p) + '\n' + gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';' + return gcode + + def end_code(self, p): + if p.units.upper() == 'IN': + z = p.z_end / 25.4 + else: + z = p.z_end + gcode = self.feedrate_rapid_code(p) + '\n' + gcode += self.position_code(p).format(**p) + ',' + str(float(z * 100.0)) + ';' + return gcode + + def feedrate_code(self, p): + fr_sec = p.feedrate / 60 + + # valid feedrate for MDX20 is between 0.1mm/sec and 15mm/sec (6mm/min to 900mm/min) + if p.feedrate >= 900: + fr_sec = 15 + if p.feedrate < 6: + fr_sec = 6 + return 'V' + str(self.feedrate_format % fr_sec) + ';' + + def z_feedrate_code(self, p): + fr_sec = p.z_feedrate / 60 + + # valid feedrate for MDX20 is between 0.1mm/sec and 15mm/sec (6mm/min to 900mm/min) + if p.z_feedrate >= 900: + fr_sec = 15 + if p.z_feedrate < 6: + fr_sec = 6 + return 'V' + str(self.feedrate_format % fr_sec) + ';' + + def feedrate_rapid_code(self, p): + fr_sec = p.feedrate_rapid / 60 + + # valid feedrate for MDX20 is between 0.1mm/sec and 15mm/sec (6mm/min to 900mm/min) + if p.feedrate_rapid >= 900: + fr_sec = 15 + if p.feedrate_rapid < 6: + fr_sec = 6 + return 'V' + str(self.feedrate_format % fr_sec) + ';' + + def spindle_code(self, p): + return '!MC1' + + def dwell_code(self, p): + return'' + + def spindle_stop_code(self, p): + return '!MC0'