Skip to content
New issue

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

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

Already on GitHub? # to your account

Add timestamps to actuator target values #474

Conversation

lukasmittag
Copy link
Contributor

No description provided.

@lukasmittag lukasmittag force-pushed the databroker/add_targetvalue_timestamps branch from 7745c6f to b2211d1 Compare February 9, 2023 12:56
#[derive(Debug, Clone)]
pub struct Entry {
pub datapoint: Datapoint,
pub actuator_target: Option<DataValue>,
pub actuator_target: Option<ActuatorTarget>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't wrong. But the data type of actuator target is Datapoint (in the .proto file) so an alternative would be to just use Option<Datapoint>. I think that would make it easier to reuse the conversion functions already in place for Datapoint (and would make the data type less nested).

Copy link
Contributor Author

@lukasmittag lukasmittag Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I thought about this too. Would it make definetly less nested. Then I would suggest to rename the datapoint in value or something else because otherwise I think the naming can be confusing. Or value_datapoint and target_datapoint

Copy link
Contributor

@argerus argerus Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, not so sure about that.

I think the general terminology in VSS (and elsewhere) is to call "value + timestamp" a datapoint. See for example VISS, here and here.

Now. VSS doesn't have the concept of actuator targets, but if we want to introduce a new thing which is also a "value + timestamp", one way to look at it is that it also has the data type DataPoint.

I suppose you see it as more of a variable name. Both ways to look at it makes sense I think. The alternative is to just keep it as you have already done, or maybe make it a new type ActuatorTarget(Datapoint) instead.

Copy link
Contributor Author

@lukasmittag lukasmittag Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see the point about Option<Datapoint> for the target value too. I will change it to this and keep the actuator_target variable name. Should be enough to understand.

@lukasmittag lukasmittag force-pushed the databroker/add_targetvalue_timestamps branch from b2211d1 to b1d7cae Compare February 10, 2023 15:02
Copy link
Contributor

@argerus argerus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Rebase, and the build should succeed as well.

@lukasmittag lukasmittag force-pushed the databroker/add_targetvalue_timestamps branch from b1d7cae to 4c61bc9 Compare February 14, 2023 09:00
@SebastianSchildt SebastianSchildt merged commit 3c8dbb1 into eclipse:master Feb 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants