wire up firmware flash progress

Also turn off logging and longer checksum interval to improve performance

94K movehub fw flashes in about 1:45
This commit is contained in:
David Lechner
2020-05-20 19:57:23 -05:00
committed by David Lechner
parent 7ba99d62bb
commit 3ae2fb2eef
8 changed files with 81 additions and 39 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import React from 'react';
import { Col, Row } from 'react-bootstrap';
import Container from 'react-bootstrap/Container';
import Editor from './Editor';
import StatusBar from './Statusbar';
import StatusBar from './StatusBar';
import Terminal from './Terminal';
import Toolbar from './Toolbar';
+24
View File
@@ -0,0 +1,24 @@
import React from 'react';
import ProgressBar from 'react-bootstrap/ProgressBar';
import { connect } from 'react-redux';
import { RootState } from '../reducers';
type StateProps = { progress: number };
type StatusProps = StateProps;
class StatusBar extends React.Component<StatusProps> {
render(): JSX.Element {
return (
<div className="bg-info p-2">
<ProgressBar className="w-25" now={this.props.progress} />
</div>
);
}
}
const mapStateToProps = (state: RootState): StateProps => ({
progress: state.status.progress,
});
export default connect(mapStateToProps)(StatusBar);
-33
View File
@@ -1,33 +0,0 @@
import React from 'react';
import ProgressBar from 'react-bootstrap/ProgressBar';
import { BLEConnectionState } from '../reducers/ble';
interface StatusBarState {
bleState: BLEConnectionState;
}
class StatusBar extends React.Component<{}, StatusBarState> {
constructor(props: {}) {
super(props);
this.state = { bleState: BLEConnectionState.Disconnected };
this.onAction = this.onAction.bind(this);
}
private onAction(action: string): void {
console.log(action);
}
setBLEState(state: BLEConnectionState): void {
this.setState({ bleState: state });
}
render(): JSX.Element {
return (
<div className="bg-info p-2">
<ProgressBar className="w-25"></ProgressBar>
</div>
);
}
}
export default StatusBar;