Skip to content

Commit

Permalink
shortened names in container.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgineer85 committed Nov 4, 2024
1 parent da82588 commit b30a7d4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/lowlevel/gpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main(args=None, run: bool = True):
except BadPinFactory:
print("Device not supported by gpiozero 😣")
exit(-1)
_shutterbutton_in.when_pressed = container.synced_acquisition_service.trigger_execute_job
_shutterbutton_in.when_pressed = container.jobservice.trigger_execute_job
logger.info(f"external trigger button on {_shutterbutton_in}")

try:
Expand Down
4 changes: 2 additions & 2 deletions wigglecam/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def create_basic_folders():
class Container:
# container
logging_service = LoggingService(config=appconfig.logging)
synced_acquisition_service = AcquisitionService(config=appconfig.syncedacquisition)
jobconnectedservice = JobService(config=appconfig.jobconnected, acquisition_service=synced_acquisition_service)
acquisition_service = AcquisitionService(config=appconfig.acquisition)
jobservice = JobService(config=appconfig.job, acquisition_service=acquisition_service)

def __init__(self):
# ensure dirs are avail
Expand Down
2 changes: 1 addition & 1 deletion wigglecam/routers/api/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def video_stream():

try:
return StreamingResponse(
content=container.synced_acquisition_service.gen_stream(), headers=headers, media_type="multipart/x-mixed-replace; boundary=frame"
content=container.acquisition_service.gen_stream(), headers=headers, media_type="multipart/x-mixed-replace; boundary=frame"
)
except ConnectionRefusedError as exc:
logger.warning(exc)
Expand Down
6 changes: 3 additions & 3 deletions wigglecam/routers/api/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
@router.post("/setup")
def setup_job(job_request: JobRequest) -> JobItem:
try:
return container.jobconnectedservice.setup_job_request(jobrequest=job_request)
return container.jobservice.setup_job_request(jobrequest=job_request)
except ConnectionRefusedError as exc:
raise HTTPException(status_code=status.HTTP_429_TOO_MANY_REQUESTS, detail=f"Error setting up job: {exc}") from exc


@router.get("/trigger")
def trigger_job():
"""triggers a job that was setup before. this call needs to be sent to primary only and via GPIO the nodes will execute the job."""
return container.jobconnectedservice.trigger_execute_job()
return container.jobservice.trigger_execute_job()


@router.get("/list")
def get_jobs():
"""triggers a job that was setup before. this call needs to be sent to primary only and via GPIO the nodes will execute the job."""
return container.jobconnectedservice.db_get_list_as_dict()
return container.jobservice.db_get_list_as_dict()


@router.get("/results/{job_id}")
Expand Down
4 changes: 2 additions & 2 deletions wigglecam/services/config/appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class AppConfig(BaseSettings):

# groups -> setting items
logging: ConfigLogging = ConfigLogging()
syncedacquisition: ConfigSyncedAcquisition = ConfigSyncedAcquisition()
jobconnected: ConfigJobConnected = ConfigJobConnected()
acquisition: ConfigSyncedAcquisition = ConfigSyncedAcquisition()
job: ConfigJobConnected = ConfigJobConnected()

model_config = SettingsConfigDict(
env_file_encoding="utf-8",
Expand Down

0 comments on commit b30a7d4

Please sign in to comment.