Skip to content

Commit

Permalink
Merge pull request #96 from md8n/feedrate_validation
Browse files Browse the repository at this point in the history
Feedrate validation
  • Loading branch information
BarbourSmith authored Dec 20, 2024
2 parents 54e9c59 + a4b35e2 commit e7365ce
Show file tree
Hide file tree
Showing 9 changed files with 492 additions and 351 deletions.
39 changes: 25 additions & 14 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,35 +58,44 @@ function browser_is(bname) {

window.onload = () => {
//to check if javascript is disabled like in android preview
displayNone('loadingmsg');
console.log('Connect to board');
displayNone("loadingmsg");
console.log("Connect to board");

let connectLoaded = false;
let controlsLoaded = false;
let navbarLoaded = false;
// These are all falsey, indicating nothing has been loaded
let connectDlg = "";
let controlsPanel = "";
let navbarLoaded = "";

let failSafe = 10;

let startUpInt = setInterval(() => {
// Check for various key HTML panels and load them up
if (!connectLoaded && id("connectdlg.html")) {
if (!connectDlg && id("connectdlg.html")) {
connectDlg = "loading";
connectdlg();
connectLoaded = true;
connectDlg = "loaded";
}

if (!controlsLoaded && id("controlspanel.html")) {
if (!controlsPanel && id("controlPanel")) {
controlsPanel = "loading";
ControlsPanel();
controlsLoaded = true;
controlsPanel = "loaded";
}

if (!navbarLoaded && id("navbar")) {
navbarLoaded = "loading";
navbar();
tabletInit();
navbarLoaded = true;
navbarLoaded = "loaded";
}

if (connectLoaded && controlsLoaded && navbarLoaded) {
if ((connectDlg && controlsPanel && navbarLoaded) || failSafe <= 0) {
clearInterval(startUpInt);
startUpInt = null;
}

// Ensure that we always break out of this
failSafe--;
}, 500);
}

Expand Down Expand Up @@ -195,7 +204,9 @@ function Set_page_title(page_title) {

function initUI() {
console.log('Init UI');
if (ESP3D_authentication) connectdlg(false);
if (ESP3D_authentication) {
connectdlg(false);
}
AddCmd(display_boot_progress);
//initial check
if (typeof target_firmware === 'undefined' || typeof web_ui_version === 'undefined' || typeof direct_sd === 'undefined')
Expand Down Expand Up @@ -238,7 +249,7 @@ function initUI_3() {
console.log('Get macros');
init_controls_panel();
init_grbl_panel();
console.log('Get preferences')
console.log('Get preferences');
getpreferenceslist();
initUI_4();
}
Expand All @@ -265,7 +276,7 @@ function initUI_4() {
}

function show_main_UI() {
displayUndoNone('main_ui')
displayUndoNone('main_ui');
}

// var socket_response = ''
Expand Down
10 changes: 3 additions & 7 deletions www/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,16 @@ function get_config_value(sline) {
return tline2.length > 1 ? tline2[1] : "???";
}

function get_config_help(sline) {
if (is_override_config) return "";
return inline_help(get_config_label(sline))
}
const get_config_help = (sline) => (is_override_config) ? "" : inline_help(get_config_label(sline));

function get_config_command(sline) {
return get_config_label(sline) + "=";
}

function is_config_commented(sline) {
var line = sline.trim();
if (line.length == 0) return false;
if (is_override_config) return line.startsWith(";");
return false;
if (!line.length) return false;
return (is_override_config) ? line.startsWith(";") : false;
}

function config_revert_to_default(index, is_override) {
Expand Down
Loading

0 comments on commit e7365ce

Please sign in to comment.