Пример #1
0
void Fit::setDataCurve(int curve, double start, double end) {
  if (!d_graph)
    return;

  if (d_n > 0)
    delete[] d_w;

  Filter::setDataCurve(curve, start, end);

  d_w = new double[d_n];
  PlotCurve *plotCurve = dynamic_cast<PlotCurve *>(d_curve);
  DataCurve *dataCurve = dynamic_cast<DataCurve *>(d_curve);
  // if it is a DataCurve (coming from a Table)
  if (plotCurve && dataCurve && plotCurve->type() != GraphOptions::Function) {
    QList<DataCurve *> lst = dataCurve->errorBarsList();
    foreach (DataCurve *c, lst) {
      QwtErrorPlotCurve *er = dynamic_cast<QwtErrorPlotCurve *>(c);
      if (er && !er->xErrors()) {
        d_weighting = Instrumental;
        for (int i = 0; i < d_n; i++)
          d_w[i] = er->errorValue(i); // d_w are equal to the error bar values
        weighting_dataset = er->title().text();
        return;
      }
    }
Пример #2
0
void Fit::setDataCurve(int curve, double start, double end)
{
    Filter::setDataCurve(curve, start, end);

    if (!d_w){
        d_w = (double *)malloc(d_n*sizeof(double));
        if (!d_w){
            memoryErrorMessage();
            return;
        }
	}

    if (d_graph && d_curve && ((PlotCurve *)d_curve)->type() != Graph::Function)
    {
        QList<DataCurve *> lst = ((DataCurve *)d_curve)->errorBarsList();
        foreach (DataCurve *c, lst){
            QwtErrorPlotCurve *er = (QwtErrorPlotCurve *)c;
            if (!er->xErrors()){
                d_weighting = Instrumental;
                for (int i=0; i<d_n; i++){
					double e = er->errorValue(i);
					d_w[i] = 1.0/(e*e);
				}
                weighting_dataset = er->title().text();
                return;
            }
        }
Пример #3
0
void Fit::setDataCurve(int curve, double start, double end)
{
    if (d_n > 0)
		delete[] d_w;

    Filter::setDataCurve(curve, start, end);

    d_w = new double[d_n];
    if (d_graph && d_curve && ((PlotCurve *)d_curve)->type() != Graph::Function)
    {
        QList<DataCurve *> lst = ((DataCurve *)d_curve)->errorBarsList();
        foreach (DataCurve *c, lst){
            QwtErrorPlotCurve *er = (QwtErrorPlotCurve *)c;
            if (!er->xErrors()){
                d_weighting = Instrumental;
                for (int i=0; i<d_n; i++)
                    d_w[i] = er->errorValue(i); //d_w are equal to the error bar values
                weighting_dataset = er->title().text();
                return;
            }
        }