Skip to content

Commit

Permalink
rename branchStatus to operatingStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
ghazwarhili committed Mar 12, 2024
1 parent a03a288 commit abed223
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/network-map-viewer/network/line-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export class LineLayer extends CompositeLayer {
});

linesStatus.set(line.id, {
branchStatus: line.branchStatus,
operatingStatus: line.operatingStatus,
});

const key = this.genLineKey(line);
Expand All @@ -304,7 +304,7 @@ export class LineLayer extends CompositeLayer {
terminal2Connected: line1.terminal2Connected,
});
linesStatus.set(line1.id, {
branchStatus: line1.branchStatus,
operatingStatus: line1.operatingStatus,
});
});
}
Expand Down Expand Up @@ -425,13 +425,13 @@ export class LineLayer extends CompositeLayer {
) {
//add icons
compositeData.forEach((compositeData) => {
compositeData.branchStatus = [];
compositeData.operatingStatus = [];
compositeData.lines.forEach((line) => {
let lineStatus = linesStatus.get(line.id);
if (
lineStatus !== undefined &&
lineStatus.branchStatus !== undefined &&
lineStatus.branchStatus !== 'IN_OPERATION'
lineStatus.operatingStatus !== undefined &&
lineStatus.operatingStatus !== 'IN_OPERATION'
) {
let lineData = compositeData.lineMap.get(line.id);
let coordinatesIcon =
Expand All @@ -447,8 +447,8 @@ export class LineLayer extends CompositeLayer {
line.proximityFactorEnd
);
if (coordinatesIcon !== null) {
compositeData.branchStatus.push({
status: lineStatus.branchStatus,
compositeData.operatingStatus.push({
status: lineStatus.operatingStatus,
printPosition: [
coordinatesIcon.position.longitude,
coordinatesIcon.position.latitude,
Expand Down Expand Up @@ -949,17 +949,17 @@ export class LineLayer extends CompositeLayer {
// line status
const lineStatusIconLayer = new IconLayer(
this.getSubLayerProps({
id: 'BranchStatus' + compositeData.nominalV,
data: compositeData.branchStatus,
id: 'OperatingStatus' + compositeData.nominalV,
data: compositeData.operatingStatus,
// The position passed to this layer causes a bug when zooming and maxParallelOffset is reached:
// the icon is not correctly positioned on the lines, they are slightly off.
// In the custom layers, we clamp the distanceBetweenLines. This is not done in the deck.gl TextLayer
// and IconLayer or in the position calculated here.
getPosition: (branchStatus) => branchStatus.printPosition,
getIcon: (branchStatus) => getLineIcon(branchStatus.status),
getPosition: (operatingStatus) => operatingStatus.printPosition,
getIcon: (operatingStatus) => getLineIcon(operatingStatus.status),
getSize: this.props.iconSize,
getColor: () => this.props.labelColor,
getPixelOffset: (branchStatus) => branchStatus.offset,
getPixelOffset: (operatingStatus) => operatingStatus.offset,
visible:
(!this.props.filteredNominalVoltages ||
this.props.filteredNominalVoltages.includes(
Expand Down

0 comments on commit abed223

Please sign in to comment.