Release v0.1.0
Some checks failed
CI / Release (push) Has been cancelled
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 37s

This commit is contained in:
2025-12-04 13:18:17 +00:00
parent 64be5dacbf
commit ba2ab9d5d8
9 changed files with 433 additions and 333 deletions

View File

@@ -1,3 +1,3 @@
"""py_dvt_ate: Coupled Physics DVT Simulation Platform."""
__version__ = "0.1.0-beta.2"
__version__ = "0.1.0"

File diff suppressed because it is too large Load Diff

View File

@@ -57,17 +57,39 @@ class SimulationServer:
self._instrument_server: InstrumentServer | None = None
self._physics_task: asyncio.Task[None] | None = None
self._running = False
self._paused = False # Pause physics simulation
self._time_scale = 1.0 # Simulation time multiplier
@property
def is_running(self) -> bool:
"""Check if server is currently running."""
return self._running
@property
def paused(self) -> bool:
"""Check if physics simulation is paused."""
return self._paused
@paused.setter
def paused(self, value: bool) -> None:
"""Pause or resume the physics simulation."""
self._paused = value
@property
def physics_engine(self) -> PhysicsEngine | None:
"""Get the physics engine instance."""
return self._physics_engine
@property
def time_scale(self) -> float:
"""Get the current time scale multiplier."""
return self._time_scale
@time_scale.setter
def time_scale(self, value: float) -> None:
"""Set the time scale multiplier (e.g., 10.0 = 10x faster)."""
self._time_scale = max(0.1, min(value, 1000.0))
def _setup(self) -> None:
"""Create and wire up all components."""
# Create physics engine
@@ -101,8 +123,12 @@ class SimulationServer:
dt = self._physics_engine.dt
while self._running:
self._physics_engine.step()
# Sleep for the physics timestep
if not self._paused:
# Step physics multiple times based on time scale
steps_per_tick = max(1, int(self._time_scale))
for _ in range(steps_per_tick):
self._physics_engine.step()
# Sleep for the physics timestep (wall clock time)
await asyncio.sleep(dt)
async def start(self) -> None: