v0.77.0: the laser visualizer is the Oscilloscope — screen sliders and rig diagram gone, a graticule dot size, and a sync delay per style
This commit is contained in:
@@ -180,55 +180,6 @@ class TestHeadings:
|
||||
assert not dialog._glow.font().bold()
|
||||
|
||||
|
||||
class TestLaserDiagram:
|
||||
def test_the_dialog_has_one_and_it_follows_the_settings(self, qapp, tmp_path):
|
||||
prefs = Preferences(tmp_path)
|
||||
dialog = _prefs_dialog(prefs)
|
||||
dialog._angle_sliders["visualizer_laser_pitch"].setValue(-25)
|
||||
dialog._distance_slider.setValue(16)
|
||||
config = dialog._diagram._config
|
||||
assert config["visualizer_laser_pitch"] == -25
|
||||
assert config["visualizer_laser_distance"] == 1.6
|
||||
|
||||
def test_labelled_sliders_lost_their_numbers(self, qapp, tmp_path):
|
||||
dialog = _prefs_dialog(Preferences(tmp_path))
|
||||
page = dialog._viz_pages.widget(2)
|
||||
dialog._viz_pages.setCurrentIndex(2)
|
||||
dialog.show()
|
||||
visible = {label.text() for label in page.findChildren(QLabel)
|
||||
if label.isVisible()}
|
||||
assert "3.5 m" not in visible and "0°" not in visible
|
||||
assert "3 px" not in visible
|
||||
dialog.close()
|
||||
|
||||
def test_paints_at_any_setting(self, qapp):
|
||||
from lintunes.gui import visualizer_styles as vs
|
||||
from lintunes.gui.laser_diagram import LaserDiagram
|
||||
for overrides in ({}, {"visualizer_laser_pitch": 60,
|
||||
"visualizer_laser_yaw": -60,
|
||||
"visualizer_laser_roll": 180,
|
||||
"visualizer_laser_distance": 1.0,
|
||||
"visualizer_laser_dot": 16}):
|
||||
config = vs.settings(None)
|
||||
config.update(overrides)
|
||||
diagram = LaserDiagram(config)
|
||||
diagram.resize(420, 160)
|
||||
assert not diagram.grab().isNull()
|
||||
|
||||
def test_the_screen_turns_with_the_angles(self, qapp):
|
||||
from PyQt6.QtCore import QPointF
|
||||
from lintunes.gui import visualizer_styles as vs
|
||||
from lintunes.gui.laser_diagram import LaserDiagram
|
||||
diagram = LaserDiagram(vs.settings(None))
|
||||
square = diagram.screen_corners(QPointF(0, 0), 30)
|
||||
pitched = diagram.screen_corners(QPointF(0, 0), 30, pitch=40,
|
||||
yaw=0, roll=0)
|
||||
# Tipping the top away moves the top edge along the beam.
|
||||
assert pitched[2].x() != pytest.approx(square[2].x())
|
||||
# A square screen's vertical edges are vertical.
|
||||
assert square[1].x() == pytest.approx(square[2].x())
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# 5. Copying songs gives other apps a song list
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user