Skip to content

Commit

Permalink
misc corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
devleaks committed Nov 13, 2024
1 parent 70fb508 commit a3ffec1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
14 changes: 4 additions & 10 deletions docs/Button.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The *Button Definition* is a list of attributes that describe what the button wi

Button definition can be very simple and straightforward, but definitions can also be complex and refined.

Here is an example of a very simple definition of a button to toggle the map display in X-Plane.
Here is an example of a simple definition of a button to toggle the map display in X-Plane.

```
index: 0
Expand All @@ -19,28 +19,22 @@ command: sim/map/toggle_map_display
icon: map
```

The definition of a button is always structured in 4 distinct sections:
The definition of a button can be organised into 4 distinct parts:

1. What the button is (and where it is on the deck)
2. What it does (when the button is pressed on the deck)
3. What it displays (on the deck)
4. Where does it get the value it displays from.

The following sections address these.

Here is a complex definition of a button which exemplifies all above sections (in different colors):
Here is a complex definition of a button which exemplifies all above parts (in different colors):

![[button-anatomy.png]]

Resulting button:

![[button.png|200]]

The following Sections describe the four button definition sections in detail.

The button *Activation* page describes attributes specific to *what a button will trigger or do* when used.

The button *Representation* page describes attributes specific to the *feedback* given by the button on the deck, be it an iconic image to display, a led to turn on or off, or a sound to emit.
The following Sections describe the four button definition parts in detail.

# Common Button Attributes

Expand Down
10 changes: 10 additions & 0 deletions docs/Extending/Internals/Web Decks Internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,13 @@ Code values:
"data": data
}
```

# Web Deck Drawing

Technically speaking, web decks are very simple browser entities. The web representation is an HTML Canvas. The background image of the deck is laid out as the background image of the canvas. Deck icons are images laid over the background image at precise size and positions. Nothing less, nothing more.

Another special kind of icon images can be generated by Cockpitdecks especially for web decks. They are called *hardware representations*. They behave exactly like other representations, but they only exists for web decks. They usually have particular sizes and positions, and their drawing is sometimes complex.

Web decks communicate with Cockpitdecks through standard WebSocket.

The connection is established or re-established on startup of Cockpitdecks. Cockpitdecks is aware of the web decks connected to it and only update web decks when necessary. There should never be a need to refresh a web page containing a web deck.
20 changes: 19 additions & 1 deletion docs/Extending/Reference/Glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,27 @@ It can be a simple button to press, a small LCD button, an encoder to turn, or a

A Deck is a piece of hardware connected to a computer to provide some input by means of buttons, encoders, cursors... A Deck also provide some feedback to the user through colored LED lights, small LCD icon screens, or by emitting sound and vibration.

# Web Deck

A Web Deck is an emulation of a deck in an internet browser window. Cockpitdecks provides a set of web decks that emulate existing decks.

Originally, web decks where created to speed up deck page creation and arrangement. But web decks turned out to be so convenient that they are now part of Cockpitdecks. Some users actually only use web decks, without any physical ones.

But it is possible to design as create any web deck one can imagine, built from basic components like buttons, encoders, led, and LCD displays. As a proof of this concept, there a entire overhead panel, fully reactive and responsive to the simulator changes.

Cockpitdecks allow a designer to create and use any web deck, in the context of the Cockpitdecks application.

# Layout

In Cockpitdecks, a Layout is a collection of pages that can be displayed on a deck. ON startup, a deck must tell Cockpitdecks which Layout it is going to use.
A Layout is a collection of pages that can be displayed on a deck. On startup, a deck must tell Cockpitdecks which Layout it is going to use.

# Page

A Page is a collection of buttons that are displayed on a deck at a moment.

A deck can display different pages of buttons. A button on a page can be used to switch or change a page, leading to a literally infinite number of pages.

All pages that can be displayed on a deck are grouped in a folder called the Layout of the deck.

# Cockpitdecks

Expand Down

0 comments on commit a3ffec1

Please sign in to comment.