From 23aaa890d5d30d5dba5f642a17ed7ef5bf22d7d9 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Thu, 3 Feb 2022 10:43:01 +0100 Subject: [PATCH] begin a refactor --- doc/Diagrams/classdiagramm.uxf | 96 ++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 17 deletions(-) diff --git a/doc/Diagrams/classdiagramm.uxf b/doc/Diagrams/classdiagramm.uxf index aa34dcf..19ccf23 100644 --- a/doc/Diagrams/classdiagramm.uxf +++ b/doc/Diagrams/classdiagramm.uxf @@ -1,25 +1,36 @@ -10UMLClass3500220510<<hardware>> +10UMLClass75010220650<<hardware>> MotorControl -- -- name: String -- debug: DebugMqtt* -- target_power: int8_t = 0 -- power: int8_t = 0 -- direction: uint8_t = 0 -- last_millis: uint64_t = 0; +- target_power: int8_t +- power: int8_t +- direction: uint8_t + + - pwm_pin: uint8_t - pwm_channel: uint8_t -- direction_pin_1: uint8_t -- direction_pin_2: uint8_t +- pwm_res: uint8_t +- dutycycle_min: uint8_t +- dutycycle_max: uint8_t +- direction_1: uint8_t +- direction_2: uint8_t +- delay: uint8_t +- powersteps: uint8_t + +- last_millis: uint32_t -- + MotorControl() + init(pwm_pin: uint8_t, -    pwm_channel: uint8_t, -    direction_1: uint8_t, -   direction_2: uint8_t, -    name: String) +   pwm_channel: uint8_t, +   dir_1: uint8_t, dir_2: uint8_t) ++ loop(): uint16_t + runMotorControl() -+ setTargetPower(power: int8_t) + ++ setMinPwm(uint8_t) ++ setMaxPwm(uint8_t) ++ setPowerSteps(uint8_t): uint16_t ++ setTargetPower(uint8_t) ++ setDelay(uint8_t): uint16_t + + stop() + emergencyStop() + toString() @@ -28,8 +39,11 @@ MotorControl + isTargetPowerReached(): bool + isAccelerationPositive(): bool + isAccelerationNegative(): bool + - setRealPower(power: int8_t) -- increasePower(power: int8_t)UMLClass80380220330<<hardware>> +- increasePower(power: int8_t) + +UMLClass80380220330<<hardware>> Speedometer -- - encoder: ESP32Encoder @@ -72,7 +86,7 @@ Speedometer + setSpeed(speed: double) + setRotationspeed(speed: double) - calcWheelSpeed() -- regulateMotors()UMLClass5800220330<<driveModi>> +- regulateMotors()UMLClass37010220330<<driveModi>> ManualControl -- - encoder: ESP32Encoder @@ -92,4 +106,52 @@ ManualControl + getSpeed(): double + getDirection(): uint8_t - addValToBuf(val: int16_t) -- getAverage(): int16_t \ No newline at end of file +- getAverage(): int16_tUMLClass127010210240MenuControl +-- +# parentMenu: MenuControl* +# lcd: LiquidCrystal_I2C* +-- +/+down()/ +/+up()/ +/+right()/ +/+left()/ +/+yes()/ +/+no()/ + +/+update()/ +/+printMenu()/ + ++ setParentMenu(MenuControl*) ++ setLcd(LiquidCrystal_I2C*)UMLClass98010280270MenuAction +-- +- name: char* + +- *function: void +- *callback: void + +- isMenu: bool +- menu: MenuControl +-- ++ MenuAction(const char*, (*function), (*callback)) ++ MenuAction(const char*, (*function)) ++ MenuAction(const char*, MenuControl* menu) + ++ runAction() + ++ getName(): const char* ++ getIsMenu(): bool ++ getMenu(): MenuControl* +UMLClass1220360280160Menu +-- +- inSubmenu: bool + +- entrys: list<MenuAction*> +- selectedEntry: list<MenuAction*>::iterator + +- isMenu: bool +- menu: MenuControl +-- ++ addEntry(MenuAction* entry) +Relation135024030140lt=<<-10;10;10;120Relation1080270160190lt=- +m1=* +m2=0..110;10;10;160;140;160 \ No newline at end of file