Fix #14, Add guide on creating table files#15
Fix #14, Add guide on creating table files#15jphickey merged 1 commit intonasa:masterfrom avan989:creatingTableGuide
Conversation
jphickey
left a comment
There was a problem hiding this comment.
Upon further review, the example for add_cfe_tables command is almost OK, we should just use a better name than MyTblDefault, that's all.
The selection logic on the implementation side will still work, as the selection logic extracts the basename (filename without path or extension) and uses this to search the "defs" directory for a mission- or cpu-specific version of that table file. The default file, with the path as specified in the argument (either absolute or relative), will be used as a fallback in case there was no mission-specific implementation for the table.
So, the code that is there will work.
But in the context of being a "guide" for best practices, it should be noted that the search logic uses the basename only. Because if this, the suggested name MyTblDefault is not good, for two reasons.
- It includes the word "Default" -- once overridden by a mission with a real version, it should keep the same name, but now it becomes a misnomer (not the default anymore).
- It is potentially ambiguous in that the name doesn't include the app name at all. If more than one app cloned this same but didn't rename the table file, one would have a name conflict, both in the source tree and the deployment (binary) tree.
For these two reasons, I suggest changing the a name in the documentation to something like ${APPNAME}_default to be clear that the table name should incorporate the app name, to make it remain distinctive when it is no longer in an app-specific subdirectory.
|
Changed MyTblDefault to ${APPNAME}_default |
skliper
left a comment
There was a problem hiding this comment.
I suggest the search path behavior get outlined here, and take off the fsw/src in the 3.a. example if it's ignored anyways. Otherwise it implies a specific file, vs the search/override functionality.
So 2. could detail placing the application default table in the fsw/src directory, then note the build system search path for the file of this name - the mission *_defs directory first in case the mission needs to override the default followed by the application fsw/src directory.
Actually curious if it's more complicated than this, where you could prefix the file name with the platform and build different tables for different platforms?
@jphicky could you confirm? Is this general behavior already described somewhere that this file could refer to? (the whole search path, platform prefix business)
Turns out there isn't a search path. This isn't applicable. |
|
I think this is OK now. But there IS a search path for tables - it is just using the basename only, rather than the full path of whatever is supplied in the command. The sequence is as follows (where TBLWE==table basename without extension):
The supplied path does come into play, as the fallback at the end, if the search path fails to find anything matching within the mission-specific directories. |
Got it, I suggest this get added to the guide. |
|
added sequence for file table source |
Describe the contribution
Fix #14, Add guide on creating table file using elf2cfetbl
Testing performed
Steps taken to test the contribution:
Expected behavior changes
No impact to behavior
System(s) tested on:
Additional context
None
Contributor Info
Anh Van, NASA Goddard
Community contributors
You must attach a signed CLA (required for acceptance) or reference one already submitted