Skip to content

Commit

Permalink
done?
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoryw3 committed Apr 9, 2022
1 parent 11c6986 commit 3d55ad0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clientRocket/rocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ function stopRecording() {
function createLink() {
var gpsdiv = document.getElementById("googleMaps");
var newLink = document.createElement('a');
var linkText = "https://www.google.com/maps/@" + Latitude + ',' + Longitude;
var linkText = "https://www.google.com/maps/@" + Latitude + ',' + Longitude + ',15z';
newLink.setAttribute('href', linkText);
newLink.innerHTML = linkText;
if (gpsdiv.childElementCount > 0){
gpsdiv.removeChild();
gpsdiv.removeChild(newLink);
}
else{
gpsdiv.appendChild(newLink);
Expand Down
2 changes: 0 additions & 2 deletions clientRocket/websocket_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import datetime
import json
import os
import random
import socket
import time

Expand Down Expand Up @@ -39,7 +38,6 @@ def on_message(self, message):
print(json_message)
web_message = json_message.get('run')
start_time = time.time()
past_height = 0
if web_message:
ioloop.IOLoop.instance().add_timeout(datetime.timedelta(seconds=3),
self.send_data(start_time, web_message))
Expand Down
45 changes: 45 additions & 0 deletions data_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import socket
import time

# standard local host
host = socket.gethostname()
# doesn't really matter as long as it's not in use by another program and > 1023
port = 55021

baudrate = 57600
# creating and connecting to the socket to send to the web front end
try:
s = socket.socket()
except socket.error as err:
print("socket creation failed, for why?")
s.connect((host, port))


def main():
data = b''
list_data = [0, 0, 0, 0, -90, -180, 1.909090]
while True:
# data = b','.join(data)
for i in range(0, len(list_data)):
if i != 6:
list_data[i] += 1
else:
list_data[6] += 1.3898
if list_data[4] >= 90:
list_data[4] = -90
if list_data[5] >= 180:
list_data[5] = -180

for i in range(0, len(list_data)):
if i < (len(list_data) - 1):
data += (bytes(str(int(list_data[i])), 'utf-8') + bytes(',', 'utf-8'))
else:
data += (bytes(str(int(list_data[i])), 'utf-8'))
print(data)
s.send(data)
data = b''
time.sleep(1)


if __name__ == "__main__":
main()

0 comments on commit 3d55ad0

Please sign in to comment.