Skip to content

Commit 546e330

Browse files
authored
fix: missing convert function in attitude widget (#192)
1 parent c1ed860 commit 546e330

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ui/widgets/attitude.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { render } from 'react-dom';
33
import util from 'util';
4+
import Qty from 'js-quantities'
45

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

@@ -11,6 +12,8 @@ const defaultValue = {
1112
roll: defaultText
1213
}
1314

15+
let convertRadToDeg = Qty.swiftConverter('rad', 'deg')
16+
1417
function Attitude(id, options, streamBundle, instrumentPanel) {
1518
BaseWidget.call(this, id, options, streamBundle, instrumentPanel);
1619
class ReactComponent extends React.Component {
@@ -78,7 +81,7 @@ Attitude.prototype.getInitialDimensions = function() {
7881

7982
function convertAndRound(value) {
8083
return (typeof value === 'number') ?
81-
convert(value).toFixed(4) + '°' : defaultText
84+
convertRadToDeg(value).toFixed(4) + '°' : defaultText
8285
}
8386

8487

0 commit comments

Comments
 (0)