We are adding 24 channel data Live graph using Scichart Example of Vital sign monitor. We are using VitalSignsMonitorShowcaseFragment.java example.
To show the live graph, do we need to accumulate the data for 50 point or so. I see in the code they are accumulating?
Is it necessary for the accumulation, please let us know
protected void initExample(ExampleVitalSignsMonitorFragmentBinding binding) {
final DefaultVitalSignsDataProvider dataProvider = new DefaultVitalSignsDataProvider(getActivity());
setUpChart(dataProvider);
dataProvider.getData().buffer(50, TimeUnit.MILLISECONDS).doOnNext(ecgData -> {
if(ecgData.isEmpty()) return;
dataBatch.updateData(ecgData);
UpdateSuspender.using(binding.surface, () -> {
final DoubleValues xValues = dataBatch.xValues;
ecgDataSeries.append(xValues, dataBatch.ecgHeartRateValuesA);
ecgSweepDataSeries.append(xValues, dataBatch.ecgHeartRateValuesB);
bloodPressureDataSeries.append(xValues, dataBatch.bloodPressureValuesA);
bloodPressureSweepDataSeries.append(xValues, dataBatch.bloodPressureValuesB);
bloodOxygenationDataSeries.append(xValues, dataBatch.bloodOxygenationA);
bloodOxygenationSweepDataSeries.append(xValues, dataBatch.bloodOxygenationB);
bloodVolumeDataSeries.append(xValues, dataBatch.bloodVolumeValuesA);
bloodVolumeSweepDataSeries.append(xValues, dataBatch.bloodVolumeValuesB);
final VitalSignsData lastVitalSignsData = dataBatch.lastVitalSignsData;
final double xValue = lastVitalSignsData.xValue;
lastEcgSweepDataSeries.append(xValue, lastVitalSignsData.ecgHeartRate);
lastBloodPressureDataSeries.append(xValue, lastVitalSignsData.bloodPressure);
lastBloodOxygenationSweepDataSeries.append(xValue, lastVitalSignsData.bloodOxygenation);
lastBloodVolumeDataSeries.append(xValue, lastVitalSignsData.bloodVolume);
});
}).compose(bindToLifecycle()).subscribe();
updateIndicators(0);
Observable.interval(0, 1, TimeUnit.SECONDS, AndroidSchedulers.mainThread())
.doOnNext(this::updateIndicators)
.compose(bindToLifecycle()).subscribe();
}
- Aditya Kadambi asked 3 years ago
- last active 3 years ago