Search in sources :

Example 1 with ChartPoint

use of edu.uah.rsesc.aadlsimulator.ui.dialogs.ChartHelper.ChartPoint in project AGREE by loonwerks.

the class SimulatePossibilitiesChartDialog method createPoints.

private List<ChartPoint> createPoints(final Object xElementData, final Object yElementData, final Object zElementData, final Color color) {
    final List<ChartPoint> chartPoints = new ArrayList<>();
    for (final SimulationEngineState state : simulationEngineStates) {
        final Object xElementValue = state.getElementValue(state.getNumberOfFrames() - 1, xElementData);
        final Object yElementValue = state.getElementValue(state.getNumberOfFrames() - 1, yElementData);
        if (xElementValue != null && yElementValue != null) {
            Object zElementValue = null;
            if (zElementData != null) {
                zElementValue = state.getElementValue(state.getNumberOfFrames() - 1, zElementData);
            }
            final ChartPoint chartPoint = chartHelper.createChartPoint(simulationEngineStates.indexOf(state), color);
            if (!chartHelper.setChartPointInfo(chartPoint, xElementValue, yElementValue, zElementValue)) {
                chartPoints.add(chartPoint);
            }
        }
    }
    return chartPoints;
}
Also used : SimulationEngineState(edu.uah.rsesc.aadlsimulator.SimulationEngineState) ArrayList(java.util.ArrayList) ChartPoint(edu.uah.rsesc.aadlsimulator.ui.dialogs.ChartHelper.ChartPoint)

Example 2 with ChartPoint

use of edu.uah.rsesc.aadlsimulator.ui.dialogs.ChartHelper.ChartPoint in project AGREE by loonwerks.

the class VariablesChartDialog method createPoints.

private List<ChartPoint> createPoints(final Object yElementData, final Object zElementData, final Color color) {
    final List<ChartPoint> chartPoints = new ArrayList<>();
    for (int i = 0; i < engineState.getNumberOfFrames(); i++) {
        final Object xElementValue = currentSimulationSteps.get(i);
        final Object yElementValue = engineState.getElementValue(i, yElementData);
        if (xElementValue != null && yElementValue != null) {
            Object zElementValue = null;
            if (zElementData != null) {
                zElementValue = engineState.getElementValue(i, zElementData);
            }
            final ChartPoint chartPoint = chartHelper.createChartPoint(i, color);
            if (!chartHelper.setChartPointInfo(chartPoint, xElementValue, yElementValue, zElementValue)) {
                chartPoints.add(chartPoint);
            }
        }
    }
    return chartPoints;
}
Also used : ArrayList(java.util.ArrayList) ChartPoint(edu.uah.rsesc.aadlsimulator.ui.dialogs.ChartHelper.ChartPoint) ChartPoint(edu.uah.rsesc.aadlsimulator.ui.dialogs.ChartHelper.ChartPoint)

Aggregations

ChartPoint (edu.uah.rsesc.aadlsimulator.ui.dialogs.ChartHelper.ChartPoint)2 ArrayList (java.util.ArrayList)2 SimulationEngineState (edu.uah.rsesc.aadlsimulator.SimulationEngineState)1