Search in sources :

Example 1 with VDoubleArray

use of org.yamcs.studio.data.vtype.VDoubleArray in project yamcs-studio by yamcs.

the class Sine2DWaveform method nextValue.

@Override
VDoubleArray nextValue() {
    if (initialReference == null) {
        initialReference = lastTime;
    }
    double t = initialReference.until(lastTime, ChronoUnit.SECONDS);
    var omega = 2 * Math.PI / periodInSeconds;
    var k = 2 * Math.PI / wavelengthInSamples;
    var min = -1.0;
    var max = 1.0;
    var range = 0.0;
    return (VDoubleArray) ValueFactory.newVNumberArray(generateNewValue(omega, t, k), new ArrayInt(ySamples, xSamples), ValueUtil.defaultArrayDisplay(new ArrayInt(ySamples, xSamples)), alarmNone(), newTime(lastTime), newDisplay(min, min + range * 0.1, min + range * 0.2, "", DOUBLE_FORMAT, min + range * 0.8, min + range * 0.9, max, min, max));
}
Also used : VDoubleArray(org.yamcs.studio.data.vtype.VDoubleArray) ArrayInt(org.yamcs.studio.data.vtype.ArrayInt)

Example 2 with VDoubleArray

use of org.yamcs.studio.data.vtype.VDoubleArray in project yamcs-studio by yamcs.

the class Square2DWaveform method nextValue.

@Override
VDoubleArray nextValue() {
    if (initialReference == null) {
        initialReference = lastTime;
    }
    double t = initialReference.until(lastTime, ChronoUnit.SECONDS);
    var omega = 2 * Math.PI / periodInSeconds;
    var k = 2 * Math.PI / wavelengthInSamples;
    var min = -1.0;
    var max = 1.0;
    var range = 0.0;
    return (VDoubleArray) ValueFactory.newVNumberArray(generateNewValue(omega, t, k), new ArrayInt(ySamples, xSamples), ValueUtil.defaultArrayDisplay(new ArrayInt(ySamples, xSamples)), alarmNone(), newTime(lastTime), newDisplay(min, min + range * 0.1, min + range * 0.2, "", DOUBLE_FORMAT, min + range * 0.8, min + range * 0.9, max, min, max));
}
Also used : VDoubleArray(org.yamcs.studio.data.vtype.VDoubleArray) ArrayInt(org.yamcs.studio.data.vtype.ArrayInt)

Aggregations

ArrayInt (org.yamcs.studio.data.vtype.ArrayInt)2 VDoubleArray (org.yamcs.studio.data.vtype.VDoubleArray)2