diff --git a/js/common/model/ConcentrationModel.ts b/js/common/model/ConcentrationModel.ts index 44ab193a..6ea1134f 100644 --- a/js/common/model/ConcentrationModel.ts +++ b/js/common/model/ConcentrationModel.ts @@ -18,6 +18,7 @@ import NumberIO from '../../../../tandem/js/types/NumberIO.js'; import greenhouseEffect from '../../greenhouseEffect.js'; import LayersModel, { LayersModelOptions } from './LayersModel.js'; import Tandem from '../../../../tandem/js/Tandem.js'; +import IReadOnlyProperty from '../../../../axon/js/IReadOnlyProperty.js'; // constants const SCALE_HEIGHT_OF_ATMOSPHERE: number = 8400; // in meters, taken from a Wikipedia article @@ -48,7 +49,7 @@ class ConcentrationModel extends LayersModel { public readonly dateProperty: EnumerationProperty; public readonly manuallyControlledConcentrationProperty: NumberProperty; public readonly concentrationControlModeProperty: EnumerationProperty; - public readonly concentrationProperty: DerivedProperty; + public readonly concentrationProperty: IReadOnlyProperty; /** * @param {Tandem} tandem diff --git a/js/common/model/FluxMeter.ts b/js/common/model/FluxMeter.ts index 14e55f7f..62877f06 100644 --- a/js/common/model/FluxMeter.ts +++ b/js/common/model/FluxMeter.ts @@ -14,6 +14,7 @@ import Vector2 from '../../../../dot/js/Vector2.js'; import Vector2Property from '../../../../dot/js/Vector2Property.js'; import greenhouseEffect from '../../greenhouseEffect.js'; import Tandem from '../../../../tandem/js/Tandem.js'; +import IReadOnlyProperty from '../../../../axon/js/IReadOnlyProperty.js'; class FluxMeter { readonly sunlightInProperty: NumberProperty; @@ -23,7 +24,7 @@ class FluxMeter { readonly sensorBounds: Bounds2; readonly sensorPositionProperty: Vector2Property; readonly wireMeterAttachmentPositionProperty: Vector2Property; - readonly wireSensorAttachmentPositionProperty: DerivedProperty; + readonly wireSensorAttachmentPositionProperty: IReadOnlyProperty; /** * @param {Tandem} tandem diff --git a/js/common/model/LayersModel.ts b/js/common/model/LayersModel.ts index f3c5837c..cc2d7cf6 100644 --- a/js/common/model/LayersModel.ts +++ b/js/common/model/LayersModel.ts @@ -31,6 +31,7 @@ import Cloud from './Cloud.js'; import merge from '../../../../phet-core/js/merge.js'; import FluxMeter from './FluxMeter.js'; import { PhetioObjectOptions } from '../../../../tandem/js/PhetioObject.js'; +import IReadOnlyProperty from '../../../../axon/js/IReadOnlyProperty.js'; // constants const HEIGHT_OF_ATMOSPHERE = 50000; // in meters @@ -50,8 +51,8 @@ type LayersModelOptions = { class LayersModel extends GreenhouseEffectModel { readonly surfaceTemperatureKelvinProperty: NumberProperty; - readonly surfaceTemperatureCelsiusProperty: DerivedProperty; - readonly surfaceTemperatureFahrenheitProperty: DerivedProperty; + readonly surfaceTemperatureCelsiusProperty: IReadOnlyProperty; + readonly surfaceTemperatureFahrenheitProperty: IReadOnlyProperty; readonly temperatureUnitsProperty: EnumerationProperty; readonly surfaceThermometerVisibleProperty: BooleanProperty; readonly energyBalanceVisibleProperty: BooleanProperty; diff --git a/js/common/view/ConcentrationControlPanel.ts b/js/common/view/ConcentrationControlPanel.ts index 5fef1654..b51935da 100644 --- a/js/common/view/ConcentrationControlPanel.ts +++ b/js/common/view/ConcentrationControlPanel.ts @@ -41,6 +41,7 @@ import ConcentrationModel from '../model/ConcentrationModel.js'; import ConcentrationDescriber from './describers/ConcentrationDescriber.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import RadiationDescriber from './describers/RadiationDescriber.js'; +import IReadOnlyProperty from '../../../../axon/js/IReadOnlyProperty.js'; // constants const lotsString = greenhouseEffectStrings.concentrationPanel.lots; @@ -190,7 +191,7 @@ class DateControl extends Node { * @param {Tandem} tandem */ constructor( dateProperty: EnumerationProperty, - concentrationProperty: Property, + concentrationProperty: IReadOnlyProperty, concentrationControlModeProperty: EnumerationProperty, tandem: Tandem ) { diff --git a/js/common/view/EnergyBalancePanel.ts b/js/common/view/EnergyBalancePanel.ts index 1de3a7fc..768b70d7 100644 --- a/js/common/view/EnergyBalancePanel.ts +++ b/js/common/view/EnergyBalancePanel.ts @@ -7,6 +7,7 @@ */ import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; +import IReadOnlyProperty from '../../../../axon/js/IReadOnlyProperty.js'; import Property from '../../../../axon/js/Property.js'; import AxisLine from '../../../../bamboo/js/AxisLine.js'; import ChartRectangle from '../../../../bamboo/js/ChartRectangle.js'; @@ -67,12 +68,12 @@ class EnergyBalancePanel extends Panel { // Energy "In" needs to be plotted in the negative y direction to match other graphics related to energy flux // in this sim - const negatedEnergyInProperty: DerivedProperty = new DerivedProperty( + const negatedEnergyInProperty: IReadOnlyProperty = new DerivedProperty( [ netEnergyInProperty ], ( netEnergyIn: number ) => -netEnergyIn ); - const netEnergyProperty: DerivedProperty = new DerivedProperty( + const netEnergyProperty: IReadOnlyProperty = new DerivedProperty( [ negatedEnergyInProperty, netEnergyOutProperty ], ( netIn: number, netOut: number ) => netIn + netOut ); @@ -104,9 +105,9 @@ class EnergyBalancePlot extends Node { * @param {Property.} netEnergyOutProperty - Representing net energy out, read-only * @param {Property.} netEnergyProperty - Representing net energy of the system, read-only */ - constructor( netEnergyInProperty: Property, + constructor( netEnergyInProperty: IReadOnlyProperty, netEnergyOutProperty: Property, - netEnergyProperty: Property ) { + netEnergyProperty: IReadOnlyProperty ) { super(); // position of each bar, in model coordinates diff --git a/js/common/view/TemperatureSoundGenerator.ts b/js/common/view/TemperatureSoundGenerator.ts index 852d739f..0930c63b 100644 --- a/js/common/view/TemperatureSoundGenerator.ts +++ b/js/common/view/TemperatureSoundGenerator.ts @@ -99,7 +99,7 @@ class TemperatureSoundGenerator extends SoundGenerator { // relying on the base class to monitor them so that the loops can be turned off if they don't need to be playing. // This saves processor bandwidth on the audio rendering thread, since the parent class turns down the volume but // doesn't stop the loops. - Property.multilink( + Property.multilink( [ temperatureProperty, ...options.enableControlProperties as Property[] ], () => { this.updateLoopStates(); } ); diff --git a/js/common/view/ThermometerAndReadout.ts b/js/common/view/ThermometerAndReadout.ts index 49ad8b15..42bb7c96 100644 --- a/js/common/view/ThermometerAndReadout.ts +++ b/js/common/view/ThermometerAndReadout.ts @@ -26,6 +26,7 @@ import GreenhouseEffectUtils from '../GreenhouseEffectUtils.js'; import LayersModel from '../model/LayersModel.js'; import Property from '../../../../axon/js/Property.js'; import Enumeration from '../../../../phet-core/js/Enumeration.js'; +import IReadOnlyProperty from '../../../../axon/js/IReadOnlyProperty.js'; // constants const THERMOMETER_TO_READOUT_DISTANCE = 15; // in screen coordinates @@ -173,7 +174,7 @@ class ThermometerAndReadout extends Node { * @returns {ComboBoxItem} */ private static createComboBoxItem( unitsString: string, - property: Property, + property: IReadOnlyProperty, propertyRange: Range, propertyValue: Enumeration, tandemName: string ) {