cabana: use proclog to bound initial part segment for small routes

main
Andy Haden 2017-06-29 15:27:20 -07:00
parent 572d7ba817
commit d77f9d5ce8
1 changed files with 5 additions and 2 deletions

View File

@ -74,7 +74,8 @@ export default class CanExplorer extends Component {
Routes.fetchRoutes(dongleId).then((routes) => {
if(routes) {
const route = routes[name];
const newState = {route, currentParts: [0,2]};
const newState = {route, currentParts: [0, Math.min(route.proclog - 1, 2)]};
if(this.props.dbc !== undefined) {
newState.dbc = this.props.dbc;
newState.dbcFilename = this.props.dbcFilename;
@ -101,10 +102,11 @@ export default class CanExplorer extends Component {
}
onDbcSelected(filename, dbcInstance) {
const {route} = this.state;
this.hideLoadDbc();
this.setState({dbc: dbcInstance,
dbcFilename: filename,
currentParts: [0,2],
currentParts: [0, Math.min(route.proclog - 1, 2)],
selectedMessage: null,
messages: {}}, () => {
const {route} = this.state;
@ -281,6 +283,7 @@ export default class CanExplorer extends Component {
}
onSeek(seekIndex, seekTime) {
this.setState({seekIndex, seekTime});
}