VersionUpgrade52to53.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. # Copyright (c) 2023 UltiMaker
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. import configparser
  4. from typing import Tuple, List
  5. import io
  6. from UM.VersionUpgrade import VersionUpgrade
  7. _REMOVED_SETTINGS = {
  8. "limit_support_retractions",
  9. "material_flow_dependent_temperature",
  10. }
  11. _RENAMED_PROFILES = {
  12. "um_s3_aa0.25_ABS_Normal_Quality": "um_s3_aa0.25_abs_0.1mm",
  13. "um_s3_aa0.25_CPE_Normal_Quality": "um_s3_aa0.25_cpe_0.1mm",
  14. "um_s3_aa0.25_Nylon_Normal_Quality": "um_s3_aa0.25_nylon_0.1mm",
  15. "um_s3_aa0.25_PC_Normal_Quality": "um_s3_aa0.25_pc_0.1mm",
  16. "um_s3_aa0.25_PETG_Normal_Quality": "um_s3_aa0.25_petg_0.1mm",
  17. "um_s3_aa0.25_PLA_Normal_Quality": "um_s3_aa0.25_pla_0.1mm",
  18. "um_s3_aa0.25_PP_Normal_Quality": "um_s3_aa0.25_pp_0.1mm",
  19. "um_s3_aa0.25_TPLA_Normal_Quality": "um_s3_aa0.25_tough-pla_0.1mm",
  20. "um_s3_aa0.4_ABS_Draft_Print": "um_s3_aa0.4_abs_0.2mm",
  21. "um_s3_aa0.4_ABS_Draft_Print_Quick": "um_s3_aa0.4_abs_0.2mm_quick",
  22. "um_s3_aa0.4_ABS_Fast_Print": "um_s3_aa0.4_abs_0.15mm",
  23. "um_s3_aa0.4_ABS_Fast_Print_Accurate": "um_s3_aa0.4_abs_0.15mm_engineering",
  24. "um_s3_aa0.4_ABS_Fast_Visual": "um_s3_aa0.4_abs_0.15mm_visual",
  25. "um_s3_aa0.4_ABS_High_Quality": "um_s3_aa0.4_abs_0.06mm",
  26. "um_s3_aa0.4_ABS_High_Visual": "um_s3_aa0.4_abs_0.06mm_visual",
  27. "um_s3_aa0.4_ABS_Normal_Quality": "um_s3_aa0.4_abs_0.1mm",
  28. "um_s3_aa0.4_ABS_Normal_Quality_Accurate": "um_s3_aa0.4_abs_0.1mm_engineering",
  29. "um_s3_aa0.4_ABS_Normal_Visual": "um_s3_aa0.4_abs_0.1mm_visual",
  30. "um_s3_aa0.4_BAM_Draft_Print": "um_s3_aa0.4_bam_0.2mm",
  31. "um_s3_aa0.4_BAM_Fast_Print": "um_s3_aa0.4_bam_0.15mm",
  32. "um_s3_aa0.4_BAM_Normal_Quality": "um_s3_aa0.4_bam_0.1mm",
  33. "um_s3_aa0.4_BAM_VeryDraft_Print": "um_s3_aa0.4_bam_0.3mm",
  34. "um_s3_aa0.4_CPE_Draft_Print": "um_s3_aa0.4_cpe_0.2mm",
  35. "um_s3_aa0.4_CPE_Fast_Print": "um_s3_aa0.4_cpe_0.15mm",
  36. "um_s3_aa0.4_CPE_Fast_Print_Accurate": "um_s3_aa0.4_cpe_0.15mm_engineering",
  37. "um_s3_aa0.4_CPE_High_Quality": "um_s3_aa0.4_cpe_0.06mm",
  38. "um_s3_aa0.4_CPE_Normal_Quality": "um_s3_aa0.4_cpe_0.1mm",
  39. "um_s3_aa0.4_CPE_Normal_Quality_Accurate": "um_s3_aa0.4_cpe_0.1mm_engineering",
  40. "um_s3_aa0.4_CPEP_Draft_Print": "um_s3_aa0.4_cpe-plus_0.2mm",
  41. "um_s3_aa0.4_CPEP_Fast_Print": "um_s3_aa0.4_cpe-plus_0.15mm",
  42. "um_s3_aa0.4_CPEP_Fast_Print_Accurate": "um_s3_aa0.4_cpe-plus_0.15mm_engineering",
  43. "um_s3_aa0.4_CPEP_High_Quality": "um_s3_aa0.4_cpe-plus_0.06mm",
  44. "um_s3_aa0.4_CPEP_Normal_Quality": "um_s3_aa0.4_cpe-plus_0.1mm",
  45. "um_s3_aa0.4_CPEP_Normal_Quality_Accurate": "um_s3_aa0.4_cpe-plus_0.1mm_engineering",
  46. "um_s3_aa0.4_Nylon_Draft_Print": "um_s3_aa0.4_nylon_0.2mm",
  47. "um_s3_aa0.4_Nylon_Fast_Print": "um_s3_aa0.4_nylon_0.15mm",
  48. "um_s3_aa0.4_Nylon_Fast_Print_Accurate": "um_s3_aa0.4_nylon_0.15mm_engineering",
  49. "um_s3_aa0.4_Nylon_High_Quality": "um_s3_aa0.4_nylon_0.06mm",
  50. "um_s3_aa0.4_Nylon_Normal_Quality": "um_s3_aa0.4_nylon_0.1mm",
  51. "um_s3_aa0.4_Nylon_Normal_Quality_Accurate": "um_s3_aa0.4_nylon_0.1mm_engineering",
  52. "um_s3_aa0.4_PC_Draft_Print": "um_s3_aa0.4_pc_0.2mm",
  53. "um_s3_aa0.4_PC_Fast_Print": "um_s3_aa0.4_pc_0.15mm",
  54. "um_s3_aa0.4_PC_Fast_Print_Accurate": "um_s3_aa0.4_pc_0.15mm_engineering",
  55. "um_s3_aa0.4_PC_High_Quality": "um_s3_aa0.4_pc_0.06mm",
  56. "um_s3_aa0.4_PC_Normal_Quality": "um_s3_aa0.4_pc_0.1mm",
  57. "um_s3_aa0.4_PC_Normal_Quality_Accurate": "um_s3_aa0.4_pc_0.1mm_engineering",
  58. "um_s3_aa0.4_PETG_Draft_Print": "um_s3_aa0.4_petg_0.2mm",
  59. "um_s3_aa0.4_PETG_Fast_Print": "um_s3_aa0.4_petg_0.15mm",
  60. "um_s3_aa0.4_PETG_Fast_Print_Accurate": "um_s3_aa0.4_petg_0.15mm_engineering",
  61. "um_s3_aa0.4_PETG_High_Quality": "um_s3_aa0.4_petg_0.06mm",
  62. "um_s3_aa0.4_PETG_Normal_Quality": "um_s3_aa0.4_petg_0.1mm",
  63. "um_s3_aa0.4_PETG_Normal_Quality_Accurate": "um_s3_aa0.4_petg_0.1mm_engineering",
  64. "um_s3_aa0.4_PLA_Draft_Print": "um_s3_aa0.4_pla_0.2mm",
  65. "um_s3_aa0.4_PLA_Draft_Print_Quick": "um_s3_aa0.4_pla_0.2mm_quick",
  66. "um_s3_aa0.4_PLA_Fast_Print": "um_s3_aa0.4_pla_0.15mm",
  67. "um_s3_aa0.4_PLA_Fast_Print_Accurate": "um_s3_aa0.4_pla_0.15mm_engineering",
  68. "um_s3_aa0.4_PLA_Fast_Visual": "um_s3_aa0.4_pla_0.15mm_visual",
  69. "um_s3_aa0.4_PLA_High_Quality": "um_s3_aa0.4_pla_0.06mm",
  70. "um_s3_aa0.4_PLA_High_Visual": "um_s3_aa0.4_pla_0.06mm_visual",
  71. "um_s3_aa0.4_PLA_Normal_Quality": "um_s3_aa0.4_pla_0.1mm",
  72. "um_s3_aa0.4_PLA_Normal_Quality_Accurate": "um_s3_aa0.4_pla_0.1mm_engineering",
  73. "um_s3_aa0.4_PLA_Normal_Visual": "um_s3_aa0.4_pla_0.1mm_visual",
  74. "um_s3_aa0.4_PLA_VeryDraft_Print": "um_s3_aa0.4_pla_0.3mm",
  75. "um_s3_aa0.4_PLA_VeryDraft_Print_Quick": "um_s3_aa0.4_pla_0.3mm_quick",
  76. "um_s3_aa0.4_PP_Draft_Print": "um_s3_aa0.4_pp_0.2mm",
  77. "um_s3_aa0.4_PP_Fast_Print": "um_s3_aa0.4_pp_0.15mm",
  78. "um_s3_aa0.4_PP_Normal_Quality": "um_s3_aa0.4_pp_0.1mm",
  79. "um_s3_aa0.4_TPLA_Draft_Print": "um_s3_aa0.4_tough-pla_0.2mm",
  80. "um_s3_aa0.4_TPLA_Draft_Print_Quick": "um_s3_aa0.4_tough-pla_0.2mm_quick",
  81. "um_s3_aa0.4_TPLA_Fast_Print": "um_s3_aa0.4_tough-pla_0.15mm",
  82. "um_s3_aa0.4_TPLA_Fast_Print_Accurate": "um_s3_aa0.4_tough-pla_0.15mm_engineering",
  83. "um_s3_aa0.4_TPLA_Fast_Visual": "um_s3_aa0.4_tough-pla_0.15mm_visual",
  84. "um_s3_aa0.4_TPLA_High_Quality": "um_s3_aa0.4_tough-pla_0.06mm",
  85. "um_s3_aa0.4_TPLA_High_Visual": "um_s3_aa0.4_tough-pla_0.06mm_visual",
  86. "um_s3_aa0.4_TPLA_Normal_Quality": "um_s3_aa0.4_tough-pla_0.1mm",
  87. "um_s3_aa0.4_TPLA_Normal_Quality_Accurate": "um_s3_aa0.4_tough-pla_0.1mm_engineering",
  88. "um_s3_aa0.4_TPLA_Normal_Visual": "um_s3_aa0.4_tough-pla_0.1mm_visual",
  89. "um_s3_aa0.4_TPLA_VeryDraft_Print": "um_s3_aa0.4_tough-pla_0.3mm",
  90. "um_s3_aa0.4_TPLA_VeryDraft_Print_Quick": "um_s3_aa0.4_tough-pla_0.3mm_quick",
  91. "um_s3_aa0.4_TPU_Draft_Print": "um_s3_aa0.4_tpu_0.2mm",
  92. "um_s3_aa0.4_TPU_Fast_Print": "um_s3_aa0.4_tpu_0.15mm",
  93. "um_s3_aa0.4_TPU_Normal_Quality": "um_s3_aa0.4_tpu_0.1mm",
  94. "um_s3_aa0.8_ABS_Draft_Print": "um_s3_aa0.8_abs_0.2mm",
  95. "um_s3_aa0.8_ABS_Superdraft_Print": "um_s3_aa0.8_abs_0.4mm",
  96. "um_s3_aa0.8_ABS_VeryDraft_Print": "um_s3_aa0.8_abs_0.3mm",
  97. "um_s3_aa0.8_CPE_Draft_Print": "um_s3_aa0.8_cpe_0.2mm",
  98. "um_s3_aa0.8_CPE_Superdraft_Print": "um_s3_aa0.8_cpe_0.4mm",
  99. "um_s3_aa0.8_CPE_VeryDraft_Print": "um_s3_aa0.8_cpe_0.3mm",
  100. "um_s3_aa0.8_CPEP_Fast_Print": "um_s3_aa0.8_cpe-plus_0.2mm",
  101. "um_s3_aa0.8_CPEP_Superdraft_Print": "um_s3_aa0.8_cpe-plus_0.4mm",
  102. "um_s3_aa0.8_CPEP_VeryDraft_Print": "um_s3_aa0.8_cpe-plus_0.3mm",
  103. "um_s3_aa0.8_Nylon_Draft_Print": "um_s3_aa0.8_nylon_0.2mm",
  104. "um_s3_aa0.8_Nylon_Superdraft_Print": "um_s3_aa0.8_nylon_0.4mm",
  105. "um_s3_aa0.8_Nylon_VeryDraft_Print": "um_s3_aa0.8_nylon_0.3mm",
  106. "um_s3_aa0.8_PC_Fast_Print": "um_s3_aa0.8_pc_0.2mm",
  107. "um_s3_aa0.8_PC_Superdraft_Print": "um_s3_aa0.8_pc_0.4mm",
  108. "um_s3_aa0.8_PC_VeryDraft_Print": "um_s3_aa0.8_pc_0.3mm",
  109. "um_s3_aa0.8_PETG_Draft_Print": "um_s3_aa0.8_petg_0.2mm",
  110. "um_s3_aa0.8_PETG_Superdraft_Print": "um_s3_aa0.8_petg_0.4mm",
  111. "um_s3_aa0.8_PETG_VeryDraft_Print": "um_s3_aa0.8_petg_0.3mm",
  112. "um_s3_aa0.8_PLA_Draft_Print": "um_s3_aa0.8_pla_0.2mm",
  113. "um_s3_aa0.8_PLA_Superdraft_Print": "um_s3_aa0.8_pla_0.4mm",
  114. "um_s3_aa0.8_PLA_VeryDraft_Print": "um_s3_aa0.8_pla_0.3mm",
  115. "um_s3_aa0.8_PP_Draft_Print": "um_s3_aa0.8_pp_0.2mm",
  116. "um_s3_aa0.8_PP_Superdraft_Print": "um_s3_aa0.8_pp_0.4mm",
  117. "um_s3_aa0.8_PP_VeryDraft_Print": "um_s3_aa0.8_pp_0.3mm",
  118. "um_s3_aa0.8_TPLA_Draft_Print": "um_s3_aa0.8_tough-pla_0.2mm",
  119. "um_s3_aa0.8_TPLA_Superdraft_Print": "um_s3_aa0.8_tough-pla_0.4mm",
  120. "um_s3_aa0.8_TPLA_VeryDraft_Print": "um_s3_aa0.8_tough-pla_0.3mm",
  121. "um_s3_aa0.8_TPU_Draft_Print": "um_s3_aa0.8_tpu_0.2mm",
  122. "um_s3_aa0.8_TPU_Superdraft_Print": "um_s3_aa0.8_tpu_0.4mm",
  123. "um_s3_aa0.8_TPU_VeryDraft_Print": "um_s3_aa0.8_tpu_0.3mm",
  124. "um_s3_bb0.4_PVA_Draft_Print": "um_s3_bb0.4_pva_0.2mm",
  125. "um_s3_bb0.4_PVA_Fast_Print": "um_s3_bb0.4_pva_0.15mm",
  126. "um_s3_bb0.4_PVA_High_Quality": "um_s3_bb0.4_pva_0.06mm",
  127. "um_s3_bb0.4_PVA_Normal_Quality": "um_s3_bb0.4_pva_0.1mm",
  128. "um_s3_bb0.4_PVA_VeryDraft_Print": "um_s3_bb0.4_pva_0.3mm",
  129. "um_s3_bb0.8_PVA_Draft_Print": "um_s3_bb0.8_pva_0.2mm",
  130. "um_s3_bb0.8_PVA_Superdraft_Print": "um_s3_bb0.8_pva_0.4mm",
  131. "um_s3_bb0.8_PVA_VeryDraft_Print": "um_s3_bb0.8_pva_0.3mm",
  132. "um_s3_cc0.4_CFFCPE_Draft_Print": "um_s3_cc0.4_cffcpe_0.2mm",
  133. "um_s3_cc0.4_CFFCPE_Fast_Print": "um_s3_cc0.4_cffcpe_0.15mm",
  134. "um_s3_cc0.4_CFFPA_Draft_Print": "um_s3_cc0.4_cffpa_0.2mm",
  135. "um_s3_cc0.4_CFFPA_Fast_Print": "um_s3_cc0.4_cffpa_0.15mm",
  136. "um_s3_cc0.4_GFFCPE_Draft_Print": "um_s3_cc0.4_gffcpe_0.2mm",
  137. "um_s3_cc0.4_GFFCPE_Fast_Print": "um_s3_cc0.4_gffcpe_0.15mm",
  138. "um_s3_cc0.4_GFFPA_Draft_Print": "um_s3_cc0.4_gffpa_0.2mm",
  139. "um_s3_cc0.4_GFFPA_Fast_Print": "um_s3_cc0.4_gffpa_0.15mm",
  140. "um_s3_cc0.4_PLA_Draft_Print": "um_s3_cc0.4_pla_0.2mm",
  141. "um_s3_cc0.4_PLA_Fast_Print": "um_s3_cc0.4_pla_0.15mm",
  142. "um_s3_cc0.6_CFFCPE_Draft_Print": "um_s3_cc0.6_cffcpe_0.2mm",
  143. "um_s3_cc0.6_CFFPA_Draft_Print": "um_s3_cc0.6_cffpa_0.2mm",
  144. "um_s3_cc0.6_GFFCPE_Draft_Print": "um_s3_cc0.6_gffcpe_0.2mm",
  145. "um_s3_cc0.6_GFFPA_Draft_Print": "um_s3_cc0.6_gffpa_0.2mm",
  146. "um_s3_cc0.6_PLA_Draft_Print": "um_s3_cc0.6_pla_0.2mm",
  147. "um_s3_cc0.6_PLA_Fast_Print": "um_s3_cc0.6_pla_0.15mm",
  148. "um_s5_aa0.25_ABS_Normal_Quality": "um_s5_aa0.25_abs_0.1mm",
  149. "um_s5_aa0.25_CPE_Normal_Quality": "um_s5_aa0.25_cpe_0.1mm",
  150. "um_s5_aa0.25_Nylon_Normal_Quality": "um_s5_aa0.25_nylon_0.1mm",
  151. "um_s5_aa0.25_PC_Normal_Quality": "um_s5_aa0.25_pc_0.1mm",
  152. "um_s5_aa0.25_PETG_Normal_Quality": "um_s5_aa0.25_petg_0.1mm",
  153. "um_s5_aa0.25_PLA_Normal_Quality": "um_s5_aa0.25_pla_0.1mm",
  154. "um_s5_aa0.25_PP_Normal_Quality": "um_s5_aa0.25_pp_0.1mm",
  155. "um_s5_aa0.25_TPLA_Normal_Quality": "um_s5_aa0.25_tough-pla_0.1mm",
  156. "um_s5_aa0.4_ABS_Draft_Print": "um_s5_aa0.4_abs_0.2mm",
  157. "um_s5_aa0.4_ABS_Draft_Print_Quick": "um_s5_aa0.4_abs_0.2mm_quick",
  158. "um_s5_aa0.4_ABS_Fast_Print": "um_s5_aa0.4_abs_0.15mm",
  159. "um_s5_aa0.4_ABS_Fast_Print_Accurate": "um_s5_aa0.4_abs_0.15mm_engineering",
  160. "um_s5_aa0.4_ABS_Fast_Visual": "um_s5_aa0.4_abs_0.15mm_visual",
  161. "um_s5_aa0.4_ABS_High_Quality": "um_s5_aa0.4_abs_0.06mm",
  162. "um_s5_aa0.4_ABS_High_Visual": "um_s5_aa0.4_abs_0.06mm_visual",
  163. "um_s5_aa0.4_ABS_Normal_Quality": "um_s5_aa0.4_abs_0.1mm",
  164. "um_s5_aa0.4_ABS_Normal_Quality_Accurate": "um_s5_aa0.4_abs_0.1mm_engineering",
  165. "um_s5_aa0.4_ABS_Normal_Visual": "um_s5_aa0.4_abs_0.1mm_visual",
  166. "um_s5_aa0.4_BAM_Draft_Print": "um_s5_aa0.4_bam_0.2mm",
  167. "um_s5_aa0.4_BAM_Fast_Print": "um_s5_aa0.4_bam_0.15mm",
  168. "um_s5_aa0.4_BAM_Normal_Quality": "um_s5_aa0.4_bam_0.1mm",
  169. "um_s5_aa0.4_BAM_VeryDraft_Print": "um_s5_aa0.4_bam_0.3mm",
  170. "um_s5_aa0.4_CPE_Draft_Print": "um_s5_aa0.4_cpe_0.2mm",
  171. "um_s5_aa0.4_CPE_Fast_Print": "um_s5_aa0.4_cpe_0.15mm",
  172. "um_s5_aa0.4_CPE_Fast_Print_Accurate": "um_s5_aa0.4_cpe_0.15mm_engineering",
  173. "um_s5_aa0.4_CPE_High_Quality": "um_s5_aa0.4_cpe_0.06mm",
  174. "um_s5_aa0.4_CPE_Normal_Quality": "um_s5_aa0.4_cpe_0.1mm",
  175. "um_s5_aa0.4_CPE_Normal_Quality_Accurate": "um_s5_aa0.4_cpe_0.1mm_engineering",
  176. "um_s5_aa0.4_CPEP_Draft_Print": "um_s5_aa0.4_cpe-plus_0.2mm",
  177. "um_s5_aa0.4_CPEP_Fast_Print": "um_s5_aa0.4_cpe-plus_0.15mm",
  178. "um_s5_aa0.4_CPEP_Fast_Print_Accurate": "um_s5_aa0.4_cpe-plus_0.15mm_engineering",
  179. "um_s5_aa0.4_CPEP_High_Quality": "um_s5_aa0.4_cpe-plus_0.06mm",
  180. "um_s5_aa0.4_CPEP_Normal_Quality": "um_s5_aa0.4_cpe-plus_0.1mm",
  181. "um_s5_aa0.4_CPEP_Normal_Quality_Accurate": "um_s5_aa0.4_cpe-plus_0.1mm_engineering",
  182. "um_s5_aa0.4_Nylon_Draft_Print": "um_s5_aa0.4_nylon_0.2mm",
  183. "um_s5_aa0.4_Nylon_Fast_Print": "um_s5_aa0.4_nylon_0.15mm",
  184. "um_s5_aa0.4_Nylon_Fast_Print_Accurate": "um_s5_aa0.4_nylon_0.15mm_engineering",
  185. "um_s5_aa0.4_Nylon_High_Quality": "um_s5_aa0.4_nylon_0.06mm",
  186. "um_s5_aa0.4_Nylon_Normal_Quality": "um_s5_aa0.4_nylon_0.1mm",
  187. "um_s5_aa0.4_Nylon_Normal_Quality_Accurate": "um_s5_aa0.4_nylon_0.1mm_engineering",
  188. "um_s5_aa0.4_PC_Draft_Print": "um_s5_aa0.4_pc_0.2mm",
  189. "um_s5_aa0.4_PC_Fast_Print": "um_s5_aa0.4_pc_0.15mm",
  190. "um_s5_aa0.4_PC_Fast_Print_Accurate": "um_s5_aa0.4_pc_0.15mm_engineering",
  191. "um_s5_aa0.4_PC_High_Quality": "um_s5_aa0.4_pc_0.06mm",
  192. "um_s5_aa0.4_PC_Normal_Quality": "um_s5_aa0.4_pc_0.1mm",
  193. "um_s5_aa0.4_PC_Normal_Quality_Accurate": "um_s5_aa0.4_pc_0.1mm_engineering",
  194. "um_s5_aa0.4_PETG_Draft_Print": "um_s5_aa0.4_petg_0.2mm",
  195. "um_s5_aa0.4_PETG_Fast_Print": "um_s5_aa0.4_petg_0.15mm",
  196. "um_s5_aa0.4_PETG_Fast_Print_Accurate": "um_s5_aa0.4_petg_0.15mm_engineering",
  197. "um_s5_aa0.4_PETG_High_Quality": "um_s5_aa0.4_petg_0.06mm",
  198. "um_s5_aa0.4_PETG_Normal_Quality": "um_s5_aa0.4_petg_0.1mm",
  199. "um_s5_aa0.4_PETG_Normal_Quality_Accurate": "um_s5_aa0.4_petg_0.1mm_engineering",
  200. "um_s5_aa0.4_PLA_Draft_Print": "um_s5_aa0.4_pla_0.2mm",
  201. "um_s5_aa0.4_PLA_Draft_Print_Quick": "um_s5_aa0.4_pla_0.2mm_quick",
  202. "um_s5_aa0.4_PLA_Fast_Print": "um_s5_aa0.4_pla_0.15mm",
  203. "um_s5_aa0.4_PLA_Fast_Print_Accurate": "um_s5_aa0.4_pla_0.15mm_engineering",
  204. "um_s5_aa0.4_PLA_Fast_Visual": "um_s5_aa0.4_pla_0.15mm_visual",
  205. "um_s5_aa0.4_PLA_High_Quality": "um_s5_aa0.4_pla_0.06mm",
  206. "um_s5_aa0.4_PLA_High_Visual": "um_s5_aa0.4_pla_0.06mm_visual",
  207. "um_s5_aa0.4_PLA_Normal_Quality": "um_s5_aa0.4_pla_0.1mm",
  208. "um_s5_aa0.4_PLA_Normal_Quality_Accurate": "um_s5_aa0.4_pla_0.1mm_engineering",
  209. "um_s5_aa0.4_PLA_Normal_Visual": "um_s5_aa0.4_pla_0.1mm_visual",
  210. "um_s5_aa0.4_PLA_VeryDraft_Print": "um_s5_aa0.4_pla_0.3mm",
  211. "um_s5_aa0.4_PLA_VeryDraft_Print_Quick": "um_s5_aa0.4_pla_0.3mm_quick",
  212. "um_s5_aa0.4_PP_Draft_Print": "um_s5_aa0.4_pp_0.2mm",
  213. "um_s5_aa0.4_PP_Fast_Print": "um_s5_aa0.4_pp_0.15mm",
  214. "um_s5_aa0.4_PP_Normal_Quality": "um_s5_aa0.4_pp_0.1mm",
  215. "um_s5_aa0.4_TPLA_Draft_Print": "um_s5_aa0.4_tough-pla_0.2mm",
  216. "um_s5_aa0.4_TPLA_Draft_Print_Quick": "um_s5_aa0.4_tough-pla_0.2mm_quick",
  217. "um_s5_aa0.4_TPLA_Fast_Print": "um_s5_aa0.4_tough-pla_0.15mm",
  218. "um_s5_aa0.4_TPLA_Fast_Print_Accurate": "um_s5_aa0.4_tough-pla_0.15mm_engineering",
  219. "um_s5_aa0.4_TPLA_Fast_Visual": "um_s5_aa0.4_tough-pla_0.15mm_visual",
  220. "um_s5_aa0.4_TPLA_High_Quality": "um_s5_aa0.4_tough-pla_0.06mm",
  221. "um_s5_aa0.4_TPLA_High_Visual": "um_s5_aa0.4_tough-pla_0.06mm_visual",
  222. "um_s5_aa0.4_TPLA_Normal_Quality": "um_s5_aa0.4_tough-pla_0.1mm",
  223. "um_s5_aa0.4_TPLA_Normal_Quality_Accurate": "um_s5_aa0.4_tough-pla_0.1mm_engineering",
  224. "um_s5_aa0.4_TPLA_Normal_Visual": "um_s5_aa0.4_tough-pla_0.1mm_visual",
  225. "um_s5_aa0.4_TPLA_VeryDraft_Print": "um_s5_aa0.4_tough-pla_0.3mm",
  226. "um_s5_aa0.4_TPLA_VeryDraft_Print_Quick": "um_s5_aa0.4_tough-pla_0.3mm_quick",
  227. "um_s5_aa0.4_TPU_Draft_Print": "um_s5_aa0.4_tpu_0.2mm",
  228. "um_s5_aa0.4_TPU_Fast_Print": "um_s5_aa0.4_tpu_0.15mm",
  229. "um_s5_aa0.4_TPU_Normal_Quality": "um_s5_aa0.4_tpu_0.1mm",
  230. "um_s5_aa0.8_ABS_Draft_Print": "um_s5_aa0.8_abs_0.2mm",
  231. "um_s5_aa0.8_ABS_Superdraft_Print": "um_s5_aa0.8_abs_0.4mm",
  232. "um_s5_aa0.8_ABS_VeryDraft_Print": "um_s5_aa0.8_abs_0.3mm",
  233. "um_s5_aa0.8_CPE_Draft_Print": "um_s5_aa0.8_cpe_0.2mm",
  234. "um_s5_aa0.8_CPE_Superdraft_Print": "um_s5_aa0.8_cpe_0.4mm",
  235. "um_s5_aa0.8_CPE_VeryDraft_Print": "um_s5_aa0.8_cpe_0.3mm",
  236. "um_s5_aa0.8_CPEP_Fast_Print": "um_s5_aa0.8_cpe-plus_0.2mm",
  237. "um_s5_aa0.8_CPEP_Superdraft_Print": "um_s5_aa0.8_cpe-plus_0.4mm",
  238. "um_s5_aa0.8_CPEP_VeryDraft_Print": "um_s5_aa0.8_cpe-plus_0.3mm",
  239. "um_s5_aa0.8_Nylon_Draft_Print": "um_s5_aa0.8_nylon_0.2mm",
  240. "um_s5_aa0.8_Nylon_Superdraft_Print": "um_s5_aa0.8_nylon_0.4mm",
  241. "um_s5_aa0.8_Nylon_VeryDraft_Print": "um_s5_aa0.8_nylon_0.3mm",
  242. "um_s5_aa0.8_PC_Fast_Print": "um_s5_aa0.8_pc_0.2mm",
  243. "um_s5_aa0.8_PC_Superdraft_Print": "um_s5_aa0.8_pc_0.4mm",
  244. "um_s5_aa0.8_PC_VeryDraft_Print": "um_s5_aa0.8_pc_0.3mm",
  245. "um_s5_aa0.8_PETG_Draft_Print": "um_s5_aa0.8_petg_0.2mm",
  246. "um_s5_aa0.8_PETG_Superdraft_Print": "um_s5_aa0.8_petg_0.4mm",
  247. "um_s5_aa0.8_PETG_VeryDraft_Print": "um_s5_aa0.8_petg_0.3mm",
  248. "um_s5_aa0.8_PLA_Draft_Print": "um_s5_aa0.8_pla_0.2mm",
  249. "um_s5_aa0.8_PLA_Superdraft_Print": "um_s5_aa0.8_pla_0.4mm",
  250. "um_s5_aa0.8_PLA_VeryDraft_Print": "um_s5_aa0.8_pla_0.3mm",
  251. "um_s5_aa0.8_PP_Draft_Print": "um_s5_aa0.8_pp_0.2mm",
  252. "um_s5_aa0.8_PP_Superdraft_Print": "um_s5_aa0.8_pp_0.4mm",
  253. "um_s5_aa0.8_PP_VeryDraft_Print": "um_s5_aa0.8_pp_0.3mm",
  254. "um_s5_aa0.8_TPLA_Draft_Print": "um_s5_aa0.8_tough-pla_0.2mm",
  255. "um_s5_aa0.8_TPLA_Superdraft_Print": "um_s5_aa0.8_tough-pla_0.4mm",
  256. "um_s5_aa0.8_TPLA_VeryDraft_Print": "um_s5_aa0.8_tough-pla_0.3mm",
  257. "um_s5_aa0.8_TPU_Draft_Print": "um_s5_aa0.8_tpu_0.2mm",
  258. "um_s5_aa0.8_TPU_Superdraft_Print": "um_s5_aa0.8_tpu_0.4mm",
  259. "um_s5_aa0.8_TPU_VeryDraft_Print": "um_s5_aa0.8_tpu_0.3mm",
  260. "um_s5_bb0.4_PVA_Draft_Print": "um_s5_bb0.4_pva_0.2mm",
  261. "um_s5_bb0.4_PVA_Fast_Print": "um_s5_bb0.4_pva_0.15mm",
  262. "um_s5_bb0.4_PVA_High_Quality": "um_s5_bb0.4_pva_0.06mm",
  263. "um_s5_bb0.4_PVA_Normal_Quality": "um_s5_bb0.4_pva_0.1mm",
  264. "um_s5_bb0.4_PVA_VeryDraft_Print": "um_s5_bb0.4_pva_0.3mm",
  265. "um_s5_bb0.8_PVA_Draft_Print": "um_s5_bb0.8_pva_0.2mm",
  266. "um_s5_bb0.8_PVA_Superdraft_Print": "um_s5_bb0.8_pva_0.4mm",
  267. "um_s5_bb0.8_PVA_VeryDraft_Print": "um_s5_bb0.8_pva_0.3mm",
  268. "um_s5_cc0.4_CFFCPE_Draft_Print": "um_s5_cc0.4_cffcpe_0.2mm",
  269. "um_s5_cc0.4_CFFCPE_Fast_Print": "um_s5_cc0.4_cffcpe_0.15mm",
  270. "um_s5_cc0.4_CFFPA_Draft_Print": "um_s5_cc0.4_cffpa_0.2mm",
  271. "um_s5_cc0.4_CFFPA_Fast_Print": "um_s5_cc0.4_cffpa_0.15mm",
  272. "um_s5_cc0.4_GFFCPE_Draft_Print": "um_s5_cc0.4_gffcpe_0.2mm",
  273. "um_s5_cc0.4_GFFCPE_Fast_Print": "um_s5_cc0.4_gffcpe_0.15mm",
  274. "um_s5_cc0.4_GFFPA_Draft_Print": "um_s5_cc0.4_gffpa_0.2mm",
  275. "um_s5_cc0.4_GFFPA_Fast_Print": "um_s5_cc0.4_gffpa_0.15mm",
  276. "um_s5_cc0.4_PLA_Draft_Print": "um_s5_cc0.4_pla_0.2mm",
  277. "um_s5_cc0.4_PLA_Fast_Print": "um_s5_cc0.4_pla_0.15mm",
  278. "um_s5_cc0.6_CFFCPE_Draft_Print": "um_s5_cc0.6_cffcpe_0.2mm",
  279. "um_s5_cc0.6_CFFPA_Draft_Print": "um_s5_cc0.6_cffpa_0.2mm",
  280. "um_s5_cc0.6_GFFCPE_Draft_Print": "um_s5_cc0.6_gffcpe_0.2mm",
  281. "um_s5_cc0.6_GFFPA_Draft_Print": "um_s5_cc0.6_gffpa_0.2mm",
  282. "um_s5_cc0.6_PLA_Draft_Print": "um_s5_cc0.6_pla_0.2mm",
  283. "um_s5_cc0.6_PLA_Fast_Print": "um_s5_cc0.6_pla_0.15mm"
  284. }
  285. class VersionUpgrade52to53(VersionUpgrade):
  286. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
  287. """
  288. Upgrades preferences to remove from the visibility list the settings that were removed in this version.
  289. It also changes the preferences to have the new version number.
  290. This removes any settings that were removed in the new Cura version.
  291. :param serialized: The original contents of the preferences file.
  292. :param filename: The file name of the preferences file.
  293. :return: A list of new file names, and a list of the new contents for
  294. those files.
  295. """
  296. parser = configparser.ConfigParser(interpolation = None)
  297. parser.read_string(serialized)
  298. # Update version number.
  299. parser["metadata"]["setting_version"] = "21"
  300. # Remove deleted settings from the visible settings list.
  301. if "general" in parser and "visible_settings" in parser["general"]:
  302. visible_settings = set(parser["general"]["visible_settings"].split(";"))
  303. for removed in _REMOVED_SETTINGS:
  304. if removed in visible_settings:
  305. visible_settings.remove(removed)
  306. parser["general"]["visible_settings"] = ";".join(visible_settings)
  307. result = io.StringIO()
  308. parser.write(result)
  309. return [filename], [result.getvalue()]
  310. def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
  311. """
  312. Upgrades instance containers to remove the settings that were removed in this version.
  313. It also changes the instance containers to have the new version number.
  314. This removes any settings that were removed in the new Cura version and updates settings that need to be updated
  315. with a new value.
  316. :param serialized: The original contents of the instance container.
  317. :param filename: The original file name of the instance container.
  318. :return: A list of new file names, and a list of the new contents for
  319. those files.
  320. """
  321. parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
  322. parser.read_string(serialized)
  323. # Update version number.
  324. parser["metadata"]["setting_version"] = "21"
  325. if "values" in parser:
  326. # Remove deleted settings from the instance containers.
  327. for removed in _REMOVED_SETTINGS:
  328. if removed in parser["values"]:
  329. del parser["values"][removed]
  330. result = io.StringIO()
  331. parser.write(result)
  332. return [filename], [result.getvalue()]
  333. def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
  334. """
  335. Upgrades stacks to have the new version number.
  336. :param serialized: The original contents of the stack.
  337. :param filename: The original file name of the stack.
  338. :return: A list of new file names, and a list of the new contents for
  339. those files.
  340. """
  341. parser = configparser.ConfigParser(interpolation = None)
  342. parser.read_string(serialized)
  343. # Update version number.
  344. if "metadata" not in parser:
  345. parser["metadata"] = {}
  346. parser["metadata"]["setting_version"] = "21"
  347. for container in parser['containers']:
  348. parser['containers'][container] = _RENAMED_PROFILES.get(parser['containers'][container], parser['containers'][container])
  349. result = io.StringIO()
  350. parser.write(result)
  351. return [filename], [result.getvalue()]