Skip to content

Commit

Permalink
Fixes bug that prevented rendering field model charts
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuhaoBai committed Apr 24, 2024
1 parent 0f0355c commit 8054a6d
Show file tree
Hide file tree
Showing 7 changed files with 19,887 additions and 3,101 deletions.
18,017 changes: 14,929 additions & 3,088 deletions client/package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions client/src/app/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class AppContainer extends Component<Props, State> {
this._fetchFeederModels();
}
});
zip(
this.simulationManagementService.selectSimulationSnapshotState('stateStore'),
this.simulationManagementService.selectSimulationSnapshotState('topologyModel')
)
zip(
this.simulationManagementService.selectSimulationSnapshotState('stateStore'),
this.simulationManagementService.selectSimulationSnapshotState('topologyModel')
)
.subscribe({
next: (tuple: [ApplicationState, TopologyModel]) => {
const modelMRID = tuple[1].feeders[0].mRID;
Expand All @@ -119,7 +119,7 @@ export class AppContainer extends Component<Props, State> {
this._stompClientService.readOnceFrom<GetAvailableApplicationsRequestPayload>(destination)
.subscribe({
next: payload => {
// Todo - For Field Model to receive Min/Avg/Max Voltages chart, fieldModelMrid needs to be '_C1C3E687-6FFD-C753-582B-632A27E28507'
// * You can hard code mRID that you wanted to use here.
// payload.fieldModelMrid = '_C1C3E687-6FFD-C753-582B-632A27E28507';
this._stateStore.update({
applications: payload.applications,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class FieldModelManagementService {
}

private _broadcastFieldModelOutputMeasurements(payload: FieldModelOutputPayload) {
this._outputTimestamp = payload.timestamp;
this._outputTimestamp = payload.message.timestamp;
const measurementMap = new Map<string, FieldModelOutputMeasurement>();
for (const [mrid,rawFieldModelOutputMeasurement] of Object.entries(payload.message.measurements)) {
const measurementInModelDictionary = this._modelDictionaryMeasurementMap.get(mrid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export interface FieldModelOutputPayload {
measurements: {
[mrid: string]: { magnitude: number; angle: number; mrid: string };
};
timestamp: number;
};
timestamp: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class MeasurementChartContainer extends Component<Props, State> {
this._observeActiveFieldModelChangeEvent();
this._subscribeToPlotModelsStateStore();
this._subscribeToFieldModelOutputMeasurementMapStream();
this._fetchLimitsFileWhenSimulationIdChanges();
// this._fetchLimitsFileWhenSimulationIdChanges(); // * Looks like Field Model doesn't need it
this._resetRenderableChartModelsWhenFieldModelStarts();
} else {
this._observeActiveSimulationChangeEvent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,9 @@ export class TopologyRenderer extends Component<Props, State> {
nodeMap.forEach(node => {
node.y1 = minYCoordinate + (maxYCoordinate - node.y1);
if ('y2' in node) {
const nodey2 = node['y2'] as any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(node as any).y2 = minYCoordinate + (maxYCoordinate - node['y2']);
(node as any).y2 = minYCoordinate + (maxYCoordinate - nodey2);
}
});
}
Expand Down
Loading

0 comments on commit 8054a6d

Please sign in to comment.