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

lestarch: add in ability to override telemetry time #713

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

LeStarch
Copy link
Collaborator

Originating Project/Creator OWLS
Affected Component Autocoder Template (Channels)
Affected Architectures(s)
Related Issue(s)
Has Unit Tests (y/n) n/a
Builds Without Errors (y/n) y
Unit Tests Pass (y/n) y
Documentation Included (y/n) n

Change Description

Some use cases for sending telemetry include overriding the "time" the telemetry was taken. This may have to do with hardware, a previously stored read, or the need to correlate across sample. This currently can only be done crudely by copying AC code into one's user code. This breaks the telemetry call into two polymorphic calls: one maintains current behavior and delegates internally to the second, which uses supplied time not calculated time.

Future Work

Is there sufficient use cases enough to add this to Events?

@LeStarch
Copy link
Collaborator Author

LeStarch commented Jun 15, 2021

Here is a diff of the autogenerated code:

CPP File:

   void PingReceiverComponentBase ::
     tlmWrite_PR_NumPings(U32 arg)
   {
+    Fw::Time _tlmTime;
+    if (this->m_Time_OutputPort[0].isConnected()) {
+       this->m_Time_OutputPort[0].invoke( _tlmTime);
+    }
+    this->tlmWrite_PR_NumPings(arg, _tlmTime);
+  }
 
+  void PingReceiverComponentBase ::
+    tlmWrite_PR_NumPings(U32 arg, Fw::Time& _tlmTime)
+  {
     if (this->m_Tlm_OutputPort[0].isConnected()) {
-      Fw::Time _tlmTime;
-      if (this->m_Time_OutputPort[0].isConnected()) {
-         this->m_Time_OutputPort[0].invoke( _tlmTime);
-      }

~~HPP File:~~~

     //! Write telemetry channel PR_NumPings
     //!
     /* Number of pings received */
     void tlmWrite_PR_NumPings(
         U32 arg /*!< The telemetry value*/
     );
+    void tlmWrite_PR_NumPings(
+        U32 arg /*!< The telemetry value*/,
+        Fw::Time& _tlmTime //!< Timestamp of telemetry override if needed
+    );

@LeStarch LeStarch force-pushed the update/override-time branch from 45c47f5 to 685ba0a Compare June 15, 2021 01:43
@LeStarch
Copy link
Collaborator Author

@bocchino, @timcanham I have gotten the code-size down to 7.35% more than a binary compiled without this feature. This is using a test-case of 10000+ telemetry items to ensure that the effect is significant.

If this is sufficient, I can push this solution and we can move forward.

@LeStarch LeStarch force-pushed the update/override-time branch from 685ba0a to b703bd0 Compare June 16, 2021 05:11
@bocchino
Copy link
Collaborator

This looks fine to me.

@timcanham
Copy link
Collaborator

Do you have the latest diff?

@LeStarch
Copy link
Collaborator Author

LeStarch commented Jun 16, 2021

@timcanham difference of autogenerated code (latest)

HPP File

     //!
     /* Type of the output signal: SINE, TRIANGLE, etc. */
     void tlmWrite_Type(
-        Ref::SignalType& arg /*!< The telemetry value*/
+        Ref::SignalType& arg /*!< The telemetry value*/,
+        Fw::Time _tlmTime=Fw::Time() /*!< Timestamp. Default: unspecified, request from getTime port*/
     );

CPP

   void SignalGenComponentBase ::
-    tlmWrite_Type(Ref::SignalType& arg)
+    tlmWrite_Type(Ref::SignalType& arg, Fw::Time _tlmTime)
   {
-
     if (this->m_tlmOut_OutputPort[0].isConnected()) {
-      Fw::Time _tlmTime;
-      if (this->m_timeCaller_OutputPort[0].isConnected()) {
+      if (this->m_timeCaller_OutputPort[0].isConnected() && _tlmTime ==  Fw::ZERO_TIME) {

@LeStarch LeStarch force-pushed the update/override-time branch from b703bd0 to 5ea2dab Compare June 16, 2021 19:44
@LeStarch LeStarch requested a review from timcanham June 19, 2021 20:59
@LeStarch
Copy link
Collaborator Author

@timcanham can you review this.

@LeStarch LeStarch merged commit 3065968 into nasa:devel Jun 21, 2021
@LeStarch LeStarch deleted the update/override-time branch September 2, 2021 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants