Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specification of generation time when writing parameters #18

Closed
merose opened this issue Jan 31, 2022 · 1 comment
Closed

Allow specification of generation time when writing parameters #18

merose opened this issue Jan 31, 2022 · 1 comment

Comments

@merose
Copy link

merose commented Jan 31, 2022

This is related to the Yamcs enhancement in yamcs/yamcs#605.

It is currently possible to specify the generation time when writing parameters using the batchSetParameterValues API. The corresponding Python API should also support an optional argument to specify the generation time.

@fqqb
Copy link
Member

fqqb commented Mar 2, 2022

Addressed as of v1.7.6

Example usage:

from datetime import datetime, timezone
from yamcs.tmtc.model import ValueUpdate

gentime = datetime.now(tz=timezone.utc)

# Example 1
processor.set_parameter_value("/some/parameter", 123, generation_time=gentime)
processor.set_parameter_value("/some/other/parameter", 456, generation_time=gentime)

# Example 2
processor.set_parameter_values({
    "/some/parameter": 123,
    "/some/other/parameter": 456
}, generation_time=gentime)

# Example 3
processor.set_parameter_values({
    "/some/parameter": ValueUpdate(123, generation_time=gentime),
    "/some/other/parameter": ValueUpdate(456, generation_time=gentime)
})

Works also for set_parameter_value because it gets redirected to set_parameter_values (thinking to get rid of the non-batch HTTP method on Yamcs).

@fqqb fqqb closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants