WMatSelect module

class WMatSelect(parent=None)[source]

Bases: pyleecan.GUI.Dialog.DMatLib.WMatSelect.Ui_WMatSelect.Ui_WMatSelect, PyQt5.QtWidgets.QWidget

Material related widget including a Label, a Combobox to select a material and a Button to edit a material libary. WMatSelect is instantiated to empty material data, so it has to be referenced to actual material data with the update method prior to its first usage.

saveNeeded
update(obj, mat_attr_name, matlib=[], matlib_path='')[source]

Set a reference to a material libray and material data path, updates the Combobox by the material names of the libary and set a referenced material by name.

Parameters:
  • self – A WMatSelect object
  • obj – A pyleecan object that has a material attribute
  • mat_attr_name – A string of the material attribute name
  • matlib – A material libary, i.e. a list of Material objects
  • matlib_path – A string containing the path of material data
setText(txt)[source]

Set the Label’s text

Parameters:
  • self – A WMatSelect object
  • txt – A text string
set_mat_type(index)[source]

Signal to set the referenced material from the material libary by the selected Combobox index

Parameters:
  • self – A WMatSelect object
  • index – Current index of the combobox
s_open_matlib()[source]

Open the GUI (DMatLib widget) to Edit the Material library

Parameters:self – A WMatSelect object
set_matlib()[source]

Update the matlib with the new value

Parameters:self – A WMatSelect object