Skip to content

Commit

Permalink
Merge pull request #445 from GRIDAPPSD/fix/overlap-equipment
Browse files Browse the repository at this point in the history
Fix/overlap equipment
  • Loading branch information
AAndersn authored Oct 26, 2022
2 parents c3c44bf + d2c34d8 commit d6c1174
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ export class TopologyRenderer extends Component<Props, State> {
.y(node => node.screenY1);
edgeMap.forEach(edge => {
const path = create('svg:path').node();
path.setAttribute('class', `topology-renderer__canvas__edge _${edge.name}_`);
if (!edge.name.startsWith('tpx')) {
path.setAttribute('class', `topology-renderer__canvas__edge _${edge.name}_`);
}
path.setAttribute('d', edgeGenerator([edge.from, edge.to]));
documentFragment.appendChild(path);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ export class TopologyRendererContainer extends Component<Props, State> {
edgeMap: new Map(),
inverted: false
};

for (const group of ['batteries', 'switches', 'solarpanels', 'swing_nodes', 'transformers', 'capacitors', 'regulators']) {
for (const datum of feeder[group]) {
const mRIDs = this.props.mRIDs.get(datum.name) || [];
const resolvedMRIDs = Array.isArray(mRIDs) ? mRIDs : [mRIDs];
let node: Node;

switch (group) {
case 'swing_nodes':
node = this._createNewNode({
Expand Down Expand Up @@ -339,8 +337,12 @@ export class TopologyRendererContainer extends Component<Props, State> {

private _latLongToXY(longitude: number, lat: number): { x: number; y: number } {
return {
x: Math.floor(136.0 * (longitude + 77.0292) / (-77.0075 + 77.0292)) / 10,
y: Math.floor(117.0 * (lat - 38.8762) / (38.8901 - 38.8762)) / 10
// Archive the old method of calculating Lat and Long to xy coordinations
// x: Math.floor(136.0 * (longitude + 77.0292) / (-77.0075 + 77.0292)) / 10,
// y: Math.floor(117.0 * (lat - 38.8762) / (38.8901 - 38.8762)) / 10

x: 136.0 * (longitude + 77.0292) / 0.00217,
y: 114.0 * (lat - 38.8762) / 0.00139
};
}

Expand Down

0 comments on commit d6c1174

Please sign in to comment.