Skip to content

Commit

Permalink
add minor camera error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Jan 23, 2024
1 parent af0d4df commit e099293
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion oresat_cfc/drivers/pirt1280.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def integration_time(self) -> int:

@integration_time.setter
def integration_time(self, value: int):
if value == self._integration_time:
if not self.is_enabled or value == self._integration_time:
return # nothing todo

# from the specified number of integration_time, get the number of integration_time
Expand Down
4 changes: 2 additions & 2 deletions oresat_cfc/services/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ def _on_read_cam_temp(self) -> int:
def _on_read_cam_integration(self) -> int:
"""SDO read callback for camera integration time."""

print(self._pirt1280.integration_time)

return self._pirt1280.integration_time

def _on_write_cam_integration(self, value: int):
Expand All @@ -211,6 +209,8 @@ def _on_write_cam_integration(self, value: int):
def _on_read_last_display_capture(self) -> bytes:
"""SDO read callback for display image."""

if not self._last_capture_obj.value:
return b""
return make_display_image(self._last_capture_obj.value, sat_percent=95, downscale_factor=2)

def _on_read_cam_enabled(self) -> bytes:
Expand Down

0 comments on commit e099293

Please sign in to comment.