freq_fff.as 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // quick settings brim
  2. float last_brim_val = 5;
  3. int s_brim_get()
  4. {
  5. float bw = get_float("brim_width");
  6. if (bw > 0) {
  7. last_brim_val = bw;
  8. return 1;
  9. }
  10. return 0;
  11. }
  12. void s_brim_set(bool new_val)
  13. {
  14. if(new_val) {
  15. float bw = get_float("brim_width");
  16. set_float("brim_width", last_brim_val);
  17. } else {
  18. set_float("brim_width", 0);
  19. }
  20. }
  21. // quick settings support
  22. int s_support_fff_get(string &out get_val)
  23. {
  24. bool support_material = get_bool("support_material");
  25. if (!support_material) { // None
  26. return 0;
  27. }
  28. bool support_material_auto = get_bool("support_material_auto");
  29. if (!support_material_auto) { // For support enforcers only
  30. return 2;
  31. }
  32. bool support_material_buildplate_only = get_bool("support_material_buildplate_only");
  33. if (support_material_buildplate_only) { // Support on build plate only
  34. return 1;
  35. }
  36. // everywhere
  37. return 3;
  38. }
  39. void s_support_fff_set(string &in new_val, int idx)
  40. {
  41. if(idx == 0) { // None
  42. back_initial_value("support_material_buildplate_only");
  43. back_initial_value("support_material_auto");
  44. set_bool("support_material", false);
  45. } else if(idx == 1) { // Support on build plate only
  46. set_bool("support_material_buildplate_only", true);
  47. set_bool("support_material_auto", true);
  48. set_bool("support_material", true);
  49. } else if(idx == 2) { // For support enforcers only
  50. set_bool("support_material_buildplate_only", false);
  51. set_bool("support_material_auto", false);
  52. set_bool("support_material", true);
  53. } else if(idx == 3) { // everywhere
  54. set_bool("support_material_buildplate_only", false);
  55. set_bool("support_material_auto", true);
  56. set_bool("support_material", true);
  57. }
  58. }
  59. // quick settings bed type (nematx)
  60. int s_bed_fff_get(string &out get_val)
  61. {
  62. int bed_temperature = get_int("bed_temperature");
  63. int fl_bed_temperature = get_int("first_layer_bed_temperature");
  64. if (bed_temperature == fl_bed_temperature) {
  65. if (bed_temperature == 130) {
  66. return 1; //glue
  67. }
  68. if (bed_temperature == 170) {
  69. return 2; //noglue
  70. }
  71. }
  72. return 0; // custom
  73. }
  74. void s_bed_fff_set(string &in new_val, int idx)
  75. {
  76. if(idx == 0) { // custom
  77. back_initial_value("bed_temperature");
  78. back_initial_value("first_layer_bed_temperature");
  79. } else if(idx == 1) { // glue
  80. set_int("bed_temperature", 130);
  81. set_int("first_layer_bed_temperature", 130);
  82. } else if(idx == 2) { // noglue
  83. set_int("bed_temperature", 170);
  84. set_int("first_layer_bed_temperature", 170);
  85. }
  86. }