Python Yamcs Client
- General Client
- Mission Database
- TM/TC Processing
- Archive
- Link Management
- Object Storage
- File Transfer
- Time Correlation (TCO)
- Timeline
- Examples
- alarms.py
- archive_breakdown.py
- archive_retrieval.py
- authenticate.py
- ccsds_completeness.py
- commanding.py
- cop1.py
- file_transfer.py
- links.py
- events.py
- mission_time.py
- packet_subscription.py
- parameter_subscription.py
- plot_with_matplotlib.py
- query_mdb.py
- read_write_parameters.py
- reconnection.py
- timeline.py
- write_mdb.py
Related
Download this Document
mission_time.pyΒΆ
from time import sleep
from yamcs.client import YamcsClient
def callback(dt):
print("Mission time:", dt)
if __name__ == "__main__":
client = YamcsClient("localhost:8090")
subscription = client.create_time_subscription("simulator", callback)
sleep(6)
print("-----")
# You don't have to use the on_data callback. You could also
# directly retrieve the latest state from a local cache:
print("Last time from cache:", subscription.time)
# But then maybe you don't need a subscription, so do simply:
time = client.get_time("simulator")
print("Mission time (fresh from server)", time)