From 879f7ec4ac411ce81b5310b627e170f66431f5ad Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 28 Sep 2022 21:39:13 +0200 Subject: [PATCH] update READMEs --- README.md | 11 ++++++++++- ws-tasks/README.md | 14 +++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fe862ef..af9d8d0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,15 @@ for people with basic C++ skills who want to learn how the FSFW works and how to On-Board Software (OBSW) in general. This workshop does not rely on external hardware and can be done on a host machine (e.g. laptop). +# Requirements + +1. [`git`](https://git-scm.com/) installed +2. [`cmake`](https://cmake.org/) installed as the build system generator +3. C++ compiler installed. On Windows, you can use [MinGW64](https://www.msys2.org/) or + [clang](https://releases.llvm.org/download.html). On Unix, you can use the pre-installed GCC +4. Build system for C/C++ installed. For Windows, it is recommended to use [ninja](https://ninja-build.org/). + On Unix, you can use the pre-installed `make` tool. + # Getting started Start by cloning this repository and updating the submodules to also clone @@ -60,7 +69,7 @@ by example and how to intgerate a library without CMake support. This chapter will introduce the object manager and expand the knowledge of the tasks workshop by showing how to conveniently create global addressable objects. It also provides an introduction into TMTC handling, as virtually all space systems are remote systems where -telemetry and telecommands are the pŕimary data interface available to communicate with the satellite. +telemetry and telecommands are the primary data interface available to communicate with the satellite. ## Controller workshop diff --git a/ws-tasks/README.md b/ws-tasks/README.md index 0d29d5c..2da331f 100644 --- a/ws-tasks/README.md +++ b/ws-tasks/README.md @@ -100,12 +100,14 @@ pure virtual functions. ```cpp virtual ~() = default; ``` + 3. Add a abstract virtual function `performOperation`. Abstract virtual functions look like this in general ```cpp virtual (...) = 0; ``` + 4. Implement you custom interface for `MyExecutableObject` by re-using the exsiting `performOperation` function. In general, when implementing an interface or overriding a virtual function, it is recommended to add the `override` keyword @@ -122,14 +124,15 @@ pure virtual functions. to inheritance for flexible software designs. The new `MyPeriodicTask` class should have a ctor which expects a `MyExecutableObjectIF` by reference and the task frequency in milliseconds as an `uint32_t`. It caches both the executbale object and the task frequency - as private member variables. Also add a `std::thread` member variable. - 6. Add a public `start` function and leave it empty for now. + as private member variables. + 6. Add a public `start` function which returns a `std::thread` and leave it empty for now. 7. Add a private static `executeTask` method which expects `MyPeriodicTask` by reference. Its implementation is similar to the `executeTask` method of `MyExecutableObject`. Remove the `executeTask` implementation from `MyExecutableObject`. 8. In the start method, use `std::thread` API with `MyPeriodicTask::executeTask` as the executed function. Pass the task itself by reference similarly to how it was done in task 2. - Cache the created thread into the thread member variable. + Return the created thread directly, so callers can use the `join` method to block on thread + completion. We now have two separate classes where one class only contains application logic and the other one only contains scheduling logic. The `MyPeriodicTask` is also able to schedule arbitrary @@ -169,7 +172,8 @@ It also offers a unform API to execute periodic tasks in form of the [`PeriodicTaskIF`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/PeriodicTaskIF.h). These tasks can then be created using the -[`TaskFactory`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/TaskFactory.h) singleton. +[`TaskFactory`](https://egit.irs.uni-stuttgart.de/fsfw/fsfw/src/branch/master/src/fsfw/tasks/TaskFactory.h) +singleton. An arbitrary number of executable objects can then be passed to a periodic task. These objects are then executed sequentially. This allows a granular design of executable tasks. @@ -228,7 +232,7 @@ the execution slot. This is useful for objects where there are multiple processi but the steps take different amount of times. In examples or other OBSW implementations using the framework, you will often -see the distrinction between an `ObjectFactory.cpp` and an `InitMission.cpp`. +see the distinction between an `ObjectFactory.cpp` and an `InitMission.cpp`. In the first file, all global (executable) objects will be created. In the second file, all of these objects will be scheduled. Another chapter will introduce the Object Manager to show what exactly is happening here.