forked from hudbrog/gCodeViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
330 lines (305 loc) · 19.6 KB
/
index.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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>gcode viewer - online gcode viewer and analyzer in your browser!</title>
<meta name="description" content="Visual GCode viewer and analyzer in your browser. No need to upload you GCode anywhere, everything is done locally. " />
<meta name="keywords" content="GCode,g-code,viewer,online,javascript" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="language" content="english" />
<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="favicon.ico" />
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml" />
<link rel="meta" type="application/rdf+xml" title="Dublin" href="/dublin.rdf" />
<link rel="canonical" href="http://gcode.ws/" />
<link rel="stylesheet" type="text/css" href="css/cupertino/jquery-ui-1.9.0.custom.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" media="screen" />
<link rel="stylesheet" type="text/css" href="lib/codemirror.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<script type="text/javascript" src="lib/jquery-1.8.2.js"></script>
<script type="text/javascript" src="lib/jquery-ui-1.9.0.custom.js"></script>
<script type="text/javascript" src="lib/codemirror.js"></script>
<script type="text/javascript" src="lib/mode_gcode/gcode_mode.js"></script>
<script type="text/javascript" src="lib/three.js"></script>
<script type="text/javascript" src="lib/bootstrap.js"></script>
<script type="text/javascript" src="lib/modernizr.custom.09684.js"></script>
<script type="text/javascript" src="lib/TrackballControls.js"></script>
<script type="text/javascript" src="lib/zlib.min.js"></script>
<script type="text/javascript" src="js/ui.js"></script>
<script type="text/javascript" src="js/gCodeReader.js"></script>
<script type="text/javascript" src="js/renderer.js"></script>
<script type="text/javascript" src="js/analyzer.js"></script>
<script type="text/javascript" src="js/renderer3d.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-38437619-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<meta property="og:title" content="gCodeViewer - online gcode viewer and analyzer!" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://gcode.ws" />
<meta property="og:image" content="http://gcode.ws/screenshot.jpg" />
<meta property="og:site_name" content="Online GCode Viewer" />
<meta property="fb:admins" content="1537520789" />
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1&appId=122261684619414";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="analysisModal" class="modal hide fade">
<div class="modal-header">
<h3>Running analysis....</h3>
</div>
<div class="modal-body">
<div class="progress" >
<div id="analysisProgress" class="bar" style="width: 0;"></div>
</div>
</div>
<div class="modal-footer">
<a href="#" class="btn disabled">Please wait for process to get finished</a>
</div>
</div>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li >
<a class="brand" href="#">GCode Viewer</a>
</li>
</ul>
<ul class="nav pull-right">
<li class="dropdown">
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
Spread the word
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li class="socials">
<div class="g-plusone" data-annotation="inline" data-width="150"></div>
</li>
<li class="socials"><div class="fb-like" data-href="http://gcode.ws" data-send="false" data-layout="button_count" data-width="150" data-show-faces="true" data-action="recommend"></div></li>
<li class="socials"><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://gcode.ws" data-text="Check out a nice online gcode viewer!">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="wrap" class="ui-widget ui-widget-content ui-corner-all">
<div id="control">
<img src="img/logo.png" alt="gCodeViewer - an online gcode viewer"/>
<div id="accordion2" class="accordion">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#fileAccordionTab">
Select GCode file
</a>
</div>
<div id="fileAccordionTab" class="accordion-body collapse">
<div class="accordion-inner">
<input type="file" id="file" name="files" />
<!--<form class="add-teacher" id="fAddTeacher" enctype="multipart/form-data" method="post" novalidate="novalidate">-->
<!--<button id="selectFileButton">Select GCode File</button>-->
<!--</form>-->
<div id="drop_zone">Drop file here</div>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#progressAccordionTab">
Progress indicators
</a>
</div>
<div id="progressAccordionTab" class="accordion-body collapse">
<div class="accordion-inner">
<div id="progressBlock">
<div class="progress" >
<div id="loadProgress" class="bar" style="width: 0;"></div>
</div>
<div class="progress" >
<div id="analyzeProgress" class="bar" style="width: 0;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#infoAccordionTab">
Model info
</a>
</div>
<div id="infoAccordionTab" class="accordion-body collapse">
<div class="accordion-inner">
<p id="list"></p>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#layerAccordionTab">
Layer Info
</a>
</div>
<div id="layerAccordionTab" class="accordion-body collapse">
<div class="accordion-inner">
<p id="layerInfo"></p>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#options2DAccordionTab">
2D Render options
</a>
</div>
<div id="options2DAccordionTab" class="accordion-body collapse">
<div class="accordion-inner">
<label>Speed display type: </label>
<label for="speedDisplayRadio"><input type="radio" name="speedDisplay" id="speedDisplayRadio" value="1" onclick="GCODE.ui.processOptions()" checked> mm/sec</label>
<label for="exPerMMRadio"><input type="radio" name="speedDisplay" id="exPerMMRadio" value="1" onclick="GCODE.ui.processOptions()" > mm extrusion per mm move</label>
<label for="volPerSecRadio"><input type="radio" name="speedDisplay" id="volPerSecRadio" value="1" onclick="GCODE.ui.processOptions()" > mm^3/sec</label>
<label for="showMovesCheckbox"><input type="checkbox" id="showMovesCheckbox" value="1" onclick="GCODE.ui.processOptions()" checked> Show non-extrusion moves</label>
<label for="showRetractsCheckbox"><input type="checkbox" id="showRetractsCheckbox" value="2" onclick="GCODE.ui.processOptions()" checked> Show retracts and restarts</label>
<label for="moveModelCheckbox"><input type="checkbox" id="moveModelCheckbox" value="3" onclick="GCODE.ui.processOptions()" checked> Move model to the center of the grid</label>
<label for="differentiateColorsCheckbox"><input type="checkbox" id="differentiateColorsCheckbox" value="7" onclick="GCODE.ui.processOptions()" checked> Show different speeds with different colors</label>
<label for="thickExtrusionCheckbox"><input type="checkbox" id="thickExtrusionCheckbox" value="8" onclick="GCODE.ui.processOptions()"> Emulate extrusion width</label>
<label for="alphaCheckbox"><input type="checkbox" id="alphaCheckbox" value="10" onclick="GCODE.ui.processOptions()" > Render lines slightly transparent</label>
<!--<label for="widthModifier">Width modifier: <input type="text" value="2" id="widthModifier" onchange="GCODE.ui.processOptions()"/></label>-->
<label for="showNextLayer"><input type="checkbox" id="showNextLayer" value="9" onclick="GCODE.ui.processOptions()" > Show +1 layer</label>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#analyzeOptionsAccordioinTab">
GCode analyzer options
</a>
</div>
<div id="analyzeOptionsAccordioinTab" class="accordion-body collapse">
<div class="accordion-inner">
These require re-analyzing file:<br />
<label for="sortLayersCheckbox"><input type="checkbox" id="sortLayersCheckbox" value="4" onclick="GCODE.ui.processOptions()" checked>Sort layers by Z</label>
<label for="purgeEmptyLayersCheckbox"><input type="checkbox" id="purgeEmptyLayersCheckbox" value="5" onclick="GCODE.ui.processOptions()" checked>Hide empty layers</label>
<label for="showGCodeCheckbox"><input type="checkbox" id="showGCodeCheckbox" value="6" onclick="GCODE.ui.processOptions()" checked>Show GCode in GCode tab (memory intensive!)</label>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#printerInfoAccordioinTab">
Printer Info
</a>
</div>
<div id="printerInfoAccordioinTab" class="accordion-body collapse">
<div class="accordion-inner">
<label for="filamentDia">Plastic diameter: <input type="text" value="1.75" id="filamentDia" onchange="GCODE.ui.processOptions()"/></label>
<label>Plastic type: </label>
<label for="plasticABS"><input type="radio" name="radPlastic" id="plasticABS" value="ABS" onclick="GCODE.ui.processOptions()" checked>ABS</label>
<label for="plasticPLA"><input type="radio" name="radPlastic" id="plasticPLA" value="PLA" onclick="GCODE.ui.processOptions()" >PLA</label>
<label for="nozzleDia">Nozzle size: <input type="text" value="0.4" id="nozzleDia" onchange="GCODE.ui.processOptions()"/></label>
<label for="volumetricE"><input type="checkbox" id="volumetricE" onclick="GCODE.ui.processOptions()"> Volumetric E</label>
<label for="hourlyCost">Printer hourly cost: <input type="text" value="1.00" id="hourlyCost" onchange="GCODE.ui.processOptions()"/></label>
<label for="filamentPrice">Filament price(per gram): <input type="text" value="0.05" id="filamentPrice" onchange="GCODE.ui.processOptions()"/></label>
</div>
</div>
</div>
<div class="accordion-group hide" id="errAnalyseTab">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#errorAnalysisAccordioinTab">
Error Analysis
</a>
</div>
<div id="errorAnalysisAccordioinTab" class="accordion-body collapse">
<div class="accordion-inner">
<button class="btn disabled" id="runAnalysisButton" onclick="GCODE.analyzer.runAnalyze()"/>Run analysis</button>
<div id="analysisOptionsDiv" class="hide">
<label for="renderErrors"><input type="checkbox" id="renderErrors" onclick="GCODE.ui.processOptions()">Render error analysis results</label>
</div>
</div>
</div>
</div>
</div>
<output id="errorList"></output>
</div>
<div id="gcode">
<div id="tabs-min" class="tabbable">
<ul id="myTab" class="nav nav-tabs">
<li class=""><a href="#tab2d" data-toggle="tab">2D</a></li>
<li class=""><a href="#tab3d" data-toggle="tab">3D</a></li>
<li class=""><a href="#tabGCode" data-toggle="tab">GCode</a></li>
<li class="active"><a href="#tabAbout" data-toggle="tab">About</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="tab2d">
<canvas id="canvas" width="650" height="620"></canvas>
<div id="slider-vertical"></div>
<div id="slider-horizontal"></div>
</div>
<div class="tab-pane" id="tab3d">
<div id="3d_container"></div>
</div>
<div class="tab-pane" id="tabGCode">
<div id="gCodeContainer"></div>
</div>
<div class="tab-pane active" id="tabAbout">
<div class="aboutpage">
<h1>gCodeViewer</h1>
<b>gCodeViewer</b> is a visual GCode visualizer, viewer and analyzer in your own browser! It works on any OS in almost any modern browser (chrome, ff, safari 6, opera, ie10 should work too). All you need to do - is drag your *.gcode file to the designated zone.<br /><br />
Current features include:<br />
<ul>
<li>Visualize GCode in 2D, layer by layer
<ul>
<li>Show retracts and restarts</li>
<li>Show print/move/retract speeds</li>
<li>Display only part of layer, animate sequence of layer printing</li>
<li>Show two layers simultaneously so you can check overhangs</li>
<li>Adjust line width to simulate print more closely</li>
<li><b>Gcode viewer will try to parse nozzle and filament diameters from gcode, but it may fail to do so. In that case you will need to set it manually in 'Printer Info' tab</b></li>
</ul>
</li>
<li>Analyze GCode
<ul>
<li>Print time, amount of plastic used, layer height, etc. for whole file and for single layer</li>
<li>Reference visualized part to GCode file (i.e. select a certain part of 2d visualization, switch to GCode view - it will highlight list of lines responsible for visualized piece)</li>
</ul>
</li>
<li>Multiplatform, available online (but works offline too), works locally (doesn't upload you g-code anywhere or download anything but application itself)</li>
<li>3D visualization (I don't know what for, it's dull and useless.. need to rewrite it from scratch)</li>
<li>And yeah, it's slow, memory hungry and only supports modern browsers</li>
<li>Totally open source so you can use it as you like</li>
</ul>
<br /><br />
All sources are available at <a href="https://github.com/hudbrog/gCodeViewer">https://github.com/hudbrog/gCodeViewer</a><br />
If you find any bugs or have feature requests - don't hesitate to post them to <a href="https://github.com/hudbrog/gCodeViewer/issues">https://github.com/hudbrog/gCodeViewer/issues</a><br />
And I would appreciate if you like it on Thingiverse page: <a href="http://www.thingiverse.com/thing:35248">http://www.thingiverse.com/thing:35248</a><br />
</div>
</div>
</div>
</div>
</div>
</div>
<script>
GCODE.ui.initHandlers();
</script>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</body>
</html>