Skip to content

Commit

Permalink
add caption to photon source (i.e. laser), see #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Nov 13, 2024
1 parent a08b078 commit aab7ef2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/QuantumMeasurementStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type StringsType = {
'propagationIntoPageStringProperty': LocalizedStringProperty;
'classicalCoinStringProperty': LocalizedStringProperty;
'PStringProperty': LocalizedStringProperty;
'photonSourceStringProperty': LocalizedStringProperty;
'preparedStateStringProperty': LocalizedStringProperty;
'probabilityStringProperty': LocalizedStringProperty;
'probabilityOfValuePatternStringProperty': LocalizedStringProperty;
Expand Down
7 changes: 6 additions & 1 deletion js/photons/view/LaserNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ export default class LaserNode extends Node {
centerY: modelViewTransform.modelToViewY( model.position.y ),
tandem: providedOptions.tandem.createTandem( 'laserPointerNode' )
} );
const caption = new Text( QuantumMeasurementStrings.photonSourceStringProperty, {
font: new PhetFont( 12 ),
centerX: laserPointerNode.centerX,
top: laserPointerNode.bottom + 5
} );

const nodeChildren: Node[] = [ laserPointerNode ];
const nodeChildren: Node[] = [ laserPointerNode, caption ];

// If the laser is in many-photon mode, we need a slider to control the rate of photon emission. And a label for
// the rate.
Expand Down
3 changes: 3 additions & 0 deletions quantum-measurement-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
"P": {
"value": "P"
},
"photonSource": {
"value": "Photon Source"
},
"preparedState": {
"value": "Prepared State"
},
Expand Down

0 comments on commit aab7ef2

Please sign in to comment.