diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b175830ae..dece9a694 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Version History v6.2.0 ------ +* Fix M1M3 force dropdown selection behavior ``_ * Adjust polling rate for external services queries ``_ * Add visual cue on CSCDetail and CSCExpanded to identify CSCs on simulation mode ``_ diff --git a/love/src/components/MainTel/M1M3/M1M3.jsx b/love/src/components/MainTel/M1M3/M1M3.jsx index 41a194c95..02e7b846a 100644 --- a/love/src/components/MainTel/M1M3/M1M3.jsx +++ b/love/src/components/MainTel/M1M3/M1M3.jsx @@ -61,8 +61,8 @@ export default class M1M3 extends Component { colormap: () => '#fff', width: 480, zoomLevel: 1, - selectedForceInput: '', - selectedForceParameter: '', + selectedForceInput: null, + selectedForceParameter: null, showActuatorsID: true, showHardpoints: true, actuatorsForce: [], @@ -354,6 +354,7 @@ export default class M1M3 extends Component { const filteredParameters = M1M3ActuatorForces[force]; this.setState({ selectedForceInput: force, + selectedForceParameter: null, forceParameters: filteredParameters, }); }; @@ -487,27 +488,35 @@ export default class M1M3 extends Component { }; render() { + const { summaryState, detailedState, alignment } = this.props; + const { + actuators, actuatorsForce, zoomLevel, showActuatorsID, showHardpoints, forceParameters, + selectedForceInput, selectedForceParameter, selectedActuatorId, selectedHardpointId, + xRadius, + yRadius, + maxRadius, + width, } = this.state; - const scale = (Math.max(this.state.xRadius, this.state.yRadius) * this.state.width) / 65000; + const scale = (Math.max(xRadius, yRadius) * width) / 65000; const margin = 60; - const summaryStateName = summaryStateMap[this.props.summaryState]; + const summaryStateName = summaryStateMap[summaryState]; const summaryStateStatus = summaryStateToStyle[summaryStateName]; - const detailedStateName = m1m3DetailedStateMap[this.props.detailedState]; + const detailedStateName = m1m3DetailedStateMap[detailedState]; const detailedStateStatus = m1m3DetailedStateToStyle[detailedStateName]; - const alignedStateName = alignedStateMap[this.props.alignment]; + const alignedStateName = alignedStateMap[alignment]; const alignedStateStatus = alignedStateToStyle[alignedStateName]; const maxForce = defaultNumberFormatter(Math.max(...actuatorsForce)); @@ -544,7 +553,7 @@ export default class M1M3 extends Component { Select force input: this.forceParameterSelected(selection)} />
Show actuators ID:
- +
Show hardpoints:
- +
@@ -622,48 +631,48 @@ export default class M1M3 extends Component { )} 0 ? styles.circleOverlay : styles.circleOverlayDisabled} - cx={this.state.width / 2} - cy={this.state.width / 2} + className={actuators.length > 0 ? styles.circleOverlay : styles.circleOverlayDisabled} + cx={width / 2} + cy={width / 2} key={'background'} - r={this.state.width / 2 - 30} + r={width / 2 - 30} /> 0 ? styles.cursorMove : styles.circleOverlayDisabled} - cx={this.state.width / 2} - cy={this.state.width / 2} + className={actuators.length > 0 ? styles.cursorMove : styles.circleOverlayDisabled} + cx={width / 2} + cy={width / 2} key={'overlay'} fill={'none'} - r={this.state.width / 2 - 30} + r={width / 2 - 30} pointerEvents="all" onMouseEnter={this.enableScroll} onMouseLeave={this.disableScroll} /> - {this.state.actuators.map((act, i) => { + {actuators.map((act, i) => { return ( this.actuatorSelected(act.id)}> M1M3 Entrance - - + + @@ -718,7 +727,7 @@ export default class M1M3 extends Component { @@ -736,8 +745,8 @@ export default class M1M3 extends Component { @@ -746,7 +755,7 @@ export default class M1M3 extends Component {