mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-04-30 21:49:33 +00:00
Merge branch 'main' into dev-v2.3
This commit is contained in:
@@ -13,12 +13,12 @@
|
||||
|
||||
let config = {};
|
||||
|
||||
function point(v,e) {
|
||||
function point(v) {
|
||||
return {
|
||||
label: fmtnum(v) + 'A',
|
||||
title: (e ? 'Estimated ' : '') + v.toFixed(1) + ' A',
|
||||
title: v.toFixed(1) + ' A',
|
||||
value: isNaN(v) ? 0 : v,
|
||||
color: ampcol(v ? (v)/(max)*100 : 0, e)
|
||||
color: ampcol(v ? (v)/(max)*100 : 0)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,8 +30,19 @@
|
||||
points.push(point(i1));
|
||||
}
|
||||
if(u2 > 0) {
|
||||
xTicks.push({ label: 'L2' });
|
||||
points.push(point(i2, i2e));
|
||||
if(i2e) {
|
||||
xTicks.push({ label: 'L2' });
|
||||
points.push({
|
||||
label: 'Not available',
|
||||
labelAngle: -90,
|
||||
title: 'L2 current is not reported by your meter',
|
||||
value: 0,
|
||||
color: '#7c3aedcc'
|
||||
});
|
||||
} else {
|
||||
xTicks.push({ label: 'L2' });
|
||||
points.push(point(i2));
|
||||
}
|
||||
}
|
||||
if(u3 > 0) {
|
||||
xTicks.push({ label: 'L3' });
|
||||
|
||||
@@ -82,9 +82,9 @@
|
||||
<text
|
||||
width="{barWidth - 4}"
|
||||
dominant-baseline="middle"
|
||||
text-anchor="{barWidth < vertSwitch ? 'left' : 'middle'}"
|
||||
text-anchor="{barWidth < vertSwitch || point.labelAngle ? 'left' : 'middle'}"
|
||||
fill="{yScale(point.value) > yScale(0)-labelOffset ? point.color : 'white'}"
|
||||
transform="translate({xScale(i) + barWidth/2} {yScale(point.value) > yScale(0) - labelOffset ? yScale(point.value) - labelOffset : yScale(point.value) + 10}) rotate({barWidth < vertSwitch ? 90 : 0})"
|
||||
transform="translate({xScale(i) + barWidth/2} {yScale(point.value) > yScale(0) - labelOffset ? yScale(point.value) - labelOffset : yScale(point.value) + 10}) rotate({point.labelAngle ? point.labelAngle : barWidth < vertSwitch ? 90 : 0})"
|
||||
|
||||
>{point.label}</text>
|
||||
{#if point.title}
|
||||
|
||||
@@ -11,7 +11,7 @@ export function voltcol(volt) {
|
||||
return '#d90000';
|
||||
};
|
||||
|
||||
export function ampcol(pct, est) {
|
||||
export function ampcol(pct) {
|
||||
let col;
|
||||
if(pct > 90) col = '#d90000';
|
||||
else if(pct > 85) col = '#e32100';
|
||||
@@ -19,7 +19,7 @@ export function ampcol(pct, est) {
|
||||
else if(pct > 75) col = '#dcd800';
|
||||
else col = '#32d900';
|
||||
|
||||
return col+(est?'88':'');
|
||||
return col;
|
||||
};
|
||||
|
||||
export function exportcol(pct) {
|
||||
|
||||
@@ -35,9 +35,12 @@
|
||||
}
|
||||
|
||||
let cc = false;
|
||||
$: {
|
||||
sysinfoStore.subscribe(update => {
|
||||
sysinfo = update;
|
||||
if(update.fwconsent === 1) {
|
||||
cc = !sysinfo.usrcfg;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2">
|
||||
|
||||
Reference in New Issue
Block a user