void PlotWizard::addXCol() { if (noCurves()) return; QString text = plotAssociations->currentItem()->text(); if ( text.contains("(X)") ) QMessageBox::warning(this, tr("MantidPlot - Error"), tr("You have already defined a X column!")); else { plotAssociations->currentItem()->setText(text+columnsList->currentItem()->text()+"(X)"); } }
void plotWizard::addXCol() { if (noCurves()) return; QString text=plotAssociations->currentText(); if (text.contains("(X)",TRUE)>0) QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have allready defined a X column!")); else { int item=plotAssociations->currentItem (); plotAssociations->changeItem (text+columnsList->currentText()+"(X)",item); } }
void PlotWizard::accept() { QStringList curves, curves3D, ribbons; for (int i=0; i < plotAssociations->count(); i++) { QString text = plotAssociations->item(i)->text(); if (text.endsWith("(X)")) { QMessageBox::critical(this, tr("MantidPlot - Error"), tr("Please define a Y column for the following curve") + ":\n\n" + text); return; } if ( text.contains("(Z)") ) { if ( text.contains("(Y)") && !curves3D.contains(text) ) curves3D << text; else if ( !text.contains("(Y)") && !ribbons.contains(text) ) ribbons << text; } else if ( text.contains("(xErr)") || text.contains("(yErr)")) { QStringList lst = text.split(",", QString::SkipEmptyParts); lst.pop_back(); QString master_curve = lst.join(","); if (!curves.contains(master_curve)) curves.prepend(master_curve); if (!curves.contains(text)) curves << text; //add error bars at the end of the list. } else if (!curves.contains(text)) curves.prepend(text); } if (curves.count()>0) emit plot(curves); if (curves3D.count()>0) plot3D(curves3D); if (ribbons.count()>0) plot3DRibbon(ribbons); if(!noCurves()) close(); }
void PlotWizard::addZCol() { if (noCurves()) return; QString text = plotAssociations->currentItem()->text(); if ( text.contains("(xErr)") || text.contains("(yErr)") ) QMessageBox::warning(this, tr("MantidPlot - Error"), tr("This kind of curve is not handled by MantidPlot!")); else if ( !text.contains("(X)") ) QMessageBox::warning(this, tr("MantidPlot - Error"), tr("You must define a X column first!")); else if ( text.contains("(Z)") ) QMessageBox::warning(this, tr("MantidPlot - Error"), tr("You have already defined a Z column!")); else { plotAssociations->currentItem()->setText(text+", "+columnsList->currentItem()->text()+"(Z)"); } }
void plotWizard::addZCol() { if (noCurves()) return; QString text=plotAssociations->currentText(); if (text.contains("(xErr)",TRUE) > 0 || text.contains("(yErr)",TRUE) > 0) QMessageBox::warning(this, tr("QtiPlot - Error"), tr("This kind of curve is not handled by QtiPlot!")); else if (text.contains("(X)",TRUE) == 0) QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You must define a X column first!")); else if (text.contains("(Z)",TRUE)>0) QMessageBox::warning(this, tr("QtiPlot - Error"), tr("You have allready defined a Z column!")); else { int item=plotAssociations->currentItem (); plotAssociations->changeItem (text+", "+columnsList->currentText()+"(Z)",item); } }
void plotWizard::accept() { QStringList curves, curves3D, ribbons; bool multiple=FALSE; int i=0; for (i=0;i<(int)plotAssociations->count ();i++) { QString text=plotAssociations->text (i); if (text.contains("(Z)", TRUE)>0 ) { if (text.contains("(Y)", TRUE)>0 && curves3D.contains(text) == 0) curves3D<<text; else if ( text.contains("(Y)", TRUE) ==0 && ribbons.contains(text) == 0) ribbons<<text; } else { if (curves.contains(text)>0) multiple=TRUE; else curves<<text; } } if (multiple) QMessageBox::warning(this,tr("QtiPlot - Warning"), tr("Redefinitions of the same curve are ignored!")); if ((int)curves.count ()>0) emit plot(curves); for (i=0;i<(int)curves3D.count ();i++) emit plot3D(curves3D[i]); for (i=0;i<(int)ribbons.count ();i++) emit plot3DRibbon(ribbons[i]); if (!noCurves()) close(); }