nanover.app.frame_app module

Module providing an implementation of an NanoVer frame-serving application, for publishing simulations and trajectories for consumption by clients.

class nanover.app.frame_app.NanoverFrameApplication(server: NanoverServer, discovery: DiscoveryServer | None = None, name: str | None = None)

Bases: NanoverApplicationServer

Application-level class for implementing a NanoVer frame server, something that publishes FrameData that can be consumed, e.g. simulation trajectories.

Example

>>> with NanoverFrameApplication.basic_server() as app:
...     frame_publisher = app.frame_publisher
...     example_frame = FrameData() # A simple frame representing two particles.
...     example_frame.particle_positions = [[0,0,0],[1,1,1]]
...     example_frame.particle_count = 2
...     frame_publisher.send_frame(0, example_frame)
DEFAULT_SERVER_NAME: str = 'NanoVer Frame Server'
close()

Close the application server and all services.

property frame_publisher: FramePublisher

The frame publisher attached to this application. Use it to publish frames for consumption by NanoVer frame clients.

Returns:

The FramePublisher attached to this application.