Esempio n. 1
0
  private PCMReader buildAverageFilter(Shell shell) throws IncompatibleDataTypeError {
    PCMReader reader = new PCMReader();
    PlotData timeData = new PlotData();
    PlotCanvas timeCanvas = new PlotCanvas(shell, timeData);
    timeCanvas.setup();
    timeData.setDataPerHeight(0x20000000 / 1);
    timeData.setDataPerWidth(30000);
    timeData.xoffset = 5000;
    timeData.title = "Input";
    reader.addListener(timeCanvas);

    LocalMaximaFilter filter1 = new LocalMaximaFilter();
    filter1.connectTo(reader);

    AverageFilter filter2 = new AverageFilter(100, 3);
    PlotData2Y maData = new PlotData2Y();
    PlotCanvas maCanvas = new PlotCanvas(shell, maData);
    maCanvas.setup();
    maData.setDataPerHeight(0x20000000 / 1);
    maData.setDataPerWidth(30000);
    maData.xoffset = 5000;
    maData.title = "Average";
    filter2.addListener(maCanvas);
    filter2.connectTo(filter1);

    return reader;
  }