Frästisch mit elektronischer Höhenverstellung mittels Schrittmotoren.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

RouterSetup.h 3.0KB

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