plotter_14.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. def customSlider():
  2. limitSlider = QSlider(Qt.Horizontal)
  3. limitSlider.setMinimum(-3)
  4. limitSlider.setMaximum(3)
  5. limitSlider.setValue(1)
  6. limitSlider.setTickPosition(QSlider.TicksBothSides)
  7. limitSlider.setTickInterval(1)
  8. limitSlider.valueChanged.connect(lambda: valueChange(workspace))
  9. limitSlider.setStatusTip("Change axes limit")
  10. return limitSlider
  11. workspace.xLimitSlider = customSlider()
  12. workspace.yLimitSlider = customSlider()
  13. workspace.zLimitSlider = customSlider()
  14. workspace.meshDensityValue = QLabel(
  15. "Mesh Layers: " + str(workspace.axisRange[3]))
  16. workspace.meshDensityValue.setStatusTip("Increment for a denser mesh in 3D plot")
  17. workspace.meshDensity = QSpinBox()
  18. workspace.meshDensity.setFixedSize(200, 30)
  19. workspace.meshDensity.setRange(10, 75)
  20. workspace.meshDensity.setValue(30)
  21. workspace.meshDensity.valueChanged.connect(lambda: valueChange(workspace))
  22. workspace.meshDensity.setStatusTip("Incrementing mesh density may affect performance")
  23. refreshPlotterText = QLabel("Apply plotter settings")
  24. refreshPlotter = QPushButton('Apply')
  25. refreshPlotter.setFixedSize(200, 30)
  26. refreshPlotter.clicked.connect(lambda: refreshPlot(workspace))
  27. refreshPlotter.setStatusTip("Apply modified settings to plotter.")
  28. axisPref = QSplitter(Qt.Vertical)
  29. axisPref.addWidget(workspace.xLimitValue)
  30. axisPref.addWidget(workspace.xLimitSlider)
  31. axisPref.addWidget(workspace.yLimitValue)
  32. axisPref.addWidget(workspace.yLimitSlider)
  33. axisPref.addWidget(workspace.zLimitValue)
  34. axisPref.addWidget(workspace.zLimitSlider)
  35. plotSetPref = QSplitter(Qt.Vertical)
  36. plotSetPref.addWidget(workspace.meshDensityValue)
  37. plotSetPref.addWidget(workspace.meshDensity)
  38. plotSetPref.addWidget(refreshPlotterText)
  39. plotSetPref.addWidget(refreshPlotter)
  40. prefLayout.addWidget(plotSetPref)
  41. prefLayout.addWidget(axisPref)
  42. prefLayout.setFixedWidth(400)
  43. return prefLayout