PrintSetupContent.qml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. import QtQuick 2.10
  2. import QtQuick.Controls 2.3
  3. import QtQuick.Layouts 1.3
  4. Column
  5. {
  6. spacing: UM.Theme.getSize("default_margin").height
  7. Row
  8. {
  9. width: parent.width
  10. spacing: UM.Theme.getSize("default_margin").height
  11. Column
  12. {
  13. width: settingsTabs.columnWidth
  14. spacing: UM.Theme.getSize("default_lining").height
  15. Label
  16. {
  17. text: catalog.i18nc("@label", "Printer Settings")
  18. font.bold: true
  19. renderType: Text.NativeRendering
  20. }
  21. Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
  22. Loader
  23. {
  24. id: buildAreaWidthField
  25. sourceComponent: numericTextFieldWithUnit
  26. property string settingKey: "machine_width"
  27. property string label: catalog.i18nc("@label", "X (Width)")
  28. property string unit: catalog.i18nc("@label", "mm")
  29. property bool forceUpdateOnChange: true
  30. }
  31. Loader
  32. {
  33. id: buildAreaDepthField
  34. sourceComponent: numericTextFieldWithUnit
  35. property string settingKey: "machine_depth"
  36. property string label: catalog.i18nc("@label", "Y (Depth)")
  37. property string unit: catalog.i18nc("@label", "mm")
  38. property bool forceUpdateOnChange: true
  39. }
  40. Loader
  41. {
  42. id: buildAreaHeightField
  43. sourceComponent: numericTextFieldWithUnit
  44. property string settingKey: "machine_height"
  45. property string label: catalog.i18nc("@label", "Z (Height)")
  46. property string unit: catalog.i18nc("@label", "mm")
  47. property bool forceUpdateOnChange: true
  48. }
  49. Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
  50. Loader
  51. {
  52. id: shapeComboBox
  53. sourceComponent: comboBoxWithOptions
  54. property string settingKey: "machine_shape"
  55. property string label: catalog.i18nc("@label", "Build plate shape")
  56. property bool forceUpdateOnChange: true
  57. }
  58. Loader
  59. {
  60. id: centerIsZeroCheckBox
  61. sourceComponent: simpleCheckBox
  62. property string settingKey: "machine_center_is_zero"
  63. property string label: catalog.i18nc("@option:check", "Origin at center")
  64. property bool forceUpdateOnChange: true
  65. }
  66. Loader
  67. {
  68. id: heatedBedCheckBox
  69. sourceComponent: simpleCheckBox
  70. property var settingKey: "machine_heated_bed"
  71. property string label: catalog.i18nc("@option:check", "Heated bed")
  72. property bool forceUpdateOnChange: true
  73. }
  74. Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
  75. Loader
  76. {
  77. id: gcodeFlavorComboBox
  78. sourceComponent: comboBoxWithOptions
  79. property string settingKey: "machine_gcode_flavor"
  80. property string label: catalog.i18nc("@label", "G-code flavor")
  81. property bool forceUpdateOnChange: true
  82. property var afterOnActivate: manager.updateHasMaterialsMetadata
  83. }
  84. }
  85. Column
  86. {
  87. width: settingsTabs.columnWidth
  88. spacing: UM.Theme.getSize("default_lining").height
  89. Label
  90. {
  91. text: catalog.i18nc("@label", "Printhead Settings")
  92. font.bold: true
  93. renderType: Text.NativeRendering
  94. }
  95. Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
  96. Loader
  97. {
  98. id: printheadXMinField
  99. sourceComponent: headPolygonTextField
  100. property string label: catalog.i18nc("@label", "X min")
  101. property string tooltip: catalog.i18nc("@tooltip", "Distance from the left of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
  102. property string axis: "x"
  103. property string side: "min"
  104. }
  105. Loader
  106. {
  107. id: printheadYMinField
  108. sourceComponent: headPolygonTextField
  109. property string label: catalog.i18nc("@label", "Y min")
  110. property string tooltip: catalog.i18nc("@tooltip", "Distance from the front of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
  111. property string axis: "y"
  112. property string side: "min"
  113. }
  114. Loader
  115. {
  116. id: printheadXMaxField
  117. sourceComponent: headPolygonTextField
  118. property string label: catalog.i18nc("@label", "X max")
  119. property string tooltip: catalog.i18nc("@tooltip", "Distance from the right of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
  120. property string axis: "x"
  121. property string side: "max"
  122. }
  123. Loader
  124. {
  125. id: printheadYMaxField
  126. sourceComponent: headPolygonTextField
  127. property string label: catalog.i18nc("@label", "Y max")
  128. property string tooltip: catalog.i18nc("@tooltip", "Distance from the rear of the printhead to the center of the nozzle. Used to prevent colissions between previous prints and the printhead when printing \"One at a Time\".")
  129. property string axis: "y"
  130. property string side: "max"
  131. }
  132. Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
  133. Loader
  134. {
  135. id: gantryHeightField
  136. sourceComponent: numericTextFieldWithUnit
  137. property string settingKey: "gantry_height"
  138. property string label: catalog.i18nc("@label", "Gantry height")
  139. property string unit: catalog.i18nc("@label", "mm")
  140. property string tooltip: catalog.i18nc("@tooltip", "The height difference between the tip of the nozzle and the gantry system (X and Y axes). Used to prevent collisions between previous prints and the gantry when printing \"One at a Time\".")
  141. property bool forceUpdateOnChange: true
  142. }
  143. Item { width: UM.Theme.getSize("default_margin").width; height: UM.Theme.getSize("default_margin").height }
  144. UM.TooltipArea
  145. {
  146. height: childrenRect.height
  147. width: childrenRect.width
  148. text: machineExtruderCountProvider.properties.description
  149. visible: extruderCountModel.count >= 2
  150. Row
  151. {
  152. spacing: UM.Theme.getSize("default_margin").width
  153. Label
  154. {
  155. anchors.verticalCenter: extruderCountComboBox.verticalCenter
  156. width: Math.max(0, settingsTabs.labelColumnWidth)
  157. text: catalog.i18nc("@label", "Number of Extruders")
  158. elide: Text.ElideRight
  159. renderType: Text.NativeRendering
  160. }
  161. ComboBox
  162. {
  163. id: extruderCountComboBox
  164. model: ListModel
  165. {
  166. id: extruderCountModel
  167. Component.onCompleted:
  168. {
  169. for(var i = 0; i < manager.definedExtruderCount; i++)
  170. {
  171. extruderCountModel.append({text: String(i + 1), value: i})
  172. }
  173. }
  174. }
  175. Connections
  176. {
  177. target: manager
  178. onDefinedExtruderCountChanged:
  179. {
  180. extruderCountModel.clear();
  181. for(var i = 0; i < manager.definedExtruderCount; ++i)
  182. {
  183. extruderCountModel.append({text: String(i + 1), value: i});
  184. }
  185. }
  186. }
  187. currentIndex: machineExtruderCountProvider.properties.value - 1
  188. onActivated:
  189. {
  190. manager.setMachineExtruderCount(index + 1);
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. Row
  198. {
  199. spacing: UM.Theme.getSize("default_margin").width
  200. anchors.left: parent.left
  201. anchors.right: parent.right
  202. height: parent.height - y
  203. Column
  204. {
  205. height: parent.height
  206. width: settingsTabs.columnWidth
  207. Label
  208. {
  209. text: catalog.i18nc("@label", "Start G-code")
  210. font.bold: true
  211. }
  212. Loader
  213. {
  214. id: machineStartGcodeField
  215. sourceComponent: gcodeTextArea
  216. property int areaWidth: parent.width
  217. property int areaHeight: parent.height - y
  218. property string settingKey: "machine_start_gcode"
  219. property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very start.")
  220. }
  221. }
  222. Column {
  223. height: parent.height
  224. width: settingsTabs.columnWidth
  225. Label
  226. {
  227. text: catalog.i18nc("@label", "End G-code")
  228. font.bold: true
  229. }
  230. Loader
  231. {
  232. id: machineEndGcodeField
  233. sourceComponent: gcodeTextArea
  234. property int areaWidth: parent.width
  235. property int areaHeight: parent.height - y
  236. property string settingKey: "machine_end_gcode"
  237. property string tooltip: catalog.i18nc("@tooltip", "G-code commands to be executed at the very end.")
  238. }
  239. }
  240. }
  241. }