Skip to content

Add FW_TIME_BASE_DEFAULT constant to dict#5401

Open
zimri-leisher wants to merge 1 commit into
nasa:develfrom
zimri-leisher:5400-time-base-default-dict-const
Open

Add FW_TIME_BASE_DEFAULT constant to dict#5401
zimri-leisher wants to merge 1 commit into
nasa:develfrom
zimri-leisher:5400-time-base-default-dict-const

Conversation

@zimri-leisher

Copy link
Copy Markdown
Collaborator
Related Issue(s) #5400
Has Unit Tests (y/n) n
Documentation Included (y/n) y
Generative AI was used in this contribution (y/n) n

Change Description

  • Add FW_TIME_BASE_DEFAULT constant to FPP and dictionary. Defaults to TB_WORKSTATION_TIME

Rationale

Allows ground data tools not to guess when choosing a default time base. Saves a decent bit of time for anyone who has to manually input times again and again. This was present in Fpy, users have to pass TB_WORKSTATION_TIME to the time() function again and again when constructing ISO 8601 dates.

AI Usage (see policy)

None

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report — base devel

Overall (line): 82.08% → 82.08% (+0.00)
Regression threshold: 0.50% (line).

Regressions

(none over threshold)

Modules changed

Module Line Δ Function Δ Branch Δ
Fw/DataStructures 98.30 +0.09 96.95 -0.19 83.03 +0.19
Os/Generic 89.29 +0.13 88.16 +0.00 73.11 +0.00
Os/Generic/Types 92.39 +0.36 92.86 +0.00 73.33 +0.95

Modules without UTs

CFDP/Checksum/GTest, Drv/ByteStreamDriverModel, Drv/Interfaces, Drv/LinuxGpioDriver, Drv/LinuxI2cDriver, Drv/LinuxSpiDriver, Drv/LinuxUartDriver, Drv/Ports, Drv/Ports/DataTypes, FppTestProject/FppTest/interfaces, FppTestProject/FppTest/topology/async, FppTestProject/FppTest/topology/components/Comp, FppTestProject/FppTest/topology/components/Framework, FppTestProject/FppTest/topology/components/Receiver, FppTestProject/FppTest/topology/components/Sender, FppTestProject/FppTest/topology/guarded, FppTestProject/FppTest/topology/ports, FppTestProject/FppTest/topology/sync, FppTestProject/FppTest/topology/top_ports, FppTestProject/FppTest/topology/types, Fw/Cmd, Fw/Com, Fw/Comp, Fw/FilePacket/GTest, Fw/Fpy, Fw/Interfaces, Fw/Obj, Fw/Port, Fw/Ports/CompletionStatus, Fw/Ports/Ready, Fw/Ports/Signal, Fw/Ports/SuccessCondition, Fw/Prm, Fw/SerializableFile/test/TestSerializable, Fw/Sm, Fw/Test, Fw/Types/GTest, Os/Models, Svc/Cycle, Svc/DpPorts, Svc/Fatal, Svc/FatalHandler, Svc/FileDownlinkPorts, Svc/FprimeProtocol, Svc/Interfaces, Svc/PassiveConsoleTextLogger, Svc/Ping, Svc/PolyIf, Svc/Ports/CommsPorts, Svc/Ports/FilePorts, Svc/Ports/OsTimeEpoch, Svc/Ports/TlmPacketizerPorts, Svc/Ports/VersionPorts, Svc/Sched, Svc/Seq, Svc/Subtopologies/CdhCore, Svc/Subtopologies/ComCcsds, Svc/Subtopologies/ComFprime, Svc/Subtopologies/ComLoggerTee, Svc/Subtopologies/DataProducts, Svc/Subtopologies/DpCompression, Svc/Subtopologies/FileHandling, Svc/Types/TlmPacketizerTypes, Svc/WatchDog, TestDeploymentsProject/Ref/PingReceiver, TestDeploymentsProject/Ref/RecvBuffApp, TestDeploymentsProject/Ref/SendBuffApp, TestDeploymentsProject/Ref/Top, TestDeploymentsProject/Ref/TypeDemo, cmake/test/data/TestDeployment/TestBuildAutocoder, cmake/test/data/TestDeployment/TestChainedAutocoder, cmake/test/data/TestDeployment/TestHeaderAutocoder, cmake/test/data/TestDeployment/TestTargetAutocoder, cmake/test/data/test-fprime-library/TestLibrary/TestComponent, cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent

@@ -94,3 +94,6 @@ dictionary enum TimeBase : FwTimeBaseStoreType {
TB_SC_TIME = 3, @< Time as reported by the spacecraft clock.
TB_DONT_CARE = 0xFFFF @< Don't care value for sequences. If FwTimeBaseStoreType is changed, value should be changed (Required)
} default TB_NONE;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we use the value as the actual default of the TimeBase enum?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I thought about this for a while. I decided against it, because I think they're doing two unrelated things. One is configuring what the default ground software option for TIME_BASE should be. The other is configuring what the default value should be when you construct this enum, and I just don't think those are necessarily the same thing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ah I see - I did not catch that nuance. thanks

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would be worth clarifying in the docstring not to confuse the next reader :D

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's fair, I can clarify that!

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.

2 participants