Data products not plotting the last recorded data point #162

When reading a data stream to plot the end of stream flag is being set
as the last point is read.  This was causing several layers of calls
not to save the last point.  I went ahead and saved the result of the
get_next_point calls whether the end of stream flag is set or not and now
we don't lose the last point.
This commit is contained in:
Alex Lin 2016-08-03 16:32:46 -05:00
parent a32e1d7557
commit 3d604ff770
3 changed files with 12 additions and 9 deletions

View File

@ -216,6 +216,11 @@ CurveViewNode::CurveViewNode( Widget Toplevel,
}
}
// Save the final point from getXY
fermi_curve->points[ fermi_curve->nPoints ].x = (x * x_scale_val) + x_bias_val;
fermi_curve->points[ fermi_curve->nPoints ].y = (y * y_scale_val) + y_bias_val;
fermi_curve->nPoints ++;
//------------------------------------------------------------------
// Set the XYCurve's remaining elements.
//------------------------------------------------------------------

View File

@ -102,14 +102,12 @@ DPC_UnitConvDataStream::~DPC_UnitConvDataStream() {
// MEMBER FUNCTION
int DPC_UnitConvDataStream::get(double* timestamp, double* paramValue) {
double time, value;
int ret ;
if ( source_ds->get(&time, &value) ) {
*timestamp = time;
*paramValue = cv_convert_double(cf, value) ;;
return (1);
} else {
return (0);
}
ret = source_ds->get(&time, &value) ;
*timestamp = time;
*paramValue = cv_convert_double(cf, value) ;;
return ret ;
}
// MEMBER FUNCTION

View File

@ -253,9 +253,9 @@ int DPC_std_curve::getXY(double *X_value, double *Y_value) {
}
} else {
eos = !ds[0]->get( &t1, &v1);
*X_value = cv_convert_double(time_conversion,t1);
*Y_value = v1;
if (!eos) {
*X_value = cv_convert_double(time_conversion,t1);
*Y_value = v1;
return(1);
}
}