-
Notifications
You must be signed in to change notification settings - Fork 41
/
widget.html
201 lines (184 loc) · 15.3 KB
/
widget.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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>
<!--(auto-fill by runme.js-->
</title>
<!-- ChiliPeppr is based on bootstrap CSS. -->
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Customized version of require.js for ChiliPeppr. Please see require.js docs for how
ChiliPeppr's dependency system works as it's based on require.js. -->
<script type='text/javascript' src="//i2dcui.appspot.com/js/require.js"></script>
<!-- widget.css DON'T REMOVE -->
<style type='text/css'>
/* widget.css will get inlined here by runme.js. don't remove this comment or inlining will fail. */
</style>
<link rel="stylesheet" type="text/css" href="widget.css">
<!-- DON'T REMOVE end widget.css -->
<!-- widget.js DON'T REMOVE -->
<script type='text/javascript'>
//<![CDATA[
/* widget.js will get inlined here by runme.js. don't remove this comment or inlining will fail. */
//]]>
</script>
<script type='text/javascript' src="widget.js"></script>
<!-- DON'T REMOVE end widget.js -->
</head>
<body>
<div id="com-chilipeppr-widget-3dviewer" class="panel panel-default" style="float:left;">
<div class="panel-heading well">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group" data-style="padding-right:6px;">
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-viewextents" data-container="body" data-toggle="popover" data-placement="auto" data-content="View extents of GCode object" data-trigger="hover" data-delay="800"> <span class="glyphicon glyphicon-eye-open"></span>
</button>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-lookattoolhead active btn-primary" data-container="body" data-toggle="popover" data-placement="auto" data-content="Look at the toolhead toggle button. If toggled on, during the sample or real run of Gcode the 3D view will always place the toolhead at the center. Toggling this off means the camera will not reposition onto the toolhead during moves."
data-trigger="hover" data-delay="800"> <span class="glyphicon glyphicon-facetime-video"></span>
</button>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-jog" data-container="body" data-toggle="popover" data-placement="auto" data-content="Jog Mode. Click here or hold down Ctrl on the keyboard while your mouse is over the 3D viewer to turn on jog mode. This lets you move around the 3D object and click to jog based on where the jog head is at."
data-trigger="hover" data-delay="800">Jog</button>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-inspect" data-container="body" data-toggle="popover" data-placement="auto" data-content="Inspect Mode. Click here or hold down Shift on the keyboard while your mouse is over the 3D viewer to turn on inspect mode. This lets you inspect lines in the 3D Viewer."
data-trigger="hover" data-delay="800"><span class="glyphicon glyphicon-search"></span><span class="glyphicon glyphicon-hand-left" style="margin-left:0px;"></span>
</button>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-th"></span> <span class="caret" style="font-size:10px;margin-left: -2px;xmargin-right: -4px"></span></button>
<ul id="com-chilipeppr-widget-3dviewer-gridsizing" class="dropdown-menu xdropdown-menu-right" role="menu">
<li role="presentation" class="dropdown-header">Grid Size</li>
<li><a class="alert-info com-chilipeppr-widget-3dviewer-gridsizing-1x" href="javascript:">1x (Default)</a></li>
<li><a class="com-chilipeppr-widget-3dviewer-gridsizing-2x" href="javascript:">2x</a></li>
<li><a class="com-chilipeppr-widget-3dviewer-gridsizing-5x" href="javascript:">5x</a></li>
<li><a class="com-chilipeppr-widget-3dviewer-gridsizing-10x" href="javascript:">10x</a></li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-cog"></span> <span class="caret" style="font-size:10px;margin-left: -2px;xmargin-right: -4px"></span></button>
<ul id="com-chilipeppr-widget-3dviewer-settings" class="dropdown-menu xdropdown-menu-right" role="menu">
<li role="presentation" class="dropdown-header">Options</li>
<li><a class="com-chilipeppr-widget-3dviewer-settings-shadows" href="javascript:">Toggle Toolhead Shadow On/Off</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation" class="dropdown-header">Frame Rate of Rendering</li>
<li><a class="com-chilipeppr-widget-3dviewer-settings-fr com-chilipeppr-widget-3dviewer-settings-fr-5" href="javascript:">5 fps (Least CPU Usage)</a></li>
<li><a class="com-chilipeppr-widget-3dviewer-settings-fr com-chilipeppr-widget-3dviewer-settings-fr-10" href="javascript:">10 fps</a></li>
<li><a class="com-chilipeppr-widget-3dviewer-settings-fr com-chilipeppr-widget-3dviewer-settings-fr-15" href="javascript:">15 fps</a></li>
<li><a class="alert-info com-chilipeppr-widget-3dviewer-settings-fr com-chilipeppr-widget-3dviewer-settings-fr-30" href="javascript:">30 fps (Default)</a></li>
<li><a class="com-chilipeppr-widget-3dviewer-settings-fr com-chilipeppr-widget-3dviewer-settings-fr-60" href="javascript:">60 fps (Most CPU Usage)</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation" class="dropdown-header">For Super Slow Machines</li>
<li><a class="com-chilipeppr-widget-3dviewer-settings-fr com-chilipeppr-widget-3dviewer-settings-fr-0" href="javascript:">Disable 3D Viewer (No CPU Usage)</a></li>
</ul>
</div>
</div>
<div class="btn-group" data-style="padding-right:6px;">
<div class="btn-xs com-chilipeppr-widget-3dviewer-simulator-title" style="">Simulator</div>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-samplerun" data-container="body" data-toggle="popover" data-placement="auto" data-content="Play a sample run of the GCode" data-trigger="hover" data-delay="800"> <span class="glyphicon glyphicon-play"></span>
</button>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-samplerunspeed" data-container="body" data-toggle="popover" data-placement="auto" data-content="Speed up from x1 to x1000" data-trigger="hover" data-delay="800">x1</button>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-samplerunpause" data-container="body" data-toggle="popover" data-placement="auto" data-content="Pause the sample run of the GCode" data-trigger="hover" data-delay="800">
<span class="glyphicon glyphicon-pause"></span>
</button>
<button type="button" class="btn btn-xs btn-default com-chilipeppr-widget-3d-menu-samplerunstop" data-container="body" data-toggle="popover" data-placement="auto" data-content="Stop the sample run of the GCode" data-trigger="hover" data-delay="800"> <span class="glyphicon glyphicon-stop"></span>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span></button>
<ul id="com-chilipeppr-widget-3dviewer-dropdown" class="dropdown-menu dropdown-menu-right" role="menu">
<li><a class="com-chilipeppr-widget-3d-menu-samplerun" href="javascript:">Play Sample Run</a></li>
</ul>
</div>
<div class="btn-group" style="position:relative;font-size:9px;line-height:22px;">
<div style="position:absolute;top:-1px;left:28px;border:0px solid red;line-height:10px;" class="com-chilipeppr-widget-3dviewer-units-indicator">-</div>
<div style="position:absolute;top:5px;left:28px;border:0px solid red;" class="frames-per-sec">32 fps</div>
</div>
</div>
<span class="panel-title" style="padding-right:10px;" data-toggle="popover" data-trigger="hover" data-placement="auto" data-content="">3D Viewer</span>
<div style="xposition:absolute;bottom:-18px;left:0px;border:0px solid red;line-height:10px;" class="com-chilipeppr-widget-3dviewer-panzoom-indicator">Pan: Right-Click Drag, Zoom to: Mousewheel/Touchpad Scroll, Orbit: Mouse/Touch Drag</div>
</div>
<div id="com-chilipeppr-widget-3dviewer-body" class="panel-body">
<!-- WebGL rendering area -->
<div id="com-chilipeppr-widget-3dviewer-renderArea" tabindex="1">
<div class="youhavenowebgl hidden" style="width:100%;height:100%;color:white;position:absolute;top:0;left:0;">You appear to not have WebGL support or WebGL has crashed. The 3D Viewer can't be used without WebGL.</div>
<div class="data-details hidden">Drag and Drop Gcode Here...</div>
</div>
<div class="com-chilipeppr-widget-3dviewer-inspect panel hidden" style="top:40px;left:20px">
<table class="table table-bordered table-striped table-condensed">
<tbody>
<tr>
<th colspan="2" class="info-title">
<button type="button" class="close" style="width:100%;text-align:right;">×</button>
</th>
</tr>
<tr class="row-signal" xstyle="vertical-align:middle;">
<td xstyle="vertical-align:middle;">Line</td>
<td xstyle="vertical-align:middle;">
<span class="inspect-line" xstyle="vertical-align:middle;float:left;"></span>
<button class="btn btn-default btn-xs pull-right inspect-btn-goto">Go To</button>
</td>
</tr>
<tr class="">
<td class="">Gcode</td>
<td class="inspect-gcode"></td>
</tr>
<!-- <tr class="">
<td class="">Start</td>
<td class="inspect-start"></td>
</tr> -->
<tr class="">
<td class="">End Pos</td>
<td class="inspect-end"></td>
</tr>
<tr class="">
<td class="">Feedrate</td>
<td class="inspect-feedrate"></td>
</tr>
<tr>
<td>Distance of Move</td>
<td class="inspect-distance"></td>
</tr>
<tr>
<td>Time for This Line</td>
<td class="inspect-time"></td>
</tr>
<tr>
<td>Est Time to Get Here</td>
<td class="inspect-timeSum"></td>
</tr>
</tbody>
</table>
</div>
<div id="warningArea">
<div class="alert alert-warning alert-dismissable hidden">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>G2/G3 arcs only rendered as straight lines. They are yellow to show where actual positioning in your CNC will differ from 3D rendering. If anyone wants to fork and fix arcs, feel free.</div>
</div>
</div>
</div>
<!-- Modal for Out of Local Storage -->
<div id="com-chilipeppr-widget-3dviewer-outofspace" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">3D Viewer Out of Local Storage Space</h4>
</div>
<div class="modal-body">
<p>You are out of local storage space, so ChiliPeppr can't save your Gcode file. Please delete all of your local storage files for ChiliPeppr using the
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown"
data-container="body" data-toggle="popover" data-placement="auto" data-trigger="hover" data-title="Drag and Drop" data-content="Drag a Gcode file onto your browser window to load it."><span class="glyphicon glyphicon-file"></span><span class="glyphicon glyphicon-share-alt" style="margin-left:-2px;color:#666666;"></span> <span class="caret"></span></button> in the workspace.</p>
<p>You can also ignore this error and proceed since ChiliPeppr will simply load your file into RAM and function perfectly fine. The only downside is if you reload ChiliPeppr, it won't have your most recent file loaded.</p>
<p>Browsers typically only allow for 5MB of local storage, which isn't much.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
<script id="vertexShader" type="x-shader/x-vertex">
uniform vec3 viewVector; uniform float c; uniform float p; varying float intensity; void main() { vec3 vNormal = normalize( normalMatrix * normal ); vec3 vNormel = normalize( normalMatrix * viewVector ); intensity = pow( c - dot(vNormal, vNormel), p );
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }
</script>
<!-- fragment shader a.k.a. pixel shader -->
<script id="fragmentShader" type="x-shader/x-vertex">
uniform vec3 glowColor; varying float intensity; void main() { vec3 glow = glowColor * intensity; gl_FragColor = vec4( glow, 1.0 ); }
</script>
</div>
</body>
</html>