RecommendedSupportSelector.qml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Copyright (c) 2022 UltiMaker
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import QtQuick.Layouts 1.3
  6. import UM 1.5 as UM
  7. import Cura 1.7 as Cura
  8. RecommendedSettingSection
  9. {
  10. id: enableSupportRow
  11. title: catalog.i18nc("@label", "Support")
  12. icon: UM.Theme.getIcon("Support")
  13. enableSectionSwitchVisible: supportEnabled.properties.enabled == "True"
  14. enableSectionSwitchChecked: supportEnabled.properties.value == "True"
  15. enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled
  16. tooltipText: catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, these parts would collapse during printing.")
  17. function onEnableSectionChanged(state)
  18. {
  19. supportEnabled.setPropertyValue("value", state)
  20. }
  21. property UM.SettingPropertyProvider supportEnabled: UM.SettingPropertyProvider
  22. {
  23. id: supportEnabled
  24. containerStack: Cura.MachineManager.activeMachine
  25. key: "support_enable"
  26. watchedProperties: [ "value", "enabled", "description" ]
  27. storeIndex: 0
  28. }
  29. contents: [
  30. RecommendedSettingItem
  31. {
  32. settingName: catalog.i18nc("@action:label", "Support Type")
  33. tooltipText: catalog.i18nc("@label", "Chooses between the techniques available to generate support. \n\n\"Normal\" support creates a support structure directly below the overhanging parts and drops those areas straight down. \n\n\"Tree\" support creates branches towards the overhanging areas that support the model on the tips of those branches, and allows the branches to crawl around the model to support it from the build plate as much as possible.")
  34. isCompressed: enableSupportRow.isCompressed
  35. settingControl: Cura.SingleSettingComboBox
  36. {
  37. id:support
  38. width: parent.width
  39. settingName: "support_structure"
  40. propertyRemoveUnusedValue: false
  41. }
  42. },
  43. RecommendedSettingItem
  44. {
  45. Layout.preferredHeight: childrenRect.height
  46. settingName: catalog.i18nc("@action:label", "Print with")
  47. tooltipText: catalog.i18nc("@label", "The extruder train to use for printing the support. This is used in multi-extrusion.")
  48. // Hide this component when there is only one extruder
  49. enabled: Cura.ExtruderManager.enabledExtruderCount > 1
  50. visible: Cura.ExtruderManager.enabledExtruderCount > 1
  51. isCompressed: enableSupportRow.isCompressed || Cura.ExtruderManager.enabledExtruderCount <= 1
  52. settingControl: Cura.SingleSettingExtruderSelectorBar
  53. {
  54. extruderSettingName: "support_extruder_nr"
  55. onSelectedIndexChanged: support.forceUpdateSettings()
  56. }
  57. },
  58. RecommendedSettingItem
  59. {
  60. settingName: catalog.i18nc("@action:label", "Placement")
  61. tooltipText: catalog.i18nc("support_type description", "Adjusts the placement of the support structures. The placement can be set to touching build plate or everywhere. When set to everywhere the support structures will also be printed on the model.")
  62. isCompressed: enableSupportRow.isCompressed
  63. settingControl: Cura.SingleSettingComboBox
  64. {
  65. width: parent.width
  66. settingName: "support_type"
  67. }
  68. }
  69. ]
  70. }