Skip to content

Fleet Button

The Fleet Button is a large button that stands for a whole fleet. It shows the name and status of the fleet, a few key figures and the number of alerts, and the operator clicks it to choose the fleet. It is found in the App - OpenBridge section of the Perspective Component Palette as Fleet Button.

Fleet Button with a name, a status, two readouts and alert counts

From top to bottom:

  1. Name and status — fleetName and status. See Name and Status.
  2. Readouts — a row of values with labels. See Readouts.
  3. Alerts — a topic and the number of alarms, warnings and cautions. See Alerts.

The Fleet Button is one of three components for a system that integrates several vessels:

  • The Fleet Button stands for the fleet as a whole.
  • The Integration Button stands for one vessel, or one system.
  • The Integration Bar is the header of such a system, where the operator chooses between the fleet and its vessels.

A typical fleet page has one Fleet Button followed by an Integration Button per vessel, and a click on either sets selectedVessel of the Integration Bar. See Example 1. See App Components — Overview for the other app components.

A Fleet Button dropped from the palette has no name and no readouts, and shows only the alert row:

Fleet Button with default properties

fleetName is the name of the fleet, and status a line of text under it.

Name Fleet Button with a name
Name and status Fleet Button with a name and a status
Name Description Property Type
fleetName Name of the fleet. Empty by default. value
status Text under the name. Empty by default. value

readouts is a list of values shown side by side. Each readout is an object:

Name Description Property Type
label Text under the value. value
value The value: a number or a text. value
unit Unit shown after the value. value

The readouts share the width of the button:

Readouts
1 One readout
2 Two readouts
3 Three readouts

The button shows the value as it is. To control the number of decimals, format the value in the binding, for example with the expression numberFormat({[default]Fleet/AvgSpeed}, "#,##0.0").

Name Description Property Type
readouts The readouts. Empty by default. array

With showAlerts the button has an alert row at the bottom. It shows the text in alertTopic, an icon, and one badge for each count in alerts that is not zero: alarms, warnings and cautions.

Alarms, warnings and cautions Alert row with three counts
Warnings only Alert row with one count
All counts 0 Alert row without alerts
showAlerts false Fleet Button without the alert row

When all counts are zero the row is dimmed and shows No alerts.

alertTopicIcon is the icon before the topic. A new Fleet Button has the placeholder icon; choose another, or clear alertTopicIcon.path for a row without an icon:

Placeholder (default) Alert row with the placeholder icon
An alert icon Alert row with a bell
No icon Alert row without an icon

The Fleet Button does not count alarms itself. Bind each count to an expression or a tag that holds the number.

Name Description Property Type
showAlerts Show the alert row. Default true. value
alertTopic Text of the alert row. Empty by default. value
alertTopicIcon Icon before the text, chosen with the icon picker. object
alerts The alert counts. See below. object

alerts sub-properties:

Name Description Property Type
alarm Number of alarms. Default 0. value
warning Number of warnings. Default 0. value
caution Number of cautions. Default 0. value

Set selected to true to show the button as the chosen one:

selected
false (default) Fleet Button, not selected
true Selected Fleet Button

A click on the button does not change selected. It fires onActionPerformed, and your script or binding decides what is selected. Bind selected to the property that holds the choice, as in Example 1.

Name Description Property Type
selected Show the button as selected. Default false. value

The button is as wide as the component’s box (the blue frame) and as high as its content, from the top of the box. With two rows of text, readouts and the alert row it is 167 px high:

Fleet Button and its box


Properties not covered in the sections above:

Name Description Property Type
style Standard Perspective style object. object
Event Description Event Object
onActionPerformed Fired when the operator clicks the button. —

Example 1 — Fleet Button that Selects the Fleet

Section titled “Example 1 — Fleet Button that Selects the Fleet”

The session has a custom property vessel that holds the chosen vessel, and is empty when the fleet is chosen. selectedVessel of the Integration Bar is bound bidirectionally to it.

  1. Drop a Fleet Button into the view, 320 × 167.

  2. Set fleetName to Coastal Fleet, and bind status, the values in readouts and the counts in alerts to the tags of the fleet.

  3. Bind selected to the expression {session.custom.vessel} = "".

  4. Add a script to onActionPerformed:

    self.session.custom.vessel = ''

Below it, add one Integration Button per vessel that sets the property to its vessel in the same way.

Built on the OpenBridge Design System