Frästisch mit elektronischer Höhenverstellung mittels Schrittmotoren.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RouterSetup.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * RouterSetup.h
  3. *
  4. * Created on: 25.01.2022
  5. * Author: FSmilari
  6. */
  7. #ifndef ROUTER_SETUP_H_
  8. #define ROUTER_SETUP_H_
  9. #include <stdint.h>
  10. #include <Preferences.h>
  11. #include <RotaryEncoder.h>
  12. #include "Display.h"
  13. const static char ROUTER_NAMESPACE[] = "routerelv_stp";
  14. const static char SPEED[] = "speed";
  15. const static char ACCELERATION[] = "acceleration";
  16. const static char STEPSPERREV[] = "stepsPerRev";
  17. const static char PITCH[] = "pitch";
  18. const static char TOOLLENGHTSNHT[] = "toolLenghtSnHt";
  19. const static char ENCSPEEDSLOW[] = "encSpeedSlow";
  20. const static char ENCSPEEDFAST[] = "encSpeedFast";
  21. const static char LVLHEIGHTDIVE[] = "lvlHeightDive";
  22. const static char TOOLCHGONPWRON[] = "toolChgOnPwrOn";
  23. const static String ConfigStep[9] = { "Geschw.", "Beschl.", "Schritte/U", "Steigung", "Höhe WLS", "SLOW", "FAST", "Ink. Eint.", "WzW P-ON" };
  24. class RouterSetup {
  25. private:
  26. Preferences eeprom;
  27. Display &display;
  28. float speed; // in revolutions/second (U/s)
  29. float accelleration; // in revolutions/second^2 (U/s^2)
  30. uint16_t stepsPerRev; // micro stepping: 200 400 800 1600 3200 6400
  31. float pitch; // in mm
  32. float toolLenghtSensorHeight; // in mm
  33. uint8_t encoderSpeedSlow; // in 1/100 mm
  34. uint8_t encoderSpeedFast; // in 1/100 mm
  35. float levelHeightDiving; // in mm
  36. bool toolChangeOnPowerOn; // Yes or No
  37. bool doInitialization;
  38. byte configStepIndex;
  39. String getCfgOptForStepIndex(byte configStepIndex);
  40. String getCfgOptUnitForStepIndex(byte configStepIndex);
  41. public:
  42. const static int eeprom_start_adress = 0;
  43. const static int eeprom_signatur = 1024;
  44. const static uint8_t version = 1;
  45. RouterSetup(Display &display);
  46. float getSpeed() const;
  47. void setSpeed(float speed);
  48. float getAcceleration() const;
  49. void setAcceleration(float accelleration);
  50. uint8_t getEncoderSpeedFast() const;
  51. void setEncoderSpeedFast(uint8_t encoderSpeedFast);
  52. uint8_t getEncoderSpeedSlow() const;
  53. void setEncoderSpeedSlow(uint8_t encoderSpeedSlow);
  54. float getLevelHeightDiving() const;
  55. void setLevelHeightDiving(float levelHeightDiving);
  56. float getPitch() const;
  57. void setPitch(float pitch);
  58. uint16_t getStepsPerRev() const;
  59. void setStepsPerRev(uint16_t stepsPerRev);
  60. float getToolLenghtSensorHeight() const;
  61. void setToolLenghtSensorHeight(float toolLenghtSensorHeight);
  62. bool isToolChangOnPowerOn() const;
  63. void setToolChangOnPowerOn(bool toolChangOnPowerOn);
  64. void clear();
  65. void readFromEEPROM();
  66. void saveToEEPROM();
  67. void initialize();
  68. void onRotaryControlerSwitch();
  69. void onRotaryControlerLongSwitch();
  70. void onRotaryControlerTurn(RotaryEncoder::Direction turn);
  71. void printValues();
  72. };
  73. #endif /* ROUTER_SETUP_H_ */