Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Dawn Version Update; Fix Odd Peripheral Param Display (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmasd authored Feb 7, 2018
1 parent 196bdf0 commit e664996
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
5 changes: 4 additions & 1 deletion dawn/fake-runtime/FakeRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ class FakeRuntime {
sensor('MOTOR_SCALAR', 'MS2', [param('Val', 'float', randomFloat(-100, 100))], '101'),
sensor('LimitSwitch', 'LS1', [param('Val', 'int', Math.round(randomFloat(0, 1)))], '102'),
sensor('SENSOR_SCALAR', 'SS1', [param('Val', 'float', randomFloat(-100, 100))], '103'),
sensor('SENSOR_SCALAR', 'SS2', [param('Val', 'float', randomFloat(-100, 100))], '104'),
sensor('SENSOR_SCALAR', 'SS2', [
param('Val 1', 'float', randomFloat(-100, 100)),
param('Val 2', 'float', randomFloat(-100, 100)),
param('Val 3', 'float', randomFloat(-100, 100))], '104'),
sensor('SENSOR_BOOLEAN', 'SB1', [param('Val', 'bool', Math.random() < 0.5)], '105'),

// Special Cases handled in dawn/renderer/reducers/peripherals.js
Expand Down
17 changes: 9 additions & 8 deletions dawn/main/MenuTemplate/DebugMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ const DebugMenu = {
});
},
},
{
label: 'Full Stack Timestamp',
click() {
RendererBridge.reduxDispatch({
type: 'TIMESTAMP_CHECK',
});
},
},

{
label: 'Reload',
accelerator: 'CommandOrControl+R',
Expand All @@ -73,6 +66,14 @@ if (process.env.NODE_ENV === 'development') {
}
},
});
DebugMenu.submenu.push({
label: 'Full Stack Timestamp',
click() {
RendererBridge.reduxDispatch({
type: 'TIMESTAMP_CHECK',
});
},
});
}

export default DebugMenu;
2 changes: 1 addition & 1 deletion dawn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dawn",
"version": "0.6.0",
"version": "2018.0.0",
"description": "Frontend for PIE Robotics System",
"license": "Apache-2.0",
"private": true,
Expand Down
6 changes: 3 additions & 3 deletions dawn/renderer/components/DNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ConfigBox from './ConfigBox';
import UpdateBox from './UpdateBox';
import StatusLabel from './StatusLabel';
import TooltipButton from './TooltipButton';
import { REG_VERSION, FC_VERSION } from '../constants/Constants';
import { VERSION } from '../constants/Constants';
import { runtimeState } from '../utils/utils';

class DNavComponent extends React.Component {
Expand All @@ -34,9 +34,9 @@ class DNavComponent extends React.Component {

createHeader() {
if (this.props.fieldControlStatus) {
return `Dawn v${FC_VERSION} ${(this.props.heart) ? '+' : '-'}`;
return `Dawn v${VERSION} ${(this.props.heart) ? '+' : '-'}`;
}
return `Dawn v${REG_VERSION}`;
return `Dawn v${VERSION}`;
}

render() {
Expand Down
7 changes: 4 additions & 3 deletions dawn/renderer/components/peripherals/GenericPeripheral.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const GenericPeripheral = ({
{
_.map(param, obj => (
<div key={`${obj.param}-${device_name}-Overall`}>
<h4 style={{ float: 'right', height: '10px' }} key={`${obj.param}-${device_name}`} >
<h4 style={{ clear: 'right', float: 'right', height: '10px' }} key={`${obj.param}-${device_name}`} >
{`${obj.param}: ${numeral(obj.int_value || obj.float_value).format('+0.00')}`}
</h4>
</div>
Expand All @@ -28,14 +28,15 @@ const GenericPeripheral = ({
);

GenericPeripheral.propTypes = {
device_name: PropTypes.string.isRequired,
device_name: PropTypes.string,
device_type: PropTypes.string,
id: PropTypes.string.isRequired,
param: PropTypes.array.isRequired,
};

GenericPeripheral.defaultProps = {
device_type: 'Undefined Type',
device_name: 'Unknown Device',
device_type: 'Unknown Type',
};

export default GenericPeripheral;
5 changes: 3 additions & 2 deletions dawn/renderer/components/peripherals/Motor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ const Motor = ({ id, device_name, param }) => (
{
_.map(param, obj => ( // TODO: Figure out if a ProgressBar is useful
<div key={`${obj.param}-${device_name}-Overall`}>
<h4 style={{ float: 'right', height: '10px' }} key={`${obj.param}-${device_name}`}>
<h4 style={{ clear: 'right', float: 'right', height: '50px' }} key={`${obj.param}-${device_name}`}>
{`${obj.param}: ${numeral(obj.float_value).format('+0.00')}`}
<ProgressBar now={obj.float_value} min={-100} />

</h4>
<ProgressBar style={{ clear: 'right', height: '20px' }} now={obj.float_value} min={-100} />
</div>
))
}
Expand Down
3 changes: 1 addition & 2 deletions dawn/renderer/constants/Constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import keyMirror from 'keymirror';

export const REG_VERSION = '0.7.0';
export const FC_VERSION = 'FC-0.3.0';
export const VERSION = '2018.0.0';
export const PeripheralTypes = keyMirror({
MOTOR_SCALAR: null,
SENSOR_BOOLEAN: null,
Expand Down

0 comments on commit e664996

Please sign in to comment.