Skip to content

Commit

Permalink
Revert "Add sourcing the virtual environment to the right spot (#1993)"
Browse files Browse the repository at this point in the history
This reverts commit bad27f2.
  • Loading branch information
thomas-bc authored Aug 4, 2023
1 parent 5905e9a commit 4ecfa30
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 45 deletions.
26 changes: 10 additions & 16 deletions docs/Tutorials/HelloWorld/Deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ ground control and data collection of the deployment.

To create a deployment, run the following commands:
```bash
# In: MyProject
cd MyProject
fprime-util new --deployment
```
This command will ask for some input. Respond with the following answers:

```
deployment_name [MyDeployment]: MyDeployment
path_to_fprime [./fprime]:
author_name []: LeStarch
```

> For any other questions, select the default response.
Expand All @@ -49,13 +50,6 @@ to `MyDeployment/CMakeLists.txt`.
include("${FPRIME_PROJECT_ROOT}/project.cmake")
...
```
> To build this new deployment generate a build cache and then build.
> ```bash
> # In: MyProject/MyDeployment
> fprime-util generate
> fprime-util build
> ```
> > Notice `fprime-util generate` was used again. This is because this new deployment builds in a separate environment.

In this section the `HelloWorld` component will be added to the `MyDeployment` deployment. This can be done by adding
the component to the topology defined in `MyDeployment/Top`.
Expand All @@ -68,13 +62,12 @@ specific configuration.
In order to add a component to the topology, it must be added to the topology model. An instance definition and an
instance initializer must both be added.

To add an instance definition, add `instance helloWorld` to the instance definition list in the `topology MyDeployment` section
To add an instance definition, add `instance helloWorld` to the instance definition list in the `topology Ref` section
of `MyDeployment/Top/topology.fpp`. This is shown below.

Edit `MyDeployment/Top/topology.fpp`:
```
...
topology MyDeployment {
topology Ref {
# ----------------------------------------------------------------------
# Instances used in the topology
# ----------------------------------------------------------------------
Expand All @@ -92,7 +85,6 @@ Next, an instance initializer must be added to topology instances defined in `My
Since the `HelloWorld` component is an `active` component it should be added to the active components section and should
define a priority and queue depth options. This is shown below.

Add to `MyDeploymment/Top/instances.fpp`:
```
...
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -120,7 +112,6 @@ Finally, our new telemetry channel should be added to our telemetry packet speci
channel can be ignored as the deployment will not use the telemetry packetizer. Add the following to the `ignore`
section of `MyDeployment/Top/MyDeploymentPackets.xml`.

Update `MyDeployment/Top/MyDeploymentPackets.xml`:
```
<ignore>
...
Expand All @@ -132,12 +123,15 @@ Since this component has no custom ports nor does it require special configurati
completed. The deployment can now be set up and built using the following commands:

```
# In: MyProject/MyDeployment
cd MyDeployment
fprime-util generate
fprime-util build -j4
```
> Resolve any errors that occur before continuing to the running section.
Resolve any errors that occur before continuing to the testing section.

## Running With `fprime-gds`
> Notice `fprime-util generate` was used again. This is because this new deployment builds in a separate environment.
## Testing With `fprime-gds`

It is now time to test the `HelloWorld` component by running the deployment created in this section. This can be
accomplished by running the `fprime-gds` command in the deployment, verifying connection, sending the new SEND_HELLO
Expand Down
29 changes: 10 additions & 19 deletions docs/Tutorials/HelloWorld/HelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,20 @@ The next step is to create the new component. First, create a directory called `
components and change into that directory.

```bash
# In: MyProject
mkdir -p MyComponents
mkdir MyComponents
cd MyComponents
```

Creating a new component is accomplished with the following command:

```bash
# In: MyProject/MyComponents
fprime-util new --component
```
This command will ask for some input. You should respond with the following answers:

```
[INFO] Cookiecutter source: using builtin
component_name [MyComponent]: HelloWorld
component_name [MyComponent]: HelloWorld
component_short_description [Example Component for F Prime FSW framework.]: Hello World Tutorial Component
component_namespace [HelloWorld]: MyComponents
Select component_kind:
Expand All @@ -74,21 +72,20 @@ Choose from 1, 2 [1]: 1
Select enable_parameters:
1 - yes
2 - no
Choose from 1, 2 [1]: 1
Choose from 1, 2 [1]: 2
[INFO] Found CMake file at 'MyProject/project.cmake'
Add component MyComponents/HelloWorld to MyProject/project.cmake at end of file (yes/no)? yes
Generate implementation files (yes/no)? yes
Generate implementation files (yes/no)? no
```

> For any other questions, select the default response.
This will create a new component called "HelloWorld" in the "MyProject" namespace. This new component will be able to
define commands, events, telemetry channels, and parameters.
define commands, events, and telemetry channels.

We should navigate to the component's directory and look around:

```bash
# In: MyProject/MyComponents
cd HelloWorld
ls
```
Expand All @@ -107,11 +104,9 @@ To build this component run `fprime-util build` in the current folder.
A component model defines the interface of the component with the rest of the F´ system and with the ground system F´
communicates with. In this case we intend to define a command, an event, and a telemetry channel as specified above.

Open the model file `HelloWorld.fpp` and add replace the line:
Open the model file `HelloWorld.fpp` and add replace the line

```
async command TODO opcode 0
```
`async command TODO opcode 0`

with the following:

Expand All @@ -135,7 +130,6 @@ telemetry GreetingCount: U32
With this step completed you can generate a basic implementation with the following command:

```bash
# In: MyProject/MyComponents/HelloWorld
fprime-util impl
```

Expand Down Expand Up @@ -177,15 +171,12 @@ void HelloWorld:: SAY_HELLO_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw
> private:
> U32 m_greetingCount;
> ```
> Should be added inside the `class` definition in `HelloWorld.hpp`.
>
> **HelloWorld.cpp: Updating Constructor**
> ```c++
> HelloWorld:: HelloWorld(const char *const compName) : HelloWorldComponentBase(compName),
> m_greetingCount(0)
> {
> HelloWorld:: HelloWorld() :
> m_greetingCount(0),
> HelloWorldComponentBase(compName) {
> ```
> Should be added to the `HelloWorld` constructor at the top of the file.
The component should build without errors by running `fprime-util build`. Resolve any errors that occur before
proceeding to the next section.
Expand Down
13 changes: 3 additions & 10 deletions docs/Tutorials/HelloWorld/NewProject.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,9 @@ Choose from 1, 2 [1]: 1
Use the default for anything not specified. This command will take a moment to run.

The above command creates a new F´ project structure in a folder called `MyProject`, use the `devel` branch of F´ as
the basis for the project, and sets up the matching tools in a new Virtual Environment.

> Load the tools for this project via the virtual environment.
>
> ```bash
> cd MyProject
> . venv/bin/activate
>```
>
> Make sure to load these tools any time you are working with the this project.
the basis for the project, and set up the matching tools in a new Virtual Environment.

> Experienced F´ users may note that we have not yet created a deployment, but rather just the base project structure.
## Building the New F´ Project

Expand Down

0 comments on commit 4ecfa30

Please sign in to comment.