Skip to content

Commit

Permalink
minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardosgeral committed Mar 8, 2019
1 parent a2dea46 commit 1a140ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Binary file modified Nextion/HMI/relier.HMI
Binary file not shown.
8 changes: 5 additions & 3 deletions camera_timelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def CaptureImage(self):
if not os.path.exists(self.picsLocation): # Create the directory if it doesn't exist.
os.makedirs(self.picsLocation)
#take the actual photo
try:
command = 'fswebcam -i 0 -d v4l2:/dev/video0 -r 1280x960 -fps 20 -S 5 --top-banner --font sans:28 --timestamp "%Y-%m-%d %H:%M" ' \
' --title "{} hh:mm:ss" --subtitle "{} liters/hour" ' \
try: ## fswebcam --list-controls (in the terminal)
command = 'fswebcam -i 0 -d v4l2:/dev/video0 -r 1600x1200 -fps 0 -S 4 --top-banner --font sans:28 --timestamp "%Y-%m-%d %H:%M"'\
' -s Brightness=6 -s Contrast=14 -s Saturation=54 -s Hue=0 -s "White Balance Temperature, Auto"=False -s Gamma=182 -s "White Balance Temperature"=4000 -s Gain=8 -s Sharpness=7'\
' -s "Exposure, Auto"="Aperture Priority Mode" -s "Exposure (Absolute)"=200'\
' --title "{} hh:mm:ss" --subtitle "{} liters/hour"'\
' --info "Test name: {} | Type: {}" --save {}/{}.jpg'.format(self.elapsed, self.flowrate ,self.testname, self.testtype, self.picsLocation, self.getDateTime())
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) # take snap
process.wait(timeout=0)
Expand Down
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,15 @@ def read_display_write(e_rdw): # read and display data in page "record" and writ
#t_pics.join() # takes too long. don't use
t2=time.time()
delta=t2-t1
if delta >= float(inp['interval']):
delta=float(inp['interval'])-0.5 # half second interval if delta is bigger than interval

if delta >= float(inp['interval']):
delta=float(inp['interval'])
sleep(float(inp['interval'])-delta) # Interval between records


### time to make video
if doMovie == 1:
sleep(1)
nxlib.nx_setcmd_1par(ser,'page', 15)
# make video in a separate thread
ip = get_ip_address()
Expand Down
2 changes: 2 additions & 0 deletions movie_timelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def MovieMaker(self):
nxlib.nx_setText(nxlib.ser, nxApp.ID_ip[0], nxApp.ID_ip[1], str(self.ip))

try:
os.remove(os.path.join('/home/pi/relier', '0')) ## fswebcam creates this temporary file
os.remove(os.path.join('/home/pi/relier', '10')) ## fswebcam creates this temporary file
os.remove(os.path.join('/home/pi/relier', '20')) ## fswebcam creates this temporary file
os.remove(os.path.join('/home/pi/relier', '30')) ## fswebcam creates this temporary file
except:
Expand Down

0 comments on commit 1a140ad

Please sign in to comment.