Skip to content

Commit

Permalink
Removing webcam code (#649)
Browse files Browse the repository at this point in the history
Partly a shameless attempt to increase code coverage. ;)
  • Loading branch information
wtgee authored Sep 30, 2018
1 parent e52c15a commit e64c296
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 263 deletions.
34 changes: 2 additions & 32 deletions bin/peas_shell
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ from pprint import pprint

from peas.sensors import ArduinoSerialMonitor
from peas.weather import AAGCloudSensor
from peas.webcam import Webcam

from pocs.utils import current_time
from pocs.utils.config import load_config
Expand All @@ -23,7 +22,6 @@ class PanSensorShell(cmd.Cmd):
""" A simple command loop for the sensors. """
intro = 'Welcome to PEAS Shell! Type ? for help'
prompt = 'PEAS > '
webcams = None
environment = None
weather = None
active_sensors = dict()
Expand All @@ -49,7 +47,7 @@ class PanSensorShell(cmd.Cmd):
console.color_print("{:>12s}: ".format('Loop Timer'),
"default", "inactive", "yellow")

for sensor_name in ['environment', 'weather', 'webcams']:
for sensor_name in ['environment', 'weather']:
if sensor_name in self.active_sensors:
console.color_print("{:>12s}: ".format(sensor_name.title()),
"default", "active", "lightgreen")
Expand Down Expand Up @@ -106,7 +104,7 @@ class PanSensorShell(cmd.Cmd):
""" Toggle DEBUG on/off for sensor
Arguments:
sensor {str} -- environment, weather, webcams
sensor {str} -- environment, weather
"""
# TODO(jamessynge): We currently use a single logger, not one per module or sensor.
# Figure out whether to keep this code and make it work, or get rid of it.
Expand Down Expand Up @@ -141,34 +139,6 @@ class PanSensorShell(cmd.Cmd):
return
self.do_load_weather()
self.do_load_environment()
# self.do_load_webcams()

def do_load_webcams(self, *arg):
""" Load the webcams """
if self._keep_looping:
print_error('The timer loop is already running.')
return
print("Loading webcams")

class WebCams(object):

def __init__(self, config):

self.webcams = list()
self.config = config

for webcam in self.config:
# Create the webcam
if os.path.exists(webcam.get('port')):
self.webcams.append(Webcam(webcam))

def capture(self, **kwargs):
for wc in self.webcams:
wc.capture()

self.webcams = WebCams(self.config.get('webcams', []))

self.do_enable_sensor('webcams')

def do_load_environment(self, *arg):
""" Load the arduino environment sensors """
Expand Down
8 changes: 0 additions & 8 deletions conf_files/peas.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
webcams:
-
name: 'cam_01'
port: '/dev/video0'
-
name: 'cam_02'
port: '/dev/video1'
directories:
images: '/var/panoptes/images'
webcam: '/var/panoptes/webcams'
data: '/var/panoptes/data'
environment:
auto_detect: True
Expand Down
1 change: 0 additions & 1 deletion conf_files/pocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ location:
directories:
base: /var/panoptes
images: images
webcam: webcams
data: data
resources: POCS/resources/
targets: POCS/resources/targets
Expand Down
222 changes: 0 additions & 222 deletions peas/webcam.py

This file was deleted.

0 comments on commit e64c296

Please sign in to comment.