migrate to package

This commit is contained in:
Siwat Sirichai 2022-10-30 13:29:32 +07:00
parent 3d5a084b47
commit 50fc6dda3f
16 changed files with 52 additions and 7 deletions

14
app.py
View File

@ -1,13 +1,13 @@
from telemetrix_rpi_pico import telemetrix_rpi_pico
import kuukar_leds
import kuukar_collision
import kuukar_motion
import kuukar_lcd
import kuukar_sensors
import kuukar_environment
import kuukar.kuukar_leds as kuukar_leds
import kuukar.kuukar_collision as kuukar_collision
import kuukar.kuukar_motion as kuukar_motion
import kuukar.kuukar_lcd as kuukar_lcd
import kuukar.kuukar_sensors as kuukar_sensors
import kuukar.kuukar_environment as kuukar_environment
from flask import Flask, request
from kuukar_config import SERIAL_AUX_BOARD, SERIAL_DRIVER_BOARD
from kuukar.kuukar_config import SERIAL_AUX_BOARD, SERIAL_DRIVER_BOARD
app = Flask(__name__)

13
classes.dot Normal file
View File

@ -0,0 +1,13 @@
digraph "classes" {
rankdir=BT
charset="utf-8"
"kuukar.kuukar_collision.collision" [color="aliceblue", fontcolor="black", label="{collision|aux : TelemetrixRpiPico\llcd\lleds\l|collision_handle(data)\l}", shape="record", style="filled"];
"kuukar.kuukar_cv.cv" [color="aliceblue", fontcolor="black", label="{cv|lcd\lleds\l|capture_image()\ldetect_face(image)\lhandle_face_detected()\l}", shape="record", style="filled"];
"kuukar.kuukar_environment.environment" [color="aliceblue", fontcolor="black", label="{environment|h_alerted : bool\lh_alerted : bool\llcd\lleds\lsensors\lt_alerted : bool\lt_alerted : bool\l|}", shape="record", style="filled"];
"kuukar.kuukar_lcd.lcd" [color="aliceblue", fontcolor="black", label="{lcd|nextion\l|pause_video(): None\lplay_video(filename: str): None\lresume_video(): None\lstop_video(): None\l}", shape="record", style="filled"];
"kuukar.kuukar_leds.leds" [color="aliceblue", fontcolor="black", label="{leds|ambient_light : list\lambient_light : list\laux_board : TelemetrixRpiPico\lflashing : bool\lflashing : bool\lheadlight : bool\lleft_signal : bool\lleft_signal : bool\lreverse_signal : bool\lreverse_signal : bool\lright_signal : bool\lright_signal : bool\lstart_time\lstart_time\l|flash(r: int, g: int, b: int, duration: int)\lset_ambient_led(r: int, g: int, b: int)\lset_headlights(state: bool)\lset_left_signal_led(state: bool)\lset_reverse_led(state: bool)\lset_right_signal_led(state: bool)\l}", shape="record", style="filled"];
"kuukar.kuukar_motion.motion" [color="aliceblue", fontcolor="black", label="{motion|driver : TelemetrixRpiPico\lleds\lroam_thread : Thread\lroaming : bool\lroaming : bool\lsensors\l|drive(speed: int)\lmotor_write(forward_pin: int, reverse_pin: int, speed: int)\lroam_start()\lroam_stop()\lstop()\lturn(speed: int, duration: float)\l}", shape="record", style="filled"];
"kuukar.kuukar_nextion.nextion" [color="aliceblue", fontcolor="black", label="{nextion|allow_serial_read : bool\ldevice : Serial\l|get_attribute(attribute: str)\lhandle_serial(data: list)\lhandle_touch_event(data: list)\lhex_string_list_to_bytes(hexstring_list: list): bytes\llittle_endian_to_int(data: list): int\lread_serial(): list\lreset_device()\lsend_command(command: str)\l}", shape="record", style="filled"];
"kuukar.kuukar_sensors.sensors" [color="aliceblue", fontcolor="black", label="{sensors|aux : TelemetrixRpiPico\ldriver : TelemetrixRpiPico\l|get_brightness_pct(): float\lget_humidity_pct(): float\lget_temperature(): float\lsonar_get_distance(id: int): float\l}", shape="record", style="filled"];
"kuukar.kuukar_voice.voice" [color="aliceblue", fontcolor="black", label="{voice|lcd\lleds\l|handle_voice_prompt(command)\l}", shape="record", style="filled"];
}

BIN
classes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

0
kuukar/__init__.py Normal file
View File

32
packages.dot Normal file
View File

@ -0,0 +1,32 @@
digraph "packages" {
rankdir=BT
charset="utf-8"
"kuukar" [color="aliceblue", label="kuukar", shape="box", style="filled"];
"kuukar.kuukar_collision" [color="aliceblue", label="kuukar.kuukar_collision", shape="box", style="filled"];
"kuukar.kuukar_config" [color="aliceblue", label="kuukar.kuukar_config", shape="box", style="filled"];
"kuukar.kuukar_cv" [color="aliceblue", label="kuukar.kuukar_cv", shape="box", style="filled"];
"kuukar.kuukar_environment" [color="aliceblue", label="kuukar.kuukar_environment", shape="box", style="filled"];
"kuukar.kuukar_lcd" [color="aliceblue", label="kuukar.kuukar_lcd", shape="box", style="filled"];
"kuukar.kuukar_leds" [color="aliceblue", label="kuukar.kuukar_leds", shape="box", style="filled"];
"kuukar.kuukar_motion" [color="aliceblue", label="kuukar.kuukar_motion", shape="box", style="filled"];
"kuukar.kuukar_nextion" [color="aliceblue", label="kuukar.kuukar_nextion", shape="box", style="filled"];
"kuukar.kuukar_sensors" [color="aliceblue", label="kuukar.kuukar_sensors", shape="box", style="filled"];
"kuukar.kuukar_voice" [color="aliceblue", label="kuukar.kuukar_voice", shape="box", style="filled"];
"kuukar.kuukar_collision" -> "kuukar.kuukar_config" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_collision" -> "kuukar.kuukar_lcd" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_collision" -> "kuukar.kuukar_leds" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_cv" -> "kuukar.kuukar_lcd" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_cv" -> "kuukar.kuukar_leds" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_environment" -> "kuukar.kuukar_lcd" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_environment" -> "kuukar.kuukar_leds" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_environment" -> "kuukar.kuukar_sensors" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_lcd" -> "kuukar.kuukar_nextion" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_leds" -> "kuukar.kuukar_config" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_motion" -> "kuukar.kuukar_config" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_motion" -> "kuukar.kuukar_leds" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_motion" -> "kuukar.kuukar_sensors" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_nextion" -> "kuukar.kuukar_config" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_sensors" -> "kuukar.kuukar_config" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_voice" -> "kuukar.kuukar_lcd" [arrowhead="open", arrowtail="none"];
"kuukar.kuukar_voice" -> "kuukar.kuukar_leds" [arrowhead="open", arrowtail="none"];
}

BIN
packages.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB