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

Add Svc.Version component #2747

Merged
merged 44 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2a5dba3
2604: SDD in Progress
Shivaly-Reddy Mar 28, 2024
2e67154
2604: Fixed bug in version
Shivaly-Reddy Apr 10, 2024
27a58bc
Merge branch 'nasa:devel' into devel
Shivaly-Reddy Apr 17, 2024
2156618
Merge branch 'nasa:devel' into devel
Shivaly-Reddy Apr 22, 2024
25ede54
2604: Updates to user defined versions
Shivaly-Reddy Apr 24, 2024
8d30c55
FP-2604: Updates to Version module and UTs
Shivaly-Reddy May 10, 2024
3638982
Merging from the forked
Shivaly-Reddy May 10, 2024
6160ed2
Merge branch 'devel' into FP-2604
Shivaly-Reddy May 10, 2024
d1c48ca
FP-2604 : Updates based on changes made by Thomas to version.hpp
Shivaly-Reddy May 10, 2024
5d50140
FP-2604: Updates to Version based on conversations with Tim and Michael
Shivaly-Reddy May 21, 2024
9b1cd59
FP-2604: Updates to UTs and respective code changes
Shivaly-Reddy May 24, 2024
68860c9
FP-2604: Updates based on review comments
Shivaly-Reddy May 28, 2024
77c7b49
FP-2604: Minor updates based on pull request auto comments
Shivaly-Reddy May 28, 2024
3b177af
FP-2604: Updates to Ref to integrate versions config and include chan…
Shivaly-Reddy May 29, 2024
06df65d
FP-2604 : Update function call in UTs for config to match standards
Shivaly-Reddy May 29, 2024
2e4b8e7
FP-2604: Remove commented out lines so the python formatter passes in…
Shivaly-Reddy May 29, 2024
6229411
FP-2604: Fixing python formatting issues
Shivaly-Reddy May 29, 2024
7fcff5f
FP-2604: Updates to code based on peer review comments
Shivaly-Reddy Jun 4, 2024
b2eac8f
FP-2604: Format *.cpp files, create new Ports dir in Svc
Shivaly-Reddy Jun 5, 2024
4e78ca5
FP-2604: Update spell check errors
Shivaly-Reddy Jun 5, 2024
d420c18
FP-2604: Check spell error fixes
Shivaly-Reddy Jun 5, 2024
3d84138
FP-2604: Update spell check errors
Shivaly-Reddy Jun 5, 2024
8174258
FP-2604: Validated argument for version_types
Shivaly-Reddy Jun 5, 2024
3a5a366
Merge branch 'nasa:devel' into devel
Shivaly-Reddy Jun 5, 2024
ed36afb
FP-2604: Don't think this will make a difference with the CI errors s…
Shivaly-Reddy Jun 5, 2024
4176008
Merge branch 'devel' into FP-2604
Shivaly-Reddy Jun 5, 2024
8252982
FP-2604: Updates to Version based on updates to Fw::StringBase
Shivaly-Reddy Jun 5, 2024
364fc26
FP-2604: Fixing the memory allocation error for autocoded versions files
Shivaly-Reddy Jun 11, 2024
ccf88a9
Merge branch 'nasa:devel' into devel
Shivaly-Reddy Jun 11, 2024
afabdbd
Merge branch 'devel' into FP-2604
Shivaly-Reddy Jun 11, 2024
d8effea
FP-2604: Fixed target name in version.cmake so ref/top/topology make …
Shivaly-Reddy Jun 11, 2024
83f6f76
FP-2604: python file formatting error fix
Shivaly-Reddy Jun 11, 2024
acc3367
FP-2604: version python script formatting
Shivaly-Reddy Jun 11, 2024
0528ee4
FP-2604: Trial/error format fixes on python script
Shivaly-Reddy Jun 11, 2024
f80da30
FP-2604: Reformatted python script
Shivaly-Reddy Jun 12, 2024
a0c6bed
FP-2604: Updates to fix CI/linux errors
Shivaly-Reddy Jun 12, 2024
a8c506c
FP-2604: Add UT version for version.cpp
Shivaly-Reddy Jun 12, 2024
ab83a41
FP-2604: Formatting and styling updates
Shivaly-Reddy Jun 13, 2024
0e61c22
Delete Svc/Version/test/ut/VersionTesterHelpers.cpp
LeStarch Jun 13, 2024
d43dc24
Deleting dead code in test
LeStarch Jun 13, 2024
0ad1828
Removing blanks in SDD
LeStarch Jun 13, 2024
dd5af24
Removing parameter ports (unused)
LeStarch Jun 13, 2024
f8f0f16
FP-2604: Updates to versions based on peer review comments and code s…
Shivaly-Reddy Jul 9, 2024
bb65216
FP-2604: Formatting fixes
Shivaly-Reddy Jul 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ setschedpolicy
setstacksize
settime
settype
setversion
sev
sface
sfregoso
Expand Down Expand Up @@ -979,6 +980,7 @@ spidev
srandom
srange
SRCS
sreddy
sss
Ssymbols
STAMEM
Expand Down
58 changes: 58 additions & 0 deletions Ref/Top/RefPackets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,64 @@
<channel name="dpBufferManager.NoBuffs"/>
<channel name="dpBufferManager.EmptyBuffs"/>
</packet>

<packet name="Version1" id="22" level="2">
<channel name="version.FrameworkVersion"/>
<channel name="version.ProjectVersion"/>
</packet>

<packet name="Version_Library1" id="23" level="2">
<channel name="version.LibraryVersion01"/>
<channel name="version.LibraryVersion02"/>
</packet>
<packet name="Version_Library2" id="24" level="2">
<channel name="version.LibraryVersion03"/>
<channel name="version.LibraryVersion04"/>
</packet>
<packet name="Version_Library3" id="25" level="2">
<channel name="version.LibraryVersion05"/>
<channel name="version.LibraryVersion06"/>
</packet>
<packet name="Version_Library4" id="26" level="2">
<channel name="version.LibraryVersion07"/>
<channel name="version.LibraryVersion08"/>
</packet>
<packet name="Version_Library5" id="27" level="2">
<channel name="version.LibraryVersion09"/>
<channel name="version.LibraryVersion10"/>
</packet>

<packet name="Version_Custom1" id="28" level="2">
thomas-bc marked this conversation as resolved.
Show resolved Hide resolved
<channel name="version.CustomVersion01"/>
</packet>
<packet name="Version_Custom2" id="29" level="2">
<channel name="version.CustomVersion02"/>
</packet>
<packet name="Version_Custom3" id="30" level="2">
<channel name="version.CustomVersion03"/>
</packet>
<packet name="Version_Custom4" id="31" level="2">
<channel name="version.CustomVersion04"/>
</packet>
<packet name="Version_Custom5" id="32" level="2">
<channel name="version.CustomVersion05"/>
</packet>
<packet name="Version_Custom6" id="33" level="2">
<channel name="version.CustomVersion06"/>
</packet>
<packet name="Version_Custom7" id="34" level="2">
<channel name="version.CustomVersion07"/>
</packet>
<packet name="Version_Custom8" id="35" level="2">
<channel name="version.CustomVersion08"/>
</packet>
<packet name="Version_Custom9" id="36" level="2">
<channel name="version.CustomVersion09"/>
</packet>
<packet name="Version_Custom10" id="37" level="2">
<channel name="version.CustomVersion10"/>
</packet>



<!-- Ignored packets -->
Expand Down
2 changes: 2 additions & 0 deletions Ref/Top/RefTopology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ void setupTopology(const TopologyState& state) {
loadParameters();
// Autocoded task kick-off (active components). Function provided by autocoder.
startTasks(state);
// Startup TLM and Config verbosity for Versions
version.config(true);
Comment on lines +159 to +160
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can/should this be moved inside configureTopology() ?

// Initialize socket client communication if and only if there is a valid specification
if (state.hostname != nullptr && state.port != 0) {
Os::TaskString name("ReceiveTask");
Expand Down
4 changes: 4 additions & 0 deletions Ref/Top/instances.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ module Ref {

instance sendBuffComp: Ref.SendBuff base id 0x2600 \
queue size Default.QUEUE_SIZE



# ----------------------------------------------------------------------
# Passive component instances
Expand Down Expand Up @@ -161,5 +163,7 @@ module Ref {
instance systemResources: Svc.SystemResources base id 0x4B00

instance dpBufferManager: Svc.BufferManager base id 0x4C00

instance version: Svc.Version base id 0x4D00

}
1 change: 1 addition & 0 deletions Ref/Top/topology.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module Ref {
instance dpMgr
instance dpWriter
instance dpBufferManager
instance version

# ----------------------------------------------------------------------
# Pattern graph specifiers
Expand Down
2 changes: 2 additions & 0 deletions Svc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/StaticMemory/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TlmChan/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/TlmPacketizer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SystemResources/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/VersionPorts")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be good to add a CMakeLists.txt under Svc/Ports/ so that we can only include

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports")

here, and future ports can easily be added under the Svc/Ports module

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is this pointed to VersionPorts or are you saying in general?


# Text logger components included by default,
# but can be disabled if FW_ENABLE_TEXT_LOGGING=0 is desired.
Expand All @@ -56,3 +57,4 @@ endif()

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PosixTime/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxTimer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Version/")
9 changes: 9 additions & 0 deletions Svc/Ports/VersionPorts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
####
# CMakeLists.txt:
#
# Sets up the fprime module build within CMake.
####
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/VersionPorts.fpp"
)
register_fprime_module()
21 changes: 21 additions & 0 deletions Svc/Ports/VersionPorts/VersionPorts.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#####
# Version Ports:
#
# A port setting/getting custom versions per project.
#####

module Svc{

@ An enumeration for version status
enum VersionStatus {
OK = 0 @< Version was good
FAILURE = 1 @< Failure to get version
}

@ Port for setting and getting Versions
port Version(
version_id: VersionCfg.VersionEnum @< The entry to access
ref version_string: string @< The value to be passed
ref status: VersionStatus @< The command response argument
)
}
2 changes: 1 addition & 1 deletion Svc/SystemResources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(SOURCE_FILES
)
set(MOD_DEPS
Os
version
version
)
register_fprime_module()
### UTs ###
Expand Down
31 changes: 31 additions & 0 deletions Svc/Version/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
####
# F prime CMakeLists.txt:
#
# SOURCE_FILES: combined list of source and autocoding files
# MOD_DEPS: (optional) module dependencies
# UT_SOURCE_FILES: list of source files for unit tests
#
####
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/Version.fpp"
"${CMAKE_CURRENT_LIST_DIR}/Version.cpp"
)

# Uncomment and add any modules that this component depends on, else
# they might not be available when cmake tries to build this component.

set(MOD_DEPS
Os
version
)

register_fprime_module()

set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/Version.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/version.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/VersionTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/VersionTestMain.cpp"
)
set (UT_AUTO_HELPERS ON)
register_fprime_ut()
Loading
Loading