Skip to content

Commit

Permalink
use string Properties for prepare/observe button, see #54
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Jan 3, 2025
1 parent b8735c9 commit 86e2ed7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/bloch-sphere/view/BlochSphereMeasurementArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import QuantumMeasurementConstants from '../../common/QuantumMeasurementConstant
import BlochSphereNode from '../../common/view/BlochSphereNode.js';
import QuantumMeasurementHistogram from '../../common/view/QuantumMeasurementHistogram.js';
import quantumMeasurement from '../../quantumMeasurement.js';
import QuantumMeasurementStrings from '../../QuantumMeasurementStrings.js';
import BlochSphereModel from '../model/BlochSphereModel.js';
import { BlochSphereScene } from '../model/BlochSphereScene.js';
import { MeasurementBasis } from '../model/MeasurementBasis.js';
Expand Down Expand Up @@ -134,8 +135,12 @@ export default class BlochSphereMeasurementArea extends Node {
} ), QuantumMeasurementConstants.panelOptions );

const prepareObserveButtonTextProperty = new DerivedStringProperty(
[ model.readyToObserveProperty ],
readyToObserve => readyToObserve ? 'Observe' : 'Prepare'
[
model.readyToObserveProperty,
QuantumMeasurementStrings.observeStringProperty,
QuantumMeasurementStrings.reprepareStringProperty
],
( readyToObserve, observeString, reprepareString ) => readyToObserve ? observeString : reprepareString
);

const prepareObserveButton = new TextPushButton(
Expand Down

0 comments on commit 86e2ed7

Please sign in to comment.