mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 02:56:38 +00:00
initial structure implemented
docs -> _docs
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from .base import FlightDatabaseBase
|
||||
from .flight_database import FlightDatabase
|
||||
|
||||
__all__ = ["FlightDatabaseBase", "FlightDatabase"]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user