Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Large update to layout, buttons, and graphs #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
9,189 changes: 5,821 additions & 3,368 deletions AvionicsData/accel.txt

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions AvionicsData/angul.txt

This file was deleted.

Binary file modified __pycache__/flaskApp.cpython-36.pyc
Binary file not shown.
74 changes: 58 additions & 16 deletions flaskApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,58 @@
import base64
import json
import numpy as np

from datetime import datetime
import time
import re

api_app = Flask(__name__)
CORS(api_app, support_credentials=True)

port = '/dev/cu.usbmodem1411'
ser = serial.Serial(port,9600, bytesize=8, parity=serial.PARITY_NONE, stopbits=1, timeout=2)

#port = '/dev/cu.usbmodem1411'
port = 'COM3'
ser = serial.Serial(port,9600, bytesize=8, parity=serial.PARITY_NONE, stopbits=1, timeout=2)
input_data = np.zeros(9)

def get_data():
ibuffer = "" # Buffer for raw data waiting to be processed
while True:
time.sleep(.1) # Best between .1 and 1
data = ser.read(4096) # May need to adjust read size
print(data)
ibuffer += data # Concat data sets that were possibly split during reading
ibuffer = "" # Buffer for raw data waiting to be processed
while True:
time.sleep(.05) # Best between .1 and 1
#data = ser.read(4096).decode('utf-8') # May need to adjust read size
data = re.sub("SETUP\r\n","",data).replace("\r\n","/")
data = re.sub("(//)*","",data).split("/")
if(len(data)>0):
if(data[0] == ''):
data = data[1:]
if(len(data)>0):
if(data[len(data)-1] == ''):
data = data[:len(data)-1]
if (len(data) == 13):
input_data = [data[1],data[3],data[4],data[5],data[7],data[8],data[9],data[11],data[12]]
print(input_data)
'''
ibuffer += data # Concat data sets that were possibly split during reading
if '\r\n' in ibuffer: # If complete data set
line, ibuffer = ibuffer.split('\r\n', 1) # Split off first completed set
yield line.strip('\r\n') # Sanitize and Yield data
'''

ser_data = get_data()
while True:
data = ser_data.next().replace(' ','').split(',')
#ser_data = get_data()
'''

while True:
data = next(ser_data).replace(' ','').split(',')
data = re.sub("SETUP\r\n","",data).replace("\r\n","/")
data = re.sub("(//)*","",data).split("/")
print(data)
if len(data) > 0:
"""
data processing down here

"""
ser.close()

ser.close()
'''
@api_app.route("/")
@cross_origin(supports_credentials=True)
def home():
Expand Down Expand Up @@ -78,13 +99,34 @@ def getAcc():

Data collected here will be displayed as rising and lowering bar graph.
"""
accel = {'accel':(np.random.rand()/10+.5)*1000}

#accel = {'altitude':(np.random.rand()/10+.5)*1000, 'accel':[(np.random.rand()/10+.5)*1000,(np.random.rand()/10+.5)*1000,(np.random.rand()/10+.5)*1000], 'angl':[(np.random.rand())*90-45,np.random.rand()*90-45,np.random.rand()*90-45],'gps':[np.random.rand()*90-45,np.random.rand()*90-45]}
global input_data
time.sleep(.1) # Best between .1 and 1
data = ser.read(4096).decode('utf-8') # May need to adjust read size
data = re.sub("SETUP\r\n","",data).replace("\r\n","/")
data = re.sub("(//)*","",data).split("/")
print(data)
if(len(data)>0):
if(data[0] == ''):
data = data[1:]
if(len(data)>0):
if(data[len(data)-1] == ''):
data = data[:len(data)-1]
if (len(data) == 13):
input_data = [data[1],data[3],data[4],data[5],data[7],data[8],data[9],data[11],data[12]]
print(input_data)

#process data into aarray input_data

print(input_data)
accel = {'altitude':input_data[0], 'accel':[input_data[1],input_data[2],input_data[3]], 'angl':[input_data[4],input_data[5],input_data[6]],'gps':[input_data[7],input_data[8]]}
print(json.dumps(accel))
f = open("./AvionicsData/accel.txt","a+")
f.write(str(json.dumps(accel))+"\n")
f.write(str(datetime.today().isoformat(' ')) + "\t" + str(json.dumps(accel))+"\n")
f.close()
return(json.dumps(accel))

@api_app.route("/getAng")
@cross_origin(supports_credentials=True)
def getAng():
Expand Down
Binary file added flaskApp.pyc
Binary file not shown.
15 changes: 0 additions & 15 deletions node_modules/.bin/eslint

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/handlebars

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/html-minifier

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/jest

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/jest-runtime

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/js-yaml

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/rc

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/sane

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/sha.js

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/shjs

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/strip-indent

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/svgo

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/sw-precache

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/uglifyjs

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/webpack

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/webpack-dev-server

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions node_modules/@types/d3-selection/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading