-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Apexcharts' of https://github.com/CCGSRobotics/RoboHUD
- Loading branch information
Showing
6 changed files
with
83 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Charts</title> | ||
<link rel="stylesheet" href="CSS/main.css"> | ||
<script type="text/javascript" src="JS/main.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div class="main"> | ||
<canvas id="myChart" width="400" height="400"></canvas> | ||
<script> | ||
//http://www.chartjs.org/docs/latest/ | ||
var Chart = require('chart.js'); | ||
var ctx = document.getElementById("myChart").getContext('2d'); | ||
var myChart = new Chart(ctx, { | ||
type: 'bar', | ||
data: { | ||
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], | ||
datasets: [{ | ||
label: '# of Votes', | ||
data: [12, 19, 3, 5, 2, 3], | ||
backgroundColor: [ | ||
'rgba(255, 99, 132, 0.2)', | ||
'rgba(54, 162, 235, 0.2)', | ||
'rgba(255, 206, 86, 0.2)', | ||
'rgba(75, 192, 192, 0.2)', | ||
'rgba(153, 102, 255, 0.2)', | ||
'rgba(255, 159, 64, 0.2)' | ||
], | ||
borderColor: [ | ||
'rgba(255,99,132,1)', | ||
'rgba(54, 162, 235, 1)', | ||
'rgba(255, 206, 86, 1)', | ||
'rgba(75, 192, 192, 1)', | ||
'rgba(153, 102, 255, 1)', | ||
'rgba(255, 159, 64, 1)' | ||
], | ||
borderWidth: 1 | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero:true | ||
} | ||
}] | ||
} | ||
} | ||
}); | ||
console.log(myChart) | ||
</script> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,29 +6,30 @@ | |
<link rel="stylesheet" href="CSS/main.css"> | ||
<script type="text/javascript" src="JS/main.js"></script> | ||
<script type="text/javascript" scr="JS/Resources/Player/server-tcp.js"></script> | ||
<script type="text/javascript" src="JS/client.js"></script> | ||
<script type="text/javascript"> | ||
execute('node App/JS/Resources/Player/server-tcp.js'); | ||
function startCamera() { | ||
execute(`sshpass -p \"raspberry\" ssh [email protected] 'raspivid -t 0 -o - -w 960 -h 540 -fps 25 -pf baseline | nc -k -l 5000'`) | ||
var iframe = document.createElement('iframe'); | ||
iframe.setAttribute('id', 'camera-view'); | ||
iframe.setAttribute('src', 'http://localhost:8080'); | ||
iframe.setAttribute('width', '1000'); | ||
iframe.setAttribute('height', '625'); | ||
execute('node App/JS/Resources/Player/server-tcp.js'); | ||
function startCamera() { | ||
// execute(`sshpass -p \"raspberry\" ssh [email protected] 'raspivid -t 0 -o - -w 960 -h 540 -fps 25 -pf baseline | nc -k -l 5000'`) | ||
var iframe = document.createElement('iframe'); | ||
iframe.setAttribute('id', 'camera-view'); | ||
iframe.setAttribute('src', 'http://localhost:8080'); | ||
iframe.setAttribute('width', '1000'); | ||
iframe.setAttribute('height', '625'); | ||
|
||
var markerPoint = document.getElementById('marker'); | ||
markerPoint.parentNode.insertBefore(iframe, markerPoint); | ||
var markerPoint = document.getElementById('marker'); | ||
markerPoint.parentNode.insertBefore(iframe, markerPoint); | ||
|
||
document.getElementById('cameraToggle').setAttribute('onclick', 'stopCamera()'); | ||
document.getElementById('cameraToggle').innerHTMl = 'Stop'; | ||
} | ||
document.getElementById('cameraToggle').setAttribute('onclick', 'stopCamera()'); | ||
document.getElementById('cameraToggle').innerHTMl = 'Stop'; | ||
} | ||
|
||
function stopCamera() { | ||
execute(`sshpass -p \"raspberry\" ssh [email protected] 'pkill -f raspivid && pkill -f \"nc -k -l 5000\"'`); | ||
var toggleButton = document.getElementById('cameraToggle'); | ||
document.getElementById('cameraToggle').setAttribute('onclick', 'startCamera()'); | ||
document.getElementById('cameraToggle').innerHTMl = 'Start'; | ||
} | ||
function stopCamera() { | ||
execute(`sshpass -p \"raspberry\" ssh [email protected] 'pkill -f raspivid && pkill -f \"nc -k -l 5000\"'`); | ||
var toggleButton = document.getElementById('cameraToggle'); | ||
document.getElementById('cameraToggle').setAttribute('onclick', 'startCamera()'); | ||
document.getElementById('cameraToggle').innerHTMl = 'Start'; | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters