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

Update channels to last received with option for latest time #139

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

LeStarch
Copy link
Collaborator

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

Change Description

This adds a setting to control if the latest channel received (by order, or by timestamp) should be displayed.

Defaults to packet order, but users expecting out-of-order packets can adjust in the settings tab.

@LeStarch
Copy link
Collaborator Author

LeStarch commented Aug 18, 2023

Tested with:

+++ b/Drv/BlockDriver/BlockDriverImpl.cpp
@@ -2,6 +2,10 @@
 #include <FpConfig.hpp>
 #include <Fw/Types/Assert.hpp>
 
+
+bool well_fake = false;
+Fw::Time fake_time = Fw::Time();
+
 namespace Drv {
 
     BlockDriverImpl::BlockDriverImpl(const char* compName) :
@@ -24,8 +28,16 @@ namespace Drv {
         timer.take();
         // call output timing signal
         this->CycleOut_out(0,timer);
+
+        if (well_fake)
+            fake_time.set(fake_time.getSeconds() - 1, 0);
+        else {
+            well_fake = true;
+            fake_time = this->getTime();
+        }
+
         // increment cycles and write channel
-        this->tlmWrite_BD_Cycles(this->m_cycles);
+        this->tlmWrite_BD_Cycles(this->m_cycles, fake_time);
         this->m_cycles++;
     }
 

This causes the cycle count in block driver to count backwards. When checked, the backward channel updates. When unchecked, the update is not seen.

Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

LGTM

@LeStarch LeStarch merged commit 7a1b98c into nasa:devel Aug 23, 2023
12 checks passed
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.

None yet

2 participants