Merge branch 'master' of github.com:GridSpace/grid-apps

This commit is contained in:
Stewart Allen 2021-04-18 21:51:05 -04:00
commit 1b630b6505
2 changed files with 19 additions and 3 deletions

View file

@ -194,7 +194,9 @@
API.show.progress(evt.loaded/evt.total, "sending");
});
ajax.open("POST", host+"/api/files/local");
ajax.setRequestHeader("X-Api-Key", apik);
if (apik) {
ajax.setRequestHeader("X-Api-Key", apik);
}
ajax.send(form);
}

View file

@ -1228,11 +1228,25 @@
return ((PI * SQR(noz/2)) / (PI * SQR(fil/2))) * (slice / noz);
}
function subv(consts, v) {
let sv = consts[v];
if (sv !== undefined) {
v = sv;
}
sv = parseFloat(sv);
if (isNaN(sv)) {
return v;
}
return sv;
}
function constOp(tok, consts, opch, op) {
let pos, v1, v2;
if ((pos = tok.indexOf(opch)) > 0) {
v1 = parseFloat(consts[tok.substring(0,pos)] || 0);
v2 = parseFloat(tok.substring(pos+1)) || 0;
let lv = tok.substring(0,pos);
let rv = tok.substring(pos+1);
v1 = subv(consts,lv) || 0;
v2 = subv(consts,rv) || 0;
return op(v1,v2).round(4);
} else {
return null;