This repository has been archived by the owner on Jan 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
index_old.html
893 lines (792 loc) · 60.2 KB
/
index_old.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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=yes, user-scalable=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="">
<meta name="author" content="">
<!--
AUTHOR: Peter van der Walt
With:
3D Viewer, SVG Import, SVG/DXF CAM: John Lauer and Joe Walnes
DXF Import: Ben Zuillsmith
Raster: Peter van der Walt and Nathaniel Stenzel
Documentation and Wiki: Anthony Bolgar
LaserWeb Version 2.0 - A Web Based Lasercutter CAM
Copyright (C) 2016 Peter van der Walt
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<title>LaserWeb 2.0</title>
<!-- Bootstrap and UX -->
<link type="text/css" rel="stylesheet" media="all" href="lib/bootstrap/css/bootstrap.min.css" id="theme_css" />
<link type="text/css" rel="stylesheet" media="all" href="lib/bootstrap/css/bootstrap-callouts.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/main.css" id="extra_css" />
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/jquery/mindmup-editabletable.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="lib/bootstrap/js/bootstrap-filestyle.js"></script>
<script src="lib/bootstrap/js/dropdowns-enhancement.js"></script>
<link type="text/css" rel="stylesheet" media="all" href="lib/bootstrap/css/bootstrap-colorselector.css" id="extra_css" />
<script src="lib/bootstrap/js/bootstrap-colorselector.js"></script>
<script src="lib/nprogress/nprogress.js"></script>
<link rel="stylesheet" href="lib/nprogress/nprogress.css" />
<link rel="stylesheet" href="lib/jquery/jquery-ui.css" />
<script src="lib/jquery/jquery-ui.js"></script>
<!-- Font -->
<link rel="stylesheet" href="css/font-awesome.css" />
<!-- ThreeJS -->
<script src="lib/threejs/three.min.js"></script>
<script src="lib/threejs/GridRect.js"></script>
<script src="lib/threejs/OrbitControls.js"></script>
<script src="lib/threejs/Projector.js"></script>
<script src="lib/threejs/CanvasRenderer.js"></script>
<script src="lib/threejs/TransformControls.js"></script>
<script src="js/viewer.js"></script>
<!-- Serial Port JSON -->
<script src="js/spjs.js"></script>
<!-- DXF Library -->
<script type="text/javascript" src="lib/dxf/dxf-parser.js"></script>
<script type="text/javascript" src="lib/dxf/three-dxf.js"></script>
<script type="text/javascript" src="js/dxf-render.js"></script>
<!-- SVG New Lib -->
<script type="text/javascript" src="lib/snap/snap.svg-min.js"></script>
<script type="text/javascript" src="js/svg-render.js"></script>
<!-- Three CAM -->
<script type="text/javascript" src="js/fileprep.js"></script>
<script type="text/javascript" src="js/threegcode.js"></script>
<script type="text/javascript" src="lib/clipperjs/clipper_unminified.js"></script>
<!-- Raster CAM -->
<script type="text/javascript" src="js/raster.js"></script>
<script type="text/paperscript" src="js/laserraster.js" canvas="canvas-1"></script>
<script type="text/javascript" src="lib/paperjs/paper-full.min.js"></script>
<!-- STL Cam -->
<script type="text/javascript" src="lib/slacer/stl.js"></script>
<script type="text/javascript" src="lib/slacer/slicer.js"></script>
<script type="text/javascript" src="lib/slacer/mesh.js"></script>
<script type="text/javascript" src="js/stlcam.js"></script>
<!-- Jog Widget -->
<script type="text/javascript" src="js/jog.js"></script>
<!-- Smoothie Ethernet -->
<script type="text/javascript" src="js/smoothie.js"></script>
<!-- Grbl -->
<script type="text/javascript" src="js/grbl.js"></script>
<!-- Macros Panel -->
<script src="js/macros.js"></script>
<!-- Saved/load settings -->
<script src="js/localstorage.js"></script>
<!-- Gcode Viewer -->
<script src="lib/gcode-viewer/gcode-parser.js"></script>
<script src="lib/gcode-viewer/ui.js"></script>
<!-- User Interface -->
<script src="js/main.js"></script>
</head>
<body>
<div id="renderArea"></div>
<!-- Note - background div - see CSS -->
<nav id="navbar-top" class="navbar navbar-default navbar-static navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#top-menu"> <span class="sr-only">Menu</span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse bs-js-navbar-collapse" id="top-menu">
<form class="navbar-form navbar-left" role="form">
<span class="btn btn-lg btn-default btn-file" title="Open a png, .jpg, .jpeg, .bmp, .gcode, .svg, .dxf, or .stl file"><i class="fa fa-folder-open fa-fw"></i>Open<input id="file" type="file" accept=".png,.jpg,.jpeg,.bmp,.gcode,.g,.svg,.dxf,.stl" /></span>
</form>
<form class="navbar-form navbar-left" role="form">
<a class="btn btn-lg btn-default" id="toggleviewer" href="#"><i class="fa fa-w fa-picture-o"></i> View</a>
<a class="btn btn-lg btn-default" id="togglefile" href="#"><i class="fa fa-w fa-file-image-o"></i> File</a>
<a class="btn btn-lg btn-default" id="togglegcode" href="#"><i class="fa fa-w fa-codepen"></i> G-Code</a>
</form>
<form class="navbar-form navbar-left" role="form">
<a class="btn btn-lg btn-default" id="togglemachine" href="#"><i class="fa fa-w fa-tasks"></i> Machine</a>
<a class="btn btn-lg btn-default" id="togglemacro" href="#"><i class="fa fa-w fa-th"></i> Macro</a>
<a class="btn btn-lg btn-default" id="togglesettings" href="#"><i class="fa fa-w fa-cogs"></i> Settings</a>
</form>
</div>
</div>
</nav>
<!-- /navbar-top -->
<nav id="navbar-bottom" class="navbar navbar-default navbar-static navbar-fixed-bottom" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#bottom-menu"> <span class="sr-only">Menu</span>
<span class="icon-bar"></span>
</button>
<!--a class="navbar-brand" href="#">LaserWeb 2.0</a -->
</div>
<div class="collapse navbar-collapse bs-js-navbar-collapse" id="bottom-menu">
<form class="navbar-form navbar-left" role="form">
<div class="form-group">
<label for="port"><i class="fa fa-usb fa-lg"></i></label>
<!--input type="select" class="form-control" id="port" -->
<select id="port" class="form-control input-lg" disabled>
<option value="no">Select port</option>
</select>
</div>
<div class="form-group">
<label for="buffer"><i class="fa fa-link fa-lg"></i></label>
<!--input type="select" class="form-control" id="baud"-->
<select id="buffer" class="form-control input-lg" disabled>
<option value="no">Select buffer</option>
</select>
</div>
<div class="form-group">
<label for="baud"><i class="fa fa-tty fa-lg"></i></label>
<!--input type="select" class="form-control" id="baud"-->
<select id="baud" class="form-control input-lg" disabled>
<option value="230400">230400</option>
<option value="115200" selected="selected">115200</option>
<option value="57600">57600</option>
<option value="38400">38400</option>
<option value="19200">19200</option>
<option value="9600">9600</option>
</select>
</div>
<a class="btn btn-lg btn-default disabled" id="connect" href="#">Connect</a>
<a class="btn btn-lg btn-default" id="refreshPort" href="#"><i class="fa fa-refresh"></i></a>
</form>
<ul class="nav navbar-nav navbar-right">
<li id="fat-menu" class="dropdown"> <a href="#" id="drop5" role="button" class="dropdown-toggle" data-toggle="dropdown"><b>About</b> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="drop5">
<li role="presentation"><a role="menuitem" tabindex="-1" href="http://about.me/peter6960">Author</a>
</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/openhardwarecoza/LaserWeb2/wiki">Help & Wiki</a>
</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/openhardwarecoza/LaserWeb/wiki/SPONSORS">Donations</a>
</li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/openhardwarecoza/LaserWeb2">Github Repository</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- /navbar bottom -->
<!-- Main Body -->
<div class="container-fluid" style="margin-top: 70px; margin-bottom: 70px; max-width: 100%; max-height: 100%" id="mainBody">
<div class="row">
<div class="col-xs-3">
<!-- Left Panel -->
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<span class="pull-right">
<span class="badge badge-default badge-notify" title="Items in Queue" id="queueCnt" style="margin-right: 5px;">Queued: 0</span>
</span>
<br>
<br>
<div id="mPosition">
<div id="mX" class="dro">X: 0.000</div>
<div id="mY" class="dro">Y: 0.000</div>
<div id="mZ" class="dro">Z: 0.000</div>
</div>
</div>
<div class="row">
<div class="collapse in" id="consoleBody">
<p class="list-group-item-text">
<!-- Command Console -->
<div id="console"></div>
<div class="input-group">
<span class="input-group-addon" style="width: 60px;"><i class="fa fa-terminal fa-lg"></i></span>
<input type="text" autocomplete="on" class="form-control" id="command">
<span class="input-group-btn">
<button id="sendCommand" class="btn btn-default disabled" disabled="true" type="button"><i class="fa fa-play" style="margin-right: 10px;"></i>Send</button>
</span>
</div>
</p>
</div>
</span>
</div>
</div>
</div>
</div>
<div class="col-xs-9">
<div class="row" id="macro_container" style="display: none;">
<div class="bs-callout bs-callout-danger" id="macrostatus">
<h4><i class="fa fa-fw fa-exclamation" aria-hidden="true"></i>No macros created yet</h4> Please click Edit to start creating your own Macro buttons
<ul>
<li>Maximum of 24 unique user assignable buttons</li>
<li>Specify custom label text</li>
<li>Specify the GCode/MCode to be sent to the machine when Macro button is pressed</li>
<li>Specify a custom color for the button</li>
</ul>
</div>
<!-- Macro Settings -->
<div class="container" id="macro_settings" style="display: none;">
<div class="list-group">
<a href="#" class="list-group-item"><h4 class="list-group-item-heading">Edit Macro Buttons</h4></a>
<p class="list-group-item-text">
Configure Labels and G-Code commands for up to 24 buttons:
</div>
<div class="table-responsive">
<table class="table" id="macroEdit">
<thead>
<tr>
<th data-formatter="runningFormatter">Button #</th>
<th>Label</th>
<th>G-Code</th>
<th>Color</th>
<th>Delete</th>
</tr>
</thead>
<tbody id="macrostbody">
</tbody>
</table>
<button type="button" class="btn btn-sm btn-default" id="addrow"><i class="fa fa-w fa-plus"></i></button>
</div>
</div>
<!-- Macro Panel -->
<div class="container" id="macro_pad">
<!-- Dynamically Populated by readMacros() -->
</div>
<!-- Edit/Save Macro Buttons -->
<div class="row">
<hr>
<div class="col-sm-4"></div>
<div class="col-sm-4">
<button type="button" class="btn btn-lg btn-default" id="savemacro" style="width:100%; height:100%; display: none;"><i class="fa fa-w fa-floppy-o"></i> Save</button>
<button type="button" class="btn btn-lg btn-default" id="editmacro" style="width:100%; height:100%;"><i class="fa fa-w fa-pencil-square-o"></i> Edit</button>
</div>
</div>
</div>
<div class="row" id="viewer_container" style="display: none;">
<!-- <div id="renderArea"></div> -->
<div class="btn-group" role="group" id="transformcontrols">
<button type="button" data-title="Move Object" class="btn btn-lg btn-default" id="translateBtn"><i class="fa fa-arrows fa-lg"></i></button>
<button type="button" data-title="Resize Object" class="btn btn-lg btn-default" id="resizeBtn"><i class="fa fa-expand fa-lg"></i></button>
<button type="button" data-title="Link Aspect" class="btn btn-lg btn-default" id="linkAspectBtn"><i id='linkAspect' class="fa fa-link fa-lg"></i></button>
</div>
<div class="btn-group" role="group" id="cameracontrols">
<button type="button" data-title="Reset Camera" class="btn btn-lg btn-default" id="viewReset"><i class="fa fa-search fa-fw"></i>Reset</button>
</div>
<div class="btn-group" role="group" id="pan controls">
<button type="button" data-title="Pan Left" class="btn btn-lg btn-default" id="panleft"><i class="fa fa-arrow-left fa-lg"></i></button>
<div class="btn-group input-group btn-group-vertical" role="group" id="panvert" aria-label="Vertical Pan">
<button type="button" data-title="Pan Up" class="btn btn-lg btn-default" id="panup"><i class="fa fa-arrow-up fa-lg"></i></button>
<button type="button" data-title="Pan Down" class="btn btn-lg btn-default" id="pandown"><i class="fa fa-arrow-down fa-lg"></i></button>
</div>
<button type="button" data-title="Pan Right" class="btn btn-lg btn-default" id="panright"><i class="fa fa-arrow-right fa-lg"></i></button>
</div>
</div>
<div class="row" id="gcode_container" style="display: none;">
<!-- <div id="renderArea"></div> -->
<textarea id="gcodepreview" style="width: 100%; height: 100px ;"></textarea>
<button class="btn btn-lg btn-default btn-file" title="Export GCODE to a file" onclick="saveFile()"><i class="fa fa-save fa-fw"></i>Save</span>
</div>
<div class="row" id="control_container" style="display: none;">
<div class="bs-callout bs-callout-danger" id="controlstatus">
<h4><i class="fa fa-fw fa-exclamation" aria-hidden="true"></i>Not connected to a machine</h4> Please Connect to a machine first:
<ul>
<li>Download spjs</li>
<li>Plug in your machine's controller and run spjs</li>
<li>Click "refresh ports", select a port, protocol and baud rate</li>
<li>Click 'Connect'</li>
</ul>
</div>
<div class="col-sm-10">
<div class="list-group" id="dromodule">
<span class="list-group-item">
<h4 class="list-group-item-heading">Jog Control<a data-toggle="collapse" href="#jogBody" aria-expanded="false" aria-controls="jogBody"><span class="pull-right"><i class="fa fa-bars" style="color: #aaa;" title="Minimise"></i></span></a>
</h4>
<div class="collapse in" id="jogBody">
<p class="list-group-item-text">
<div class="col-sm-10">
<div class="btn-group input-group btn-group-justified" role="group" id="jogx" aria-label="X Moves">
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" style="background-color: #9f9f9f;" onclick="sendGcode('G91\nG0 X-10\nG90\n');">-10</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" style="background-color: #bebebe;" onclick="sendGcode('G91\nG0 X-1\nG90\n');">-1</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" style="background-color: #cacaca;" onclick="sendGcode('G91\nG0 X-0.1\nG90\n');">-0.1</button>
</div>
<div class="btn-group input-group btn-group-vertical" role="group" id="jogy" aria-label="Y Moves">
<button type="button" class="btn btn-lg btn-default" style="background-color: #9f9f9f;" onclick="sendGcode('G91\nG0 Y10\nG90\n');">+10</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #bebebe;" onclick="sendGcode('G91\nG0 Y1\nG90\n');">+1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #cacaca;" onclick="sendGcode('G91\nG0 Y0.1\nG90\n');">+0.1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #dedbdb;"><i class="fa fa-arrows" aria-hidden="true"></i></button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #cacaca;" onclick="sendGcode('G91\nG0 Y-0.1\nG90\n');">-0.1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #bebebe;" onclick="sendGcode('G91\nG0 Y-1\nG90\n');">-1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #9f9f9f;" onclick="sendGcode('G91\nG0 Y-10\nG90\n');">-10</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" style="background-color: #cacaca;" onclick="sendGcode('G91\nG0 X0.1\nG90\n');">+0.1</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" style="background-color: #bebebe;" onclick="sendGcode('G91\nG0 X1\nG90\n');">+1</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" style="background-color: #9f9f9f;" onclick="sendGcode('G91\nG0 X10\nG90\n');">+10</button>
</div>
</div>
<br>
</div>
<div class="col-sm-2">
<div class="btn-group input-group btn-group-vertical" role="group" id="jogz" aria-label="Z Moves">
<button type="button" class="btn btn-lg btn-default" style="background-color: #9f9f9f;" onclick="sendGcode('G91\nG0 Z10\nG90\n');">Z+10</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #bebebe;" onclick="sendGcode('G91\nG0 Z1\nG90\n');">Z+1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #cacaca;" onclick="sendGcode('G91\nG0 Z0.1\nG90\n');">Z+0.1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #dedbdb;"><i class="fa fa-arrows-v" aria-hidden="true"></i></button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #cacaca;" onclick="sendGcode('G91\nG0 Z-0.1\nG90\n');">Z-0.1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #bebebe;" onclick="sendGcode('G91\nG0 Z-1\nG90\n');">Z-1</button>
<button type="button" class="btn btn-lg btn-default" style="background-color: #9f9f9f;" onclick="sendGcode('G91\nG0 Z-10\nG90\n');">Z-10</button>
</div>
</div>
</p>
<div class="row">
<div class="col-sm-12">
<div class="btn-group input-group btn-group-justified" role="group" id="MacGrp" aria-label="Job Control">
<!-- span class="input-group-addon"><i class="fa fa-cube"></i></span -->
<div class="btn-group" role="group" id="unlockBtnGrp" style="display: none;">
<button type="button" class="btn btn-default" id="unlockBtn" onclick="unlockMachine();"><i class="fa fa-unlock fa-lg"></i></button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" id="homeBtn" onclick="homeMachine();"><i class="fa fa-home fa-lg"></i></button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" id="playBtn" onclick="playpauseMachine();"><i id="playicon" class="fa fa-play fa-lg"></i></button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" id="stopBtn" onclick="stopMachine();"><i class="fa fa-stop fa-lg"></i></button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-lg btn-default" id="zeroBtn" onclick="sendGcode('G92 X0 Y0 Z0');"><i class="fa fa-location-arrow fa-lg"></i></button>
</div>
</div>
</div>
</div>
</div>
<!-- Collapse Body -->
</span>
</div>
</div>
<div class="col-sm-5">
</div>
</div>
<div class="row" id="file_container" style="display: none;">
<div class="bs-callout bs-callout-danger" id="filestatus">
<h4><i class="fa fa-fw fa-exclamation" aria-hidden="true"></i>No File to work with</h4> Please open a file from the "Open" button:
<br> SVG (Paths only, single group), DXF (R14 Lines/Polylines/Circles), BMP/PNG/JPEG (Raster Engraving) and GCODE (External CAM) are all supported
</div>
<!-- Module CAM -->
<div class="list-group" id="cammodule" style="display: none;">
<div class="col-xs-5">
<span class="list-group-item">
<h4 class="list-group-item-heading">Prepare Job<span class="pull-right"><a data-toggle="collapse" href="#camBody" aria-expanded="false" aria-controls="camBody"><i class="fa fa-bars" style="color: #aaa;" title="Minimise"></i></span></a>
</h4>
<div class="collapse in" id="camBody">
<p class="list-group-item-text">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li><a href="#stltab" id="stlopt" role="tab" data-toggle="tab" style="display: none;">STL</a></li>
<li class="active"><a href="#preptab" id="prepopt" role="tab" data-toggle="tab">Prepare</a>
</li>
<li><a href="#convtab" role="tab" data-toggle="tab">Convert</a></li>
</ul>
<!-- Tab panes -->
<!-- Tab 1 -->
<div class="tab-content">
<div class="tab-pane active" id="preptab">
<div class="btn-group" role="group" aria-label="cam">
<!-- Row 2 -->
<p>
<div id="inflateFeature" class="input-group" style="width: 100%;">
<span class="input-group-addon">Tool Offset:</span>
<div class="input-group">
<input type="number" step="0.1" class="form-control input-sm" value="1" id="inflateVal" style="text-align:right;">
<span class="input-group-addon">mm</span>
</div>
<span class="input-group-btn">
<button id="stepinfup" class="btn btn-default btn-sm" type="button"><i class="fa fa-caret-up"></i></button>
<button id="stepinfdn" class="btn btn-default btn-sm" type="button"><i class="fa fa-caret-down"></i></button>
<button id="removeInflateGrp" class="btn btn-default btn-sm" type="button"><i class="fa fa-times"></i></button>
</span>
</div>
<p>
<div class="input-group" style="width: 100%;">
<span class="input-group-addon">Scale:</span>
<div class="input-group">
<input type="number" class="form-control input-sm" value="100" id="scaleFactor" style="text-align:right;">
<span class="input-group-addon">%</span>
<span class="input-group-btn">
<button id="stepscaleup" class="btn btn-default btn-sm" type="button"><i class="fa fa-caret-up"></i></button>
<button id="stepscaledn" class="btn btn-default btn-sm" type="button"><i class="fa fa-caret-down"></i></button>
</span>
<!-- <span class="input-group-btn">
<button id="dpi96" class="btn btn-default btn-sm" type="button">96dpi</button>
</span>
<span class="input-group-btn">
<button id="dpi90" class="btn btn-default btn-sm" type="button">90dpi</button>
</span> -->
</div>
</div>
<p>
<div class="input-group" style="width: 100%;">
<span class="input-group-addon">Position:</span>
<div class="input-group">
<input type="number" class="form-control input-sm" value="0" id="xpos" style="text-align:right;">
<span class="input-group-addon">X</span>
<input type="number" class="form-control input-sm" value="0" id="ypos" style="text-align:right;">
<span class="input-group-addon">Y</span>
</div>
</div>
</div>
</div>
<!-- Tab 2 -->
<div class="tab-pane" id="convtab">
<p>
<div class="btn-group btn-group-justified" role="group" aria-label="gengcode">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" id="generategcode">Generate G-Code</button>
</div>
</div>
<table class="table table-hover table-striped" id="layers">
<caption>Configure parameters per layer</caption>
<thead>
<tr>
<th>Layer</th>
<th>Settings</th>
</tr>
</thead>
<tbody id="layersbody">
</tbody>
</table>
</div>
<!-- Tab 3 -->
<div class="tab-pane" id="stltab">
<p>
<div class="input-group" style="width: 100%;">
<span class="input-group-addon">Original STL:</span>
<div class="btn-group btn-group-justified" role="group" aria-label="stltab">
<div class="btn-group" role="group">
<button type="button" class="btn btn-sm btn-default" id="showstl" onclick="showstl()">Show</button>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-sm btn-default" id="hidestl" onclick="hidestl()">Hide</button>
</div>
</div>
</div>
<p>
<div class="btn-group btn-group-justified" role="group" aria-label="stltab">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" id="generateslices" onclick="generateSlices();">Slice STL</button>
</div>
</div>
Configure thickness per layer - usually this equates to the thickness of the material you'll be cutting the slices from:
<p>
<div class="input-group" style="width: 100%;">
<span class="input-group-addon">Layer Height:</span>
<div class="input-group">
<input type="number" step="0.1" class="form-control input-sm" value="1.5" id="layerheight" style="text-align:right;">
<span class="input-group-addon">mm</span>
</div>
</div>
<p>
</div>
</div>
<!-- <div class="tab-content"> -->
</div>
<!-- <div class="collapse in" id="camBody"> -->
</div>
</div>
<!-- End Module CAM -->
<div class="canvas" id="rasterOutput" style="display: none;">
<canvas id="canvas-1"></canvas>
</div>
<!-- Module Raster -->
<div class="list-group" id="rastermodule" style="display: none;">
<div class="col-xs-5">
<span class="list-group-item">
<h4 class="list-group-item-heading">Raster<a data-toggle="collapse" href="#rasterBody" aria-expanded="false" aria-controls="rasterBody"><span class="pull-right"><i class="fa fa-bars" style="color: #aaa;" title="Minimise"></i></span></a>
</h4>
<div class="collapse in" id="rasterBody">
<p class="list-group-item-text">
<div class="" id="rasterparams">
<div class="well">
<label for="laserpwrsliderlbl">Constrain Laser Power: </label>
<span id="laserpwr" style="border:0; font-weight:bold; background: transparent;"></span>
<div id="laserpwrslider"></div>
</div>
<div class="well">
<input type="checkbox" value="1" id="useRasterBlackWhiteSpeeds" /> Enable Adaptive Feedrate Grayscale Control
<div class="" id="blackwhitespeedsection" style="display: none;">
<span style="font-size: 10px; font-color: #ccc">This feature allows you to fine tune the grayscale for linearity based on the material in use. </span>
<center>
<label for="laservariablespeedlbl">Feedrate for lightest (white) and darkest (black)</label>
<br>
<div id="laservariablespeedslider"></div>
<span id="laservariablespeed" style="border:0; font-weight:bold; background: transparent;"></span><span> mm/min</span>
</center>
</div>
</div>
<div class="well">
<label for="spotsizesliderlbl">Zoom/Resolution: </label>
<span id="spotsize" style="border:0; font-weight:bold; background: transparent;"></span>
<div id="spotsizeslider"></div>
</div>
<div class="input-group" style="margin-bottom:10px; width: 100%;">
<span class="input-group-addon" style="width: 100px;"><i class="fa fa-line-chart fa-lg" style="margin-right: 20px;"></i>Engrave (G1) Feedrate</span>
<input type="text input-sm" class="form-control" value="2000" id="feedRate">
<span class="input-group-addon" style="width: 60px;">mm/min</span>
</div>
<div class="input-group" style="margin-bottom:10px; width: 100%;">
<span class="input-group-addon" style="width: 100px;"><i class="fa fa-line-chart fa-lg" style="margin-right: 20px;"></i>Rapid (G0) Feedrate</span>
<input type="text input-sm" class="form-control" value="6000" id="rapidRate">
<span class="input-group-addon" style="width: 60px;">mm/min</span>
</div>
<center>
<a class="btn btn-sm btn-default disabled" id="rasterNow"><i class="fa fa-square-o fa-lg" style="margin-right: 3px;"></i>Prepare Raster</a>
<!-- button type="button" class="btn btn-danger disabled" id="rasterWidgetSendRasterToLaser"><i class="fa fa-fire" style="margin-right: 8px;"></i>Send to Laser</button -->
</center>
<center>
Imported Image Dimensions: <span id="dims">0px x 0 px</span>
<br> Engraved Image Dimensions: <span id="physdims">0mm x 0 mm</span>
<br>
<div style="display: none;">
<img id="origImage" style="border: 1px solid #555; max-width:300px;">
</div>
</center>
<hr>
<div class="canvas" id="rasterOutput" style="display: none;">
<canvas id="canvas-1"></canvas>
</div>
</div>
<!-- rasterparams -->
<div id="rasterProgressShroud">
<center>
<h3>Converting...</h3>
<span id="rasterProgressPerc"></span>
</center>
<!-- <div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only">0% Complete</span>
</div>
</div> -->
</div>
<!-- rastershroud -->
</p>
</div>
</span>
</div>
</div>
</span>
</div>
<div class="row" id="settings_container" style="display: none;">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#home">SPJS</a></li>
<li><a data-toggle="tab" href="#menu1">Machine</a></li>
<li><a data-toggle="tab" href="#menu2">G-Code</a></li>
<li><a data-toggle="tab" href="#menu3">Application</a></li>
<li><a data-toggle="tab" href="#menu4">Backup/Restore</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<br>
<div class="list-group">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">SPJS</h4>
<p class="list-group-item-text">
Download and run the SPJS Server to connect LaserWeb to your Machine:
<br> V1.88 Build date: Feb 6, 2015
<form class="form-horizontal">
<div class="form-group">
<label for="laserXMax" class="control-label col-xs-3">IP Address</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="spjsip" placeholder="127.0.0.1">
</div>
</div>
</form>
<div class="list-group">
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_windows_386.zip">Windows x32</a>
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_windows_amd64.zip">Windows x64</a>
<!--<a class="list-group-item" target="_blank" href="http://chilipeppr.com/downloads/v1.86/serial-port-json-server-1.86_darwin_amd64.zip">Mac OS X x64</a>-->
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_linux_386.tar.gz">Linux x32</a>
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_linux_amd64.tar.gz">Linux x64</a>
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_linux_arm.tar.gz">Raspberry Pi (Linux ARM)</a>
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_linux_arm.tar.gz">Beagle Bone Black (Linux ARMv7)</a>
<a class="list-group-item" href="https://github.com/chilipeppr/serial-port-json-server/releases/download/v1.88/serial-port-json-server-1.88_linux_amd64.tar.gz">Intel Edison (Linux x64)</a>
<a class="list-group-item" target="_blank" href="http://github.com/chilipeppr/serial-port-json-server/releases">Github Release Page</a>
<a class="list-group-item" target="_blank" href="http://github.com/chilipeppr/serial-port-json-server">Compile from source (Github)</a>
</div>
</p>
</a>
</div>
</div>
<div id="menu1" class="tab-pane fade">
<br>
<div class="list-group">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">Machine Settings</h4>
<p class="list-group-item-text">
Configure LaserWeb 2.0 to your machine specifics:
<br>
<i>(NB: Page needs a refresh for these settings to take effect!)</i>
<form class="form-horizontal">
<br>
<div class="form-group">
<label for="laserXMax" class="control-label col-xs-3">X-Length</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="laserXMax" placeholder="600">
</div>
</div>
<div class="form-group">
<label for="laserYMax" class="control-label col-xs-3">Y-Length</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="laserYMax" placeholder="400">
</div>
</div>
</form>
</p>
</a>
</div>
</div>
<div id="menu2" class="tab-pane fade">
<br>
<form class="form-horizontal">
<div class="list-group">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">G-Code Settings</h4>
<p class="list-group-item-text">
Configure pre/post/control GCode commands:
<div class="form-group">
<label for="startgcode" class="control-label col-xs-3">Start G-Code</label>
<div class="col-xs-9">
<textarea class="form-control" id="startgcode" placeholder="G28\nG90\nM80"></textarea>
</div>
</div>
<div class="form-group">
<label for="laseron" class="control-label col-xs-3">Laser ON Command</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="laseron" placeholder="M3 / blank for firmwares that support G1"></input>
</div>
</div>
<div class="form-group">
<label for="laseroff" class="control-label col-xs-3">Laser OFF Command</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="laseroff" placeholder="M5 / blank for firmwares that support G1"></input>
</div>
</div>
<div class="form-group">
<label for="laseroff" class="control-label col-xs-3">PWM Max S</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="lasermultiply" placeholder="255"></input>
</div>
</div>
<div class="form-group">
<label for="homingseq" class="control-label col-xs-3">Homing Sequence</label>
<div class="col-xs-9">
<input type="text" class="form-control" id="homingseq" placeholder="G28"></input>
</div>
</div>
<div class="form-group">
<label for="endgcode" class="control-label col-xs-3">End G-Code</label>
<div class="col-xs-9">
<textarea class="form-control" id="endgcode" placeholder="M81\nG28\n"></textarea>
</div>
</div>
<div class="form-group">
<label for="endgcode" class="control-label col-xs-3">Travel Moves (mm/min)</label>
<div class="col-xs-9">
<textarea class="form-control" id="rapidspeed" placeholder="2000"></textarea>
</div>
</div>
</form>
</p>
</a>
</div>
</div>
<div id="menu3" class="tab-pane fade">
<br>
<form class="form-horizontal">
<div class="list-group">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">Application Settings</h4>
<p class="list-group-item-text">
Configure how the application works, turn on/off features:
<div class="form-group">
<label for="endgcode" class="control-label col-xs-3">Experimental: Tool Offset </label>
<div class="col-xs-9">
<select class="form-control" id="useOffset">
<option>Enable</option>
<option>Disable</option>
</select>
</div>
</div>
<div class="form-group">
<label for="imagePosition" class="control-label col-xs-3">Place uploaded image in quadrant</label>
<div class="col-xs-9">
<select class="form-control" id="imagePosition">
<option>BottomLeft</option>
<option>TopLeft</option>
</select>
</div>
</div>
</form>
</p>
</a>
</div>
</div>
<div id="menu4" class="tab-pane fade">
<br>
<form class="form-horizontal">
<div class="list-group">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">Backup/Restore your settings/macros</h4>
<p class="list-group-item-text">
Download a backup or restore settings from a backup file:
<div class="form-group">
<label for="backup" class="control-label col-xs-7">Export all your custom machine/gcode/application settings as well as custom Macro buttons. Please ensure you always have a backup at hand</label>
<div class="col-xs-5">
<div class="btn-group input-group btn-group-justified" role="group" id="jogx" aria-label="X Moves">
<div class="btn-group" role="group">
<button id="backup" class="btn btn-lg btn-default btn-file" title="Take a backup" onclick="backupSettingsLocal()"><i class="fa fa-download fa-fw" aria-hidden="true"></i></i>Backup Settings/Macros</button>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="restore" class="control-label col-xs-7"> If you have a backed up laserweb-settings-backup.json file you can restore it to this instance of LaserWeb</label>
<div class="col-xs-5">
<div class="btn-group input-group btn-group-justified" role="group" id="jogx" aria-label="X Moves">
<div class="btn-group" role="group">
<span id="restore" class="btn btn-lg btn-default btn-file" title="Open a backup settings file"><i class="fa fa-upload fa-fw" aria-hidden="true"></i>Restore from file<input id="jsonFile" type="file" accept=".json" /></span>
</div>
</div>
</div>
</div>
</a>
</div>
</form>
</div>
<button type="button" class="btn btn-lg btn-default" data-dismiss="modal" id="savesettings">Save</button>
<button type="button" class="btn btn-lg btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Main Body Div -->
</body>
</html>