RecommendedSupportSelector.qml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. UM.SettingPropertyProvider
  30. {
  31. id: supportExtruderProvider
  32. key: "support_extruder_nr"
  33. containerStack: Cura.MachineManager.activeMachine
  34. watchedProperties: [ "value" ]
  35. storeIndex: 0
  36. }
  37. contents: [
  38. RecommendedSettingItem
  39. {
  40. settingName: catalog.i18nc("@action:label", "Support Type")
  41. 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.")
  42. isCompressed: enableSupportRow.isCompressed
  43. settingControl: Cura.SingleSettingComboBox
  44. {
  45. id:support
  46. width: parent.width
  47. settingName: "support_structure"
  48. propertyRemoveUnusedValue: false
  49. updateAllExtruders: false
  50. defaultExtruderIndex: supportExtruderProvider.properties.value
  51. }
  52. },
  53. RecommendedSettingItem
  54. {
  55. Layout.preferredHeight: childrenRect.height
  56. settingName: catalog.i18nc("@action:label", "Print with")
  57. tooltipText: catalog.i18nc("@label", "The extruder train to use for printing the support. This is used in multi-extrusion.")
  58. // Hide this component when there is only one extruder
  59. enabled: Cura.ExtruderManager.enabledExtruderCount > 1
  60. visible: Cura.ExtruderManager.enabledExtruderCount > 1
  61. isCompressed: enableSupportRow.isCompressed || Cura.ExtruderManager.enabledExtruderCount <= 1
  62. settingControl: Cura.SingleSettingExtruderSelectorBar
  63. {
  64. extruderSettingName: "support_extruder_nr"
  65. onSelectedIndexChanged:
  66. {
  67. support.updateAllExtruders = true
  68. support.forceUpdateSettings()
  69. support.updateAllExtruders = false
  70. }
  71. }
  72. },
  73. RecommendedSettingItem
  74. {
  75. settingName: catalog.i18nc("@action:label", "Placement")
  76. 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.")
  77. isCompressed: enableSupportRow.isCompressed
  78. settingControl: Cura.SingleSettingComboBox
  79. {
  80. width: parent.width
  81. settingName: "support_type"
  82. updateAllExtruders: true
  83. defaultExtruderIndex: supportExtruderProvider.properties.value
  84. }
  85. }
  86. ]
  87. }