Skip to content

Commit

Permalink
Add "British" schematicStandard, see #429
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 5, 2021
1 parent ec106b6 commit 508ad4b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions circuit-construction-kit-common-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"iec": {
"value": "IEC"
},
"british": {
"value": "British"
},
"animationSpeedLimitReached": {
"value": "Animation speed limit reached! Simulation speed reduced to {{percent}}% normal."
},
Expand Down
2 changes: 1 addition & 1 deletion js/CCKCQueryParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const CCKCQueryParameters = window.QueryStringMachine.getAll( {
public: true,
type: 'string',
defaultValue: 'ieee',
validValues: [ 'ieee', 'iec' ]
validValues: [ 'ieee', 'iec', 'british' ]
},

//------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion js/view/CCKCOptionsDialogContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class CCKCOptionsDialogContent extends VBox {
};
const verticalAquaRadioButtonGroup = new VerticalAquaRadioButtonGroup( schematicTypeProperty, [
{ node: new Text( circuitConstructionKitCommonStrings.ieee, textOptions ), value: SchematicType.IEEE, tandemName: 'ieeeRadioButton' },
{ node: new Text( circuitConstructionKitCommonStrings.iec, textOptions ), value: SchematicType.IEC, tandemName: 'iecRadioButton' }
{ node: new Text( circuitConstructionKitCommonStrings.iec, textOptions ), value: SchematicType.IEC, tandemName: 'iecRadioButton' },
{ node: new Text( circuitConstructionKitCommonStrings.british, textOptions ), value: SchematicType.BRITISH, tandemName: 'britishRadioButton' }
], {
tandem: tandem.createTandem( 'schematicTypeRadioButtonGroup' ),
radioButtonOptions: {
Expand Down
2 changes: 1 addition & 1 deletion js/view/FuseNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class FuseNode extends FixedCircuitElementNode {
.lineToRelative( 0, -boxHeight );

const updateSchematicType = schematicType => {
schematicNode.shape = schematicType === SchematicType.IEEE ? schematicShape :
schematicNode.shape = ( schematicType === SchematicType.IEEE || schematicType === SchematicType.BRITISH ) ? schematicShape :
fuseIEC;
};
schematicTypeProperty.link( updateSchematicType );
Expand Down
2 changes: 1 addition & 1 deletion js/view/SchematicType.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Enumeration from '../../../phet-core/js/Enumeration.js';
import circuitConstructionKitCommon from '../circuitConstructionKitCommon.js';

const SchematicType = Enumeration.byKeys( [ 'IEC', 'IEEE' ] );
const SchematicType = Enumeration.byKeys( [ 'IEC', 'IEEE', 'BRITISH' ] );

circuitConstructionKitCommon.register( 'SchematicType', SchematicType );
export default SchematicType;
4 changes: 3 additions & 1 deletion js/view/schematicTypeProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import CCKCQueryParameters from '../CCKCQueryParameters.js';
import circuitConstructionKitCommon from '../circuitConstructionKitCommon.js';
import SchematicType from './SchematicType.js';

const schematicTypeProperty = new Property( CCKCQueryParameters.schematicStandard === 'iec' ? SchematicType.IEC : SchematicType.IEEE );
const schematicTypeProperty = new Property( CCKCQueryParameters.schematicStandard === 'iec' ? SchematicType.IEC :
CCKCQueryParameters.schematicStandard === 'british' ? SchematicType.BRITISH :
SchematicType.IEEE );

circuitConstructionKitCommon.register( 'schematicTypeProperty', schematicTypeProperty );
export default schematicTypeProperty;

0 comments on commit 508ad4b

Please sign in to comment.