zooc.data.fixed_offset

Fixed offset profile is a user defined offset with a name and z-offset.

class zooc.data.fixed_offset.FixedOffset(*, name, z_offset)

Bases: KlipperConfigDict

Single fixed profile value.

Parameters:
  • name (str) – Name of the fixed offset profile.

  • z_offset (float) – Z offset value [mm].

static get_title()

Get the list of config variables.

This defines the which instance variables are the config variables, their stored order and naturally the name of the values. E.g., returning [‘low’, ‘high’] means the class has to have members ‘low’ and ‘high’.

Returns:

List of key names.

Return type:

list[str]

get_data()

Get the dictionary of all config variables.

Returns:

Dict of config variables.

Return type:

dict[str, float]

to_string()

Comma separated list of all config variables get_title() as <key>=<value> pairs.

I.e.:

<key_1>=<value_1>, <key_2>=<value_2>
Returns:

String of all config variables.

Return type:

str

zooc.data.fixed_offset.load_fixed_offsets(config)

Load and parse fixes profiles from a configuration file.

Configuration has syntax:

fixed_offsets = name=<profile name>, z_offset=<offset>...

Example:

fixed_offsets =
    name=pla, z_offset=0.01
    name=pei_tpu, z_offset=-0.02
Parameters:

config (ConfigWrapper) – Klipper configuration object to load the data from.

Returns:

Profile data or an empty dict when not found.

Return type:

dict[str, float]