RecommendedSupportSelector.qml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. width: parent.width
  38. settingName: "support_structure"
  39. }
  40. },
  41. RecommendedSettingItem
  42. {
  43. Layout.preferredHeight: childrenRect.height
  44. settingName: catalog.i18nc("@action:label", "Print with")
  45. tooltipText: catalog.i18nc("@label", "The extruder train to use for printing the support. This is used in multi-extrusion.")
  46. // Hide this component when there is only one extruder
  47. enabled: Cura.ExtruderManager.enabledExtruderCount > 1
  48. visible: Cura.ExtruderManager.enabledExtruderCount > 1
  49. isCompressed: enableSupportRow.isCompressed || Cura.ExtruderManager.enabledExtruderCount <= 1
  50. settingControl: Cura.SingleSettingExtruderSelectorBar
  51. {
  52. extruderSettingName: "support_extruder_nr"
  53. }
  54. },
  55. RecommendedSettingItem
  56. {
  57. settingName: catalog.i18nc("@action:label", "Placement")
  58. 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.")
  59. isCompressed: enableSupportRow.isCompressed
  60. settingControl: Cura.SingleSettingComboBox
  61. {
  62. width: parent.width
  63. settingName: "support_type"
  64. }
  65. }
  66. ]
  67. }