Skip to content

Commit

Permalink
🩹 [2.1.56] Handle MB(…)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 12, 2024
1 parent 104c558 commit fd214a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

The following enhancements and changes have been made to ***Auto Build Marlin***.

## 2.1.56
- Handle `MB(...)` in schema

## 2.1.55
- Update for new `Conditionals-#-abc.h` files

Expand Down
2 changes: 1 addition & 1 deletion abm/abm.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<button type="button" onclick="msg({ command:'monitor' })"><img src="${ img_path('btn-monitor.svg') }" /> Monitor</button>
<button type="button" onclick="msg({ command:'refresh' })"><img src="${ img_path('btn-refresh.svg') }" /> Refresh</button>
</div>
<h1><a href="https://marlinfw.org">Marlin Firmware</a> <span>Auto Build <span id="abm-vers">2.1.55</span></span></h1>
<h1><a href="https://marlinfw.org">Marlin Firmware</a> <span>Auto Build <span id="abm-vers">2.1.56</span></span></h1>
<div id="error"></div>
<div id="abm-main">
<form id="showy">
Expand Down
11 changes: 10 additions & 1 deletion abm/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,15 @@ class ConfigSchema {
return count;
}

// Is MOTHERBOARD any one of the boards provided?
function MB(foo) {
const item = priorItemNamed('MOTHERBOARD');
if (!item) return false;
const mb = item.value.replace(/^BOARD_/, '');
if (foo instanceof Array) return foo.includes(mb);
return foo == mb;
}

///// Conditions based on other criteria, e.g., item.name /////

function _nonzero(name) {
Expand All @@ -531,7 +540,7 @@ class ConfigSchema {

// The item is enabled by its E < EXTRUDERS.
function HAS_EAXIS(eindex) {
const extruders = priorItemNamed(`EXTRUDERS`);
const extruders = priorItemNamed('EXTRUDERS');
if (extruders == null) return false;
const stat = extruders && extruders.enabled && eindex < extruders.value;
//console.log(`HAS_EAXIS(${eindex}) == ${stat ? 'true' : 'false'}`, extruders);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "auto-build",
"displayName": "Auto Build Marlin",
"description": "Provides an interface to quickly build and upload Marlin Firmware.",
"version": "2.1.55",
"version": "2.1.56",
"preview": false,
"publisher": "marlinfirmware",
"icon": "icon.png",
Expand Down

0 comments on commit fd214a3

Please sign in to comment.