Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4055d56
working camera calibration, needs cleaning
ThomasMorvan May 5, 2026
bfd2d35
Merge remote-tracking branch 'upstream/develop'
ThomasMorvan May 11, 2026
4569168
autonomouse params
ThomasMorvan May 11, 2026
7576c36
Merge pull request #2 from BrainCircuitsBehaviorLab/develop
ThomasMorvan May 14, 2026
7821c17
write autonomouse positions instead of cam positions
ThomasMorvan May 14, 2026
8aeab16
Merge branch 'main' of https://github.com/ThomasMorvan/village
ThomasMorvan May 14, 2026
2213435
backup fixes
ThomasMorvan May 14, 2026
3362fe5
wrap task info label in qscroll for long descriptions
ThomasMorvan May 14, 2026
2b3474c
Better (?) AutoNoMouse handling: custom parameters auto added to GUI…
ThomasMorvan May 20, 2026
83bfaf6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 1, 2026
95cf607
autonomouse live param update
ThomasMorvan Jun 1, 2026
ebfdca2
linting
ThomasMorvan Jun 1, 2026
7331d55
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 1, 2026
c0f2d87
linting
ThomasMorvan Jun 1, 2026
ffd7e5d
Merge remote-tracking branch 'origin/main'
ThomasMorvan Jun 1, 2026
00158e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 1, 2026
13bc189
linting
ThomasMorvan Jun 1, 2026
a902a10
Merge remote-tracking branch 'origin/main'
ThomasMorvan Jun 1, 2026
fa17fe5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 1, 2026
cc035f9
Merge remote-tracking branch 'upstream/develop' into sync-upstream
ThomasMorvan Jun 2, 2026
1d5d4b3
fix circular import
ThomasMorvan Jun 2, 2026
5ebdff4
hasattr checks again
ThomasMorvan Jun 2, 2026
9e39985
Merge remote-tracking branch 'upstream/develop'
ThomasMorvan Jun 8, 2026
01c0dcc
fix ledstrip pixel type
ThomasMorvan Jun 8, 2026
8de86b5
to test: changed paintEvent to drawForeground for DrawOnFrame
ThomasMorvan Jun 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions village/devices/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,17 @@ def render_request(self, completed_request) -> None:
self._frame_counter = 0
super().render_request(completed_request)

def paintEvent(self, event) -> None:
"""Renders the camera frame then draws screen-only overlays."""
super().paintEvent(event)
if self._cam is not None:
painter = QPainter(self)
self._cam.task_is_running = manager.state.task_is_running()
manager.camera_draw.draw_preview(self._cam, painter)
painter.end()
def drawForeground(self, painter: QPainter, rect) -> None:
"""Draws screen-only overlays on top of the camera frame
(which is a QGraphicsView in QPicamera2!)."""
super().drawForeground(painter, rect)
if self._cam is None:
return
painter.save()
painter.resetTransform()
self._cam.task_is_running = manager.state.task_is_running()
manager.camera_draw.draw_preview(self._cam, painter)
painter.restore()


# the camera class
Expand Down
10 changes: 6 additions & 4 deletions village/devices/led_strip.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import traceback
from typing import Any

from pi5neo import Pi5Neo
from pi5neo import Pi5Neo, EPixelType

from village.classes.null_classes import NullLEDStrip
from village.scripts.log import log
Expand All @@ -12,7 +12,7 @@ def get_led_strip(
spi_device: str = "/dev/spidev0.0",
num_leds: int = 10,
spi_speed_khz: int = 800,
pixel_type: str = "GRB",
pixel_type: EPixelType = EPixelType.RGB,
quiet_mode: bool = True,
) -> Any | NullLEDStrip:
"""Factory function to get an instance of the LED strip.
Expand All @@ -21,7 +21,9 @@ def get_led_strip(
spi_device (str): SPI device path
num_leds (int): Number of LEDs in the strip
spi_speed_khz (int): SPI speed in kHz
pixel_type (str): Type of LED pixels 'GRB' or 'GRBW' or 'RGB' or 'RGBW'
pixel_type (EPixelType): Color channel order of the pixels. One of
EPixelType.RGB / GRB / RGBW / GRBW (RGB/GRB are 3-channel,
RGBW/GRBW have a dedicated white channel).
quiet_mode (bool): Whether to suppress output
Returns:
NullLEDStrip: An instance of the LED strip class or
Expand All @@ -48,6 +50,6 @@ def get_led_strip(
spi_device=settings.get("SPI_DEVICE"),
num_leds=settings.get("NUMBER_OF_LEDS"),
spi_speed_khz=settings.get("SPI_SPEED_KHZ"),
pixel_type=settings.get("PIXEL_TYPE").value,
pixel_type=EPixelType[settings.get("PIXEL_TYPE").name],
quiet_mode=True,
)
Loading