Skip to content

Commit

Permalink
fix: Updated dev env setup page - hello world example (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkopp authored Dec 29, 2023
1 parent 46d38fa commit 9f89c5c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
Binary file not shown.
Binary file modified docs/dev-corner/assets/dev-guide/hello-world-pfd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 40 additions & 10 deletions docs/dev-corner/dev-guide/setup-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,48 @@ git checkout -b test-branch master
```

Open this file in the editor/IDE:
`src/instruments/src/Common/displayUnit.tsx`
`fbw-a32nx/src/systems/instruments/src/MsfsAvionicsCommon/displayUnit.tsx`

Go to line 84 and add the following:
Go to line 181 and add the following after that line:

```
<text
className="SelfTestText"
x="50%"
y="62%"
>
HELLO FLYBYWIRE A32NX!
</text>
<text
class="SelfTestText"
x="50%"
y="62%"
>
HELLO FLYBYWIRE A32NX!
</text>
```

After you save, it should look like this:

![hello-world-example-src-code](../assets/dev-guide/hello-world-example-src-code.png){loading=lazy}
```TS title="displayUnit.tsx"
<svg style="display:none" ref={this.selfTestRef} class="SelfTest" viewBox="0 0 600 600">
<rect class="SelfTestBackground" x="0" y="0" width="100%" height="100%" />
<text
class="SelfTestText"
x="50%"
y="50%"
>
SELF TEST IN PROGRESS
</text>
<text
class="SelfTestText"
x="50%"
y="56%"
>
(MAX 40 SECONDS)
</text>
<text
class="SelfTestText"
x="50%"
y="62%"
>
HELLO FLYBYWIRE A32NX!
</text>
</svg>
```

Now recompile your branch:

Expand All @@ -139,3 +164,8 @@ When turning on power to the aircraft, the screens will do a self test. See if y
![hello-world-pfd](../assets/dev-guide/hello-world-pfd.png){loading=lazy}

**Congratulations! You have successfully made a code change and deployed the new add-on to the simulator.**

!!!note "Development Workflow"
The above is obviously not an efficient workflow as you have to restart the simulator after every code change.
There are several ways to avoid this and hot reload the code into the simulator while it is running. But this is out
of scope for this guide as it only serves to test the basic development environment.

1 comment on commit 9f89c5c

@vercel
Copy link

@vercel vercel bot commented on 9f89c5c Dec 29, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

docs – ./

docs-git-primary-flybywire.vercel.app
docs.flybywiresim.com
docs-flybywire.vercel.app

Please sign in to comment.