Exclude parameter descriptions when parsing grbl settings

pull/303/head
CJPrez 2023-03-19 16:23:18 -07:00 zatwierdzone przez GitHub
rodzic 17d8f51a64
commit 204da5ff45
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -74,7 +74,12 @@ function grblSettings(data) {
grblconfig = data.split('\n')
for (i = 0; i < grblconfig.length; i++) {
var key = grblconfig[i].split('=')[0];
var param = grblconfig[i].split('=')[1]
// Certain versions of grbl add a description to each parameter returned by the '$$'
// command. Use parseFloat to get just the numerical value.
// For example:
// $0=10 (step pulse,usec) ;Step pulse time, microseconds
// would convert to just 10 rather than '10 (step pulse,usec)'
var param = parseFloat(grblconfig[i].split('=')[1]);
grblParams[key] = param
}
// $('#grblconfig').show();