initial structure implemented

docs -> _docs
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-12-01 14:20:56 +02:00
parent 9134c5db06
commit abc26d5c20
360 changed files with 3881 additions and 101 deletions
+5
View File
@@ -0,0 +1,5 @@
from .base import FlightDatabaseBase
from .flight_database import FlightDatabase
__all__ = ["FlightDatabaseBase", "FlightDatabase"]
+70
View File
@@ -0,0 +1,70 @@
from abc import ABC, abstractmethod
from typing import Optional
from models.flight import Flight, FlightState, Waypoint
from models.results import FrameResult
from models.chunks import ChunkHandle
from models.core import Pose
class FlightDatabaseBase(ABC):
@abstractmethod
async def create_flight(self, flight: Flight) -> str:
pass
@abstractmethod
async def get_flight(self, flight_id: str) -> Optional[Flight]:
pass
@abstractmethod
async def delete_flight(self, flight_id: str) -> bool:
pass
@abstractmethod
async def update_flight_state(self, state: FlightState) -> bool:
pass
@abstractmethod
async def get_flight_state(self, flight_id: str) -> Optional[FlightState]:
pass
@abstractmethod
async def save_frame_result(self, flight_id: str, result: FrameResult) -> bool:
pass
@abstractmethod
async def get_frame_result(
self, flight_id: str, frame_id: int
) -> Optional[FrameResult]:
pass
@abstractmethod
async def get_all_frame_results(self, flight_id: str) -> list[FrameResult]:
pass
@abstractmethod
async def save_chunk(self, chunk: ChunkHandle) -> bool:
pass
@abstractmethod
async def get_chunk(self, chunk_id: str) -> Optional[ChunkHandle]:
pass
@abstractmethod
async def get_flight_chunks(self, flight_id: str) -> list[ChunkHandle]:
pass
@abstractmethod
async def save_pose(self, flight_id: str, pose: Pose) -> bool:
pass
@abstractmethod
async def get_poses(self, flight_id: str) -> list[Pose]:
pass
@abstractmethod
async def update_waypoints(
self, flight_id: str, waypoints: list[Waypoint]
) -> bool:
pass
@@ -0,0 +1,56 @@
from typing import Optional
from .base import FlightDatabaseBase
from models.flight import Flight, FlightState, Waypoint
from models.results import FrameResult
from models.chunks import ChunkHandle
from models.core import Pose
class FlightDatabase(FlightDatabaseBase):
async def create_flight(self, flight: Flight) -> str:
raise NotImplementedError
async def get_flight(self, flight_id: str) -> Optional[Flight]:
raise NotImplementedError
async def delete_flight(self, flight_id: str) -> bool:
raise NotImplementedError
async def update_flight_state(self, state: FlightState) -> bool:
raise NotImplementedError
async def get_flight_state(self, flight_id: str) -> Optional[FlightState]:
raise NotImplementedError
async def save_frame_result(self, flight_id: str, result: FrameResult) -> bool:
raise NotImplementedError
async def get_frame_result(
self, flight_id: str, frame_id: int
) -> Optional[FrameResult]:
raise NotImplementedError
async def get_all_frame_results(self, flight_id: str) -> list[FrameResult]:
raise NotImplementedError
async def save_chunk(self, chunk: ChunkHandle) -> bool:
raise NotImplementedError
async def get_chunk(self, chunk_id: str) -> Optional[ChunkHandle]:
raise NotImplementedError
async def get_flight_chunks(self, flight_id: str) -> list[ChunkHandle]:
raise NotImplementedError
async def save_pose(self, flight_id: str, pose: Pose) -> bool:
raise NotImplementedError
async def get_poses(self, flight_id: str) -> list[Pose]:
raise NotImplementedError
async def update_waypoints(
self, flight_id: str, waypoints: list[Waypoint]
) -> bool:
raise NotImplementedError