TestContent.qml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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. import "../MachineSettings"
  8. //
  9. // This component contains the content for the "Welcome" page of the welcome on-boarding process.
  10. //
  11. Item
  12. {
  13. id: base
  14. UM.I18nCatalog { id: catalog; name: "cura" }
  15. anchors.left: parent.left
  16. anchors.right: parent.right
  17. anchors.top: parent.top
  18. property int labelWidth: 130
  19. property int controlWidth: UM.Theme.getSize("setting_control").width * 3 / 4
  20. property var labelFont: UM.Theme.getFont("medium")
  21. property int columnWidth: (parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2
  22. property int columnSpacing: 10
  23. property int propertyStoreIndex: 5 // definition_changes
  24. Item
  25. {
  26. id: upperBlock
  27. anchors.top: parent.top
  28. anchors.left: parent.left
  29. anchors.right: parent.right
  30. anchors.margins: UM.Theme.getSize("default_margin").width
  31. height: childrenRect.height
  32. // =======================================
  33. // Left-side column for "Printer Settings"
  34. // =======================================
  35. Column
  36. {
  37. anchors.top: parent.top
  38. anchors.left: parent.left
  39. width: base.columnWidth
  40. spacing: base.columnSpacing
  41. Label // Title Label
  42. {
  43. text: catalog.i18nc("@title:label", "Printer Settings")
  44. font: UM.Theme.getFont("medium_bold")
  45. renderType: Text.NativeRendering
  46. }
  47. NumericTextFieldWithUnit // "X (Width)"
  48. {
  49. id: machineXWidthField
  50. containerStackId: Cura.MachineManager.activeMachineId
  51. settingKey: "machine_width"
  52. settingStoreIndex: propertyStoreIndex
  53. labelText: catalog.i18nc("@label", "X (Width)")
  54. labelFont: base.labelFont
  55. labelWidth: base.labelWidth
  56. controlWidth: base.controlWidth
  57. unitText: catalog.i18nc("@label", "mm")
  58. // TODO: add forceUpdateOnChangeFunction:
  59. }
  60. NumericTextFieldWithUnit // "Y (Depth)"
  61. {
  62. id: machineYDepthField
  63. containerStackId: Cura.MachineManager.activeMachineId
  64. settingKey: "machine_depth"
  65. settingStoreIndex: propertyStoreIndex
  66. labelText: catalog.i18nc("@label", "Y (Depth)")
  67. labelFont: base.labelFont
  68. labelWidth: base.labelWidth
  69. controlWidth: base.controlWidth
  70. unitText: catalog.i18nc("@label", "mm")
  71. // TODO: add forceUpdateOnChangeFunction:
  72. }
  73. NumericTextFieldWithUnit // "Z (Height)"
  74. {
  75. id: machineZHeightField
  76. containerStackId: Cura.MachineManager.activeMachineId
  77. settingKey: "machine_height"
  78. settingStoreIndex: propertyStoreIndex
  79. labelText: catalog.i18nc("@label", "Z (Height)")
  80. labelFont: base.labelFont
  81. labelWidth: base.labelWidth
  82. controlWidth: base.controlWidth
  83. unitText: catalog.i18nc("@label", "mm")
  84. // TODO: add forceUpdateOnChangeFunction:
  85. }
  86. ComboBoxWithOptions // "Build plate shape"
  87. {
  88. id: buildPlateShapeComboBox
  89. containerStackId: Cura.MachineManager.activeMachineId
  90. settingKey: "machine_shape"
  91. settingStoreIndex: propertyStoreIndex
  92. labelText: catalog.i18nc("@label", "Build plate shape")
  93. labelFont: base.labelFont
  94. labelWidth: base.labelWidth
  95. controlWidth: base.controlWidth
  96. // TODO: add forceUpdateOnChangeFunction:
  97. }
  98. SimpleCheckBox // "Origin at center"
  99. {
  100. id: originAtCenterCheckBox
  101. containerStackId: Cura.MachineManager.activeMachineId
  102. settingKey: "machine_center_is_zero"
  103. settingStoreIndex: propertyStoreIndex
  104. labelText: catalog.i18nc("@label", "Origin at center")
  105. labelFont: base.labelFont
  106. labelWidth: base.labelWidth
  107. // TODO: add forceUpdateOnChangeFunction:
  108. }
  109. SimpleCheckBox // "Heated bed"
  110. {
  111. id: heatedBedCheckBox
  112. containerStackId: Cura.MachineManager.activeMachineId
  113. settingKey: "machine_heated_bed"
  114. settingStoreIndex: propertyStoreIndex
  115. labelText: catalog.i18nc("@label", "Heated bed")
  116. labelFont: base.labelFont
  117. labelWidth: base.labelWidth
  118. // TODO: add forceUpdateOnChangeFunction:
  119. }
  120. ComboBoxWithOptions // "G-code flavor"
  121. {
  122. id: gcodeFlavorComboBox
  123. containerStackId: Cura.MachineManager.activeMachineId
  124. settingKey: "machine_gcode_flavor"
  125. settingStoreIndex: propertyStoreIndex
  126. labelText: catalog.i18nc("@label", "G-code flavor")
  127. labelFont: base.labelFont
  128. labelWidth: base.labelWidth
  129. controlWidth: base.controlWidth
  130. // TODO: add forceUpdateOnChangeFunction:
  131. // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata
  132. }
  133. }
  134. // =======================================
  135. // Right-side column for "Printhead Settings"
  136. // =======================================
  137. Column
  138. {
  139. anchors.top: parent.top
  140. anchors.right: parent.right
  141. width: base.columnWidth
  142. spacing: base.columnSpacing
  143. Label // Title Label
  144. {
  145. text: catalog.i18nc("@title:label", "Printhead Settings")
  146. font: UM.Theme.getFont("medium_bold")
  147. renderType: Text.NativeRendering
  148. }
  149. PrintHeadMinMaxTextField // "X min"
  150. {
  151. id: machineXMinField
  152. settingStoreIndex: propertyStoreIndex
  153. labelText: catalog.i18nc("@label", "X min")
  154. labelFont: base.labelFont
  155. labelWidth: base.labelWidth
  156. controlWidth: base.controlWidth
  157. unitText: catalog.i18nc("@label", "mm")
  158. axisName: "x"
  159. axisMinOrMax: "min"
  160. // TODO: add forceUpdateOnChangeFunction:
  161. }
  162. PrintHeadMinMaxTextField // "Y min"
  163. {
  164. id: machineYMinField
  165. settingStoreIndex: propertyStoreIndex
  166. labelText: catalog.i18nc("@label", "Y min")
  167. labelFont: base.labelFont
  168. labelWidth: base.labelWidth
  169. controlWidth: base.controlWidth
  170. unitText: catalog.i18nc("@label", "mm")
  171. axisName: "y"
  172. axisMinOrMax: "min"
  173. // TODO: add forceUpdateOnChangeFunction:
  174. }
  175. PrintHeadMinMaxTextField // "X max"
  176. {
  177. id: machineXMaxField
  178. settingStoreIndex: propertyStoreIndex
  179. labelText: catalog.i18nc("@label", "X max")
  180. labelFont: base.labelFont
  181. labelWidth: base.labelWidth
  182. controlWidth: base.controlWidth
  183. unitText: catalog.i18nc("@label", "mm")
  184. axisName: "x"
  185. axisMinOrMax: "max"
  186. // TODO: add forceUpdateOnChangeFunction:
  187. }
  188. PrintHeadMinMaxTextField // "Y max"
  189. {
  190. id: machineYMaxField
  191. containerStackId: Cura.MachineManager.activeMachineId
  192. settingKey: "machine_head_with_fans_polygon"
  193. settingStoreIndex: propertyStoreIndex
  194. labelText: catalog.i18nc("@label", "Y max")
  195. labelFont: base.labelFont
  196. labelWidth: base.labelWidth
  197. controlWidth: base.controlWidth
  198. unitText: catalog.i18nc("@label", "mm")
  199. axisName: "y"
  200. axisMinOrMax: "max"
  201. // TODO: add forceUpdateOnChangeFunction:
  202. }
  203. NumericTextFieldWithUnit // "Gantry Height"
  204. {
  205. id: machineGantryHeightField
  206. containerStackId: Cura.MachineManager.activeMachineId
  207. settingKey: "gantry_height"
  208. settingStoreIndex: propertyStoreIndex
  209. labelText: catalog.i18nc("@label", "Gantry Height")
  210. labelFont: base.labelFont
  211. labelWidth: base.labelWidth
  212. controlWidth: base.controlWidth
  213. unitText: catalog.i18nc("@label", "mm")
  214. // TODO: add forceUpdateOnChangeFunction:
  215. }
  216. ComboBoxWithOptions // "Number of Extruders"
  217. {
  218. id: numberOfExtrudersComboBox
  219. containerStackId: Cura.MachineManager.activeMachineId
  220. settingKey: "machine_extruder_count"
  221. settingStoreIndex: propertyStoreIndex
  222. labelText: catalog.i18nc("@label", "Number of Extruders")
  223. labelFont: base.labelFont
  224. labelWidth: base.labelWidth
  225. controlWidth: base.controlWidth
  226. // TODO: add forceUpdateOnChangeFunction:
  227. // TODO: add afterOnActivate: manager.updateHasMaterialsMetadata
  228. optionModel: ListModel
  229. {
  230. id: extruderCountModel
  231. Component.onCompleted:
  232. {
  233. extruderCountModel.clear()
  234. for (var i = 1; i <= Cura.MachineManager.activeMachine.maxExtruderCount; i++)
  235. {
  236. extruderCountModel.append({text: String(i), value: i})
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. Item // Start and End G-code
  244. {
  245. id: lowerBlock
  246. anchors.top: upperBlock.bottom
  247. anchors.bottom: parent.bottom
  248. anchors.left: parent.left
  249. anchors.right: parent.right
  250. anchors.margins: UM.Theme.getSize("default_margin").width
  251. GcodeTextArea // "Start G-code"
  252. {
  253. anchors.top: parent.top
  254. anchors.bottom: parent.bottom
  255. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  256. anchors.left: parent.left
  257. width: base.columnWidth - UM.Theme.getSize("default_margin").width
  258. labelText: catalog.i18nc("@title:label", "Start G-code")
  259. containerStackId: Cura.MachineManager.activeMachineId
  260. settingKey: "machine_start_gcode"
  261. settingStoreIndex: propertyStoreIndex
  262. }
  263. GcodeTextArea // "End G-code"
  264. {
  265. anchors.top: parent.top
  266. anchors.bottom: parent.bottom
  267. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  268. anchors.right: parent.right
  269. width: base.columnWidth - UM.Theme.getSize("default_margin").width
  270. labelText: catalog.i18nc("@title:label", "End G-code")
  271. containerStackId: Cura.MachineManager.activeMachineId
  272. settingKey: "machine_end_gcode"
  273. settingStoreIndex: propertyStoreIndex
  274. }
  275. }
  276. }