code
stringlengths
3
6.57k
create_tool_button(style_name='MenuButton', status_tip='Open dialog for a different primitive')
switcher.setArrowType(QtCore.Qt.DownArrow)
switcher.setPopupMode(QtWidgets.QToolButton.InstantPopup)
switcher.setMenu(self.parent.primitives_menu)
switcher_layout.addStretch(1)
switcher_layout.addWidget(switcher)
self.main_layout.addLayout(switcher_layout)
createFormInputs(self)
FormGroup()
self.mesh_args.items()
key.replace('_', ' ')
title()
FormControl(pretty_label, value, required=True)
control.form_lineedit.textChanged.connect(self.nameCheck)
FormControl(pretty_label, value, desc='mm', required=True, number=True)
control.range(0, None, min_exclusive=True)
self.form_group.addControl(control)
outer_radius.compareWith(inner_radius, CompareValidator.Operator.Greater)
inner_radius.compareWith(outer_radius, CompareValidator.Operator.Less)
self.main_layout.addWidget(self.form_group)
self.form_group.groupValidation.connect(self.formValidation)
nameCheck(self, value)
isInvalid(f'"{self.parent_model.all_sample_key}" is a reserved name')
formValidation(self, is_valid)
self.create_primitive_button.setEnabled(True)
self.create_primitive_button.setDisabled(True)
createPrimiviteButtonClicked(self)
self.textboxes.items()
self.parent.presenter.addPrimitive(self.primitive, self.mesh_args)
self.parent_model.uniqueKey(self.primitive.value)
InsertPointDialog(QtWidgets.QWidget)
__init__(self, point_type, parent)
super()
__init__(parent)
self.parent.scenes.switchToSampleScene()
format(point_type.value)
QtWidgets.QVBoxLayout()
FormGroup()
FormControl('X', 0.0, required=True, desc=unit, number=True)
FormControl('Y', 0.0, required=True, desc=unit, number=True)
FormControl('Z', 0.0, required=True, desc=unit, number=True)
self.form_group.addControl(self.x_axis)
self.form_group.addControl(self.y_axis)
self.form_group.addControl(self.z_axis)
self.form_group.groupValidation.connect(self.formValidation)
QtWidgets.QHBoxLayout()
QtWidgets.QPushButton(self.title)
self.execute_button.clicked.connect(self.executeButtonClicked)
button_layout.addWidget(self.execute_button)
button_layout.addStretch(1)
self.main_layout.addWidget(self.form_group)
self.main_layout.addLayout(button_layout)
self.main_layout.addStretch(1)
self.setLayout(self.main_layout)
self.setMinimumWidth(450)
formValidation(self, is_valid)
self.execute_button.setEnabled(True)
self.execute_button.setDisabled(True)
executeButtonClicked(self)
self.parent.presenter.addPoints([(point, True)
InsertVectorDialog(QtWidgets.QWidget)
__init__(self, parent)
super()
__init__(parent)
self.parent.scenes.switchToSampleScene()
QtWidgets.QVBoxLayout()
self.main_layout.addSpacing(spacing)
self.main_layout.addWidget(QtWidgets.QLabel('Measurement Point:')
QtWidgets.QComboBox()
self.points_combobox.setView(QtWidgets.QListView()
self.main_layout.addWidget(self.points_combobox)
self.updatePointList()
self.main_layout.addSpacing(spacing)
QtWidgets.QHBoxLayout()
QtWidgets.QVBoxLayout()
alignment_layout.addWidget(QtWidgets.QLabel('Alignment:')
QtWidgets.QComboBox()
self.alignment_combobox.setView(QtWidgets.QListView()
self.alignment_combobox.setInsertPolicy(QtWidgets.QComboBox.InsertAtCurrent)
self.updateAlignment()
self.alignment_combobox.activated.connect(self.addNewAlignment)
self.alignment_combobox.currentIndexChanged.connect(self.changeRenderedAlignment)
alignment_layout.addWidget(self.alignment_combobox)
alignment_layout.addSpacing(spacing)
layout.addLayout(alignment_layout)
QtWidgets.QComboBox()
self.detector_combobox.setView(QtWidgets.QListView()
self.detector_combobox.addItems(list(self.parent_model.instrument.detectors.keys()
len(self.parent_model.instrument.detectors)
QtWidgets.QVBoxLayout()
detector_layout.addWidget(QtWidgets.QLabel('Detector:')
detector_layout.addWidget(self.detector_combobox)
self.detector_combobox.iconSize()
self.detector_combobox.setItemIcon(0, create_icon(settings.value(settings.Key.Vector_1_Colour)
self.detector_combobox.setItemIcon(1, create_icon(settings.value(settings.Key.Vector_2_Colour)
detector_layout.addSpacing(spacing)
layout.addSpacing(spacing)
layout.addLayout(detector_layout)
self.main_layout.addLayout(layout)
self.main_layout.addWidget(QtWidgets.QLabel('Strain Component:')