}
private void calculate() {
if ((this.currentAnalysis.getSelectedSegments() != null) && (this.currentAnalysis.getFinalSegment() != null)) {
this.allCharts = new XYChart("Segmentos", "Muestras", "Amplitud (%)");
Iterator<SelectedSegment> segments = this.currentAnalysis.getSelectedSegments().iterator();
while (segments.hasNext()) {
SelectedSegment selectedSegment = segments.next();
this.allCharts.addSeries("Seg-" + (selectedSegment.getNumber() + 1), selectedSegment.getSegment().toDoubleArray(), 1);
SelectionItem selectItem = this.selectionItems.get(selectedSegment.getNumber());
if (selectItem != null) {
selectItem.setSelected(true);
}
}
double frequency = this.currentAnalysis.getSignalFrequency().getFrequency().doubleValue();
this.finalSegment = new XYChart("Curva Final", "Tiempo (ms)", "Amplitud (%)");
this.finalSegment.addSeries("Latido", this.currentAnalysis.getFinalSegment().getFinalSegment().toDoubleArray(), frequency);
this.derivates = new XYChart("Derivadas", "Tiempo (ms)", "Amplitud (%)");
this.derivates.addSeries("Latido", this.currentAnalysis.getFinalSegment().getFinalSegment().toDoubleArray(), frequency);
this.derivates.addSeries("Derivada 1ra", this.currentAnalysis.getFinalSegment().getFirstDerivatite().toDoubleArray(), frequency);
this.derivates.addSeries("Derivada 2da", this.currentAnalysis.getFinalSegment().getSecondDerivative().toDoubleArray(), frequency);
this.derivates.addSeries("Derivada 3ra", this.currentAnalysis.getFinalSegment().getThirdDerivative().toDoubleArray(), frequency);
this.derivates.addSeries("Derivada 4ta", this.currentAnalysis.getFinalSegment().getFourthDerivative().toDoubleArray(), frequency);