Package systole.view.charts

Examples of systole.view.charts.XYChart


    }

    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);
View Full Code Here


    }

    private void report() {
        if ((this.currentAnalysis != null) && (this.currentAnalysis.getFinalSegment() != null)) {

            XYChart chart = new XYChart("Registro de Variación", "[ms]", "[%]");

            chart.addSeries("", this.currentAnalysis.getFinalSegment().getFinalSegment().toDoubleArray(), this.currentAnalysis.getSignalFrequency().getFrequency().doubleValue());
            chart.setShowLegend(false);
            chart.setShowTitle(false);

            this.reportPanel = chart.blackAndWhitePlot();
            this.reportPanel.setMaximumSize(new Dimension(400, 230));
            this.image = chart.plotThumbnail(280, 200, true);
            this.reportPanel.setMouseZoomable(false);
            this.reportPanel.setPopupMenu(null);
            this.reported = true;
        }
    }
View Full Code Here

            FilterSettings filtSet = new FilterSettings();
            filtSet.createDefault(this.parentControl.getAnalysis().getSignalFrequency().getFrequency().doubleValue());
            RawSignal rawSignal = this.parentControl.getAnalysis().getRawSignal();

            // primer grafico -> señal cruda
            XYChart rawSignalXYChart = new XYChart("Señal Original", "Muestras", "Amplitud (%)");
            rawSignalXYChart.setShowLegend(false);
            rawSignalXYChart.addSeries("Tren de Pulsos", rawSignal.getSegment().toDoubleArray(), 1);
            this.rawSignalChart = rawSignalXYChart.plot();

            this.segment = FilterProcessor.filterPulseWave(rawSignal.getSegment(), filtSet);

            // Si fue tomada invertida, la invierto
            if (rawSignal.isInverted()) {
                this.segment = this.segment.invert();
            }

            // segundo grafico -> señal invertida y filtrada
            this.filteredSignalModel = new XYChart("Señal Filtrada", "Muestras", "Amplitud (%)");
            filteredSignalModel.setShowLegend(false);
            this.filteredSignalModel.addSeries("Tren de Pulsos", this.segment.toDoubleArray(), 1);
            this.filteredSignalChart = this.filteredSignalModel.plot();
        } catch (Exception e) {
            SystoleLogger.getInstance().logError(e.getMessage());
View Full Code Here

        }
        return null;
    }

    private void doDerivatives(Segment segment) {
        this.derivates = new XYChart("Derivadas", "Tiempo (ms)", "Amplitud (%)");
        double frequency = this.currentAnalysis.getSignalFrequency().getFrequency().doubleValue();
        this.derivates.addSeries("Latido", segment.toDoubleArray(), frequency);
        this.derivates.addSeries("Derivada 1ra", finalSignal.getFirstDerivatite().toDoubleArray(), frequency);
        this.derivates.addSeries("Derivada 2da", finalSignal.getSecondDerivative().toDoubleArray(), frequency);
        this.derivates.addSeries("Derivada 3ra", finalSignal.getThirdDerivative().toDoubleArray(), frequency);
View Full Code Here

        this.derivates.addSeries("Derivada 3ra", finalSignal.getThirdDerivative().toDoubleArray(), frequency);
        this.derivates.addSeries("Derivada 4ta", finalSignal.getFourthDerivative().toDoubleArray(), frequency);
    }

    private void doCharts(Segment segment) {
        this.allCharts = new XYChart("Segmentos", "Muestras", "Amplitud (%)");

        Iterator<SelectedSegment> segments = this.parentControl.getSelectionModel().getSelectedSegments().iterator();
        while (segments.hasNext()) {
            SelectedSegment selectedSegment = segments.next();
            this.allCharts.addSeries("Seg-" + (selectedSegment.getNumber() + 1), selectedSegment.getSegment().toDoubleArray(), 1);
        }

        this.finalSegment = new XYChart("Curva Final", "Tiempo (ms)", "Amplitud (%)");
        this.finalSegment.addSeries("Latido", segment.toDoubleArray(), this.currentAnalysis.getSignalFrequency().getFrequency().doubleValue());
    }
View Full Code Here

    protected Void doInBackground() {
        try {
            ResultsModel modelResult = this.parentControl.getResultsModel();
            if ((modelResult != null) && (modelResult.getCurrentFinalSignal() != null)) {

                XYChart chart = new XYChart("Registro de Variación", "[ms]", "[%]");

                chart.addSeries("", modelResult.getCurrentFinalSignal().getFinalSegment().toDoubleArray(), this.parentControl.getAnalysis().getSignalFrequency().getFrequency().doubleValue());
                chart.setShowLegend(false);
                chart.setShowTitle(false);

                this.image = chart.plotThumbnail(280, 200, true);
                this.chartPanel = chart.blackAndWhitePlot();
                this.finished = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

    private void doPloit() {
        if (this.getRawSignal() != null) {
            this.preview.getjPnlCenter().removeAll();
            this.preview.getjPnlCenter().setLayout(new BorderLayout());
            Segment segment = (this.getRawSignal().isInverted() ? this.getRawSignal().getSegment().invert() : this.getRawSignal().getSegment());
            XYChart ploter = new XYChart("Tren de pulsos", "Muestras", "Amplitud");
            ploter.addSeries("pulsos", segment.toDoubleArray(), 1);
            ploter.setShowLegend(false);
            ploter.setShowTitle(false);
            this.chart = ploter.plot();
            this.preview.getjPnlCenter().add(this.chart, BorderLayout.CENTER);
        } else {
            this.preview.getjPnlCenter().removeAll();
        }
        this.preview.getjPnlCenter().revalidate();
View Full Code Here

    public void loadSegmentToCorrelation(Segment segment) {
        this.clearSelection();
        if (segment != null) {
            this.empty = false;
            this.selected = segment;
            this.plot = new XYChart(null);
            this.plot.setShowLegend(false);
            this.plot.setShowTitle(false);
            this.plot.addSeries("Selected segment", this.selected.toDoubleArray(), 1);
            ChartPanel pnl = this.plot.plot();
            pnl.setMouseZoomable(false);
View Full Code Here

    private void loadResults(List<CorrelationResult> segments) {
        if (segments != null) {
            Iterator<CorrelationResult> it = segments.iterator();
            CorrelationResult currentSegment;
            Segment segment;
            XYChart chart;
            int currentPos;
            String name;
            ChartPanel pnl;
            if ((x == 0) || (y == 0)) {
                x = this.jPnlResultCenter.getWidth() / 4;
                y = this.jPnlResultCenter.getHeight() - 15;
            }
            Dimension dim = new Dimension(x, y);
            DecimalFormat format = new DecimalFormat("####.00");
            while (it.hasNext()) {
                currentSegment = it.next();
                //currentPos = this.controller.getAnalysis().getAllSegments().getSegments().indexOf(currentSegment);
                segment = this.controller.getAnalysis().getAllSegments().getSegments().elementAt(currentSegment.getSegmentNumber());
                name = "Segmento: " + currentSegment.getSegmentNumber();
                chart = new XYChart(name);
                chart.addSeries(name, segment.toDoubleArray(), 1);
                chart.setShowLegend(false);
                chart.setShowTitle(false);
                pnl = chart.plot();
                pnl.setMouseZoomable(false);
                pnl.setPopupMenu(null);
                BigDecimal correlation = currentSegment.getCorrelation().multiply(new BigDecimal(100));
                String hint = "Grado de correlación: " + format.format(correlation);
                JPnlItemAutoSelection img = new JPnlItemAutoSelection(currentSegment.getSegmentNumber(), pnl, this, hint);
View Full Code Here

            if ((sliced != null) && (!sliced.isEmpty())) {

                this.items = new Vector<ImageFlowItem>();
                this.images = new Vector<Image>();
                ImageFlowItem flowItem;
                XYChart thumb;
                for (int i = 0; i < sliced.size(); i++) {
                    thumb = new XYChart("Segmento " + (i + 1));
                    thumb.setShowLegend(false);
                    thumb.addSeries("", sliced.elementAt(i).toDoubleArray(), 1);
                    flowItem = new ImageFlowItem(thumb.plotThumbnail(225, 225, false), "Segmento " + (i + 1));
                    this.items.add(flowItem);
                    thumb.setShowTitle(false);
                    this.images.add(thumb.plotThumbnail(200, 150, false));
                    this.selectionItems.add(new SelectionItem(i));
                }
            }
        } catch (Exception e) {
            SystoleLogger.getInstance().logError(e.getMessage());
View Full Code Here

TOP

Related Classes of systole.view.charts.XYChart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.