MachineSettingsExtruderTab.qml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. // Copyright (c) 2019 Ultimaker B.V.
  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 UM 1.3 as UM
  6. import Cura 1.1 as Cura
  7. //
  8. // This component contains the content for the "Welcome" page of the welcome on-boarding process.
  9. //
  10. Item
  11. {
  12. id: base
  13. UM.I18nCatalog { id: catalog; name: "cura" }
  14. anchors.left: parent.left
  15. anchors.right: parent.right
  16. anchors.top: parent.top
  17. property int labelWidth: 210 * screenScaleFactor
  18. property int controlWidth: (UM.Theme.getSize("setting_control").width * 3 / 4) | 0
  19. property var labelFont: UM.Theme.getFont("default")
  20. property int columnWidth: ((parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2) | 0
  21. property int columnSpacing: 3 * screenScaleFactor
  22. property int propertyStoreIndex: manager ? manager.storeContainerIndex : 1 // definition_changes
  23. property string extruderStackId: ""
  24. property int extruderPosition: 0
  25. property var forceUpdateFunction: manager.forceUpdate
  26. function updateMaterialDiameter()
  27. {
  28. manager.updateMaterialForDiameter(extruderPosition)
  29. }
  30. Item
  31. {
  32. id: upperBlock
  33. anchors.top: parent.top
  34. anchors.left: parent.left
  35. anchors.right: parent.right
  36. anchors.margins: UM.Theme.getSize("default_margin").width
  37. height: childrenRect.height
  38. // =======================================
  39. // Left-side column "Nozzle Settings"
  40. // =======================================
  41. Column
  42. {
  43. anchors.top: parent.top
  44. anchors.left: parent.left
  45. width: parent.width * 2 / 3
  46. spacing: base.columnSpacing
  47. Label // Title Label
  48. {
  49. text: catalog.i18nc("@title:label", "Nozzle Settings")
  50. font: UM.Theme.getFont("medium_bold")
  51. renderType: Text.NativeRendering
  52. }
  53. Cura.NumericTextFieldWithUnit // "Nozzle size"
  54. {
  55. id: extruderNozzleSizeField
  56. visible: !Cura.MachineManager.activeMachine.hasVariants
  57. containerStackId: base.extruderStackId
  58. settingKey: "machine_nozzle_size"
  59. settingStoreIndex: propertyStoreIndex
  60. labelText: catalog.i18nc("@label", "Nozzle size")
  61. labelFont: base.labelFont
  62. labelWidth: base.labelWidth
  63. controlWidth: base.controlWidth
  64. unitText: catalog.i18nc("@label", "mm")
  65. forceUpdateOnChangeFunction: forceUpdateFunction
  66. }
  67. Cura.NumericTextFieldWithUnit // "Compatible material diameter"
  68. {
  69. id: extruderCompatibleMaterialDiameterField
  70. containerStackId: base.extruderStackId
  71. settingKey: "material_diameter"
  72. settingStoreIndex: propertyStoreIndex
  73. labelText: catalog.i18nc("@label", "Compatible material diameter")
  74. labelFont: base.labelFont
  75. labelWidth: base.labelWidth
  76. controlWidth: base.controlWidth
  77. unitText: catalog.i18nc("@label", "mm")
  78. forceUpdateOnChangeFunction: forceUpdateFunction
  79. // Other modules won't automatically respond after the user changes the value, so we need to force it.
  80. afterOnEditingFinishedFunction: updateMaterialDiameter
  81. }
  82. Cura.NumericTextFieldWithUnit // "Nozzle offset X"
  83. {
  84. id: extruderNozzleOffsetXField
  85. containerStackId: base.extruderStackId
  86. settingKey: "machine_nozzle_offset_x"
  87. settingStoreIndex: propertyStoreIndex
  88. labelText: catalog.i18nc("@label", "Nozzle offset X")
  89. labelFont: base.labelFont
  90. labelWidth: base.labelWidth
  91. controlWidth: base.controlWidth
  92. unitText: catalog.i18nc("@label", "mm")
  93. minimum: Number.NEGATIVE_INFINITY
  94. forceUpdateOnChangeFunction: forceUpdateFunction
  95. }
  96. Cura.NumericTextFieldWithUnit // "Nozzle offset Y"
  97. {
  98. id: extruderNozzleOffsetYField
  99. containerStackId: base.extruderStackId
  100. settingKey: "machine_nozzle_offset_y"
  101. settingStoreIndex: propertyStoreIndex
  102. labelText: catalog.i18nc("@label", "Nozzle offset Y")
  103. labelFont: base.labelFont
  104. labelWidth: base.labelWidth
  105. controlWidth: base.controlWidth
  106. unitText: catalog.i18nc("@label", "mm")
  107. minimum: Number.NEGATIVE_INFINITY
  108. forceUpdateOnChangeFunction: forceUpdateFunction
  109. }
  110. Cura.NumericTextFieldWithUnit // "Cooling Fan Number"
  111. {
  112. id: extruderNozzleCoolingFanNumberField
  113. containerStackId: base.extruderStackId
  114. settingKey: "machine_extruder_cooling_fan_number"
  115. settingStoreIndex: propertyStoreIndex
  116. labelText: catalog.i18nc("@label", "Cooling Fan Number")
  117. labelFont: base.labelFont
  118. labelWidth: base.labelWidth
  119. controlWidth: base.controlWidth
  120. unitText: ""
  121. forceUpdateOnChangeFunction: forceUpdateFunction
  122. }
  123. }
  124. }
  125. Item // Extruder Start and End G-code
  126. {
  127. id: lowerBlock
  128. anchors.top: upperBlock.bottom
  129. anchors.bottom: parent.bottom
  130. anchors.left: parent.left
  131. anchors.right: parent.right
  132. anchors.margins: UM.Theme.getSize("default_margin").width
  133. Cura.GcodeTextArea // "Extruder Start G-code"
  134. {
  135. anchors.top: parent.top
  136. anchors.bottom: parent.bottom
  137. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  138. anchors.left: parent.left
  139. width: base.columnWidth - UM.Theme.getSize("default_margin").width
  140. labelText: catalog.i18nc("@title:label", "Extruder Start G-code")
  141. containerStackId: base.extruderStackId
  142. settingKey: "machine_extruder_start_code"
  143. settingStoreIndex: propertyStoreIndex
  144. }
  145. Cura.GcodeTextArea // "Extruder End G-code"
  146. {
  147. anchors.top: parent.top
  148. anchors.bottom: parent.bottom
  149. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  150. anchors.right: parent.right
  151. width: base.columnWidth - UM.Theme.getSize("default_margin").width
  152. labelText: catalog.i18nc("@title:label", "Extruder End G-code")
  153. containerStackId: base.extruderStackId
  154. settingKey: "machine_extruder_end_code"
  155. settingStoreIndex: propertyStoreIndex
  156. }
  157. }
  158. }