scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

importOPJ.cpp
Go to the documentation of this file.
1 
14 
32 #include "importOPJ.h"
33 
36 
37 #include <QRegExp>
38 #include <QApplication>
39 #include <QMessageBox>
40 #include <QDockWidget>
41 #include <QLocale>
42 #include <QDate>
43 #include "Matrix.h"
44 #include "ColorButton.h"
45 #include "MultiLayer.h"
46 #include "Note.h"
47 #include "Folder.h"
48 #include "QwtHistogram.h"
49 #include "Grid.h"
50 
51 #define OBJECTXOFFSET 200
52 
53 QString strreverse(const QString &str) //QString reversing
54 {
55  QString out="";
56  for(int i=str.length()-1; i>=0; --i)
57  {
58  out+=str[i];
59  }
60  return out;
61 }
62 
63 QString posixTimeToString(time_t pt)
64 {
65  QDateTime qdt;
66  qdt.setTime_t(pt);
67  return qdt.toString("dd.MM.yyyy hh.mm.ss");
68 }
69 
70 ImportOPJ::ImportOPJ(ApplicationWindow *app, const QString& filename) :
71  mw(app)
72 {
73  xoffset=0;
74  try {
75  mw->setStatusBarText(QString("Import start ..."));
76  OriginFile opj((const char *)filename.toLocal8Bit());
77  parse_error = opj.parse();
78  mw->setStatusBarText(QString("... file parsed. Starting conversion to SciDAVis ..."));
79  importTables(opj);
80  importGraphs(opj);
81  importNotes(opj);
82  mw->setStatusBarText(QString());
83  if(filename.endsWith(".opj", Qt::CaseInsensitive))
84  createProjectTree(opj);
85  mw->showResults(opj.resultsLogString().c_str(), mw->logWindow.isVisible());
86  } catch(const std::logic_error& er){
87  QApplication::restoreOverrideCursor();
88  QMessageBox::critical(mw, "Origin Project Import Error", QString(er.what()));
89  }
90 }
91 
92 inline uint qHash(const tree<Origin::ProjectNode>::iterator &key)
93 {
94  return qHash(key->name.c_str());
95 }
96 
97 bool ImportOPJ::createProjectTree(const OriginFile& opj)
98 {
99  const tree<Origin::ProjectNode>* projectTree = opj.project();
100  tree<Origin::ProjectNode>::iterator root = projectTree->begin(projectTree->begin());
101  if(!root.node)
102  return false;
103  FolderListItem* item = (FolderListItem*)mw->folders.topLevelItem(0);
104  item->setText(0, root->name.c_str());
105  item->folder()->setName(root->name.c_str());
106  Folder* projectFolder = mw->projectFolder();
107  QHash<tree<Origin::ProjectNode>::iterator, Folder*> parent;
108  parent[root] = projectFolder;
109  for(tree<Origin::ProjectNode>::iterator sib = projectTree->begin(root); sib != projectTree->end(root); ++sib)
110  {
111  if(sib->type == Origin::ProjectNode::Folder){
112 
113  Folder& f = parent.value(projectTree->parent(sib))->addChild<Folder>(sib->name.c_str());
114  parent[sib] = &f;
115  f.setBirthDate(posixTimeToString(sib->creationDate));
116  f.setModificationDate(posixTimeToString(sib->modificationDate));
119  } else {
120  QString name = sib->name.c_str();
121  if(sib->type == Origin::ProjectNode::Note)
122  {
123  QRegExp rx("^@\\((\\S+)\\)$");
124  if(rx.indexIn(name) == 0)
125  name = rx.cap(1);
126  }
127  const char* nodetype;
128  switch (sib->type)
129  {
130  case Origin::ProjectNode::SpreadSheet:
131  nodetype = "Table";
132  break;
133  case Origin::ProjectNode::Matrix:
134  nodetype = "Matrix";
135  break;
136  case Origin::ProjectNode::Graph:
137  nodetype = "MultiLayer";
138  break;
139  case Origin::ProjectNode::Graph3D:
140  // there is no Graph3D type yet
141  nodetype = "MultiLayer"; // "Graph3D";
142  break;
143  case Origin::ProjectNode::Note:
144  nodetype = "Note";
145  break;
146  case Origin::ProjectNode::Excel:
147  // there is no Excel type yet
148  nodetype = "Table";
149  break;
150  default:
151  nodetype = "Unknown";
152  break;
153  }
154  MyWidget* w = projectFolder->window(name, nodetype);
155  while (w){ // Origin window names are unique, but we need to loop on all sheets of Excel windows
156  Folder *f = parent.value(projectTree->parent(sib));
157  if (f){
158  if (f==parent[root]) break; // skip windows that go to root folder
159  // removeWindow uses QList.removeAll, so remove w before adding it to its folder
160  projectFolder->removeWindow(w);
161  f->addWindow(w);
162  f->setActiveWindow(w);
163  }
164  w = projectFolder->window(name, nodetype);
165  }
166  }
167  }
168  mw->changeFolder(projectFolder, true);
169  return true;
170 }
171 
173  int scidavisstyle=0;
174  switch (linestyle)
175  {
176  case Origin::GraphCurve::Solid:
177  scidavisstyle=0;
178  break;
179  case Origin::GraphCurve::Dash:
180  case Origin::GraphCurve::ShortDash:
181  scidavisstyle=1;
182  break;
183  case Origin::GraphCurve::Dot:
184  case Origin::GraphCurve::ShortDot:
185  scidavisstyle=2;
186  break;
187  case Origin::GraphCurve::DashDot:
188  case Origin::GraphCurve::ShortDashDot:
189  scidavisstyle=3;
190  break;
191  case Origin::GraphCurve::DashDotDot:
192  scidavisstyle=4;
193  break;
194  }
195  return scidavisstyle;
196 }
197 
198 // spreadsheets can be either in its own window or as a sheet in excels windows
199 bool ImportOPJ::importSpreadsheet(const OriginFile &opj, const Origin::SpreadSheet &spread)
200 {
201  static int visible_count=0;
202  QLocale locale = mw->locale();
203  int SciDAVis_scaling_factor=10; //in Origin width is measured in characters while in SciDAVis - pixels --- need to be accurate
204  int columnCount = spread.columns.size();
205  int maxrows = spread.maxRows;
206  if(!columnCount) //remove tables without cols
207  return false;
208 
209  Table *table = mw->newTable(spread.name.c_str(), maxrows, columnCount);
210  if (!table)
211  return false;
212  if (spread.hidden || spread.loose)
213  mw->hideWindow(table);
214 
215  table->setWindowLabel(spread.label.c_str());
216  for(int j = 0; j < columnCount; ++j){
217  Origin::SpreadColumn column = spread.columns[j];
218  Column *scidavis_column = table->column(j);
219 
220  QString name(column.name.c_str());
221  scidavis_column->setName(name.replace(QRegExp(".*_"),""));
222  if (column.command.size() > 0)
223  scidavis_column->setFormula(Interval<int>(0,maxrows), QString(column.command.c_str()));
224  scidavis_column->setComment(QString(column.comment.c_str()));
225  table->setColumnWidth(j, (int)column.width*SciDAVis_scaling_factor);
226 
227  switch(column.type){
228  case Origin::SpreadColumn::X:
230  break;
231  case Origin::SpreadColumn::Y:
233  break;
234  case Origin::SpreadColumn::Z:
236  break;
237  case Origin::SpreadColumn::XErr:
239  break;
240  case Origin::SpreadColumn::YErr:
242  break;
243  case Origin::SpreadColumn::Label:
244  default:
246  }
247 
248  QString format;
249  switch(column.valueType) {
250  case Origin::Numeric:
251  case Origin::TextNumeric:
252  /*
253  A TextNumeric column in Origin is a column whose filled cells contain either a double or a string.
254  In SciDAVis there is no equivalent column type.
255  Set the SciDAVis column type as 'Numeric' or 'Text' depending on the type of first element in column.
256  TODO: Add a "per column" flag, settable at import dialog, to choose between both types.
257  */
258  {
259  double datavalue;
260  bool setAsText = false;
262  for (int i=0; i < std::min((int)column.data.size(), maxrows); ++i) {
263  Origin::variant value(column.data[i]);
264  if (value.type() == Origin::variant::V_DOUBLE) {
265  datavalue = value.as_double();
266  if (datavalue==_ONAN) continue; // mark for empty cell
267  if (!setAsText) {
268  scidavis_column->setValueAt(i, datavalue);
269  } else { // convert double to string for Text columns
270  scidavis_column->setTextAt(i, locale.toString(datavalue, 'g', 16));
271  }
272  } else { // string
273  if (!setAsText && i==0) {
274  table->column(j)->setColumnMode(SciDAVis::Text);
275  setAsText = true;
276  }
277  scidavis_column->setTextAt(i, column.data[i].as_string());
278  }
279  }
280  int f=0;
281  if(column.numericDisplayType == 0)
282  {
283  f=0;
284  }
285  else
286  {
287  switch(column.valueTypeSpecification)
288  {
289  case 0: //Decimal 1000
290  f=1;
291  break;
292  case 1: //Scientific
293  f=2;
294  break;
295  case 2: //Engeneering
296  case 3: //Decimal 1,000
297  f=0;
298  break;
299  }
300  Double2StringFilter *filter = static_cast<Double2StringFilter*>(table->column(j)->outputFilter());
301  filter->setNumericFormat(f);
302  filter->setNumDigits(column.decimalPlaces);
303  }
304  break;
305  }
306  case Origin::Text:
307  table->column(j)->setColumnMode(SciDAVis::Text);
308  for (int i=0; i < min((int)column.data.size(), maxrows); ++i) {
309  scidavis_column->setTextAt(i, column.data[i].as_string());
310  }
311  break;
312  case Origin::Date:
313  {
314  switch(column.valueTypeSpecification) {
315  case -128:
316  format="dd/MM/yyyy";
317  break;
318  case -119:
319  format="dd/MM/yyyy HH:mm";
320  break;
321  case -118:
322  format="dd/MM/yyyy HH:mm:ss";
323  break;
324  case 0:
325  case 9:
326  case 10:
327  format="dd.MM.yyyy";
328  break;
329  case 2:
330  format="MMM d";
331  break;
332  case 3:
333  format="M/d";
334  break;
335  case 4:
336  format="d";
337  break;
338  case 5:
339  case 6:
340  format="ddd";
341  break;
342  case 7:
343  format="yyyy";
344  break;
345  case 8:
346  format="yy";
347  break;
348  case 11:
349  case 12:
350  case 13:
351  case 14:
352  case 15:
353  format="yyMMdd";
354  break;
355  case 16:
356  case 17:
357  format="MMM";
358  break;
359  case 19:
360  format="M-d-yyyy";
361  break;
362  default:
363  format="dd.MM.yyyy";
364  }
365  for (int i=0; i < min((int)column.data.size(), maxrows); ++i)
366  scidavis_column->setValueAt(i, column.data[i].as_double());
368  DateTime2StringFilter *filter = static_cast<DateTime2StringFilter*>(scidavis_column->outputFilter());
369  filter->setFormat(format);
370  break;
371  }
372  case Origin::Time:
373  {
374  switch(column.valueTypeSpecification + 128) {
375  case 0:
376  format="hh:mm";
377  break;
378  case 1:
379  format="hh";
380  break;
381  case 2:
382  format="hh:mm:ss";
383  break;
384  case 3:
385  format="hh:mm:ss.zzz";
386  break;
387  case 4:
388  format="hh ap";
389  break;
390  case 5:
391  format="hh:mm ap";
392  break;
393  case 6:
394  format="mm:ss";
395  break;
396  case 7:
397  format="mm:ss.zzz";
398  break;
399  case 8:
400  format="hhmm";
401  break;
402  case 9:
403  format="hhmmss";
404  break;
405  case 10:
406  format="hh:mm:ss.zzz";
407  break;
408  }
409  for (int i=0; i < min((int)column.data.size(), maxrows); ++i)
410  scidavis_column->setValueAt(i, column.data[i].as_double());
412  DateTime2StringFilter *filter = static_cast<DateTime2StringFilter*>(table->column(j)->outputFilter());
413  filter->setFormat(format);
414  break;
415  }
416  case Origin::Month:
417  {
418  switch(column.valueTypeSpecification) {
419  case 0:
420  format = "MMM";
421  break;
422  case 1:
423  format = "MMMM";
424  break;
425  case 2:
426  format = "M";
427  break;
428  }
429  for (int i=0; i < min((int)column.data.size(), maxrows); ++i)
430  scidavis_column->setValueAt(i, column.data[i].as_double());
432  DateTime2StringFilter *filter = static_cast<DateTime2StringFilter*>(table->column(j)->outputFilter());
433  filter->setFormat(format);
434  break;
435  }
436  case Origin::Day:
437  {
438  switch(column.valueTypeSpecification)
439  {
440  case 0:
441  format = "ddd";
442  break;
443  case 1:
444  format = "dddd";
445  break;
446  case 2:
447  format = "d";
448  break;
449  }
450  for (int i=0; i < min((int)column.data.size(), maxrows); ++i)
451  scidavis_column->setValueAt(i, column.data[i].as_double());
452  table->column(j)->setColumnMode(SciDAVis::Day);
453  DateTime2StringFilter *filter = static_cast<DateTime2StringFilter*>(table->column(j)->outputFilter());
454  filter->setFormat(format);
455  break;
456  }
457  default:
458  break;
459  }
460  }
461 
462 
463 
464  if(!(spread.hidden || spread.loose) || opj.version() != 7.5){
465  table->showNormal();
466 
467  //cascade the tables
468  if (opj.version() >= 6.0)
469  {
470  Origin::Rect windowRect;
471  windowRect = spread.frameRect;
472  table->move(QPoint(windowRect.left, windowRect.top));
473  }
474  else {
475  int dx = table->verticalHeaderWidth();
476  int dy=table->frameGeometry().height() - table->height();
477  table->move(QPoint(visible_count*dx+xoffset*OBJECTXOFFSET,visible_count*dy));
478  visible_count++;
479  }
480 
481  }
482  return true;
483 }
484 bool ImportOPJ::importTables(const OriginFile &opj)
485 {
486  static int visible_count=0;
487  int SciDAVis_scaling_factor=10; //in Origin width is measured in characters while in SciDAVis - pixels --- need to be accurate
488  for(unsigned int s = 0; s < opj.spreadCount(); ++s)
489  {
490  mw->setStatusBarText(QString("Spreadsheet %1 / %2").arg(s+1).arg(opj.spreadCount()));
491  Origin::SpreadSheet spread = opj.spread(s);
492  int columnCount = spread.columns.size();
493  if(!columnCount) //remove tables without cols
494  continue;
495  importSpreadsheet(opj, spread);
496  }
497 //Import excels
498  for (unsigned int s = 0; s < opj.excelCount(); ++s)
499  {
500  Origin::Excel excelwb = opj.excel(s);
501  for (unsigned int j = 0; j < excelwb.sheets.size(); ++j) {
502  mw->setStatusBarText(QString("Excel %1 / %2, sheet %3 / %4").arg(s+1).arg(opj.excelCount()).arg(j+1).arg(excelwb.sheets.size()));
503  Origin::SpreadSheet spread = excelwb.sheets[j];
504  int columnCount = spread.columns.size();
505  if(!columnCount) //remove tables without cols
506  continue;
507  spread.name = excelwb.name;
508  // scidavis does not have windows with multiple sheets
509  if (j>0) {
510  spread.name.append("@").append(std::to_string(j+1));
511  }
512  spread.maxRows = excelwb.maxRows;
513  importSpreadsheet(opj, spread);
514  }
515  }
516 
517 
518 //Import matrices
519  for(unsigned int s = 0; s < opj.matrixCount(); ++s)
520  {
521  Origin::Matrix matrix = opj.matrix(s);
522  unsigned int layers = matrix.sheets.size();
523  for(unsigned int l = 0; l < layers; ++l){
524  Origin::MatrixSheet& layer = matrix.sheets[l];
525  int columnCount = layer.columnCount;
526  int rowCount = layer.rowCount;
527  mw->setStatusBarText(QString("Matrix %1 / %2, sheet %3 / %4").arg(s+1).arg(opj.matrixCount()).arg(l+1).arg(layers));
528  Matrix* Matrix=mw->newMatrix(matrix.name.c_str(), rowCount, columnCount);
529  if (!Matrix)
530  return false;
531  Matrix->setWindowLabel(matrix.label.c_str());
532  Matrix->setFormula(layer.command.c_str());
533  Matrix->setColumnsWidth(layer.width * SciDAVis_scaling_factor);
534 // TODO
535 #if 0
536  Matrix->table()->blockSignals(true);
537 #endif
538  QVector<qreal> values;
539  values.resize(rowCount*columnCount);
540  for (int i=0; i<min((int)values.size(),(int)layer.data.size()); i++) {
541  values[i]=layer.data[i];
542  }
543  Matrix->setCells(values);
544 
546 
547  QChar format;
548  int prec = 6;
549  switch(layer.valueTypeSpecification){
550  case 0: //Decimal 1000
551  format='f';
552  prec = layer.decimalPlaces;
553  break;
554  case 1: //Scientific
555  format='e';
556  prec = layer.decimalPlaces;
557  break;
558  case 2: //Engineering
559  case 3: //Decimal 1,000
560  format='g';
561  prec = layer.significantDigits;
562  break;
563  }
564  Matrix->setNumericFormat(format, prec);
566 // TODO
567 #if 0
568  Matrix->table()->blockSignals(false);
569 #endif
570  Matrix->showNormal();
571 
572  //cascade the matrices
573 #if 0
574  int dx=Matrix->verticalHeaderWidth();
575  int dy=Matrix->frameGeometry().height() - matrix->height();
576 #endif
577 // TODO
578  int dx = 100;
579  int dy = 100;
580  Matrix->move(QPoint(visible_count*dx+xoffset*OBJECTXOFFSET,visible_count*dy));
581  visible_count++;
582 
583  }
584 
585  if(visible_count>0)
586  xoffset++;
587  }
588  return true;
589 }
590 
591 bool ImportOPJ::importNotes(const OriginFile &opj)
592 {
593  int visible_count=0;
594  for(unsigned int n = 0; n < opj.noteCount(); ++n)
595  {
596  Origin::Note _note = opj.note(n);
597  QString name = _note.name.c_str();
598  QRegExp rx("^@(\\S+)$");
599  if(rx.indexIn(name)==0)
600  {
601  name=name.mid(2,name.length()-3);
602  }
603  Note *note = mw->newNote(name);
604  if(!note)
605  return false;
606  note->setWindowLabel(_note.label.c_str());
607  note->setText(QString(_note.text.c_str()));
608 
609  //cascade the notes
610  int dx=20;
611  int dy=note->frameGeometry().height() - note->height();
612  note->move(QPoint(visible_count*dx+xoffset*OBJECTXOFFSET,visible_count*dy));
613  visible_count++;
614  }
615  if(visible_count>0)
616  xoffset++;
617  return true;
618 }
619 
620 bool ImportOPJ::importGraphs(const OriginFile &opj)
621 {
622  double pi=3.141592653589793;
623  int visible_count=0;
624  int tickTypeMap[]={0,3,1,2};
625  for(unsigned int g = 0; g < opj.graphCount(); ++g)
626  {
627  Origin::Graph _graph = opj.graph(g);
628  MultiLayer *ml = mw->multilayerPlot(_graph.name.c_str());//, 0);
629  if (!ml)
630  return false;
631 
632  ml->hide();
633  ml->setWindowLabel(_graph.label.c_str());
634  unsigned int layers = _graph.layers.size();
635  for(unsigned int l = 0; l < layers; ++l)
636  {
637  mw->setStatusBarText(QString("Graph %1 / %2, layer %3 / %4").arg(g+1).arg(opj.graphCount()).arg(l+1).arg(layers));
638  Origin::GraphLayer& layer = _graph.layers[l];
639  Graph *graph=ml->addLayer();
640  if(!graph)
641  return false;
642  if(!layer.legend.text.empty()) {
643  graph->newLegend(parseOriginText(QString::fromLocal8Bit(layer.legend.text.c_str())));
644  }
645  //add texts
646  for(unsigned int i = 0; i < layer.texts.size(); ++i) {
647  graph->newLegend(parseOriginText(QString::fromLocal8Bit(layer.texts[i].text.c_str())));
648  }
649  int auto_color=0;
650  int style=0;
651  for(unsigned int c = 0; c < layer.curves.size(); ++c)
652  {
653  Origin::GraphCurve& _curve = layer.curves[c];
654  QString data(_curve.dataName.c_str());
655  int color=0;
656  switch(_curve.type)
657  {
658  case Origin::GraphCurve::Line:
659  style=Graph::Line;
660  break;
661  case Origin::GraphCurve::Scatter:
662  style=Graph::Scatter;
663  break;
664  case Origin::GraphCurve::LineSymbol:
665  style=Graph::LineSymbols;
666  break;
667  case Origin::GraphCurve::ErrorBar:
668  case Origin::GraphCurve::XErrorBar:
669  style=Graph::ErrorBars;
670  break;
671  case Origin::GraphCurve::Column:
672  style=Graph::VerticalBars;
673  break;
674  case Origin::GraphCurve::Bar:
675  style=Graph::HorizontalBars;
676  break;
677  case Origin::GraphCurve::Histogram:
678  style=Graph::Histogram;
679  break;
680  default:
681  continue;
682  }
683  QString tableName;
684  switch(data[0].toLatin1())
685  {
686  case 'T':
687  case 'E':
688  {
689  tableName = data.right(data.length()-2);
690  Table* table = mw->table(tableName);
691  if (!table)
692  break;
693  if(style==Graph::ErrorBars)
694  {
695  int flags=_curve.symbolShape;
696  graph->addErrorBars(QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()), table, QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()),
697  ((flags&0x10)==0x10?0:1), ceil(_curve.lineWidth), ceil(_curve.symbolSize), QColor(Qt::black),
698  (flags&0x40)==0x40, (flags&2)==2, (flags&1)==1);
699  }
700  else if(style==Graph::Histogram)
701  {
702 
703  graph->insertCurve(table, QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), style);
704  }
705  else
706  {
707  graph->insertCurve(table, QString("%1_%2").arg(tableName, _curve.xColumnName.c_str()), QString("%1_%2").arg(tableName, _curve.yColumnName.c_str()), style);
708  }
709  break;
710  }
711  case 'F':
712  {
713  Origin::Function function;
714  QStringList formulas;
715  QList<double> ranges;
716  int s=opj.functionIndex(data.right(data.length()-2).toStdString().c_str());
717  function = opj.function(s);
718 
719  int type;
720  if(function.type == Origin::Function::Polar)
721  {
722  type=2;
723  formulas << function.formula.c_str() << "x";
724  ranges << pi/180*function.begin << pi/180*function.end;
725  }
726  else
727  {
728  type=0;
729  formulas << function.formula.c_str();
730  ranges << function.begin << function.end;
731  }
732  graph->addFunctionCurve(mw, type, formulas, "x", ranges, function.totalPoints, function.name.c_str());
733 
734  mw->updateFunctionLists(type, formulas);
735  break;
736  }
737  default:
738  continue;
739  }
740 
741  CurveLayout cl = graph->initCurveLayout(style, layer.curves.size());
742  cl.sSize = ceil(_curve.symbolSize*0.5);
743  cl.penWidth=_curve.symbolThickness;
744  color=_curve.symbolColor.regular;
745  if((style==Graph::Scatter||style==Graph::LineSymbols)&&color==0xF7)//0xF7 -Automatic color
746  color=auto_color++;
747  cl.symCol=color;
748  switch(_curve.symbolShape)
749  {
750  case 0: //NoSymbol
751  cl.sType=0;
752  break;
753  case 1: //Rect
754  cl.sType=2;
755  break;
756  case 2: //Ellipse
757  case 20://Sphere
758  cl.sType=1;
759  break;
760  case 3: //UTriangle
761  cl.sType=6;
762  break;
763  case 4: //DTriangle
764  cl.sType=5;
765  break;
766  case 5: //Diamond
767  cl.sType=3;
768  break;
769  case 6: //Cross +
770  cl.sType=9;
771  break;
772  case 7: //Cross x
773  cl.sType=10;
774  break;
775  case 8: //Snow
776  cl.sType=13;
777  break;
778  case 9: //Horizontal -
779  cl.sType=11;
780  break;
781  case 10: //Vertical |
782  cl.sType=12;
783  break;
784  case 15: //LTriangle
785  cl.sType=7;
786  break;
787  case 16: //RTriangle
788  cl.sType=8;
789  break;
790  case 17: //Hexagon
791  case 19: //Pentagon
792  cl.sType=15;
793  break;
794  case 18: //Star
795  cl.sType=14;
796  break;
797  default:
798  cl.sType=0;
799  }
800 
801  switch(_curve.symbolInterior)
802  {
803  case 0:
804  cl.fillCol=color;
805  break;
806  case 1:
807  case 2:
808  case 8:
809  case 9:
810  case 10:
811  case 11:
812  color =_curve.symbolFillColor.regular;
813  if((style==Graph::Scatter||style==Graph::LineSymbols)&&color==0xF7)//0xF7 -Automatic color
814  color=17;// depend on Origin settings - not stored in file
815  cl.fillCol=color;
816  break;
817  default:
818  cl.fillCol=-1;
819  }
820 
821  cl.lWidth = _curve.lineWidth;
822  color=_curve.lineColor.regular % ColorButton::colors_count;
823  cl.lCol = (_curve.lineColor.type==Origin::Color::Automatic?0:color); //0xF7 -Automatic color
824  int linestyle=_curve.lineStyle;
825  cl.filledArea=(_curve.fillArea || style==Graph::VerticalBars || style==Graph::HorizontalBars || style==Graph::Histogram || style == Graph::Pie || style == Graph::Box) ? 1 : 0;
826  if(cl.filledArea)
827  {
828  switch(_curve.fillAreaPattern)
829  {
830  case 0:
831  cl.aStyle=0;
832  break;
833  case 1:
834  case 2:
835  case 3:
836  cl.aStyle=4;
837  break;
838  case 4:
839  case 5:
840  case 6:
841  cl.aStyle=5;
842  break;
843  case 7:
844  case 8:
845  case 9:
846  cl.aStyle=6;
847  break;
848  case 10:
849  case 11:
850  case 12:
851  cl.aStyle=1;
852  break;
853  case 13:
854  case 14:
855  case 15:
856  cl.aStyle=2;
857  break;
858  case 16:
859  case 17:
860  case 18:
861  cl.aStyle=3;
862  break;
863  }
864  Origin::Color color;
865  color = (cl.aStyle == 0 ? _curve.fillAreaColor : _curve.fillAreaPatternColor);
866  cl.aCol = (color.type == Origin::Color::Automatic ? 0 : color.regular); //0xF7 -Automatic color
867  if (style == Graph::VerticalBars || style == Graph::HorizontalBars || style == Graph::Histogram)
868  {
869  color = _curve.fillAreaPatternBorderColor;
870  cl.lCol = (color.type == Origin::Color::Automatic ? 0 : color.regular); //0xF7 -Automatic color
871  color = (cl.aStyle == 0 ? _curve.fillAreaColor : _curve.fillAreaPatternColor);
872  cl.aCol = (color.type == Origin::Color::Automatic ? cl.lCol : color.regular); //0xF7 -Automatic color
873  cl.lWidth = _curve.fillAreaPatternBorderWidth;
874  linestyle = _curve.fillAreaPatternBorderStyle;
875  }
876  }
877  switch (linestyle)
878  {
879  case Origin::GraphCurve::Solid:
880  cl.lStyle=0;
881  break;
882  case Origin::GraphCurve::Dash:
883  case Origin::GraphCurve::ShortDash:
884  cl.lStyle=1;
885  break;
886  case Origin::GraphCurve::Dot:
887  case Origin::GraphCurve::ShortDot:
888  cl.lStyle=2;
889  break;
890  case Origin::GraphCurve::DashDot:
891  case Origin::GraphCurve::ShortDashDot:
892  cl.lStyle=3;
893  break;
894  case Origin::GraphCurve::DashDotDot:
895  cl.lStyle=4;
896  break;
897  }
898 
899  graph->updateCurveLayout(c, &cl);
900  if (style == Graph::VerticalBars || style == Graph::HorizontalBars)
901  {
902  QwtBarCurve *b = (QwtBarCurve*)graph->curve(c);
903  if (b)
904  b->setGap(qRound(100 -_curve.symbolSize*10));
905  }
906  else if(style == Graph::Histogram)
907  {
908  QwtHistogram *h = (QwtHistogram*)graph->curve(c);
909  if (h)
910  {
911  h->setBinning(false, layer.histogramBin, layer.histogramBegin, layer.histogramEnd);
912  h->loadData();
913  }
914  }
915  switch(_curve.lineConnect)
916  {
917  case Origin::GraphCurve::NoLine:
918  graph->setCurveStyle(c, QwtPlotCurve::NoCurve);
919  break;
920  case Origin::GraphCurve::Straight:
921  graph->setCurveStyle(c, QwtPlotCurve::Lines);
922  break;
923  case Origin::GraphCurve::BSpline:
924  case Origin::GraphCurve::Bezier:
925  case Origin::GraphCurve::Spline:
926  graph->setCurveStyle(c, 5);
927  break;
928  case Origin::GraphCurve::StepHorizontal:
929  case Origin::GraphCurve::StepHCenter:
930  graph->setCurveStyle(c, QwtPlotCurve::Steps);
931  break;
932  case Origin::GraphCurve::StepVertical:
933  case Origin::GraphCurve::StepVCenter:
934  graph->setCurveStyle(c, 6);
935  break;
936  }
937 
938  }
939  if(style==Graph::HorizontalBars)
940  {
941  graph->setScale(0,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,layer.xAxis.scale);
942  graph->setScale(2,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,layer.yAxis.scale);
943  }
944  else
945  {
946  graph->setScale(2,layer.xAxis.min,layer.xAxis.max,layer.xAxis.step,layer.xAxis.majorTicks,layer.xAxis.minorTicks,layer.xAxis.scale);
947  graph->setScale(0,layer.yAxis.min,layer.yAxis.max,layer.yAxis.step,layer.yAxis.majorTicks,layer.yAxis.minorTicks,layer.yAxis.scale);
948  }
949 
950  //grid
951  Grid *grid = graph->grid();
952 
953  grid->enableX(!layer.xAxis.majorGrid.hidden);
954  grid->enableXMin(!layer.xAxis.minorGrid.hidden);
955  grid->enableY(!layer.yAxis.majorGrid.hidden);
956  grid->enableYMin(!layer.yAxis.minorGrid.hidden);
957 
958  grid->setMajPenX(QPen(ColorButton::color(layer.xAxis.majorGrid.color), ceil(layer.xAxis.majorGrid.width),
959  Graph::getPenStyle(translateOrigin2ScidavisLineStyle((Origin::GraphCurve::LineStyle)layer.xAxis.majorGrid.style))));
960  grid->setMinPenX(QPen(ColorButton::color(layer.xAxis.minorGrid.color), ceil(layer.xAxis.minorGrid.width),
961  Graph::getPenStyle(translateOrigin2ScidavisLineStyle((Origin::GraphCurve::LineStyle)layer.xAxis.minorGrid.style))));
962  grid->setMajPenY(QPen(ColorButton::color(layer.yAxis.majorGrid.color), ceil(layer.yAxis.majorGrid.width),
963  Graph::getPenStyle(translateOrigin2ScidavisLineStyle((Origin::GraphCurve::LineStyle)layer.yAxis.majorGrid.style))));
964  grid->setMinPenY(QPen(ColorButton::color(layer.yAxis.minorGrid.color), ceil(layer.yAxis.minorGrid.width),
965  Graph::getPenStyle(translateOrigin2ScidavisLineStyle((Origin::GraphCurve::LineStyle)layer.yAxis.minorGrid.style))));
966 
967  grid->setAxis(2, 0);
968  grid->enableZeroLineX(0);
969  grid->enableZeroLineY(0);
970 
971  vector<Origin::GraphAxisFormat> formats;
972  formats.push_back(layer.yAxis.formatAxis[0]); //left
973  formats.push_back(layer.yAxis.formatAxis[1]); //right
974  formats.push_back(layer.xAxis.formatAxis[0]); //bottom
975  formats.push_back(layer.xAxis.formatAxis[1]); //top
976  graph->setXAxisTitle(parseOriginText(QString::fromLocal8Bit(formats[2].label.text.c_str())));
977  graph->setYAxisTitle(parseOriginText(QString::fromLocal8Bit(formats[0].label.text.c_str())));
978 
979  vector<Origin::GraphAxisTick> ticks;
980  ticks.push_back(layer.yAxis.tickAxis[0]); //left
981  ticks.push_back(layer.yAxis.tickAxis[1]); //right
982  ticks.push_back(layer.xAxis.tickAxis[0]); //bottom
983  ticks.push_back(layer.xAxis.tickAxis[1]); //top
984  for(int i=0; i<4; ++i)
985  {
986  QString data(ticks[i].dataName.c_str());
987  QString tableName=data.right(data.length()-2) + "_" + ticks[i].columnName.c_str();
988 
989  QString formatInfo;
990  int format = 0;
991  int type;
992  int prec = ticks[i].decimalPlaces;
993  switch(ticks[i].valueType)
994  {
995  case Origin::Numeric:
996  type=Graph::Numeric;
997  switch(ticks[i].valueTypeSpecification)
998  {
999  case 0: //Decimal 1000
1000  format=1;
1001  break;
1002  case 1: //Scientific
1003  format=2;
1004  break;
1005  case 2: //Engeneering
1006  case 3: //Decimal 1,000
1007  format=0;
1008  break;
1009  }
1010  if(prec==-1)
1011  prec=2;
1012  break;
1013  case Origin::Text: //Text
1014  type=Graph::Txt;
1015  break;
1016  case 2: // Date
1017  type=Graph::Date;
1018  break;
1019  case 3: // Time
1020  type=Graph::Time;
1021  break;
1022  case Origin::Month: // Month
1023  type=Graph::Month;
1024  format=ticks[i].valueTypeSpecification;
1025  break;
1026  case Origin::Day: // Day
1027  type=Graph::Day;
1028  format=ticks[i].valueTypeSpecification;
1029  break;
1030  case Origin::ColumnHeading:
1031  type=Graph::ColHeader;
1032  switch(ticks[i].valueTypeSpecification)
1033  {
1034  case 0: //Decimal 1000
1035  format=1;
1036  break;
1037  case 1: //Scientific
1038  format=2;
1039  break;
1040  case 2: //Engeneering
1041  case 3: //Decimal 1,000
1042  format=0;
1043  break;
1044  }
1045  prec=2;
1046  break;
1047  default:
1048  type=Graph::Numeric;
1049  format=0;
1050  prec=2;
1051  }
1052 
1053  graph->showAxis(i, type, tableName, mw->table(tableName), !(formats[i].hidden),
1054  tickTypeMap[formats[i].majorTicksType], tickTypeMap[formats[i].minorTicksType],
1055  !(ticks[i].showMajorLabels), ColorButton::color(formats[i].color), format, prec,
1056  ticks[i].rotation, 0, "", (ticks[i].color==0xF7 ? ColorButton::color(formats[i].color) : ColorButton::color(ticks[i].color)));
1057  }
1058 
1059 
1060  graph->setAutoscaleFonts(mw->autoScaleFonts);//restore user defined fonts behaviour
1062  }
1063  //cascade the graphs
1064  if(!_graph.hidden)
1065  {
1066  int dx=20;
1067  int dy=ml->frameGeometry().height() - ml->height();
1068  ml->move(QPoint(visible_count*dx+xoffset*OBJECTXOFFSET,visible_count*dy));
1069  visible_count++;
1070  ml->show();
1071  ml->arrangeLayers(true,true);
1072  }
1073  else
1074  {
1075  ml->show();
1076  ml->arrangeLayers(true,true);
1077  mw->hideWindow(ml);
1078  }
1079  }
1080  if(visible_count>0)
1081  xoffset++;
1082  return true;
1083 }
1084 
1085 QString ImportOPJ::parseOriginText(const QString &str)
1086 {
1087  QStringList lines=str.split("\n");
1088  QString text="";
1089  for(int i=0; i<lines.size(); ++i)
1090  {
1091  if(i>0)
1092  text.append("\n");
1093  text.append(parseOriginTags(lines[i]));
1094  }
1095  return text;
1096 }
1097 
1098 QString ImportOPJ::parseOriginTags(const QString &str)
1099 {
1100  QString line=str;
1101  //replace \l(...) and %(...) tags
1102  QRegExp rxline("\\\\\\s*l\\s*\\(\\s*\\d+\\s*\\)");
1103  QRegExp rxcol("\\%\\(\\d+\\)");
1104  int pos = rxline.indexIn(line);
1105  while (pos > -1) {
1106  QString value = rxline.cap(0);
1107  int len=value.length();
1108  value.replace(QRegExp(" "),"");
1109  value="\\c{"+value.mid(3,value.length()-4)+"}";
1110  line.replace(pos, len, value);
1111  pos = rxline.indexIn(line);
1112  }
1113  //Lookbehind conditions are not supported - so need to reverse string
1114  QRegExp rx("\\)[^\\)\\(]*\\((?!\\s*[buig\\+\\-]\\s*\\\\)");
1115  QRegExp rxfont("\\)[^\\)\\(]*\\((?![^\\:]*\\:f\\s*\\\\)");
1116  QString linerev = strreverse(line);
1117  QString lBracket=strreverse("&lbracket;");
1118  QString rBracket=strreverse("&rbracket;");
1119  QString ltagBracket=strreverse("&ltagbracket;");
1120  QString rtagBracket=strreverse("&rtagbracket;");
1121  int pos1=rx.indexIn(linerev);
1122  int pos2=rxfont.indexIn(linerev);
1123 
1124  while (pos1>-1 || pos2>-1) {
1125  if(pos1==pos2)
1126  {
1127  QString value = rx.cap(0);
1128  int len=value.length();
1129  value=rBracket+value.mid(1,len-2)+lBracket;
1130  linerev.replace(pos1, len, value);
1131  }
1132  else if ((pos1>pos2&&pos2!=-1)||pos1==-1)
1133  {
1134  QString value = rxfont.cap(0);
1135  int len=value.length();
1136  value=rtagBracket+value.mid(1,len-2)+ltagBracket;
1137  linerev.replace(pos2, len, value);
1138  }
1139  else if ((pos2>pos1&&pos1!=-1)||pos2==-1)
1140  {
1141  QString value = rx.cap(0);
1142  int len=value.length();
1143  value=rtagBracket+value.mid(1,len-2)+ltagBracket;
1144  linerev.replace(pos1, len, value);
1145  }
1146 
1147  pos1=rx.indexIn(linerev);
1148  pos2=rxfont.indexIn(linerev);
1149  }
1150  linerev.replace(ltagBracket, "(");
1151  linerev.replace(rtagBracket, ")");
1152 
1153  line = strreverse(linerev);
1154 
1155  //replace \b(...), \i(...), \u(...), \g(...), \+(...), \-(...), \f:font(...) tags
1156  QString rxstr[]={
1157  "\\\\\\s*b\\s*\\(",
1158  "\\\\\\s*i\\s*\\(",
1159  "\\\\\\s*u\\s*\\(",
1160  "\\\\\\s*g\\s*\\(",
1161  "\\\\\\s*\\+\\s*\\(",
1162  "\\\\\\s*\\-\\s*\\(",
1163  "\\\\\\s*f\\:[^\\(]*\\("};
1164  int postag[]={0,0,0,0,0,0,0};
1165  QString ltag[]={"<b>","<i>","<u>","<font face=Symbol>","<sup>","<sub>","<font face=%1>"};
1166  QString rtag[]={"</b>","</i>","</u>","</font>","</sup>","</sub>","</font>"};
1167  QRegExp rxtags[7];
1168  for(int i=0; i<7; ++i)
1169  rxtags[i].setPattern(rxstr[i]+"[^\\(\\)]*\\)");
1170 
1171  bool flag=true;
1172  while(flag) {
1173  for(int i=0; i<7; ++i)
1174  {
1175  postag[i] = rxtags[i].indexIn(line);
1176  while (postag[i] > -1) {
1177  QString value = rxtags[i].cap(0);
1178  int len=value.length();
1179  int pos2=value.indexOf("(");
1180  if(i<6)
1181  value=ltag[i]+value.mid(pos2+1,len-pos2-2)+rtag[i];
1182  else
1183  {
1184  int posfont=value.indexOf("f:");
1185  value=ltag[i].arg(value.mid(posfont+2,pos2-posfont-2))+value.mid(pos2+1,len-pos2-2)+rtag[i];
1186  }
1187  line.replace(postag[i], len, value);
1188  postag[i] = rxtags[i].indexIn(line);
1189  }
1190  }
1191  flag=false;
1192  for(int i=0; i<7; ++i)
1193  {
1194  if(rxtags[i].indexIn(line)>-1)
1195  {
1196  flag=true;
1197  break;
1198  }
1199  }
1200  }
1201 
1202  //replace unclosed tags
1203  for(int i=0; i<6; ++i)
1204  line.replace(QRegExp(rxstr[i]), ltag[i]);
1205  rxfont.setPattern(rxstr[6]);
1206  pos = rxfont.indexIn(line);
1207  while (pos > -1) {
1208  QString value = rxfont.cap(0);
1209  int len=value.length();
1210  int posfont=value.indexOf("f:");
1211  value=ltag[6].arg(value.mid(posfont+2,len-posfont-3));
1212  line.replace(pos, len, value);
1213  pos = rxfont.indexIn(line);
1214  }
1215 
1216  line.replace("&lbracket;", "(");
1217  line.replace("&rbracket;", ")");
1218 
1219  return line;
1220 }
1221 
1222 //TODO: bug in grid dialog
1223 // scale/minor ticks checkbox
1224 // histogram: autobin export
1225 // if prec not setted - automac+4digits
ApplicationWindow::logWindow
QDockWidget logWindow
Definition: ApplicationWindow.h:132
Matrix
Matrix worksheet class.
Definition: Matrix.h:52
Grid::setMinPenY
void setMinPenY(const QPen &p)
Definition: Grid.h:60
Grid::setMinPenX
void setMinPenX(const QPen &p)
Definition: Grid.h:54
Table::column
Column * column(int index) const
Return column number 'index'.
Definition: Table.h:121
ImportOPJ::parse_error
int parse_error
Definition: importOPJ.h:54
QwtHistogram::loadData
virtual bool loadData()
Definition: QwtHistogram.cpp:99
OBJECTXOFFSET
#define OBJECTXOFFSET
Definition: importOPJ.cpp:51
ImportOPJ::xoffset
int xoffset
Definition: importOPJ.h:55
SciDAVis::yErr
@ yErr
y errors
Definition: globals.h:61
Column::outputFilter
AbstractSimpleFilter * outputFilter() const
Return the output filter (for data type -> string conversion)
Definition: Column.cpp:593
FolderListItem
Folders list item class.
Definition: Folder.h:176
CurveLayout::fillCol
unsigned int fillCol
symbol fill color
Definition: Graph.h:80
Folder::setFolderListItem
void setFolderListItem(FolderListItem *it)
Definition: Folder.h:131
DateTime2StringFilter::setFormat
void setFormat(const QString &format)
Set the format string to be used for conversion.
Definition: DateTime2StringFilter.cpp:35
ApplicationWindow::newNote
Note * newNote(const QString &caption=QString())
Creates a new empty note window.
Definition: ApplicationWindow.cpp:2626
data
Definition: exp_saturation.c:37
Folder::setModificationDate
void setModificationDate(const QString &s)
Definition: Folder.h:127
SciDAVis::xErr
@ xErr
x errors
Definition: globals.h:60
str
#define str(x)
Definition: PythonScripting.cpp:41
Graph::setXAxisTitle
void setXAxisTitle(const QString &text)
Definition: Graph.cpp:1089
MultiLayer
An MDI window (MyWidget) managing one or more Graph objects.
Definition: MultiLayer.h:67
SciDAVis::Y
@ Y
y values
Definition: globals.h:58
Graph::Date
@ Date
Definition: Graph.h:127
AbstractAspect::setComment
void setComment(const QString &value)
Definition: AbstractAspect.cpp:265
SciDAVis::noDesignation
@ noDesignation
no plot designation
Definition: globals.h:56
ColorButton::colors_count
static const unsigned int colors_count
The number of predefined colors.
Definition: ColorButton.h:71
Note.h
CurveLayout::lWidth
int lWidth
line width
Definition: Graph.h:70
Table::setWindowLabel
virtual void setWindowLabel(const QString &s)
Set the window label.
Definition: Table.h:74
Matrix.h
Column
Aspect that manages a column.
Definition: Column.h:59
Matrix::setWindowLabel
virtual void setWindowLabel(const QString &s)
Set the window label.
Definition: Matrix.h:65
MyWidget
Base class of all MDI client windows.
Definition: MyWidget.h:52
Double2StringFilter.h
Graph::Pie
@ Pie
Definition: Graph.h:129
DateTime2StringFilter
Conversion filter QDateTime -> QString.
Definition: DateTime2StringFilter.h:41
Matrix::saveCellsToMemory
void saveCellsToMemory()
Temporally save the cell values to memory.
Definition: Matrix.cpp:380
Matrix::setFormula
void setFormula(const QString &s)
Set the matrix forumla.
Definition: Matrix.cpp:245
Folder::folderListItem
FolderListItem * folderListItem()
Pointer to the corresponding QListViewItem in the main application.
Definition: Folder.h:130
Table::verticalHeaderWidth
int verticalHeaderWidth()
Definition: Table.cpp:1358
qHash
uint qHash(const tree< Origin::ProjectNode >::iterator &key)
Definition: importOPJ.cpp:92
ApplicationWindow::changeFolder
bool changeFolder(Folder *newFolder, bool force=false)
Changes the current folder.
Definition: ApplicationWindow.cpp:13025
ColorButton.h
CurveLayout::symCol
unsigned int symCol
symbol outline color
Definition: Graph.h:78
Matrix::setNumericFormat
void setNumericFormat(const QChar &f, int prec)
Set the number format for the cells.
Definition: Matrix.cpp:255
DateTime2StringFilter.h
ImportOPJ::ImportOPJ
ImportOPJ(ApplicationWindow *app, const QString &filename)
Definition: importOPJ.cpp:70
ApplicationWindow::multilayerPlot
MultiLayer * multilayerPlot(int c, int r, int style)
Definition: ApplicationWindow.cpp:2246
ApplicationWindow::addFolderListViewItem
void addFolderListViewItem(Folder *f)
adds a folder list item to the list view "lv"
Definition: ApplicationWindow.cpp:13218
Grid.h
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:51
Graph::Time
@ Time
Definition: Graph.h:127
strreverse
QString strreverse(const QString &str)
Definition: importOPJ.cpp:53
Graph::addFunctionCurve
bool addFunctionCurve(ApplicationWindow *parent, int type, const QStringList &formulas, const QString &var, QList< double > &ranges, int points, const QString &title={})
Definition: Graph.cpp:3922
Matrix::setCells
void setCells(const QVector< qreal > &)
Set the value of all cells.
Definition: Matrix.cpp:147
ApplicationWindow::autoScaleFonts
bool autoScaleFonts
Definition: ApplicationWindow.h:973
Double2StringFilter::setNumDigits
void setNumDigits(int digits)
Set number of displayed digits.
Definition: Double2StringFilter.cpp:69
Folder::setActiveWindow
void setActiveWindow(MyWidget *w)
Definition: Folder.h:134
Column::setColumnMode
void setColumnMode(SciDAVis::ColumnMode mode, AbstractFilter *conversion_filter=0) override
Set the column mode.
Definition: Column.cpp:85
ColorButton::color
QColor color() const
Get the color of the display part.
Definition: ColorButton.cpp:140
Folder::setBirthDate
void setBirthDate(const QString &s)
Definition: Folder.h:124
CurveLayout
Structure containing curve layout parameters.
Definition: Graph.h:68
FolderListItem::folder
Folder * folder()
Definition: Folder.h:186
Column::setFormula
void setFormula(Interval< int > i, QString formula)
Set a formula string for an interval of rows.
Definition: Column.cpp:182
Graph::ColHeader
@ ColHeader
Definition: Graph.h:127
ImportOPJ::parseOriginTags
QString parseOriginTags(const QString &str)
Definition: importOPJ.cpp:1098
Table::setColPlotDesignation
void setColPlotDesignation(int col, SciDAVis::PlotDesignation d)
Definition: Table.cpp:1282
ImportOPJ::mw
ApplicationWindow * mw
Definition: importOPJ.h:56
CurveLayout::sSize
int sSize
symbol size
Definition: Graph.h:82
Folder::window
MyWidget * window(const QString &name, const char *cls="myWidget", bool recursive=false)
get a window by name
Definition: Folder.cpp:159
Folder.h
MultiLayer.h
ApplicationWindow::hideWindow
void hideWindow(MyWidget *window)
Definition: ApplicationWindow.cpp:7280
Graph::setCurveStyle
void setCurveStyle(int index, int s)
Definition: Graph.cpp:4848
Graph::updateCurveLayout
void updateCurveLayout(int index, const CurveLayout *cL)
Set layout parameters of the curve given by index.
Definition: Graph.cpp:3015
Graph::newLegend
Legend * newLegend()
Definition: Graph.cpp:2485
Graph::insertCurve
bool insertCurve(Table *w, const QString &name, int style, int startRow=0, int endRow=-1)
Definition: Graph.cpp:3367
Double2StringFilter::setNumericFormat
void setNumericFormat(char format)
Set format character as in QString::number.
Definition: Double2StringFilter.cpp:64
ImportOPJ::importGraphs
bool importGraphs(const OriginFile &opj)
Definition: importOPJ.cpp:620
Graph::HorizontalBars
@ HorizontalBars
Definition: Graph.h:130
ApplicationWindow::newTable
Table * newTable()
Creates an empty table.
Definition: ApplicationWindow.cpp:2522
posixTimeToString
QString posixTimeToString(time_t pt)
Definition: importOPJ.cpp:63
ApplicationWindow::table
Table * table(const QString &name)
Definition: ApplicationWindow.cpp:2806
python-sipcmd.flags
list flags
Definition: python-sipcmd.py:61
importOPJ.h
SciDAVis::Month
@ Month
column contains month names
Definition: globals.h:69
ApplicationWindow::updateFunctionLists
void updateFunctionLists(int type, QStringList &formulas)
Definition: ApplicationWindow.cpp:8392
CurveLayout::aStyle
int aStyle
area filling style
Definition: Graph.h:77
MyWidget::setWindowLabel
virtual void setWindowLabel(const QString &s)
Set the window label.
Definition: MyWidget.h:78
ImportOPJ::translateOrigin2ScidavisLineStyle
int translateOrigin2ScidavisLineStyle(int linestyle)
Definition: importOPJ.cpp:172
ImportOPJ::parseOriginText
QString parseOriginText(const QString &str)
Definition: importOPJ.cpp:1085
Folder
Folder for the project explorer.
Definition: Folder.h:62
Graph::Day
@ Day
Definition: Graph.h:127
Graph::Scatter
@ Scatter
Definition: Graph.h:129
CurveLayout::sType
int sType
symbol type (shape)
Definition: Graph.h:83
CurveLayout::lCol
unsigned int lCol
line color
Definition: Graph.h:69
ApplicationWindow::newMatrix
Matrix * newMatrix(int rows=32, int columns=32)
Creates a new empty matrix.
Definition: ApplicationWindow.cpp:2662
Graph::getPenStyle
static Qt::PenStyle getPenStyle(const QString &s)
Definition: Graph.cpp:4329
Folder::addWindow
void addWindow(MyWidget *w)
Definition: Folder.h:70
TableView::setColumnWidth
void setColumnWidth(int col, int width)
Definition: TableView.cpp:225
QwtBarCurve::setGap
void setGap(int gap)
Definition: QwtBarCurve.cpp:156
ApplicationWindow
SciDAVis's main window.
Definition: ApplicationWindow.h:122
CurveLayout::penWidth
int penWidth
symbol outline width
Definition: Graph.h:81
Graph::Line
@ Line
Definition: Graph.h:129
SciDAVis::Text
@ Text
column contains strings
Definition: globals.h:68
Folder::setName
void setName(const QString &s)
Definition: Folder.h:138
ApplicationWindow::projectFolder
Folder * projectFolder()
returns a pointer to the root project folder
Definition: ApplicationWindow.cpp:4992
SciDAVis::DateTime
@ DateTime
column contains dates and/or times
Definition: globals.h:71
Matrix::forgetSavedCells
void forgetSavedCells()
Definition: Matrix.cpp:390
Grid::setMajPenX
void setMajPenX(const QPen &p)
Definition: Grid.h:51
Graph::grid
Grid * grid()
Definition: Graph.h:149
Note
Notes window class.
Definition: Note.h:44
Graph::setYAxisTitle
void setYAxisTitle(const QString &text)
Definition: Graph.cpp:1082
Graph::setScale
void setScale(int axis, double start, double end, double step=0.0, int majorTicks=5, int minorTicks=5, int type=0, bool inverted=false)
Set axis scale.
Definition: Graph.cpp:1269
Graph::setAutoscaleFonts
void setAutoscaleFonts(bool yes)
Definition: Graph.h:657
QwtHistogram.h
AbstractAspect::setName
void setName(const QString &value)
Definition: AbstractAspect.cpp:234
name
char * name()
Definition: exp_saturation.c:45
Graph::addErrorBars
bool addErrorBars(const QString &xColName, const QString &yColName, Table *errTable, const QString &errColName, int type=1, int width=1, int cap=8, const QColor &color=QColor(Qt::black), bool through=true, bool minus=true, bool plus=true)
Definition: Graph.cpp:3107
ImportOPJ::importSpreadsheet
bool importSpreadsheet(const OriginFile &opj, const Origin::SpreadSheet &spread)
Definition: importOPJ.cpp:199
Graph::Month
@ Month
Definition: Graph.h:127
QwtHistogram::setBinning
void setBinning(bool autoBin, double size, double begin, double end)
Definition: QwtHistogram.cpp:91
Grid
2D Grid class
Definition: Grid.h:38
Matrix::setColumnsWidth
void setColumnsWidth(int width)
Set the width of all columns (obsolete, only for OPJ import)
Definition: Matrix.cpp:272
Note::setText
void setText(const QString &s)
Definition: Note.h:66
Folder::removeWindow
void removeWindow(MyWidget *w)
Definition: Folder.h:74
ImportOPJ::createProjectTree
bool createProjectTree(const OriginFile &opj)
Definition: importOPJ.cpp:97
ApplicationWindow::setStatusBarText
void setStatusBarText(const QString &)
Set status bar text.
Definition: ApplicationWindow.cpp:13684
CurveLayout::filledArea
int filledArea
flag: toggles area filling under curve
Definition: Graph.h:75
Graph::ErrorBars
@ ErrorBars
Definition: Graph.h:130
Graph::Txt
@ Txt
Definition: Graph.h:127
SciDAVis::Z
@ Z
z values
Definition: globals.h:59
Grid::setMajPenY
void setMajPenY(const QPen &p)
Definition: Grid.h:57
ApplicationWindow::autoResizeLayers
bool autoResizeLayers
Definition: ApplicationWindow.h:973
Graph::showAxis
void showAxis(int axis, int type, const QString &formatInfo, Table *table, bool axisOn, int majTicksType, int minTicksType, bool labelsOn, const QColor &c, int format, int prec, int rotation, int baselineDist, const QString &formula, const QColor &labelsColor)
Definition: Graph.cpp:642
Graph
A 2D-plotting widget.
Definition: Graph.h:119
ApplicationWindow::showResults
void showResults(bool ok)
Definition: ApplicationWindow.cpp:6550
SciDAVis::X
@ X
x values
Definition: globals.h:57
SciDAVis::Day
@ Day
column containts day of week names
Definition: globals.h:70
ImportOPJ::importNotes
bool importNotes(const OriginFile &opj)
Definition: importOPJ.cpp:591
Graph::Histogram
@ Histogram
Definition: Graph.h:130
Graph::initCurveLayout
CurveLayout initCurveLayout(int style, int curves=0)
Definition: Graph.cpp:2869
SciDAVis::Numeric
@ Numeric
column contains doubles
Definition: globals.h:67
MultiLayer::addLayer
Graph * addLayer(int x=0, int y=0, int width=0, int height=0)
Definition: MultiLayer.cpp:164
Graph::Box
@ Box
Definition: Graph.h:131
ApplicationWindow::current_folder
Folder * current_folder
pointer to the current folder in the project
Definition: ApplicationWindow.h:961
ImportOPJ::importTables
bool importTables(const OriginFile &opj)
Definition: importOPJ.cpp:484
Interval< int >
CurveLayout::aCol
unsigned int aCol
curve area color
Definition: Graph.h:76
Grid::enableZeroLineY
void enableZeroLineY(bool enable=true)
Definition: Grid.cpp:204
CurveLayout::lStyle
int lStyle
line style
Definition: Graph.h:71
Column::setTextAt
void setTextAt(int row, const QString &new_value)
Set the content of row 'row'.
Definition: Column.cpp:197
Double2StringFilter
Locale-aware conversion filter double -> QString.
Definition: Double2StringFilter.h:39
MultiLayer::arrangeLayers
QSize arrangeLayers(bool userSize)
Definition: MultiLayer.cpp:379
QwtBarCurve
Bar curve.
Definition: QwtBarCurve.h:37
QwtHistogram
Histogram class.
Definition: QwtHistogram.h:33
Graph::curve
QwtPlotCurve * curve(int index) const
get curve by index
Definition: Graph.cpp:2821
Graph::LineSymbols
@ LineSymbols
Definition: Graph.h:129
Graph::Numeric
@ Numeric
Definition: Graph.h:127
Grid::enableZeroLineX
void enableZeroLineX(bool enable=true)
Definition: Grid.cpp:177
ApplicationWindow::folders
FolderListView folders
Definition: ApplicationWindow.h:143
Graph::setIgnoreResizeEvents
void setIgnoreResizeEvents(bool ok)
Definition: Graph.h:645
Column::setValueAt
void setValueAt(int row, double new_value)
Set the content of row 'row'.
Definition: Column.cpp:229
Graph::VerticalBars
@ VerticalBars
Definition: Graph.h:129