MatLib module

class MatLib(path=None)[source]

Bases: PySide2.QtCore.QObject

saveNeeded = <PySide2.QtCore.Signal object>
load_mat_ref(path)[source]

Remove the reference materials and load materials from the path

Parameters
  • self (MatLib) –

  • path (str) – new material library path

add_machine_mat(machine)[source]

Add machine materials if they are not in the MatLib

Parameters
  • self (MatLib) –

  • machine (Machine) – Machine containing material to add

Returns

is_change – Machine has changed

Return type

bool

move_mach_mat_to_ref(key, index)[source]

Move a machine material into the matlib reference

Parameters
  • self (MatLib) –

  • key (str) – machine name to move the right material

  • index (int) – position of the machine material in its machine materials list

move_ref_mat_to_mach(key, index)[source]

Move a material from the reference material library to the machine materials

self: MatLib key: str

key to select the right machine list

index: int

material to move position in the reference material list

delete_material(key, index)[source]

Remove the material and delete the material file

Parameters
  • self (MatLib) –

  • key (str) – List selector in the dict : RefMatLib or MachineMatLib TODO MachineName in the future

  • index (int) – position of the material to remove

check_material_duplicated_name(key, index)[source]

Check if a material name is already used, modify it and its path if needed

Parameters
  • self (MatLib) –

  • key (str) – List selector in the dict : RefMatLib or MachineMatLib TODO MachineName in the future

  • index (int) – position of the material to check

add_new_mat_ref(material)[source]

Add a new material in the reference matlib

Parameters
add_new_mat_mach(material)[source]

Add a new material in the machine materials

Parameters
replace_material(key, index, material, save=True)[source]

Replace a material

Parameters
  • self (MatLib) –

  • key (str) – dict_mat key to select the right material list

  • index (int) – index of the material to replace

  • material (Material) – new material

  • save (bool) – save modification in the MatLib file

Returns

is_change – Machine has been change

Return type

bool

staticMetaObject = <PySide2.QtCore.QMetaObject object>