-
Notifications
You must be signed in to change notification settings - Fork 34
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
demos: grand refactoring #143
Open
MariusBgm
wants to merge
13
commits into
main
Choose a base branch
from
dev_silkit_app
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MariusBgm
changed the title
Dev silkit app
refactor demos into a generic application and bus specific apps
Nov 7, 2024
KonradBkd
changed the title
refactor demos into a generic application and bus specific apps
demos: grande refactoring
Nov 15, 2024
Demos: Overhaul SilKitApplication Demos: Add signal handling, more command line args, renaming demos: Improve application demo base demos: Remove IApp.hpp, pure virtual methods are defined in BaseApplication demos: Add license headers demos: Fix include demos: Include cctype demos: Add SimpleCan Demo demos: Remove CanDemo, restructure new Can Demos demos: Add sample participant configurations demos: Reorganized common CAN behavior; Review suggestions demos: Fix command line help message demos: CanWriter: Always send CAN FD; ApplicationBase: Fix command line help demos: Use arg struct at construction; Always send CAN FD in demo demos: Always run as-fast-as-possible with --config
KonradBkd
force-pushed
the
dev_silkit_app
branch
from
November 22, 2024 10:03
5b475ce
to
736bebe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more suggestions, mostly just fluff. I'm going to look into the LIN demos specifically now 👍 Overall fantastic stuff!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Demo Refactoring
Review / Tests:
-aA
(async, autonomous)Central modifications / guidelines
std::cout
,std::cerr
except printing command line argument usageThe demos
ApplicationBase
that provides general SIL Kit functionality (e.g. lifecycle, threading, command line args)Minimal demo SimpleCan
The SimpleCan demo is not using the
ApplicationBase
to showcase basic SIL Kit usage. It is sync-only, only takes a participant name as command line argument and sends/receives CAN frames. Focus here is on minimizing lines of code. Such a simple demo could be unique for CAN and is not necessary for each bus system.The ApplicationBase
Implements a set of default command line arguments (except
--network
which is an extension provided by the CAN Demo) :The constructor also takes a struct with the arguments that can be used to define defaults per demo implementation (e.g. Can Demos should run with stepSize = 5ms)
Provides an interface (pure virtual functions) that must be implemented by the demo:
AddCommandLineArgs()
: Inject additional demo args. Here, the CAN demo adds a--network
arg to set a network name.EvaluateCommandLineArgs()
: Evaluate the additional args after parsing. Here, the--network
is evaluated and used in the controller creationCreateControllers()
: Called before lifecycle setupInitControllers()
: Called inCommunicationReadyHandler()
DoWorkAsync()
: Called in the worker thread in async modeDoWorkSync(std::chrono::nanoseconds now)
: Called in theSimulationStepHandler
A SignalHandler is used that stops the demo in any state on CTRL-C
Public methods:
SetupCommandLineArgs(...)
: To split command line arg setup and the simulation run. Optionally, a set of default args can be excluded.Run()
: The actual simulation run. The workflow is:Demo main then is as simple as: