Skip to content

Commit

Permalink
Fix ATPtg/MTPtg mountStatus.mountRot parameter being converted from r…
Browse files Browse the repository at this point in the history
…ad to degrees whereas it already comes in degree scale.
  • Loading branch information
sebastian-aranda committed Jan 21, 2025
1 parent 8fa7b52 commit 6ee190b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions love/src/components/AuxTel/Dome/Dome.container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const DomeContainer = ({
telescopeRAHour,
telescopeRADeg,
telescopeDecDeg,
telescopeRotatorRad,
telescopeRotatorDeg,
raDecHourFormat,
...props
}) => {
Expand Down Expand Up @@ -158,7 +158,7 @@ const DomeContainer = ({
telescopeRAHour={telescopeRAHour}
telescopeRADeg={telescopeRADeg}
telescopeDecDeg={telescopeDecDeg}
telescopeRotatorRad={telescopeRotatorRad}
telescopeRotatorDeg={telescopeRotatorDeg}
raDecHourFormat={raDecHourFormat}
/>
);
Expand Down
8 changes: 4 additions & 4 deletions love/src/components/AuxTel/Dome/Dome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ export default class Dome extends Component {
telescopeRADeg: PropTypes.number,
/** Telescope current Dec in degrees */
telescopeDecDeg: PropTypes.number,
/** Telescope rotator position in rad */
telescopeRotatorRad: PropTypes.number,
/** Telescope rotator position in degrees */
telescopeRotatorDeg: PropTypes.number,
/** Whether to display the RA and DEC in hour format */
raDecHourFormat: PropTypes.bool,
};
Expand Down Expand Up @@ -306,7 +306,7 @@ export default class Dome extends Component {
telescopeRAHour,
telescopeRADeg,
telescopeDecDeg,
telescopeRotatorRad,
telescopeRotatorDeg,
raDecHourFormat,
} = this.props;

Expand Down Expand Up @@ -447,7 +447,7 @@ export default class Dome extends Component {
telescopeRAHour={telescopeRAHour}
telescopeRADeg={telescopeRADeg}
telescopeDecDeg={telescopeDecDeg}
telescopeRotatorRad={telescopeRotatorRad}
telescopeRotatorDeg={telescopeRotatorDeg}
raDecHourFormat={raDecHourFormat}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class DomeSummaryTable extends Component {
telescopeRAHour: PropTypes.number,
telescopeRADeg: PropTypes.number,
telescopeDecDeg: PropTypes.number,
telescopeRotatorRad: PropTypes.number,
telescopeRotatorDeg: PropTypes.number,
raDecHourFormat: PropTypes.bool,
};

Expand Down Expand Up @@ -113,7 +113,7 @@ export default class DomeSummaryTable extends Component {
telescopeRAHour,
telescopeRADeg,
telescopeDecDeg,
telescopeRotatorRad,
telescopeRotatorDeg,
raDecHourFormat,
} = this.props;

Expand Down Expand Up @@ -159,7 +159,7 @@ export default class DomeSummaryTable extends Component {
const parsedTelescopeDecHour = degreesToDMS(telescopeDecDeg);
const parsedTelescopeRADeg = defaultNumberFormatter(telescopeRADeg, 2) + '°';
const parsedTelescopeDecDeg = defaultNumberFormatter(telescopeDecDeg, 2) + '°';
const parsedTelescopeRotatorDeg = defaultNumberFormatter(degrees(telescopeRotatorRad), 2) + '°';
const parsedTelescopeRotatorDeg = defaultNumberFormatter(telescopeRotatorDeg, 2) + '°';
const telescopeRAText = raDecHourFormat ? parsedTelescopeRAHour : parsedTelescopeRADeg;
const telescopeDecText = raDecHourFormat ? parsedTelescopeDecHour : parsedTelescopeDecDeg;

Expand Down
4 changes: 2 additions & 2 deletions love/src/components/MainTel/MTDome/MTDome.container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const MTDomeContainer = ({
telescopeRAHour,
telescopeRADeg,
telescopeDecDeg,
telescopeRotatorRad,
telescopeRotatorDeg,
raDecHourFormat,
...props
}) => {
Expand Down Expand Up @@ -117,7 +117,7 @@ const MTDomeContainer = ({
telescopeRAHour={telescopeRAHour}
telescopeRADeg={telescopeRADeg}
telescopeDecDeg={telescopeDecDeg}
telescopeRotatorRad={telescopeRotatorRad}
telescopeRotatorDeg={telescopeRotatorDeg}
raDecHourFormat={raDecHourFormat}
/>
);
Expand Down
8 changes: 4 additions & 4 deletions love/src/components/MainTel/MTDome/MTDome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ export default class MTDome extends Component {
telescopeRADeg: PropTypes.number,
/** Telescope current Dec in degrees */
telescopeDecDeg: PropTypes.number,
/** Telescope rotator position in rad */
telescopeRotatorRad: PropTypes.number,
/** Telescope rotator position in degrees */
telescopeRotatorDeg: PropTypes.number,
/** Whether to display the RA and DEC in hour format */
raDecHourFormat: PropTypes.bool,
};
Expand Down Expand Up @@ -572,7 +572,7 @@ export default class MTDome extends Component {
telescopeRAHour,
telescopeRADeg,
telescopeDecDeg,
telescopeRotatorRad,
telescopeRotatorDeg,
raDecHourFormat,
} = this.props;

Expand Down Expand Up @@ -661,7 +661,7 @@ export default class MTDome extends Component {
telescopeRAHour={telescopeRAHour}
telescopeRADeg={telescopeRADeg}
telescopeDecDeg={telescopeDecDeg}
telescopeRotatorRad={telescopeRotatorRad}
telescopeRotatorDeg={telescopeRotatorDeg}
raDecHourFormat={raDecHourFormat}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export default class MTDomeSummaryTable extends Component {
telescopeRADeg: PropTypes.number,
/** Telescope current Dec in degrees */
telescopeDecDeg: PropTypes.number,
/** Telescope rotator position in rad */
telescopeRotatorRad: PropTypes.number,
/** Telescope rotator position in degrees */
telescopeRotatorDeg: PropTypes.number,
/** Whether to display the RA and DEC in hour format */
raDecHourFormat: PropTypes.bool,
};
Expand Down Expand Up @@ -113,7 +113,7 @@ export default class MTDomeSummaryTable extends Component {
telescopeRAHour,
telescopeRADeg,
telescopeDecDeg,
telescopeRotatorRad,
telescopeRotatorDeg,
raDecHourFormat,
} = this.props;

Expand All @@ -135,7 +135,7 @@ export default class MTDomeSummaryTable extends Component {
const parsedTelescopeDecHour = degreesToDMS(telescopeDecDeg);
const parsedTelescopeRADeg = defaultNumberFormatter(telescopeRADeg, 2) + '°';
const parsedTelescopeDecDeg = defaultNumberFormatter(telescopeDecDeg, 2) + '°';
const parsedTelescopeRotatorDeg = defaultNumberFormatter(degrees(telescopeRotatorRad), 2) + '°';
const parsedTelescopeRotatorDeg = defaultNumberFormatter(telescopeRotatorDeg, 2) + '°';
const telescopeRAText = raDecHourFormat ? parsedTelescopeRAHour : parsedTelescopeRADeg;
const telescopeDecText = raDecHourFormat ? parsedTelescopeDecHour : parsedTelescopeDecDeg;

Expand Down
4 changes: 2 additions & 2 deletions love/src/redux/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ export const getAuxiliaryTelescopeState = (state) => {
telescopeRAHour: data['telemetry-ATPtg-0-mountStatus']?.mountRA?.value ?? 0,
telescopeRADeg: data['telemetry-ATPtg-0-mountPositions']?.ra?.value[0] ?? 0,
telescopeDecDeg: data['telemetry-ATPtg-0-mountStatus']?.mountDec?.value ?? 0,
telescopeRotatorRad: data['telemetry-ATPtg-0-mountStatus']?.mountRot?.value ?? 0,
telescopeRotatorDeg: data['telemetry-ATPtg-0-mountStatus']?.mountRot?.value ?? 0,
targetName: data['event-ATPtg-0-currentTarget']?.[0].targetName?.value ?? 'Unknown',
};
};
Expand Down Expand Up @@ -1318,7 +1318,7 @@ export const getMainTelescopeState = (state) => {
telescopeRAHour: data['telemetry-MTPtg-0-mountStatus']?.mountRA?.value ?? 0,
telescopeRADeg: data['telemetry-MTPtg-0-mountPosition']?.ra?.value ?? 0,
telescopeDecDeg: data['telemetry-MTPtg-0-mountStatus']?.mountDec?.value ?? 0,
telescopeRotatorRad: data['telemetry-MTPtg-0-mountStatus']?.mountRot?.value ?? 0,
telescopeRotatorDeg: data['telemetry-MTPtg-0-mountStatus']?.mountRot?.value ?? 0,
targetName: data['event-MTPtg-0-currentTarget']?.[0].targetName?.value ?? 'Unknown',
};
};
Expand Down

0 comments on commit 6ee190b

Please sign in to comment.