gcode_reader.emulate.machine_options ==================================== .. py:module:: gcode_reader.emulate.machine_options Attributes ---------- .. autoapisummary:: gcode_reader.emulate.machine_options.ABS_EXTRUSION gcode_reader.emulate.machine_options.BOTH_EXTRUDER gcode_reader.emulate.machine_options.CONFIG_FILES gcode_reader.emulate.machine_options.DEFAULT_GCODE_SYNTAX gcode_reader.emulate.machine_options.EXPECTED_UNITS gcode_reader.emulate.machine_options.FILAMENT_EXTRUDER gcode_reader.emulate.machine_options.GCODE_FILES gcode_reader.emulate.machine_options.JSON_FILES gcode_reader.emulate.machine_options.PELLET_EXTRUDER gcode_reader.emulate.machine_options.REL_EXTRUSION Classes ------- .. autoapisummary:: gcode_reader.emulate.machine_options.BAAMOptions gcode_reader.emulate.machine_options.CEADOptions gcode_reader.emulate.machine_options.ElectroImpactOptions gcode_reader.emulate.machine_options.HendrickOptions gcode_reader.emulate.machine_options.IngersollOptions gcode_reader.emulate.machine_options.JuggerbotOptions gcode_reader.emulate.machine_options.MachineOptions gcode_reader.emulate.machine_options.RepRapOptions Module Contents --------------- .. py:class:: BAAMOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:method:: load_config(filepath) Infers options from a config file. File should have extension ".config", or ".ini" :param filepath: The path to the file to infer options from. :type filepath: str :param inplace: Defaults to True. When True, the data is saved to this MachineOptions before being returned. :type inplace: bool, Optional :param ignore_extension: Defaults to False. When True, file extension is not checked :type ignore_extension: bool, Optional :raises ValueError: Unrecognized file extension and ignore_extension is false :returns: The options data parsed from the file :rtype: dict .. py:class:: CEADOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:class:: ElectroImpactOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:class:: HendrickOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:class:: IngersollOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:class:: JuggerbotOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:class:: MachineOptions(flavor='default', offset=None, extrusion_type=ABS_EXTRUSION, units=None, motion_profile=None, g0_feed=0, g1_feed=0, max_feedrate=None, max_acceleration=None, max_jerk=None, **kwargs) A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:method:: export(filepath, overwrite: bool = False) Exports options to a config or json file. File should have extension ".config", ".ini", ".json", or ".s2c" Attempts to create a new file. If the file already exists, the export fails and returns None. :param filepath: The path to the file to export the options to. :type filepath: str :param overwrite: Defaults to False. If False, nothing is written if the file exists. If True, the file's contents will be overwritten if it exists. :type overwrite: bool, optional :raises ValueError: Unrecognized file extension :returns: None .. py:method:: find_other_setting(property) .. py:method:: load(filepath: str, file_type='', inplace=True) Determines which load function to use based on file extension Accepts files with extensions: ".nc", ".mpf", ".gcode", ".ini", ".config", ".json", ".s2c" :param filepath: The path to the file to infer options from. :type filepath: str :param file_type: Defaults to "". Accepts "gcode", "config", "json", "3mf". When set, ignore the file extension and parse the file using that format. :type file_type: str, Optional :param inplace: Defaults to True. When True, the data is saved to this MachineOptions before being returned. :type inplace: bool, Optional .. py:method:: load_3mf(filepath: str, inplace=True, ignore_extension=False) Infers options from a 3mf file. File should have extension ".3mf" :param filepath: The path to the file to infer options from. :type filepath: str :param inplace: Defaults to True. When True, the data is saved to this MachineOptions before being returned. :type inplace: bool, Optional :param ignore_extension: Defaults to False. When True, file extension is not checked :type ignore_extension: bool, Optional :raises ValueError: Unrecognized file extension and ignore_extension is false :returns: The options data parsed from the file :rtype: dict .. py:method:: load_config(filepath: str, inplace=True, ignore_extension=False) Infers options from a config file. File should have extension ".config", or ".ini" :param filepath: The path to the file to infer options from. :type filepath: str :param inplace: Defaults to True. When True, the data is saved to this MachineOptions before being returned. :type inplace: bool, Optional :param ignore_extension: Defaults to False. When True, file extension is not checked :type ignore_extension: bool, Optional :raises ValueError: Unrecognized file extension and ignore_extension is false :returns: The options data parsed from the file :rtype: dict .. py:method:: load_gcode(filepath: str, inplace=True, ignore_extension=False, encoding='utf-8') Infers options from a gcode file. File should have extension ".nc", ".mpf", or ".gcode" :param filepath: The path to the file to infer options from. :type filepath: str :param inplace: Defaults to True. When True, the data is saved to this MachineOptions before being returned. :type inplace: bool, Optional :param ignore_extension: Defaults to False. When True, file extension is not checked :type ignore_extension: bool, Optional :param encoding: File encoding. Defaults to 'utf-8'. :type encoding: str, optional :raises ValueError: Unrecognized file extension and ignore_extension is false :returns: The options data parsed from the file :rtype: dict .. py:method:: load_json(filepath: str, inplace=True, ignore_extension=False) Infers options from a json file. File should have extension ".json", or ".s2c" :param filepath: The path to the file to infer options from. :type filepath: str :param inplace: Defaults to True. When True, the data is saved to this MachineOptions before being returned. :type inplace: bool, Optional :param ignore_extension: Defaults to False. When True, file extension is not checked :type ignore_extension: bool, Optional :raises ValueError: Unrecognized file extension and ignore_extension is false :returns: The options data parsed from the file :rtype: dict .. py:property:: all_options .. py:property:: extrusion_type .. py:property:: g0_feed .. py:property:: g1_feed .. py:attribute:: gcode_options_syntax .. py:property:: max_acceleration .. py:property:: max_feedrate .. py:property:: max_jerk .. py:property:: motion_profile .. py:property:: offset .. py:attribute:: syntax .. py:property:: units .. py:class:: RepRapOptions(**kwargs) Bases: :py:obj:`MachineOptions` A generic machine options base class Initialize the options for a machine. :param flavor: Syntax definition. Defaults to "default". :type flavor: dict, optional :param offset: List of position data for machine initial position. Defaults to 0 for all location commands. :type offset: list, optional :param extrusion_type: Absolute or relative extrusion. Defaults to absolute. :type extrusion_type: string, optional :param units: Units of the print. Defaults to mm. :type units: string, optional :param motion_profile: motion profile :type motion_profile: string, optional :param g0_feed: Feedrate for G0 commands (if not specified in the command). Defaults to 0.0. :type g0_feed: float, optional :param g1_feed: Feedrate for G1 commands (if not specified in the command). Defaults to 0.0. :type g1_feed: float, optional :param max_feedrate: Feedrate limit. Defaults to None. :type max_feedrate: float, optional :param max_acceleration: Defaults to None. :type max_acceleration: float, optional :param max_jerk: Defaults to None. :type max_jerk: float, optional .. py:data:: ABS_EXTRUSION :value: 'absolute' .. py:data:: BOTH_EXTRUDER :value: 'both' .. py:data:: CONFIG_FILES :value: ('.ini', '.config') .. py:data:: DEFAULT_GCODE_SYNTAX .. py:data:: EXPECTED_UNITS :value: ('mm', 'cm', 'in') .. py:data:: FILAMENT_EXTRUDER :value: 'filament' .. py:data:: GCODE_FILES :value: ('.nc', '.mpf', '.gcode') .. py:data:: JSON_FILES :value: ('.json', '.s2c') .. py:data:: PELLET_EXTRUDER :value: 'pellet' .. py:data:: REL_EXTRUSION :value: 'relative'