mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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:
committed by
David Lechner
parent
7ba99d62bb
commit
3ae2fb2eef
@@ -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';
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user