Code formatting
This commit is contained in:
parent
0234b20ce3
commit
2bfb988460
60 changed files with 392 additions and 396 deletions
|
|
@ -1,15 +1,13 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import time
|
||||
import os
|
||||
import shutil
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import threading
|
||||
|
||||
import time
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
from labthings import StrictLock, ClientEvent
|
||||
from labthings import ClientEvent, StrictLock
|
||||
|
||||
|
||||
class BaseCamera(metaclass=ABCMeta):
|
||||
|
|
|
|||
|
|
@ -6,20 +6,19 @@
|
|||
from __future__ import division
|
||||
|
||||
import io
|
||||
import time
|
||||
import numpy as np
|
||||
from PIL import Image, ImageFont, ImageDraw
|
||||
from datetime import datetime
|
||||
|
||||
import logging
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
# Type hinting
|
||||
from typing import Tuple
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
from openflexure_microscope.camera.base import BaseCamera
|
||||
from openflexure_microscope.captures import CaptureObject
|
||||
|
||||
|
||||
"""
|
||||
PIL spams the logger with debug-level information. This is a pain when debugging api.app.
|
||||
We override the logging settings in api.app by setting a level for PIL here.
|
||||
|
|
|
|||
|
|
@ -29,31 +29,31 @@ to temporarily increase the capture resolution.
|
|||
from __future__ import division
|
||||
|
||||
import io
|
||||
import time
|
||||
import numpy as np
|
||||
import os
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
|
||||
# Type hinting
|
||||
from typing import Tuple
|
||||
|
||||
import numpy as np
|
||||
|
||||
# Pi camera
|
||||
import picamerax
|
||||
import picamerax.array
|
||||
|
||||
# Type hinting
|
||||
from typing import Tuple
|
||||
|
||||
from openflexure_microscope.camera.base import BaseCamera
|
||||
from openflexure_microscope.captures import CaptureObject
|
||||
from openflexure_microscope.paths import settings_file_path
|
||||
from openflexure_microscope.utilities import (
|
||||
json_to_ndarray,
|
||||
ndarray_to_json,
|
||||
serialise_array_b64,
|
||||
)
|
||||
|
||||
# Richard's fix gain
|
||||
from .set_picamera_gain import set_analog_gain, set_digital_gain
|
||||
|
||||
from openflexure_microscope.paths import settings_file_path
|
||||
from openflexure_microscope.utilities import (
|
||||
serialise_array_b64,
|
||||
ndarray_to_json,
|
||||
json_to_ndarray,
|
||||
)
|
||||
|
||||
|
||||
# MAIN CLASS
|
||||
class PiCameraStreamer(BaseCamera):
|
||||
|
|
@ -115,7 +115,7 @@ class PiCameraStreamer(BaseCamera):
|
|||
self.picamera_lst_path = settings_file_path(
|
||||
"picamera_lst.npy"
|
||||
) #: str: Path of .npy lens shading table file
|
||||
|
||||
|
||||
# Start the stream worker on init
|
||||
self.start_worker()
|
||||
|
||||
|
|
@ -348,7 +348,7 @@ class PiCameraStreamer(BaseCamera):
|
|||
"Suppressed a ValueError exception in start_preview. Exception: {}".format(
|
||||
e
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
def stop_preview(self):
|
||||
"""Stop the on board GPU camera preview."""
|
||||
|
|
@ -538,7 +538,7 @@ class PiCameraStreamer(BaseCamera):
|
|||
bayer=(not use_video_port) and bayer,
|
||||
use_video_port=use_video_port,
|
||||
)
|
||||
#time.sleep(0.1)
|
||||
# time.sleep(0.1)
|
||||
|
||||
# Set resolution and start stream recording if necessary
|
||||
if not use_video_port:
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
from ._remove import remove
|
||||
from ._load import load
|
||||
from ._dump import dump
|
||||
from ._transplant import transplant
|
||||
from ._insert import insert
|
||||
from ._exif import *
|
||||
from ._exceptions import *
|
||||
|
||||
from ._exif import *
|
||||
from ._insert import insert
|
||||
from ._load import load
|
||||
from ._remove import remove
|
||||
from ._transplant import transplant
|
||||
|
||||
VERSION = "1.1.2"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import struct
|
|||
from ._common import *
|
||||
from ._exif import *
|
||||
|
||||
|
||||
TIFF_HEADER_LENGTH = 8
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import io
|
|||
import struct
|
||||
import sys
|
||||
|
||||
from . import _webp
|
||||
from ._common import *
|
||||
from ._exceptions import InvalidImageDataError
|
||||
from . import _webp
|
||||
|
||||
|
||||
def insert(exif, image, new_file=None):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import struct
|
||||
import sys
|
||||
|
||||
from . import _webp
|
||||
from ._common import *
|
||||
from ._exceptions import InvalidImageDataError
|
||||
from ._exif import *
|
||||
from . import _webp
|
||||
|
||||
LITTLE_ENDIAN = b"\x49\x49"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import io
|
||||
|
||||
from ._common import *
|
||||
from . import _webp
|
||||
from ._common import *
|
||||
|
||||
|
||||
def remove(src, new_file=None):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import picamerax
|
||||
from picamerax import mmal, mmalobj, exc
|
||||
from picamerax.mmalobj import to_rational
|
||||
import time
|
||||
import logging
|
||||
import time
|
||||
|
||||
import picamerax
|
||||
from picamerax import exc, mmal, mmalobj
|
||||
from picamerax.mmalobj import to_rational
|
||||
|
||||
MMAL_PARAMETER_ANALOG_GAIN = mmal.MMAL_PARAMETER_GROUP_CAMERA + 0x59
|
||||
MMAL_PARAMETER_DIGITAL_GAIN = mmal.MMAL_PARAMETER_GROUP_CAMERA + 0x5A
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue