mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
Show warning when Power priority group 1 exceeds 50%.
This commit is contained in:
@@ -38,7 +38,7 @@ angular.module('app').directive('powerBands', ['$window', '$translate', '$rootSc
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Create Y Axis SVG Elements
|
// Create Y Axis SVG Elements
|
||||||
vis.append('g').attr('class', 'watt axis');
|
var wattAxisGroup = vis.append('g').attr('class', 'watt axis');
|
||||||
vis.append('g').attr('class', 'pct axis');
|
vis.append('g').attr('class', 'pct axis');
|
||||||
var retText = vis.append('text').attr('x', -3).style('text-anchor', 'end').attr('dy', '0.5em').attr('class', 'primary upp');
|
var retText = vis.append('text').attr('x', -3).style('text-anchor', 'end').attr('dy', '0.5em').attr('class', 'primary upp');
|
||||||
var depText = vis.append('text').attr('x', -3).style('text-anchor', 'end').attr('dy', '0.5em').attr('class', 'primary upp');
|
var depText = vis.append('text').attr('x', -3).style('text-anchor', 'end').attr('dy', '0.5em').attr('class', 'primary upp');
|
||||||
@@ -94,13 +94,26 @@ angular.module('app').directive('powerBands', ['$window', '$translate', '$rootSc
|
|||||||
retracted.selectAll('text').remove();
|
retracted.selectAll('text').remove();
|
||||||
deployed.selectAll('rect').remove();
|
deployed.selectAll('rect').remove();
|
||||||
deployed.selectAll('text').remove();
|
deployed.selectAll('text').remove();
|
||||||
|
wattAxisGroup.selectAll('line.threshold').remove();
|
||||||
|
|
||||||
// Update X & Y Axis
|
// Update X & Y Axis
|
||||||
wattScale.range([0, w]).domain([0, maxPwr]).clamp(true);
|
wattScale.range([0, w]).domain([0, maxPwr]).clamp(true);
|
||||||
pctScale.range([0, w]).domain([0, maxPwr / available]).clamp(true);
|
pctScale.range([0, w]).domain([0, maxPwr / available]).clamp(true);
|
||||||
vis.selectAll('.watt.axis').call(wattAxis);
|
wattAxisGroup.call(wattAxis);
|
||||||
vis.selectAll('.pct.axis').attr('transform', 'translate(0,' + innerHeight + ')').call(pctAxis);
|
vis.selectAll('.pct.axis').attr('transform', 'translate(0,' + innerHeight + ')').call(pctAxis);
|
||||||
|
|
||||||
|
var pwrWarningClass = 'threshold' + (bands[0].retractedSum * 2 >= available ? ' exceeded' : '') ;
|
||||||
|
vis.selectAll('.pct.axis g:nth-child(6)').selectAll('line, text').attr('class', pwrWarningClass);
|
||||||
|
|
||||||
|
wattAxisGroup.append('line')
|
||||||
|
.attr('x1', pctScale(0.5))
|
||||||
|
.attr('x2', pctScale(0.5))
|
||||||
|
.attr('y1', 0)
|
||||||
|
.attr('y2', innerHeight)
|
||||||
|
.attr('class', pwrWarningClass);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
retText.attr('y', repY);
|
retText.attr('y', repY);
|
||||||
depText.attr('y', depY);
|
depText.attr('y', depY);
|
||||||
updateLabel(retLbl, w, repY, retBandsSelected, retBandsSelected ? retractedSum : maxBand.retractedSum, available);
|
updateLabel(retLbl, w, repY, retBandsSelected, retBandsSelected ? retractedSum : maxBand.retractedSum, available);
|
||||||
|
|||||||
@@ -63,11 +63,11 @@
|
|||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
float: right;
|
float: right;
|
||||||
margin: 0.1em 0.3em 0 0;
|
margin: 0.1em 0.3em 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select {
|
.select {
|
||||||
@@ -234,6 +234,19 @@ table.total {
|
|||||||
stroke-width: 1px;
|
stroke-width: 1px;
|
||||||
stroke: #000;
|
stroke: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
svg g {
|
||||||
|
.threshold {
|
||||||
|
stroke: @secondary-disabled !important;
|
||||||
|
fill: @secondary-disabled !important;
|
||||||
|
|
||||||
|
&.exceeded {
|
||||||
|
stroke: @warning !important;
|
||||||
|
fill: @warning !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#componentPriority {
|
#componentPriority {
|
||||||
|
|||||||
Reference in New Issue
Block a user