Search in sources :

Example 1 with NumericProbeBase

use of artisynth.core.probes.NumericProbeBase in project artisynth_core by artisynth.

the class ProbeInfo method expandProbe.

public void expandProbe() {
    int width = myDisplayArea.getWidth();
    int height = GuiStorage.PROBE_DETAIL_HEIGHT;
    if (getProbe() instanceof Displayable) {
        Displayable dispProbe = (Displayable) getProbe();
        JPanel display = dispProbe.getDisplay(width, height, false);
        if (display instanceof NumericProbePanel && getProbe() instanceof NumericProbeBase) {
            smallDisplay = (NumericProbePanel) display;
        }
        myDisplayArea.add(display);
    }
    myLabel.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, Color.BLACK));
    myController.updateComponentSizes();
    updateProbeDisplays();
}
Also used : NumericProbePanel(artisynth.core.gui.NumericProbePanel) Displayable(artisynth.core.gui.Displayable) NumericProbeBase(artisynth.core.probes.NumericProbeBase) Point(java.awt.Point) WayPoint(artisynth.core.probes.WayPoint)

Example 2 with NumericProbeBase

use of artisynth.core.probes.NumericProbeBase in project artisynth_core by artisynth.

the class ProbeInfo method saveToMatlab.

private void saveToMatlab(Probe probe) {
    // connection should exist or this method shouldn't be called
    MatlabInterface mi = getMain().getMatlabConnection();
    NumericProbeBase np = (NumericProbeBase) probe;
    ProbeEditor.saveToMatlab(np, mi, myController);
}
Also used : MatlabInterface(artisynth.core.util.MatlabInterface) NumericProbeBase(artisynth.core.probes.NumericProbeBase)

Example 3 with NumericProbeBase

use of artisynth.core.probes.NumericProbeBase in project artisynth_core by artisynth.

the class ProbeInfo method clearProbeData.

private void clearProbeData() {
    if (NumericProbeBase.class.isAssignableFrom(getProbe().getClass())) {
        NumericProbeBase numericProbe = (NumericProbeBase) getProbe();
        numericProbe.getNumericList().clear();
        // add empty data, using set if settable
        if (getProbe().isSettable()) {
            getProbe().setData(getProbe().getStartTime());
            getProbe().setData(getProbe().getStopTime());
        } else if (NumericInputProbe.class.isAssignableFrom(getProbe().getClass())) {
            ((NumericInputProbe) getProbe()).loadEmpty();
        }
    } else
        System.out.println("probe is not numeric, cannot clear");
}
Also used : NumericInputProbe(artisynth.core.probes.NumericInputProbe) NumericProbeBase(artisynth.core.probes.NumericProbeBase)

Example 4 with NumericProbeBase

use of artisynth.core.probes.NumericProbeBase in project artisynth_core by artisynth.

the class ProbeInfo method setLargeDisplayVisible.

public NumericProbeDisplayLarge setLargeDisplayVisible(boolean visible) {
    Probe probe = getProbe();
    if (!(probe instanceof NumericProbeBase)) {
        return null;
    }
    // display large probe display
    if (visible) {
        if (largeDisplay == null) {
            largeDisplay = new NumericProbeDisplayLarge(probe, Integer.toString(getTrackNumber()));
            ;
            largeDisplay.addWindowListener(new WindowHandler());
            // position the large probe window to the left of the timeline window
            Point timelineLocation = myController.getLocation();
            Dimension timelineSize = myController.getSize();
            Point newLargeProbePosition = new Point(timelineLocation.x + timelineSize.width, timelineLocation.y);
            largeDisplay.setLocation(newLargeProbePosition);
        }
        largeDisplay.setVisible(true);
    } else {
        if (largeDisplay == null) {
            largeDisplay.setVisible(false);
        }
    }
    return largeDisplay;
}
Also used : NumericProbeBase(artisynth.core.probes.NumericProbeBase) Point(java.awt.Point) WayPoint(artisynth.core.probes.WayPoint) Dimension(java.awt.Dimension) NumericOutputProbe(artisynth.core.probes.NumericOutputProbe) WayPointProbe(artisynth.core.probes.WayPointProbe) Probe(artisynth.core.probes.Probe) NumericInputProbe(artisynth.core.probes.NumericInputProbe) NumericProbeDisplayLarge(artisynth.core.gui.NumericProbeDisplayLarge)

Example 5 with NumericProbeBase

use of artisynth.core.probes.NumericProbeBase in project artisynth_core by artisynth.

the class ProbeInfo method loadFromMatlab.

// load a probe from a MATLAB variable
public void loadFromMatlab(Probe probe) {
    // connection should exist or this method shouldn't be called
    MatlabInterface mi = getMain().getMatlabConnection();
    NumericProbeBase np = (NumericProbeBase) probe;
    ProbeEditor.loadFromMatlab(np, mi, myController);
}
Also used : MatlabInterface(artisynth.core.util.MatlabInterface) NumericProbeBase(artisynth.core.probes.NumericProbeBase)

Aggregations

NumericProbeBase (artisynth.core.probes.NumericProbeBase)5 NumericInputProbe (artisynth.core.probes.NumericInputProbe)2 WayPoint (artisynth.core.probes.WayPoint)2 MatlabInterface (artisynth.core.util.MatlabInterface)2 Point (java.awt.Point)2 Displayable (artisynth.core.gui.Displayable)1 NumericProbeDisplayLarge (artisynth.core.gui.NumericProbeDisplayLarge)1 NumericProbePanel (artisynth.core.gui.NumericProbePanel)1 NumericOutputProbe (artisynth.core.probes.NumericOutputProbe)1 Probe (artisynth.core.probes.Probe)1 WayPointProbe (artisynth.core.probes.WayPointProbe)1 Dimension (java.awt.Dimension)1