forked from frc1418/2015-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Aton.html
97 lines (78 loc) · 2.7 KB
/
Aton.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Autonomous</title>
<script src="Resources/d3/d3.js"></script>
<script src="Resources/jquery-2.1.3.min.js"></script>
<link href="Resources/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="Resources/dist/css/bootstrap-theme.min.css" rel="stylesheet">
<script src="Resources/dist/js/bootstrap.min.js"></script>
</head>
<link type="text/css" rel="stylesheet" href="AkiUI_MainPageCSS.css"></link>
<body class="UIPage">
<div class="MainDivide" id="AutoPathHolder">
<select id="AutoPathChoice">
</select>
<button class="btn-primary BinsLiftLevels" id="BinButton7" onclick="Socket.setKeyValue('binTo',7000,'write',true)">Bin 7000</button>
</div>
<br>
<div class="MainDivide settingsBox">
</div>
<script type="text/javascript" src="/networktables/networktables.js"></script>
<script type="text/javascript" src="writeSettings.js"></script>
<script>
/*
//var arr=new Array();
function findSelectedMode(){
var arr=new Array();
var arrayId='/SmartDashboard/Autonomous Mode/';
var selectedAutonomousMode;
if(!(NetworkTables.containsKey(arrayId+'selected'))||
NetworkTables.getValue(arrayId+'selected')==undefined){
selectedAutonomousMode=NetworkTables.getValue(arrayId+'default');
}
else{
selectedAutonomousMode=NetworkTables.getValue(arrayId+'selected');
}
console.log(selectedAutonomousMode);
//var arr={};
arr.push(selectedAutonomousMode);
return arr;
}
$(document).ready(
function(){
window.setTimeout(function(){
var arr= findSelectedMode();
fillAutonomousBox("#AutoPathChoice",'/SmartDashboard/Autonomous Mode/');
writeArray(arr,".settingsBox");
},300);
}
);
var $autoSelector=$('#AutoPathChoice');
$autoSelector.change(function(event){
var val=$autoSelector.find('option:selected').text();
NetworkTables.setValue('/SmartDashboard/Autonomous Mode/selected',val);
location.reload();
});
function fillAutonomousBox(key,arrayId,defaultVal){
d3.select(key)
.selectAll("select")
.data(NetworkTables.getValue(arrayId+'options'))
.enter()
.append("option")
.text(function(d,i){
return NetworkTables.getValue(arrayId+'options')[i];
});
if(!(NetworkTables.containsKey(arrayId+'selected'))||
NetworkTables.getValue(arrayId+'selected')==undefined){
$(key).val(NetworkTables.getValue(arrayId+'default'));
}
else{
$(key).val(NetworkTables.getValue(arrayId+'selected' ));
}
}
*/
</script>
</body>
</html>