Skip to content

Commit

Permalink
Program version added
Browse files Browse the repository at this point in the history
  • Loading branch information
signag committed Feb 22, 2024
1 parent 874c278 commit 2f1680b
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 1 deletion.
4 changes: 4 additions & 0 deletions raspiCamSrv/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
from raspiCamSrv.version import version

from flask import (
Blueprint,
Expand Down Expand Up @@ -26,6 +27,7 @@
def register():
logger.debug("In register")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
sc = cfg.serverConfig
cp = cfg.cameraProperties
Expand Down Expand Up @@ -99,6 +101,7 @@ def register():
@bp.route("/login", methods=("GET", "POST"))
def login():
g.hostname = request.host
g.version = version
cfg = CameraCfg()
sc = cfg.serverConfig
cp = cfg.cameraProperties
Expand Down Expand Up @@ -137,6 +140,7 @@ def login():
@bp.route("/password", methods=("GET", "POST"))
def password():
g.hostname = request.host
g.version = version
cfg = CameraCfg()
sc = cfg.serverConfig
cp = cfg.cameraProperties
Expand Down
14 changes: 14 additions & 0 deletions raspiCamSrv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from werkzeug.exceptions import abort
from raspiCamSrv.camCfg import CameraCfg
from raspiCamSrv.camera_pi import Camera
from raspiCamSrv.version import version

from raspiCamSrv.auth import login_required
import logging
Expand All @@ -14,6 +15,7 @@
@login_required
def main():
g.hostname = request.host
g.version = version
# Although not directly needed here, the camara needs to be initialized
# in order to load the camera-specific parameters into configuration
cam = Camera().cam
Expand All @@ -36,6 +38,7 @@ def main():
def liveViewCfg():
logger.debug("In liveViewCfg")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -91,6 +94,7 @@ def liveViewCfg():
def addLiveViewControls():
logger.debug("In addLiveViewControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
cp = cfg.cameraProperties
Expand All @@ -117,6 +121,7 @@ def addLiveViewControls():
def remLiveViewControls():
logger.debug("In remLiveViewControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -159,6 +164,7 @@ def remLiveViewControls():
def photoCfg():
logger.debug("In photoCfg")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -213,6 +219,7 @@ def photoCfg():
def addPhotoControls():
logger.debug("In addPhotoControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
cp = cfg.cameraProperties
Expand All @@ -238,6 +245,7 @@ def addPhotoControls():
def remPhotoControls():
logger.debug("In remPhotoControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -277,6 +285,7 @@ def remPhotoControls():
def rawCfg():
logger.debug("In rawCfg")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -314,6 +323,7 @@ def rawCfg():
def addRawControls():
logger.debug("In addRawControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
cp = cfg.cameraProperties
Expand All @@ -339,6 +349,7 @@ def addRawControls():
def remRawControls():
logger.debug("In remRawControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -378,6 +389,7 @@ def remRawControls():
def videoCfg():
logger.debug("In videoCfg")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down Expand Up @@ -432,6 +444,7 @@ def videoCfg():
def addVideoControls():
logger.debug("In addVideoControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
cp = cfg.cameraProperties
Expand All @@ -457,6 +470,7 @@ def addVideoControls():
def remVideoControls():
logger.debug("In remVideoControls")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cp = cfg.cameraProperties
sm = cfg.sensorModes
Expand Down
31 changes: 31 additions & 0 deletions raspiCamSrv/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from raspiCamSrv.auth import login_required
from raspiCamSrv.camera_pi import Camera
from raspiCamSrv.camCfg import CameraCfg, ServerConfig
from raspiCamSrv.version import version
from libcamera import controls
import math
import os
Expand All @@ -19,6 +20,7 @@
def index():
logger.debug("In index")
g.hostname = request.host
g.version = version
cam = Camera()
logger.debug("Camera instantiated")
cfg = CameraCfg()
Expand Down Expand Up @@ -61,6 +63,7 @@ def displayImage(photo: str):
def focus_control():
logger.debug("In focus_control")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -139,6 +142,7 @@ def focus_control():
def trigger_autofocus():
logger.debug("In trigger_autofocus")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -171,6 +175,7 @@ def trigger_autofocus():
def set_zoom():
logger.debug("In set_zoom")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -204,6 +209,7 @@ def set_zoom():
def zoom_in():
logger.debug("In zoom_in")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
logger.debug("cfg.liveViewConfig.controls=%s",cfg.liveViewConfig.controls)
cc = cfg.controls
Expand Down Expand Up @@ -240,6 +246,7 @@ def zoom_in():
def zoom_out():
logger.debug("In zoom_out")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -289,6 +296,7 @@ def zoom_out():
def zoom_full():
logger.debug("In zoom_full")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -311,6 +319,7 @@ def zoom_full():
def pan_up():
logger.debug("In pan_up")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -340,6 +349,7 @@ def pan_up():
def pan_left():
logger.debug("In pan_left")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -369,6 +379,7 @@ def pan_left():
def pan_center():
logger.debug("In pan_center")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -398,6 +409,7 @@ def pan_center():
def pan_right():
logger.debug("In pan_right")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -427,6 +439,7 @@ def pan_right():
def pan_down():
logger.debug("In pan_down")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -470,6 +483,7 @@ def zoom_draw():
def ae_control():
logger.debug("In ae_control")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -531,6 +545,7 @@ def ae_control():
def exposure_control():
logger.debug("In exposure_control")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -593,6 +608,7 @@ def exposure_control():
def image_control():
logger.debug("In image_control")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -656,6 +672,7 @@ def image_control():
def meta_clear():
logger.debug("In meta_clear")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -673,6 +690,7 @@ def meta_clear():
def meta_prev():
logger.debug("In meta_prev")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -691,6 +709,7 @@ def meta_prev():
def meta_next():
logger.debug("In meta_next")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -710,6 +729,7 @@ def meta_next():
def photoBuffer_add():
logger.debug("In photoBuffer_add")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -744,6 +764,7 @@ def photoBuffer_remove():
def photoBuffer_prev():
logger.debug("In photoBuffer_prev")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -761,6 +782,7 @@ def photoBuffer_prev():
def photoBuffer_next():
logger.debug("In photoBuffer_next")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -778,6 +800,7 @@ def photoBuffer_next():
def show_photo():
logger.debug("In show_photo")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -791,6 +814,7 @@ def show_photo():
def hide_photo():
logger.debug("In hide_photo")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -804,6 +828,7 @@ def hide_photo():
def clear_buffer():
logger.debug("In clear_buffer")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -817,6 +842,7 @@ def clear_buffer():
def take_photo():
logger.debug("In take_photo")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -843,6 +869,7 @@ def take_photo():
def take_raw_photo():
logger.debug("In take_raw_photo")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -866,6 +893,7 @@ def take_raw_photo():
def record_video():
logger.debug("In record_video")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -899,6 +927,7 @@ def record_video():
def stop_recording():
logger.debug("In stop_recording")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down Expand Up @@ -948,6 +977,7 @@ def generateHistogram(sc:ServerConfig):
def show_histogram():
logger.debug("In show_histogram")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand All @@ -965,6 +995,7 @@ def show_histogram():
def show_metadata():
logger.debug("In show_metadata")
g.hostname = request.host
g.version = version
cfg = CameraCfg()
cc = cfg.controls
sc = cfg.serverConfig
Expand Down
Loading

0 comments on commit 2f1680b

Please sign in to comment.