Repository navigation
Expand file tree
/
Copy pathmonitor.soy
More file actions
168 lines (145 loc) · 3.98 KB
/
Copy pathmonitor.soy
File metadata and controls
168 lines (145 loc) · 3.98 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/**
* @fileoverview Monitor for the Sphero mode.
*
* @license Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @author mbordihn@google.com (Markus Bordihn)
*/
{namespace cwc.soy.mode.sphero.Monitor autoescape="strict"}
/**
* Intro template.
*/
{template .intro}
{@param prefix: string}
<div id="{$prefix}intro">
The following screens allow you to control, monitor and calibrate the Sphero ball.<br>
<br>
Please calibrate your Sphero in the calibration screen before you execute any programm.<br>
</div>
{/template}
/**
* Calibration template.
*/
{template .calibration}
{@param prefix: string}
<div>
Sphero Callibration Screen<hr>
</div>
<p>
<input type="range" id="{$prefix}calibration-slide" min="0" max="360" value="180" class="mdl-slider mdl-js-slider">
</p>
<p>
Move the slider to the left / right until the tailing light shows in your direction.<br>
</p>
{/template}
/**
* Control template.
*/
{template .control}
{@param prefix: string}
<div id="{$prefix}control">
Use the buttons belows or the keyboard to control the Sphero manual.<br>
<div id="{$prefix}control-buttons">
<div id="{$prefix}move-left" class="icon_36px icon_button">keyboard_arrow_left</div>
<div id="{$prefix}move-forward" class="icon_36px icon_button">keyboard_arrow_up</div>
<div id="{$prefix}move-backward" class="icon_36px icon_button">keyboard_arrow_down</div>
<div id="{$prefix}move-right" class="icon_36px icon_button">keyboard_arrow_right</div>
</div>
<div id="{$prefix}control-commands">
<div id="{$prefix}sleep" class="icon_36px icon_button">local_hotel</div>
<div class="mdl-tooltip" for="{$prefix}sleep">
Puts the connected unit to sleep.
</div>
<div id="{$prefix}stop" class="icon_36px icon_button">pan_tool</div>
<div class="mdl-tooltip" for="{$prefix}stop">
Stops the executing of the code and the connected unit. (Space-key)
</div>
</div>
</div>
{/template}
/**
* Monitor template.
*/
{template .monitor}
{@param prefix: string}
<div id="{$prefix}location">
<div class="mdl-spinner mdl-js-spinner is-active"></div>Waiting for data ...
</div>
<div id="{$prefix}velocity"></div>
<div id="{$prefix}speed"></div>
{/template}
/**
* Location data template.
*/
{template .locationData}
{@param prefix: string}
{@param data: ?}
<h3>Location</h3>
<div id="{$prefix}location-data-values">
X: {$data.x}<br>
Y: {$data.y}<br>
</div>
{/template}
/**
* Velocity data template.
*/
{template .velocityData}
{@param prefix: string}
{@param data: ?}
<h3>Velocity</h3>
<div id="{$prefix}velocity-data-values">
X: {$data.x}<br>
Y: {$data.y}<br>
</div>
{/template}
/**
* Velocity data template.
*/
{template .speedData}
{@param prefix: string}
{@param data: ?}
<h3>Speed</h3>
<div id="{$prefix}speed-data-values">
{$data}
</div>
{/template}
/**
* Style definitions.
*/
{template .style}
{@param prefix: string}
#{$prefix}intro,
#{$prefix}control,
#{$prefix}calibration {lb}
padding: 5px;
position: relative;
{rb}
#{$prefix}control-buttons {lb}
width: 150px;
margin: auto;
padding-bottom: 10px;
{rb}
#{$prefix}calibration-buttons {lb}
width: 200px;
margin: auto;
padding-bottom: 10px;
{rb}
#{$prefix}control-buttons:first-child {lb}
padding-left: 3px;
{rb}
#{$prefix}system-buttons > div {lb}
padding: 10px;
{rb}
{/template}