Commit 872c808e authored by Francis Renaud's avatar Francis Renaud
Browse files

Bug fix: apps view rendering would crash when terminating scenario

parent fc219bbc
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ import {
  LATENCY_METRICS,
  THROUGHPUT_METRICS,
  MOBILITY_EVENT,
  TYPE_EXEC
  TYPE_EXEC,
  EXEC_STATE_IDLE
} from '../meep-constants';

const VIEW_NAME_NONE = 'none';
@@ -515,6 +516,10 @@ class DashboardContainer extends Component {

  render() {

    if (EXEC_STATE_IDLE === this.props.scenarioState) {
      console.log('Scenario is idle');
    }

    let epochs = null;
    if (!this.state.metricsPollingStopped) {
      this.epochs = this.props.epochs.slice();
@@ -712,7 +717,8 @@ const mapStateToProps = state => {
    sourceNodeSelected: state.exec.metrics.sourceNodeSelected,
    dataTypeSelected: state.exec.metrics.dataTypeSelected,
    eventCreationMode: state.exec.eventCreationMode,
    metricsTimeIntervalDuration: state.exec.metrics.timeIntervalDuration
    metricsTimeIntervalDuration: state.exec.metrics.timeIntervalDuration,
    scenarioState: state.exec.state.scenario
  };
};

+6 −0
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ import _ from 'lodash';
export const blue = '#5DBCD2';

export const lineGeneratorNodes = n1 => n2 => {
  if (!n1 || !n2) {
    return '';
  }
  return `M${n1.X},${n1.Y} L${n2.X},${n2.Y}`;
};

@@ -27,6 +30,9 @@ export const minusGenerator = () => {
};

export const curveGeneratorNodes = n1 => n2 => {
  if (!n1 || !n2) {
    return '';
  }
  return `M${n1.X},${n1.Y} C${n1.X},${n2.Y + 150} ${n1.X},${n2.Y + 50} ${n2.X},${n2.Y}`;
};