2018-06-19 20:25:40 +00:00
var grblSettingCodes = {
0 : "Step pulse time, microseconds" ,
1 : "Step idle delay, milliseconds" ,
2 : "Step pulse invert, mask" ,
3 : "Step direction invert, mask" ,
4 : "Invert step enable pin, boolean" ,
5 : "Invert limit pins, boolean" ,
6 : "Invert probe pin, boolean" ,
10 : "Status report options, mask" ,
11 : "Junction deviation, millimeters" ,
12 : "Arc tolerance, millimeters" ,
13 : "Report in inches, boolean" ,
20 : "Soft limits enable, boolean" ,
21 : "Hard limits enable, boolean" ,
22 : "Homing cycle enable, boolean" ,
23 : "Homing direction invert, mask" ,
24 : "Homing locate feed rate, mm/min" ,
25 : "Homing search seek rate, mm/min" ,
26 : "Homing switch debounce delay, milliseconds" ,
27 : "Homing switch pull-off distance, millimeters" ,
30 : "Maximum spindle speed, RPM" ,
31 : "Minimum spindle speed, RPM" ,
32 : "Laser-mode enable, boolean" ,
100 : "X-axis steps per millimeter" ,
101 : "Y-axis steps per millimeter" ,
102 : "Z-axis steps per millimeter" ,
110 : "X-axis maximum rate, mm/min" ,
111 : "Y-axis maximum rate, mm/min" ,
112 : "Z-axis maximum rate, mm/min" ,
120 : "X-axis acceleration, mm/sec^2" ,
121 : "Y-axis acceleration, mm/sec^2" ,
122 : "Z-axis acceleration, mm/sec^2" ,
130 : "X-axis maximum travel, millimeters" ,
131 : "Y-axis maximum travel, millimeters" ,
132 : "Z-axis maximum travel, millimeters"
} ;
function grblSettings ( data ) {
2018-10-18 18:58:58 +00:00
// console.log(data)
2018-06-19 20:25:40 +00:00
var template = ` `
grblconfig = data . split ( '\n' )
for ( i = 0 ; i < grblconfig . length ; i ++ ) {
var key = grblconfig [ i ] . split ( '=' ) [ 0 ] ;
var param = grblconfig [ i ] . split ( '=' ) [ 1 ]
grblParams [ key ] = param
}
2018-06-25 20:13:58 +00:00
// $('#grblconfig').show();
// grblPopulate();
// $('#grblSaveBtn').removeAttr('disabled');
// $('#grblFirmwareBtn').removeAttr('disabled');
$ ( '#grblSettings' ) . show ( )
2019-01-18 19:01:53 +00:00
if ( grblParams [ '$21' ] == 1 && grblParams [ '$22' ] == 1 ) {
$ ( '#gotozeroMPos' ) . removeClass ( 'disabled' )
$ ( '#homeBtn' ) . attr ( 'disabled' , false )
$ ( '#gotoXzeroMpos' ) . removeClass ( 'disabled' )
$ ( '#gotoYzeroMpos' ) . removeClass ( 'disabled' )
$ ( '#gotoZzeroMpos' ) . removeClass ( 'disabled' )
} else {
$ ( '#gotozeroMPos' ) . addClass ( 'disabled' )
$ ( '#homeBtn' ) . attr ( 'disabled' , true )
$ ( '#gotoXzeroMpos' ) . addClass ( 'disabled' )
$ ( '#gotoYzeroMpos' ) . addClass ( 'disabled' )
$ ( '#gotoZzeroMpos' ) . addClass ( 'disabled' )
}
2018-06-19 20:25:40 +00:00
}
function grblPopulate ( ) {
2018-06-25 20:13:58 +00:00
$ ( '#grblconfig' ) . show ( ) ;
2018-06-19 20:25:40 +00:00
$ ( '#grblconfig' ) . empty ( ) ;
var template = `
2018-06-27 19:23:34 +00:00
< form id = "grblSettingsTable" >
2018-09-17 15:35:31 +00:00
< ul class = "step-list" >
< li id = "installDriversOnSettingspage" >
2018-09-18 19:26:29 +00:00
< h6 class = "fg-openbuilds" > Load Default Settings < br > < small > Populate Grbl parameters from machine - type defaults . You can customize values as needed below < / s m a l l > < / h 6 >
< hr class = "bg-openbuilds" >
2018-09-17 15:35:31 +00:00
< div >
< div class = "grid" >
< div class = "row" >
< div class = "cell-8" >
2018-09-18 19:26:29 +00:00
< a style = "width: 100%;" class = "button dropdown-toggle bd-openbuilds secondary outline" id = "context_toggle2" > < img src = "img/mch/sphinx55.png" / > Select Machine < / a >
2018-09-17 15:35:31 +00:00
< ul class = "d-menu border bd-gray" data - role = "dropdown" data - toggle - element = "#context_toggle2" >
2019-01-23 19:07:58 +00:00
< li onclick = "selectMachine('custom');" > < a href = "#" > < img src = "img/mch/custom.png" / > Custom Machine < / a > < / l i >
< li class = "divider" > < / l i >
2018-10-18 18:58:58 +00:00
< li onclick = "selectMachine('acro55');" > < a href = "#" > < img src = "img/mch/acro55.png" / > OpenBuilds Acro 55 < / a > < / l i >
2018-09-17 15:35:31 +00:00
< li onclick = "selectMachine('acro510');" > < a href = "#" > < img src = "img/mch/acro510.png" / > OpenBuilds Acro 510 < / a > < / l i >
< li onclick = "selectMachine('acro1010');" > < a href = "#" > < img src = "img/mch/acro1010.png" / > OpenBuilds Acro 1010 < / a > < / l i >
< li onclick = "selectMachine('acro1510');" > < a href = "#" > < img src = "img/mch/acro1510.png" / > OpenBuilds Acro 1510 < / a > < / l i >
< li onclick = "selectMachine('acro1515');" > < a href = "#" > < img src = "img/mch/acro1515.png" / > OpenBuilds Acro 1515 < / a > < / l i >
< li class = "divider" > < / l i >
< li onclick = "selectMachine('cbeam');" > < a href = "#" > < img src = "img/mch/cbeam.png" / > OpenBuilds C - Beam Machine < / a > < / l i >
< li onclick = "selectMachine('cbeamxl');" > < a href = "#" > < img src = "img/mch/cbeamxl.png" / > OpenBuilds C - Beam XL < / a > < / l i >
< li class = "divider" > < / l i >
2018-11-21 14:15:10 +00:00
<!-- li onclick = "selectMachine('leadmachine55');" > < a href = "#" > < img src = "img/mch/leadmachine55.png" / > OpenBuilds Lead Machine 55 < / a > < / l i - - >
2018-09-17 15:35:31 +00:00
< li onclick = "selectMachine('leadmachine1010');" > < a href = "#" > < img src = "img/mch/leadmachine1010.png" / > OpenBuilds Lead Machine 1010 < / a > < / l i >
< li class = "divider" > < / l i >
< li onclick = "selectMachine('minimill');" > < a href = "#" > < img src = "img/mch/minimill.png" / > OpenBuilds MiniMill < / a > < / l i >
2018-10-18 18:58:58 +00:00
< li class = "divider" > < / l i >
2018-09-17 15:35:31 +00:00
< li onclick = "selectMachine('sphinx55');" > < a href = "#" > < img src = "img/mch/sphinx55.png" / > OpenBuilds Sphinx 55 < / a > < / l i >
2018-10-18 18:58:58 +00:00
< li onclick = "selectMachine('sphinx1050');" > < a href = "#" > < img src = "img/mch/sphinx1050.png" / > OpenBuilds Sphinx 1050 < / a > < / l i >
2018-09-17 15:35:31 +00:00
< li class = "divider" > < / l i >
2018-10-18 18:58:58 +00:00
< li onclick = "selectMachine('workbee1010');" > < a href = "#" > < img src = "img/mch/workbee1010.png" / > OpenBuilds Workbee 1010 < / a > < / l i >
2018-09-18 19:26:29 +00:00
< li onclick = "selectMachine('workbee1050');" > < a href = "#" > < img src = "img/mch/workbee1050.png" / > OpenBuilds Workbee 1050 < / a > < / l i >
2018-10-18 18:58:58 +00:00
< li onclick = "selectMachine('workbee1510');" > < a href = "#" > < img src = "img/mch/workbee1510.png" / > OpenBuilds Workbee 1510 < / a > < / l i >
2018-09-17 15:35:31 +00:00
< / u l >
< / d i v >
< div class = "cell-4" >
2019-01-08 16:50:24 +00:00
< input id = "limitsinstalled" data - cls - caption = "fg-openbuilds" data - cls - check = "bd-openbuilds openbuilds-switch" data - cls - switch = "openbuilds-switch" type = "checkbox" data - role = "switch" data - caption = "Limit Switches Installed" >
2018-09-17 15:35:31 +00:00
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / l i >
< li id = "installDriversOnSettingspage" >
2018-09-18 19:26:29 +00:00
< h6 class = "fg-openbuilds" > Advanced Settings < br > < small > Customise your Grbl settings below < / s m a l l > < / h 6 >
< hr class = "bg-openbuilds" >
2018-09-17 15:35:31 +00:00
< div >
2019-01-08 16:50:24 +00:00
< div style = "overflow-y: scroll; height: calc(100vh - 450px); max-height: calc(100vh - 450px); " >
< table class = "table compact striped row-hover row-border" data - show - rows - steps = "false" data - rows = "200" data - show - pagination = "false" data - show - table - info = "false" data - show - search = "false" >
2018-09-17 15:35:31 +00:00
< thead >
< tr >
2019-01-08 16:50:24 +00:00
< th > Key < / t h >
< th > Parameter < / t h >
< th style = "width: 250px; min-width: 240px !important;" > Value < / t h >
< th style = "width: 110px; min-width: 110px !important;" > Utility < / t h >
2018-09-17 15:35:31 +00:00
< / t r >
< / t h e a d >
< tbody >
2019-01-08 16:50:24 +00:00
< tr > < td > $0 < / t d > < t d > S t e p p u l s e t i m e , m i c r o s e c o n d s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " & m i c r o ; s " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 0 ' ] + ` " i d = " v a l - ` + 0 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $1 < / t d > < t d > S t e p i d l e d e l a y , m i l l i s e c o n d s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m s " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 ' ] + ` " i d = " v a l - ` + 1 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $2 < / t d >
2018-09-17 15:35:31 +00:00
< td > Step pulse invert < / t d >
< td >
2019-01-08 16:50:24 +00:00
< select id = "val-` + 2 + `-input" value = "` + grblParams['$2'] + `" >
< option value = "0" > [ 0 ] X : & # 9898 ; Y : & # 9898 ; Z : & # 9898 ; < / o p t i o n >
< option value = "1" > [ 1 ] X : & # 9899 ; Y : & # 9898 ; Z : & # 9898 ; < / o p t i o n >
< option value = "2" > [ 2 ] X : & # 9898 ; Y : & # 9899 ; Z : & # 9898 ; < / o p t i o n >
< option value = "3" > [ 3 ] X : & # 9898 ; Y : & # 9898 ; Z : & # 9899 ; < / o p t i o n >
< option value = "4" > [ 4 ] X : & # 9899 ; Y : & # 9899 ; Z : & # 9898 ; < / o p t i o n >
< option value = "5" > [ 5 ] X : & # 9899 ; Y : & # 9898 ; Z : & # 9899 ; < / o p t i o n >
< option value = "6" > [ 6 ] X : & # 9898 ; Y : & # 9899 ; Z : & # 9899 ; < / o p t i o n >
< option value = "7" > [ 7 ] X : & # 9899 ; Y : & # 9899 ; Z : & # 9899 ; < / o p t i o n >
< / s e l e c t >
2018-09-17 15:35:31 +00:00
< / t d >
< td > < / t d >
2018-06-25 20:13:58 +00:00
< / t r >
2019-01-08 16:50:24 +00:00
< tr > < td > $3 < / t d > < t d > S t e p d i r e c t i o n i n v e r t < / t d > < t d > < i n p u t r e a d o n l y t y p e = " h i d d e n " i d = " v a l - ` + 3 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 3 ' ] + ` " >
2019-01-09 19:58:41 +00:00
< input data - cls - caption = "fg-openbuilds" id = "xdirinvert" class = "secondary" type = "checkbox" data - role = "switch" data - caption = "Invert X Direction" > < br >
< input data - cls - caption = "fg-openbuilds" id = "ydirinvert" class = "secondary" type = "checkbox" data - role = "switch" data - caption = "Invert Y Direction" > < br >
< input data - cls - caption = "fg-openbuilds" id = "zdirinvert" class = "secondary" type = "checkbox" data - role = "switch" data - caption = "Invert Z Direction" >
2018-09-18 19:26:29 +00:00
< / t d > < t d > < / t d > < / t r >
2019-01-08 16:50:24 +00:00
< tr > < td > $4 < / t d > < t d > I n v e r t s t e p e n a b l e p i n < / t d > < t d > < s e l e c t i d = " v a l - ` + 4 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 4 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $5 < / t d > < t d > I n v e r t l i m i t p i n s < / t d > < t d > < s e l e c t i d = " v a l - ` + 5 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 5 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $6 < / t d > < t d > I n v e r t p r o b e p i n < / t d > < t d > < s e l e c t i d = " v a l - ` + 6 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 6 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $10 < / t d > < t d > S t a t u s r e p o r t o p t i o n s < / t d > < t d > < s e l e c t i d = " v a l - ` + 1 0 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 0 ' ] + ` " >
2018-09-17 15:35:31 +00:00
< option value = "0" > [ 0 ] WPos : & # 9899 ; MPos : & # 9898 ; Buf : & # 9898 ; < / o p t i o n >
< option value = "1" > [ 1 ] WPos : & # 9898 ; MPos : & # 9899 ; Buf : & # 9898 ; < / o p t i o n >
< option value = "2" > [ 2 ] WPos : & # 9899 ; MPos : & # 9898 ; Buf : & # 9899 ; < / o p t i o n >
< / s e l e c t > < / t d > < t d > < / t d > < / t r >
2019-01-08 16:50:24 +00:00
< tr > < td > $11 < / t d > < t d > J u n c t i o n d e v i a t i o n , m i l l i m e t e r s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 1 ' ] + ` " i d = " v a l - ` + 1 1 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $12 < / t d > < t d > A r c t o l e r a n c e , m i l l i m e t e r s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 2 ' ] + ` " i d = " v a l - ` + 1 2 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $13 < / t d > < t d > R e p o r t i n i n c h e s < / t d > < t d > < s e l e c t i d = " v a l - ` + 1 3 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 3 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # 9 8 9 8 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # 9 8 9 9 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $20 < / t d > < t d > S o f t l i m i t s e n a b l e < b r > < s m a l l > ( E n a b l e a n d S a v e H o m i n g f i r s t b e f o r e e n a b l i n g ) < s m a l l > < / t d > < t d > < s e l e c t i d = " v a l - ` + 2 0 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 0 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $21 < / t d > < t d > H a r d l i m i t s e n a b l e < / t d > < t d > < s e l e c t i d = " v a l - ` + 2 1 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 1 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $22 < / t d > < t d > H o m i n g c y c l e e n a b l e < / t d > < t d > < s e l e c t i d = " v a l - ` + 2 2 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 2 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr > < td > $23 < / t d > < t d > H o m i n g d i r e c t i o n i n v e r t < / t d > < t d > < s e l e c t i d = " v a l - ` + 2 3 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 3 ' ] + ` " >
2018-09-17 15:35:31 +00:00
< option value = "0" > [ 0 ] X : & # 9898 ; Y : & # 9898 ; Z : & # 9898 ; < / o p t i o n >
< option value = "1" > [ 1 ] X : & # 9899 ; Y : & # 9898 ; Z : & # 9898 ; < / o p t i o n >
< option value = "2" > [ 2 ] X : & # 9898 ; Y : & # 9899 ; Z : & # 9898 ; < / o p t i o n >
< option value = "3" > [ 3 ] X : & # 9898 ; Y : & # 9898 ; Z : & # 9899 ; < / o p t i o n >
< option value = "4" > [ 4 ] X : & # 9899 ; Y : & # 9899 ; Z : & # 9898 ; < / o p t i o n >
< option value = "5" > [ 5 ] X : & # 9899 ; Y : & # 9898 ; Z : & # 9899 ; < / o p t i o n >
< option value = "6" > [ 6 ] X : & # 9898 ; Y : & # 9899 ; Z : & # 9899 ; < / o p t i o n >
< option value = "7" > [ 7 ] X : & # 9899 ; Y : & # 9899 ; Z : & # 9899 ; < / o p t i o n >
< / s e l e c t > < / t d > < t d > < / t d > < / t r >
2019-01-08 16:50:24 +00:00
< tr > < td > $24 < / t d > < t d > H o m i n g l o c a t e f e e d r a t e , m m / m i n < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / m i n " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 4 ' ] + ` " i d = " v a l - ` + 2 4 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $25 < / t d > < t d > H o m i n g s e a r c h s e e k r a t e , m m / m i n < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / m i n " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 5 ' ] + ` " i d = " v a l - ` + 2 5 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $26 < / t d > < t d > H o m i n g s w i t c h d e b o u n c e d e l a y , m i l l i s e c o n d s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m s " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 6 ' ] + ` " i d = " v a l - ` + 2 6 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $27 < / t d > < t d > H o m i n g s w i t c h p u l l - o f f d i s t a n c e , m i l l i m e t e r s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 2 7 ' ] + ` " i d = " v a l - ` + 2 7 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $30 < / t d > < t d > M a x i m u m s p i n d l e s p e e d , R P M < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " R P M " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 3 0 ' ] + ` " i d = " v a l - ` + 3 0 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $31 < / t d > < t d > M i n i m u m s p i n d l e s p e e d , R P M < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " R P M " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 3 1 ' ] + ` " i d = " v a l - ` + 3 1 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $32 < / t d > < t d > L a s e r - m o d e e n a b l e < / t d > < t d > < s e l e c t i d = " v a l - ` + 3 2 + ` - i n p u t " v a l u e = " ` + g r b l P a r a m s [ ' $ 3 2 ' ] + ` " > < o p t i o n v a l u e = " 0 " > & # x 2 7 1 7 ; D i s a b l e < / o p t i o n > < o p t i o n v a l u e = " 1 " > & # x 2 7 1 3 ; E n a b l e < / o p t i o n > < / s e l e c t > < / t d > < t d > < / t d > < / t r >
< tr >
< td > $100 < / t d >
< td > X - axis steps per millimeter < / t d >
< td > < input data - role = "input" data - clear - button = "false" data - append = "steps/mm" type = "text" value = "` + grblParams['$100'] + `" id = "val-` + 100 + `-input" > < / t d >
< td >
< button title = "Calculate X-Axis Steps per mm" class = "button " type = "button" onclick = "xstepspermm()" >
< span class = "fa-layers fa-fw" >
< i class = "fas fa-calculator" data - fa - transform = "shrink-2" > < / i >
< span class = "fa-layers-text" data - fa - transform = "up-16" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Calc < / s p a n >
< span class = "fa-layers-text" data - fa - transform = "down-19" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Steps < / s p a n >
< / s p a n >
< / b u t t o n >
< button title = "Fine Tune X-Axis Steps per mm" class = "button " type = "button" onclick = "xstepscalibrate()" >
< span class = "fa-layers fa-fw" >
< i class = "fas fa-wrench" data - fa - transform = "shrink-2" > < / i >
< span class = "fa-layers-text" data - fa - transform = "up-16" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Fine < / s p a n >
< span class = "fa-layers-text" data - fa - transform = "down-19" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Tune < / s p a n >
< / s p a n >
< / b u t t o n >
< / t d >
< / t r >
2018-09-17 15:35:31 +00:00
2019-01-08 16:50:24 +00:00
< tr >
< td > $101 < / t d >
< td > Y - axis steps per millimeter < / t d >
< td > < input data - role = "input" data - clear - button = "false" data - append = "steps/mm" type = "text" value = "` + grblParams['$101'] + `" id = "val-` + 101 + `-input" > < / t d >
< td >
< button title = "Calculate Y-Axis Steps per mm" class = "button" type = "button" onclick = "ystepspermm()" >
< span class = "fa-layers fa-fw" >
< i class = "fas fa-calculator" data - fa - transform = "shrink-2" > < / i >
< span class = "fa-layers-text" data - fa - transform = "up-16" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Calc < / s p a n >
< span class = "fa-layers-text" data - fa - transform = "down-19" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Steps < / s p a n >
< / s p a n >
< / b u t t o n >
< button title = "Fine Tune Y-Axis Steps per mm" class = "button " type = "button" onclick = "ystepscalibrate()" >
< span class = "fa-layers fa-fw" >
< i class = "fas fa-wrench" data - fa - transform = "shrink-2" > < / i >
< span class = "fa-layers-text" data - fa - transform = "up-16" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Fine < / s p a n >
< span class = "fa-layers-text" data - fa - transform = "down-19" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Tune < / s p a n >
< / s p a n >
< / b u t t o n >
< / t d >
< / t r >
2018-09-17 15:35:31 +00:00
2019-01-08 16:50:24 +00:00
< tr >
< td > $102 < / t d >
< td > Z - axis steps per millimeter < / t d >
< td > < input data - role = "input" data - clear - button = "false" data - append = "steps/mm" type = "text" value = "` + grblParams['$102'] + `" id = "val-` + 102 + `-input" > < / t d >
< td >
< button title = "Calculate Z-Axis Steps per mm" class = "button" type = "button" onclick = "zstepspermm()" >
< span class = "fa-layers fa-fw" >
< i class = "fas fa-calculator" data - fa - transform = "shrink-2" > < / i >
< span class = "fa-layers-text" data - fa - transform = "up-16" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Calc < / s p a n >
< span class = "fa-layers-text" data - fa - transform = "down-19" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Steps < / s p a n >
< / s p a n >
< / b u t t o n >
< button title = "Fine Tune Z-Axis Steps per mm" class = "button " type = "button" onclick = "zstepscalibrate()" >
< span class = "fa-layers fa-fw" >
< i class = "fas fa-wrench" data - fa - transform = "shrink-2" > < / i >
< span class = "fa-layers-text" data - fa - transform = "up-16" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Fine < / s p a n >
< span class = "fa-layers-text" data - fa - transform = "down-19" style = "font-weight:600; font-family: Arial; font-size: 10px;" > Tune < / s p a n >
< / s p a n >
< / b u t t o n >
< / t d >
< / t r >
2018-09-17 15:35:31 +00:00
2019-01-08 16:50:24 +00:00
< tr > < td > $110 < / t d > < t d > X - a x i s m a x i m u m r a t e , m m / m i n < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / m i n " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 1 0 ' ] + ` " i d = " v a l - ` + 1 1 0 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $111 < / t d > < t d > Y - a x i s m a x i m u m r a t e , m m / m i n < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / m i n " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 1 1 ' ] + ` " i d = " v a l - ` + 1 1 1 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $112 < / t d > < t d > Z - a x i s m a x i m u m r a t e , m m / m i n < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / m i n " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 1 2 ' ] + ` " i d = " v a l - ` + 1 1 2 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
2018-09-17 15:35:31 +00:00
2019-01-08 16:50:24 +00:00
< tr > < td > $120 < / t d > < t d > X - a x i s a c c e l e r a t i o n , m m / s e c < s u p > 2 < / s u p > < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / s e c & s u p 2 " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 2 0 ' ] + ` " i d = " v a l - ` + 1 2 0 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $121 < / t d > < t d > Y - a x i s a c c e l e r a t i o n , m m / s e c < s u p > 2 < / s u p > < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / s e c & s u p 2 " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 2 1 ' ] + ` " i d = " v a l - ` + 1 2 1 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $122 < / t d > < t d > Z - a x i s a c c e l e r a t i o n , m m / s e c < s u p > 2 < / s u p > < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m / s e c & s u p 2 " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 2 2 ' ] + ` " i d = " v a l - ` + 1 2 2 + ` - i n p u t " > < / t d > < / t d > < t d > < / t d > < / t r >
2018-09-17 15:35:31 +00:00
2019-01-08 16:50:24 +00:00
< tr > < td > $130 < / t d > < t d > X - a x i s m a x i m u m t r a v e l , m i l l i m e t e r s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 3 0 ' ] + ` " i d = " v a l - ` + 1 3 0 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $131 < / t d > < t d > Y - a x i s m a x i m u m t r a v e l , m i l l i m e t e r s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 3 1 ' ] + ` " i d = " v a l - ` + 1 3 1 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
< tr > < td > $132 < / t d > < t d > Z - a x i s m a x i m u m t r a v e l , m i l l i m e t e r s < / t d > < t d > < i n p u t d a t a - r o l e = " i n p u t " d a t a - c l e a r - b u t t o n = " f a l s e " d a t a - a p p e n d = " m m " t y p e = " t e x t " v a l u e = " ` + g r b l P a r a m s [ ' $ 1 3 2 ' ] + ` " i d = " v a l - ` + 1 3 2 + ` - i n p u t " > < / t d > < t d > < / t d > < / t r >
2018-09-17 15:35:31 +00:00
< / t b o d y >
< / t a b l e >
2018-09-18 19:26:29 +00:00
< / d i v >
2018-09-17 15:35:31 +00:00
< / d i v >
< / l i >
< / u l >
2018-06-27 19:23:34 +00:00
< / f o r m >
2018-06-19 20:25:40 +00:00
< / d i v >
< / d i v > `
$ ( '#grblconfig' ) . append ( template )
2018-09-17 15:35:31 +00:00
2018-06-19 20:25:40 +00:00
setTimeout ( function ( ) {
$ ( "#val-32-input" ) . val ( parseInt ( grblParams [ '$32' ] ) ) . trigger ( "change" ) ;
$ ( "#val-20-input" ) . val ( parseInt ( grblParams [ '$20' ] ) ) . trigger ( "change" ) ;
$ ( "#val-21-input" ) . val ( parseInt ( grblParams [ '$21' ] ) ) . trigger ( "change" ) ;
$ ( "#val-22-input" ) . val ( parseInt ( grblParams [ '$22' ] ) ) . trigger ( "change" ) ;
$ ( "#val-23-input" ) . val ( parseInt ( grblParams [ '$23' ] ) ) . trigger ( "change" ) ;
$ ( "#val-5-input" ) . val ( parseInt ( grblParams [ '$5' ] ) ) . trigger ( "change" ) ;
$ ( "#val-6-input" ) . val ( parseInt ( grblParams [ '$6' ] ) ) . trigger ( "change" ) ;
$ ( "#val-2-input" ) . val ( parseInt ( grblParams [ '$2' ] ) ) . trigger ( "change" ) ;
$ ( "#val-3-input" ) . val ( parseInt ( grblParams [ '$3' ] ) ) . trigger ( "change" ) ;
$ ( "#val-4-input" ) . val ( parseInt ( grblParams [ '$4' ] ) ) . trigger ( "change" ) ;
$ ( "#val-10-input" ) . val ( parseInt ( grblParams [ '$10' ] ) ) . trigger ( "change" ) ;
2018-06-25 20:13:58 +00:00
} , 100 ) ; ;
2018-06-27 19:23:34 +00:00
2019-01-08 16:50:24 +00:00
$ ( '#grblSettingsTable' ) . on ( 'keyup paste click change' , 'input, select' , function ( ) {
2018-08-07 15:40:04 +00:00
checkifchanged ( )
2018-06-27 19:23:34 +00:00
} ) ;
2018-09-18 19:26:29 +00:00
// Event Handlers for Switch Checkboxes
setTimeout ( function ( ) {
$ ( '#limitsinstalled:checkbox' ) . change ( function ( ) {
enableLimits ( ) ;
} ) ;
$ ( '#xdirinvert:checkbox' ) . change ( function ( ) {
changeDirInvert ( ) ;
} ) ;
$ ( '#ydirinvert:checkbox' ) . change ( function ( ) {
changeDirInvert ( ) ;
} ) ;
$ ( '#zdirinvert:checkbox' ) . change ( function ( ) {
changeDirInvert ( ) ;
} ) ;
// populare Direction Invert Checkboxes
displayDirInvert ( )
} , 100 )
2018-06-27 19:23:34 +00:00
$ ( '#grblSettingsBadge' ) . hide ( ) ;
2018-09-18 19:26:29 +00:00
if ( grblParams [ '$21' ] == 1 && grblParams [ '$22' ] == 1 ) {
$ ( '#limitsinstalled:checkbox' ) . prop ( 'checked' , true ) ;
2019-01-18 19:01:53 +00:00
$ ( '#gotozeroMPos' ) . removeClass ( 'disabled' )
$ ( '#homeBtn' ) . attr ( 'disabled' , false )
2018-09-18 19:26:29 +00:00
} else {
$ ( '#limitsinstalled:checkbox' ) . prop ( 'checked' , false ) ;
2019-01-18 19:01:53 +00:00
$ ( '#gotozeroMPos' ) . addClass ( 'disabled' )
$ ( '#homeBtn' ) . attr ( 'disabled' , true )
2018-09-18 19:26:29 +00:00
}
2018-12-21 13:56:11 +00:00
setTimeout ( function ( ) {
setMachineButton ( laststatus . machine . name )
} , 500 )
2018-06-19 20:25:40 +00:00
}
2018-08-07 15:40:04 +00:00
function checkifchanged ( ) {
var hasChanged = false ;
for ( var key in grblParams ) {
if ( grblParams . hasOwnProperty ( key ) ) {
var j = key . substring ( 1 )
var newVal = $ ( "#val-" + j + "-input" ) . val ( ) ;
// Only send values that changed
if ( parseFloat ( newVal ) != parseFloat ( grblParams [ key ] ) ) {
hasChanged = true ;
2019-01-09 19:58:41 +00:00
if ( ! $ ( "#val-" + j + "-input" ) . parent ( ) . is ( 'td' ) ) {
$ ( "#val-" + j + "-input" ) . parent ( ) . addClass ( 'alert' )
} else if ( $ ( "#val-" + j + "-input" ) . is ( 'select' ) ) {
$ ( "#val-" + j + "-input" ) . addClass ( 'alert' )
} else if ( j == 3 ) { // Endstops
$ ( '#xdirinvert' ) . parent ( ) . children ( '.check' ) . addClass ( 'bd-red' )
$ ( '#ydirinvert' ) . parent ( ) . children ( '.check' ) . addClass ( 'bd-red' )
$ ( '#zdirinvert' ) . parent ( ) . children ( '.check' ) . addClass ( 'bd-red' )
}
2018-09-14 20:00:28 +00:00
} else {
2019-01-09 19:58:41 +00:00
if ( ! $ ( "#val-" + j + "-input" ) . parent ( ) . is ( 'td' ) ) {
$ ( "#val-" + j + "-input" ) . parent ( ) . removeClass ( 'alert' )
} else if ( $ ( "#val-" + j + "-input" ) . is ( 'select' ) ) {
$ ( "#val-" + j + "-input" ) . removeClass ( 'alert' )
} else if ( j == 3 ) {
$ ( '#xdirinvert' ) . parent ( ) . children ( '.check' ) . removeClass ( 'bd-red' )
$ ( '#ydirinvert' ) . parent ( ) . children ( '.check' ) . removeClass ( 'bd-red' )
$ ( '#zdirinvert' ) . parent ( ) . children ( '.check' ) . removeClass ( 'bd-red' )
}
2018-08-07 15:40:04 +00:00
}
}
}
if ( hasChanged ) {
$ ( '#grblSettingsBadge' ) . fadeIn ( 'slow' ) ;
$ ( '#saveBtn' ) . attr ( 'disabled' , false ) . removeClass ( 'disabled' ) ;
$ ( '#saveBtnIcon' ) . removeClass ( 'fg-gray' ) . addClass ( 'fg-grayBlue' ) ;
} else {
$ ( '#grblSettingsBadge' ) . fadeOut ( 'slow' ) ;
$ ( '#saveBtn' ) . attr ( 'disabled' , true ) . addClass ( 'disabled' ) ;
$ ( '#saveBtnIcon' ) . removeClass ( 'fg-grayBlue' ) . addClass ( 'fg-gray' ) ;
}
}
2018-06-19 20:25:40 +00:00
function grblSaveSettings ( ) {
2018-08-08 12:31:59 +00:00
var commands = ""
2018-06-19 20:25:40 +00:00
for ( var key in grblParams ) {
if ( grblParams . hasOwnProperty ( key ) ) {
var j = key . substring ( 1 )
2018-06-25 20:33:44 +00:00
var newVal = $ ( "#val-" + j + "-input" ) . val ( ) ;
// Only send values that changed
if ( parseFloat ( newVal ) != parseFloat ( grblParams [ key ] ) ) {
2018-08-08 12:31:59 +00:00
// console.log(key + ' was ' + grblParams[key] + ' but now, its ' + newVal);
commands += key + '=' + newVal + "\n"
// sendGcode(key + '=' + newVal);
2018-06-25 20:33:44 +00:00
}
2018-06-19 20:25:40 +00:00
}
}
2018-08-08 12:31:59 +00:00
console . log ( "commands" , commands )
socket . emit ( 'runJob' , commands ) ;
2018-06-25 20:57:18 +00:00
grblParams = { } ;
2018-06-27 20:53:07 +00:00
Metro . dialog . create ( {
title : "Configuration Updated. Reset Grbl?" ,
content : "<div>Some changes in the Grbl Configuration only take effect after a restart/reset of the controller. Would you like to Reset the controller now?</div>" ,
actions : [ {
caption : "Yes" ,
cls : "js-dialog-close secondary" ,
onclick : function ( ) {
setTimeout ( function ( ) {
sendGcode ( String . fromCharCode ( 0x18 ) ) ;
2018-08-07 15:46:13 +00:00
setTimeout ( function ( ) {
refreshGrblSettings ( )
} , 1000 ) ;
} , 400 ) ;
2018-06-27 20:53:07 +00:00
}
} ,
{
caption : "Later" ,
cls : "js-dialog-close" ,
onclick : function ( ) {
console . log ( "Do nothing" )
refreshGrblSettings ( ) ;
}
}
]
} ) ;
2018-06-27 19:23:34 +00:00
$ ( '#grblSettingsBadge' ) . hide ( ) ;
2018-06-25 20:42:17 +00:00
}
function refreshGrblSettings ( ) {
2018-09-18 19:26:29 +00:00
$ ( '#saveBtn' ) . attr ( 'disabled' , true ) . addClass ( 'disabled' ) ;
$ ( '#saveBtnIcon' ) . removeClass ( 'fg-grayBlue' ) . addClass ( 'fg-gray' ) ;
2018-06-25 20:57:18 +00:00
grblParams = { } ;
2018-06-25 20:13:58 +00:00
$ ( '#grblconfig' ) . empty ( ) ;
2018-08-07 10:05:49 +00:00
$ ( '#grblconfig' ) . append ( "<center>Please Wait... </center><br><center>Requesting updated parameters from the controller firmware...</center>" ) ;
2018-06-25 20:13:58 +00:00
setTimeout ( function ( ) {
2018-06-25 20:57:18 +00:00
sendGcode ( '$$' ) ;
2018-12-21 13:56:11 +00:00
sendGcode ( '$I' ) ;
2018-06-25 20:13:58 +00:00
setTimeout ( function ( ) {
2018-06-25 20:57:18 +00:00
grblPopulate ( ) ;
2018-08-07 10:05:49 +00:00
} , 500 ) ;
2018-06-27 20:53:07 +00:00
} , 50 ) ;
2018-06-25 20:57:18 +00:00
2018-09-18 19:26:29 +00:00
}
function enableLimits ( ) {
var grblParams _lim = {
$21 : "0" , //"Hard limits enable, boolean"
$22 : "0" , //"Homing cycle enable, boolean"
}
var hasLimits = $ ( '#limitsinstalled' ) . is ( ':checked' ) ;
if ( hasLimits ) {
grblParams _lim . $21 = "1" ; //"Hard limits enable, boolean"
grblParams _lim . $22 = "1" ; //"Homing cycle enable, boolean"
} else {
grblParams _lim . $21 = "0" ; //"Hard limits enable, boolean"
grblParams _lim . $22 = "0" ; //"Homing cycle enable, boolean"
}
for ( var key in grblParams _lim ) {
if ( grblParams _lim . hasOwnProperty ( key ) ) {
var j = key . substring ( 1 )
var newVal = $ ( "#val-" + j + "-input" ) . val ( ) ;
2018-10-18 18:58:58 +00:00
// console.log("$" + j + " = " + newVal)
2018-09-18 19:26:29 +00:00
$ ( "#val-" + j + "-input" ) . val ( parseFloat ( grblParams _lim [ key ] ) )
}
}
checkifchanged ( ) ;
}
// Calc Grbl 1.1 Invert Masks
// Call: calcDecFromMask(true, false, false)
// Return: 1
function calcDecFromMask ( x , y , z ) {
var string = "0000000" + ( z ? "1" : "0" ) + ( y ? "1" : "0" ) + ( x ? "1" : "0" ) ;
// console.log(string)
return parseInt ( string , 2 ) ;
}
// Calc Grbl 1.1 Invert Masks
// Call: calcMaskFromDec("4")
// Returns: {x: false, y: false, z: true}
function calcMaskFromDec ( dec ) {
var num = parseInt ( dec )
num = num . toString ( 2 )
num = ( "000" + num ) . substr ( - 3 , 3 )
// console.log(num)
var invertmask = {
x : ( num . charAt ( 2 ) == 0 ? false : true ) ,
y : ( num . charAt ( 1 ) == 0 ? false : true ) ,
z : ( num . charAt ( 0 ) == 0 ? false : true )
}
return invertmask
}
function changeDirInvert ( ) {
var xticked = $ ( '#xdirinvert' ) . is ( ':checked' ) ;
var yticked = $ ( '#ydirinvert' ) . is ( ':checked' ) ;
var zticked = $ ( '#zdirinvert' ) . is ( ':checked' ) ;
var value = calcDecFromMask ( xticked , yticked , zticked )
$ ( "#val-3-input" ) . val ( value ) . trigger ( "change" ) ;
checkifchanged ( ) ;
}
function displayDirInvert ( ) {
var dir = calcMaskFromDec ( $ ( "#val-3-input" ) . val ( ) )
$ ( '#xdirinvert:checkbox' ) . prop ( 'checked' , dir . x ) ;
$ ( '#ydirinvert:checkbox' ) . prop ( 'checked' , dir . y ) ;
$ ( '#zdirinvert:checkbox' ) . prop ( 'checked' , dir . z ) ;
checkifchanged ( ) ;
2019-01-24 15:36:24 +00:00
}
// <div class="ribbon-group">
// <button class="ribbon-icon-button" onclick="sendGcode('$RST=$'); refreshGrblSettings()">
// <span class="icon">
// <i class="fas fa-sliders-h"></i>
// </span>
// <span class="caption">Reset Settings</span>
// </button><br>
// <button class="ribbon-icon-button" onclick="sendGcode('$RST=#'); refreshGrblSettings()">
// <span class="icon">
// <i class="fas fa-layer-group"></i>
// </span>
// <span class="caption">Reset WCOs</span>
// </button><br>
// <button class="ribbon-icon-button" onclick="sendGcode('$RST=*'); refreshGrblSettings()">
// <span class="icon">
// <i class="fas fa-microchip"></i>
// </span>
// <span class="caption">Reset EEPROM</span>
// </button>
// </div>
clearWCO
clearSettings
function clearSettings ( ) {
Metro . dialog . create ( {
title : "Are you sure?" ,
content : "<div>Resetting the Grbl Settings will restore all the settings to factory defaults, but will keep other EEPROM settings intact. Would you like to continue?</div>" ,
actions : [ {
caption : "Yes" ,
cls : "js-dialog-close secondary" ,
onclick : function ( ) {
sendGcode ( '$RST=$' ) ;
refreshGrblSettings ( )
}
} ,
{
caption : "Cancel" ,
cls : "js-dialog-close" ,
onclick : function ( ) {
refreshGrblSettings ( ) ;
}
}
]
} ) ;
}
function clearWCO ( ) {
Metro . dialog . create ( {
title : "Are you sure?" ,
content : "<div>Resetting the Work Coordinate Systems will erase all the coordinate system offsets currently stored in the EEPROM on the controller. Would you like to continue?</div>" ,
actions : [ {
caption : "Yes" ,
cls : "js-dialog-close secondary" ,
onclick : function ( ) {
sendGcode ( '$RST=#' ) ;
refreshGrblSettings ( )
}
} ,
{
caption : "Cancel" ,
cls : "js-dialog-close" ,
onclick : function ( ) {
refreshGrblSettings ( ) ;
}
}
]
} ) ;
}
function clearEEPROM ( ) {
Metro . dialog . create ( {
title : "Are you sure?" ,
content : "<div>Resetting the EEPROM will erase all the Grbl Firmware settings from your controller, effectively resetting it back to factory defaults. Would you like to continue?</div>" ,
actions : [ {
caption : "Yes" ,
cls : "js-dialog-close secondary" ,
onclick : function ( ) {
sendGcode ( '$RST=*' ) ;
refreshGrblSettings ( )
}
} ,
{
caption : "Cancel" ,
cls : "js-dialog-close" ,
onclick : function ( ) {
refreshGrblSettings ( ) ;
}
}
]
} ) ;
2018-06-19 20:25:40 +00:00
}