Skip to content

Commit

Permalink
fix: missing convert function in attitude widget (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmotelet authored Apr 4, 2021
1 parent c1ed860 commit 546e330
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ui/widgets/attitude.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { render } from 'react-dom';
import util from 'util';
import Qty from 'js-quantities'

import BaseWidget, {defaultComponentDidMount, defaultComponentWillUnmount} from './basewidget';

Expand All @@ -11,6 +12,8 @@ const defaultValue = {
roll: defaultText
}

let convertRadToDeg = Qty.swiftConverter('rad', 'deg')

function Attitude(id, options, streamBundle, instrumentPanel) {
BaseWidget.call(this, id, options, streamBundle, instrumentPanel);
class ReactComponent extends React.Component {
Expand Down Expand Up @@ -78,7 +81,7 @@ Attitude.prototype.getInitialDimensions = function() {

function convertAndRound(value) {
return (typeof value === 'number') ?
convert(value).toFixed(4) + '°' : defaultText
convertRadToDeg(value).toFixed(4) + '°' : defaultText
}


Expand Down

0 comments on commit 546e330

Please sign in to comment.