From bc713a4e304d714037d3b70540454288c99e8637 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Thu, 7 Jul 2022 14:46:11 -0400 Subject: [PATCH 1/2] Add corrections enabled --- .../Mount/SummaryPanel/SummaryPanel.jsx | 19 ++++++++++++++++++- love/src/redux/selectors/selectors.js | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx b/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx index 5196338d1..354c4dbc6 100644 --- a/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx +++ b/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx @@ -61,12 +61,16 @@ export default class SummaryTable extends Component { const position = Array.isArray(this.props.hexapodReportedPosition.value) ? this.props.hexapodReportedPosition.value - : ['-','-','-','-','-','-']; + : ['-', '-', '-', '-', '-', '-']; const hexapodPosAndOffset = Array.isArray(this.props.hexapodReportedPosition.value) ? this.props.hexapodReportedPosition.value.map((pos, i) => [pos, offset[i]]) : this.props.hexapodReportedPosition; + // ATAOS + const correctionEnabled = this.props.correctionEnabled; + console.log('correctionEnabled', correctionEnabled); + //Hexapod Table data const hexapodTableData = { x: { @@ -179,6 +183,19 @@ export default class SummaryTable extends Component {
+ Corrections + + + {correctionEnabled.m1?.value ?? 'UNKNOWN'} + + + + {correctionEnabled.hexapod?.value ?? 'UNKNOWN'} + + + + {correctionEnabled.atspectrograph?.value ?? 'UNKNOWN'} + ); } diff --git a/love/src/redux/selectors/selectors.js b/love/src/redux/selectors/selectors.js index 0488cc8c3..d56c98efe 100644 --- a/love/src/redux/selectors/selectors.js +++ b/love/src/redux/selectors/selectors.js @@ -319,6 +319,7 @@ export const getMountSubscriptions = (index) => { `telemetry-ATMCS-${index}-mountEncoders`, // ATAOS `event-ATAOS-${index}-correctionOffsets`, + `event-ATAOS-${index}-correctionEnabled`, ]; }; @@ -343,6 +344,7 @@ export const getMountState = (state, index) => { const m1VentsLimitSwitches = mountData[`event-ATPneumatics-${index}-m1VentsLimitSwitches`]; const m1CoverLimitSwitches = mountData[`event-ATPneumatics-${index}-m1CoverLimitSwitches`]; const correctionOffsets = mountData[`event-ATAOS-${index}-correctionOffsets`]; + const correctionEnabled = mountData[`event-ATAOS-${index}-correctionEnabled`]; return { // ATHexapod hexapodInPosition: hexapodInPosition ? hexapodInPosition[hexapodInPosition.length - 1].inPosition.value : 0, @@ -398,6 +400,7 @@ export const getMountState = (state, index) => { v: { value: '-' }, w: { value: '-' }, }, + correctionEnabled: correctionEnabled ? correctionEnabled[correctionEnabled.length - 1] : {}, }; }; From f2f19705354c40a56f6ee17cb92916d4062e53a9 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Fri, 8 Jul 2022 12:04:34 -0400 Subject: [PATCH 2/2] Add corrections information to Mount/Summary Panel --- love/src/Config.js | 11 +++++++ .../Mount/SummaryPanel/SummaryPanel.jsx | 29 +++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index 8c87e204b..f36d08d95 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -308,6 +308,17 @@ export const m3InPositionStateMap = { 0: 'UNKNOWN', }; +// ATAOS +export const ataosCorrectionsStateMap = { + false: 'DISABLED', + true: 'ENABLED', +}; + +export const ataosCorrectionsStateToStyle = { + DISABLED: 'warning', + ENABLED: 'ok', +}; + // ATPneumatics export const m1CoverStateStateMap = { 1: 'DISABLED', diff --git a/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx b/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx index 354c4dbc6..2ddd85b4a 100644 --- a/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx +++ b/love/src/components/AuxTel/Mount/SummaryPanel/SummaryPanel.jsx @@ -9,6 +9,8 @@ import { m1CoverStateStateMap, nasmythRotatorInPositionStateMap, hexapodInPositionStateMap, + ataosCorrectionsStateMap, + ataosCorrectionsStateToStyle, stateToStyleMount, } from '../../../../Config'; import SummaryPanel from '../../../GeneralPurpose/SummaryPanel/SummaryPanel'; @@ -68,8 +70,17 @@ export default class SummaryTable extends Component { : this.props.hexapodReportedPosition; // ATAOS - const correctionEnabled = this.props.correctionEnabled; - console.log('correctionEnabled', correctionEnabled); + const { + atspectrograph: atSpectrographCorrections, + hexapod: hexapodCorrections, + m1: m1Corrections, + m2: m2Corrections, + } = this.props.correctionEnabled; + + const atSpectrographCorrectionsState = ataosCorrectionsStateMap[atSpectrographCorrections?.value ?? false]; + const hexapodCorrectionsState = ataosCorrectionsStateMap[hexapodCorrections?.value ?? false]; + const m1CorrectionsState = ataosCorrectionsStateMap[m1Corrections?.value ?? false]; + const m2CorrectionsState = ataosCorrectionsStateMap[m2Corrections?.value ?? false]; //Hexapod Table data const hexapodTableData = { @@ -186,15 +197,23 @@ export default class SummaryTable extends Component { Corrections - {correctionEnabled.m1?.value ?? 'UNKNOWN'} + {m1CorrectionsState} + + + + {m2CorrectionsState} - {correctionEnabled.hexapod?.value ?? 'UNKNOWN'} + + {hexapodCorrectionsState} + - {correctionEnabled.atspectrograph?.value ?? 'UNKNOWN'} + + {atSpectrographCorrectionsState} + );