freq_sla.as 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // quick settings support
  2. int s_support_sla_get(string &out get_val)
  3. {
  4. bool supports_enable = get_bool("supports_enable");
  5. if (!supports_enable) { // None
  6. return 0;
  7. }
  8. bool support_buildplate_only = get_bool("support_buildplate_only");
  9. if (support_buildplate_only) { // Support on build plate only
  10. return 1;
  11. }
  12. // everywhere
  13. return 2;
  14. }
  15. void s_support_sla_set(string &in new_val, int idx)
  16. {
  17. if(idx == 0) { // None
  18. back_initial_value("support_buildplate_only");
  19. set_bool("supports_enable", false);
  20. } else if(idx == 1) { // Support on build plate only
  21. set_bool("support_buildplate_only", true);
  22. set_bool("supports_enable", true);
  23. } else { // everywhere
  24. set_bool("support_buildplate_only", false);
  25. set_bool("supports_enable", true);
  26. }
  27. }
  28. // quick settings pad
  29. int s_pad_get(string &out get_val)
  30. {
  31. bool pad_enable = get_bool("pad_enable");
  32. if (!pad_enable) { // None
  33. return 0;
  34. }
  35. bool pad_around_object = get_bool("pad_around_object");
  36. if (!pad_around_object) { // Below object
  37. return 1;
  38. }
  39. // Around object
  40. return 2;
  41. }
  42. void s_pad_set(string &in new_val, int idx)
  43. {
  44. if(idx == 0) { // None
  45. back_initial_value("pad_around_object");
  46. set_bool("pad_enable", false);
  47. } else if(idx == 1) { // Below object
  48. set_bool("pad_around_object", false);
  49. set_bool("pad_enable", true);
  50. } else { // Around object
  51. set_bool("pad_around_object", true);
  52. set_bool("pad_enable", true);
  53. }
  54. }