dmcview package
Submodules
dmcview.compass module
- class dmcview.compass.Compass
Bases:
QWidgetDraw azimuth, declination, bank, and elevation class.
Represent how to draw a circle, the 4 Directions (W, N, E, S), and how the user inputs as text, Draw the Elevation, Bank, and Azimuth inside the circle.
- create_static_pixmap() None
Create a black-outlined circle.
(offset slightly to the left of center)using the QPainter class.
- Returns:
Paints the circle on the left side of the widget.
- draw_arrow(painter: QPainter, center: QPointF, radius: int) None
Creates an arrow that indicates the elevation angle.
draws an arc to represent the elevation visually, and it uses trigonometric calculations to determine positions and transformations to ensure that the arrowhead is correctly oriented
args: Radius: It determines how far the arrow will extend from its center.
- draw_azimuth(painter: QPainter, center: QPointF, radius: int, compass_angle: float) None
Calculate the azimuth position based on the compass angle and draw it with specified properties.
- Parameters:
painter – QPainter object for drawing operations.
center – Center point (QPointF) of the compass.
radius – Radius of the compass circle.
compass_angle – Current compass angle in degrees.
- draw_cardinal_points(painter: QPainter, center: QPointF, radius: int) None
Create cardinal direction markers (N, E, S, W).
Radial lines from the center using the draw_lines() method.
- Parameters:
painter – QPainter object for drawing operations.
center – Center point (QPointF) of the compass.
radius – Radius of the compass circle.
- draw_lines(painter: QPainter, center: QPointF, radius: int) None
This method is for the inside lines around the circle from the inside.
- draw_red_line(painter: QPainter, center: QPointF, radius: int) None
This method draws an arc to represent the bank visually.
represent the magnetic north direction on a compass, it uses a QPainter to draw shapes and text on a graphical interface, typically in a Qt application.
- Parameters:
painter (QPainter) – An instance of QPainter used for drawing operations on the widget.
center (QPointF) – The center point of the compass, represented as a QPointF object.
radius (int) – The radius of the compass circle, determines the size and position of the drawn elements.
- draw_rotating_magnetic_north(painter: QPainter, center: QPointF, radius: int, declination: float) None
This method draws a magnetic north indicator along with a declination arc.
- Parameters:
declination (float) – The magnetic declination in degrees.
- paintEvent(_: QEvent) None
Draws as text the user values.
Type the azimuth, declination, bank angle, elevation, and acceleration on the right side of the circle. Args: event (QEvent): Class representing an event, such as a paint event.
return: Displays as text the user values that have been input into the program.
- receive_acceleration(x: float, y: float, z: float) None
- resizeEvent(event: QResizeEvent) None
triggers when the screen is resized.
- Parameters:
event (QResizeEvent) – The QT size event
- set_elevation(elevation: float) None
- set_rotation(rotation: float) None
- start_animation_timer() None
This method initializes and starts the timer. based animations for smoothly updating the azimuth (compass heading) and declination (magnetic deviation) angles
- staticMetaObject = PySide6.QtCore.QMetaObject("Compass" inherits "QWidget": )
- update_angle(target_angle: float) None
- update_declination(target_declination: float) None