Skip to content

Commit

Permalink
wider and thinner flux sensor, see #188
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Jul 1, 2022
1 parent a6370a7 commit 69f786b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions js/common/model/FluxMeter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ type SelfOptions = {
};
export type FluxMeterOptions = SelfOptions & PhetioObjectOptions;

// constants
// The size of the flux sensor. Note that this is parallel to the ground, so "height" is actually the Z dimension.
const FLUX_SENSOR_SIZE = new Dimension2(
GreenhouseEffectConstants.SUNLIGHT_SPAN.width * 0.2,
GreenhouseEffectConstants.SUNLIGHT_SPAN.width * 0.75,
GreenhouseEffectConstants.SUNLIGHT_SPAN.height
);

Expand All @@ -67,7 +67,7 @@ class FluxMeter extends PhetioObject {

// The initial position for the flux sensor, empirically determined to be near the horizon in the observation
// window and not initially overlapping with anything important.
initialPosition: new Vector2( 0, LayersModel.HEIGHT_OF_ATMOSPHERE * 0.15 )
initialPosition: new Vector2( -LayersModel.SUNLIGHT_SPAN.width * 0.105, LayersModel.HEIGHT_OF_ATMOSPHERE * 0.15 )
},

// temporarily marking phet-io state to be false until serialization is added
Expand Down
8 changes: 4 additions & 4 deletions js/common/view/FluxMeterNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const SENSOR_FILL_COLOR = 'rgba(200,200,200,0.6)';

// The height of the sensor in the view. This is needed because the sensor model doesn't have any y-dimension height,
// so we use and arbitrary value that looks decent in the view.
const SENSOR_VIEW_HEIGHT = 30;
const SENSOR_VIEW_HEIGHT = 10;

class FluxMeterNode extends Node {
public readonly fluxPanel: Panel;
Expand Down Expand Up @@ -106,7 +106,7 @@ class FluxMeterNode extends Node {
const fluxSensorNode = new Rectangle( 0, 0, fluxSensorWidth, SENSOR_VIEW_HEIGHT, 5, 5, {
stroke: SENSOR_STROKE_COLOR,
fill: SENSOR_FILL_COLOR,
lineWidth: 4
lineWidth: 2
} );
this.addChild( fluxSensorNode );

Expand Down Expand Up @@ -147,7 +147,7 @@ class FluxMeterNode extends Node {
);

// Only allow dragging in the Y direction and not the X direction.
model.fluxSensor.positionProperty.value = new Vector2( 0, modelY );
model.fluxSensor.positionProperty.value = new Vector2( model.fluxSensor.positionProperty.value.x, modelY );
},
end: () => {
model.fluxSensor.isDraggingProperty.set( false );
Expand Down Expand Up @@ -193,7 +193,7 @@ class EnergyFluxDisplay extends Node {

const options = optionize<EnergyFluxDisplayOptions, EnergyFluxDisplayArrowSelfOptions, NodeOptions>()( {
height: 385,
fluxToArrowLengthMultiplier: 1.5E-5,
fluxToArrowLengthMultiplier: 5E-6,
arrowNodeOptions: {
headHeight: 16,
headWidth: 16,
Expand Down

0 comments on commit 69f786b

Please sign in to comment.