WindDial¶
class nmeasim::app::WindDial · Applications
Wind instrument relative to the bow: port and starboard close-hauled sectors, the apparent wind as an arrow and the true wind as a hollow marker, with angles and speeds as readouts.
Inherits nmeasim::app::DialWidget
Declared in src/app/widgets/dials.hpp (line 206)
The bow is always at the top. Ticks run every 10 degrees, longer every 30, labelled 0 to 180 on each side. The close-hauled sectors span 20 to 60 degrees off the bow, in the danger colour to port and the ok colour to starboard. The apparent wind is an accent-coloured arrow from the ring towards the centre and the true wind a hollow triangle on the ring; both sit on the side the wind comes from. The centre reads the apparent wind speed (AWS KN) and below it AWA, TWA and TWS, with angles written by format_wind_angle. The object name is wind_dial.
Summary¶
Public member functions
| Name | Description |
|---|---|
WindDial() |
Creates a wind dial showing calm air from ahead. |
set_values() |
Sets the values to show and schedules a repaint. |
apparent_angle() |
Returns the apparent wind angle last set, degrees clockwise from the bow. |
true_angle() |
Returns the true wind angle last set, degrees clockwise from the bow. |
Protected member functions
| Name | Description |
|---|---|
paintEvent() |
Paints the face, the close-hauled sectors, the ticks and labels, the true wind marker, the apparent wind arrow on top of it, and then the readouts. |
Private data members
| Name | Description |
|---|---|
apparent_angle_deg_ |
Angle the apparent wind comes from, degrees clockwise from the bow. |
apparent_speed_kn_ |
Apparent wind speed. |
true_angle_deg_ |
Angle the true wind comes from, degrees clockwise from the bow. |
true_speed_kn_ |
True wind speed. |
Public member functions¶
WindDial()¶
explicit WindDial(QWidget* parent = nullptr)
Creates a wind dial showing calm air from ahead.
Parameters
| Name | Type | Description |
|---|---|---|
parent |
QWidget* |
Parent widget, which owns the dial; may be null, in which case the caller owns it. |
Declared in src/app/widgets/dials.hpp:214 · defined in src/app/widgets/dials.cpp:219
set_values()¶
void set_values(
double apparent_angle_deg,
double apparent_speed_kn,
double true_angle_deg,
double true_speed_kn)
Sets the values to show and schedules a repaint.
Parameters
| Name | Type | Description |
|---|---|---|
apparent_angle_deg |
double |
Angle the apparent wind comes from, degrees clockwise from the bow, normally in [0, 360); other values are drawn and folded the same way. |
apparent_speed_kn |
double |
Apparent wind speed. |
true_angle_deg |
double |
Angle the true wind comes from, degrees clockwise from the bow, as core::model::Wind::true_angle_relative_deg returns it. |
true_speed_kn |
double |
True wind speed. |
Declared in src/app/widgets/dials.hpp:224 · defined in src/app/widgets/dials.cpp:224
apparent_angle()¶
double apparent_angle() const noexcept
Returns the apparent wind angle last set, degrees clockwise from the bow.
Returns double: The apparent_angle_deg of the last set_values, 0 before the first.
Declared in src/app/widgets/dials.hpp:230
true_angle()¶
double true_angle() const noexcept
Returns the true wind angle last set, degrees clockwise from the bow.
Returns double: The true_angle_deg of the last set_values, 0 before the first.
Declared in src/app/widgets/dials.hpp:234
Protected member functions¶
paintEvent()¶
void paintEvent(QPaintEvent* event) override
Paints the face, the close-hauled sectors, the ticks and labels, the true wind marker, the apparent wind arrow on top of it, and then the readouts.
Parameters
| Name | Type | Description |
|---|---|---|
event |
QPaintEvent* |
Unused; the whole dial is repainted. |
Declared in src/app/widgets/dials.hpp:241 · defined in src/app/widgets/dials.cpp:233
Private data members¶
apparent_angle_deg_¶
double apparent_angle_deg_{0.0}
Angle the apparent wind comes from, degrees clockwise from the bow.
Declared in src/app/widgets/dials.hpp:245
apparent_speed_kn_¶
double apparent_speed_kn_{0.0}
Apparent wind speed.
Declared in src/app/widgets/dials.hpp:247
true_angle_deg_¶
double true_angle_deg_{0.0}
Angle the true wind comes from, degrees clockwise from the bow.
Declared in src/app/widgets/dials.hpp:249
true_speed_kn_¶
double true_speed_kn_{0.0}
True wind speed.
Declared in src/app/widgets/dials.hpp:251
Inherited members¶
From nmeasim::app::WindDial: at(), centre(), DialWidget(), draw_face(), draw_readout(), draw_ring_marker(), draw_ticks(), hasHeightForWidth(), heightForWidth(), minimumSizeHint(), radius(), sizeHint()