You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on the CODAP wrapper, I found that the SeriesAmmeterNode is performing some functions that seem better suited for the model. See the following code in SeriesAmmeterNode.ts that updates the currentValue based on whether the series ammeter has both start and end connections:
const updateText = () => {
let readout: string = MathSymbols.NO_VALUE;
// If it is not an icon and connected at both sides, show the current, otherwise show '-'
if ( screenView ) {
const circuit = screenView.model.circuit;
const startConnection = circuit.getNeighboringVertices( seriesAmmeter.startVertexProperty.get() ).length > 1;
const endConnection = circuit.getNeighboringVertices( seriesAmmeter.endVertexProperty.get() ).length > 1;
if ( startConnection && endConnection ) {
const sign = seriesAmmeter.currentSenseProperty.value === CurrentSense.BACKWARD ? -1 : +1;
const currentValue = seriesAmmeter.currentReadoutProperty.value === null ? null : sign * seriesAmmeter.currentReadoutProperty.value;
readout = CCKCUtils.createCurrentReadout( currentValue, false, seriesAmmeter.isAlternate );
}
else {
seriesAmmeter.currentReadoutProperty.value = null;
}
}
stringProperty.value = readout;
};
@samreid and I discussed this and felt that it was potentially a significant/risky refactor, although we felt it could be worth the effort in the right context. Right now the CODAP wrapper is working well, so this is not pressing, but it makes sense to revisit this when more work is being done in CCK.
The text was updated successfully, but these errors were encountered:
While working on the CODAP wrapper, I found that the SeriesAmmeterNode is performing some functions that seem better suited for the model. See the following code in
SeriesAmmeterNode.ts
that updates the currentValue based on whether the series ammeter has both start and end connections:@samreid and I discussed this and felt that it was potentially a significant/risky refactor, although we felt it could be worth the effort in the right context. Right now the CODAP wrapper is working well, so this is not pressing, but it makes sense to revisit this when more work is being done in CCK.
The text was updated successfully, but these errors were encountered: