EngineTile¶
class nmeasim::app::EngineTile · Applications
One engine on the dashboard: its label, a running switch and editable revolutions and coolant temperature.
Inherits QFrame
Declared in src/app/widgets/dashboard_widget.hpp (line 39)
The controls are public so that tests can drive them. Every child widget is owned by the tile. The object name is engine_tile.
Summary¶
Public member functions
| Name | Description |
|---|---|
EngineTile() |
Creates a tile for one engine, not running, at 0 rpm and 0 °C until show_engine. |
show_engine() |
Shows an engine without emitting changed. |
engine() |
Returns the engine as the controls describe it. |
set_editable() |
Enables or disables the running switch and the spin boxes. |
Signals
| Name | Description |
|---|---|
changed() |
Emitted when the operator changes the running switch, the revolutions or the temperature. |
Public data members
| Name | Description |
|---|---|
label |
Caption with the engine label. |
running_check |
Running switch. |
rpm_spin |
Shaft revolutions in rpm, [0, 99999.9] without decimals, in steps of 100. |
temperature_spin |
Coolant temperature in degrees Celsius, [-50, 500] with one decimal. |
Private data members
| Name | Description |
|---|---|
suppress_signals_ |
True inside show_engine, so that programmatic changes emit no changed. |
Public member functions¶
EngineTile()¶
explicit EngineTile(const QString& label, QWidget* parent = nullptr)
Creates a tile for one engine, not running, at 0 rpm and 0 °C until show_engine.
Parameters
| Name | Type | Description |
|---|---|---|
label |
const QString& |
Engine label shown as the caption. |
parent |
QWidget* |
Parent widget, which owns the tile; may be null, in which case the caller owns it. |
Declared in src/app/widgets/dashboard_widget.hpp:48 · defined in src/app/widgets/dashboard_widget.cpp:68
show_engine()¶
void show_engine(const core::model::Engine& engine)
Shows an engine without emitting changed.
A spin box that has the keyboard focus keeps its value, so that a periodic refresh does not overwrite what the operator is typing.
Parameters
| Name | Type | Description |
|---|---|---|
engine |
const core::model::Engine& |
The engine to show; values outside the spin box ranges are clamped. |
Declared in src/app/widgets/dashboard_widget.hpp:56 · defined in src/app/widgets/dashboard_widget.cpp:107
engine()¶
core::model::Engine engine() const
Returns the engine as the controls describe it.
Returns core::model::Engine: The label, running state, revolutions and coolant temperature shown.
Declared in src/app/widgets/dashboard_widget.hpp:60 · defined in src/app/widgets/dashboard_widget.cpp:120
set_editable()¶
void set_editable(bool editable)
Enables or disables the running switch and the spin boxes.
Parameters
| Name | Type | Description |
|---|---|---|
editable |
bool |
False to grey them out, as in track and replay mode. |
Declared in src/app/widgets/dashboard_widget.hpp:64 · defined in src/app/widgets/dashboard_widget.cpp:125
Signals¶
changed()¶
void changed()
Emitted when the operator changes the running switch, the revolutions or the temperature.
Not emitted from show_engine. A typed spin box value is reported when editing finishes, not on every keystroke.
Declared in src/app/widgets/dashboard_widget.hpp:81
Public data members¶
label¶
QLabel* label
Caption with the engine label.
Declared in src/app/widgets/dashboard_widget.hpp:67
running_check¶
QCheckBox* running_check
Running switch.
Declared in src/app/widgets/dashboard_widget.hpp:69
rpm_spin¶
QDoubleSpinBox* rpm_spin
Shaft revolutions in rpm, [0, 99999.9] without decimals, in steps of 100.
Declared in src/app/widgets/dashboard_widget.hpp:71
temperature_spin¶
QDoubleSpinBox* temperature_spin
Coolant temperature in degrees Celsius, [-50, 500] with one decimal.
Declared in src/app/widgets/dashboard_widget.hpp:73
Private data members¶
suppress_signals_¶
bool suppress_signals_{false}
True inside show_engine, so that programmatic changes emit no changed.
Declared in src/app/widgets/dashboard_widget.hpp:85