Engauge Digitizer  2
 All Classes Functions Variables Typedefs Enumerations Friends Pages
TestExport.cpp
1 #include "CurveConnectAs.h"
2 #include "Document.h"
3 #include "DocumentModelExportFormat.h"
4 #include "ExportFileFunctions.h"
5 #include "ExportFileRelations.h"
6 #include "ExportValuesXOrY.h"
7 #include "LineStyle.h"
8 #include "Logger.h"
9 #include "MainWindow.h"
10 #include "MainWindowModel.h"
11 #include "PointStyle.h"
12 #include <QImage>
13 #include <qmath.h>
14 #include <QtTest/QtTest>
15 #include "Spline.h"
16 #include "SplinePair.h"
17 #include "Test/TestExport.h"
18 #include "Transformation.h"
19 
20 QTEST_MAIN (TestExport)
21 
22 using namespace std;
23 
24 const bool NOT_USING_GNUPLOT = false;
25 const bool EXPORT_ONLY= true;
26 const QString NO_ERROR_REPORT_LOG_FILE;
27 const QString NO_REGRESSION_OPEN_FILE;
28 const bool NO_GNUPLOT_LOG_FILES = false;
29 const bool NO_REGRESSION_IMPORT = false;
30 const bool NO_RESET = false;
31 const bool NO_EXPORT_ONLY = false;
32 const bool NO_EXTRACT_IMAGE_ONLY = false;
33 const QString NO_EXTRACT_IMAGE_EXTENSION;
34 const bool DEBUG_FLAG = false;
35 const QStringList NO_LOAD_STARTUP_FILES;
36 const QStringList NO_COMMAND_LINE;
37 const QString STARTUP_DIG_LOWER_CASE ("/tmp/export_only.dig");
38 const QString STARTUP_DIG_UPPER_CASE ("/tmp/export_only.DIG");
39 const QStringList ONE_LOAD_STARTUP_FILE_LOWER_CASE (STARTUP_DIG_LOWER_CASE);
40 const QStringList ONE_LOAD_STARTUP_FILE_UPPER_CASE (STARTUP_DIG_UPPER_CASE);
41 const bool REGRESSION_IMPORT = true;
42 
43 TestExport::TestExport(QObject *parent) :
44  QObject(parent),
45  m_mainWindow (0),
46  m_document (0)
47 {
48 }
49 
50 bool TestExport::checkCommasInFunctionsForDelimiter (ExportDelimiter delimiter,
51  QLocale::Country country,
52  QString &output)
53 {
54  initData (false,
55  delimiter,
56  country);
57 
58  QTextStream str (&output);
59  bool success = true;
60  QString dummy;
61 
62  try {
63  bool isLogXTheta = (m_modelCoords.coordScaleXTheta() == COORD_SCALE_LOG);
64  bool isLogYRadius = (m_modelCoords.coordScaleYRadius() == COORD_SCALE_LOG);
65  unsigned int numWritesSoFar = 0;
66 
67  ExportFileFunctions exportFile;
68  CurveLimits curveLimitsMin, curveLimitsMax; // Empty containers mean no limits are in effect
69  exportFile.exportAllPerLineXThetaValuesMerged (m_modelExportOverride,
70  *m_document,
71  m_modelMainWindow,
72  m_curvesIncluded,
73  m_xThetaValues,
74  exportDelimiterToText (delimiter, NOT_USING_GNUPLOT),
75  m_transformation,
76  isLogXTheta,
77  isLogYRadius,
78  curveLimitsMin,
79  curveLimitsMax,
80  str,
81  numWritesSoFar);
82  }
83  catch (...)
84  {
85  success = false;
86  }
87 
88  return (success);
89 }
90 
91 bool TestExport::checkCommasInRelationsForDelimiter (ExportDelimiter delimiter,
92  QLocale::Country country,
93  QString &output)
94 {
95  initData (false,
96  delimiter,
97  country);
98 
99  QTextStream str (&output);
100  bool success = true;
101  QString dummy;
102 
103  try {
104  bool isLogXTheta = (m_modelCoords.coordScaleXTheta() == COORD_SCALE_LOG);
105  bool isLogYRadius = (m_modelCoords.coordScaleYRadius() == COORD_SCALE_LOG);
106  unsigned int numWritesSoFar = 0;
107 
108  ExportFileRelations exportFile;
109  exportFile.exportAllPerLineXThetaValuesMerged (m_modelExportOverride,
110  *m_document,
111  m_modelMainWindow,
112  m_curvesIncluded,
113  exportDelimiterToText (delimiter, NOT_USING_GNUPLOT),
114  m_transformation,
115  isLogXTheta,
116  isLogYRadius,
117  str,
118  numWritesSoFar);
119  }
120  catch (...)
121  {
122  success = false;
123  }
124 
125  return (success);
126 }
127 
128 void TestExport::cleanupTestCase ()
129 {
130 }
131 
132 void TestExport::initData (bool isLog,
133  ExportDelimiter delimiter,
134  QLocale::Country country)
135 {
136  const QString CURVE_NAME ("Curve1");
137  const int LINE_WIDTH = 2, POINT_LINE_WIDTH = 1;
138  const ColorPalette LINE_COLOR = COLOR_PALETTE_BLACK, POINT_COLOR = COLOR_PALETTE_BLACK;
139  const int RADIUS = 5;
140 
141  QImage nullImage;
142  m_document = new Document (nullImage);
143 
144  m_curvesIncluded.clear ();
145  m_curvesIncluded << CURVE_NAME;
146 
147  CurveStyles curveStyles (m_document->coordSystem ());
148  CurveStyle curveStyle (LineStyle (LINE_WIDTH,
149  LINE_COLOR,
150  CONNECT_AS_FUNCTION_SMOOTH),
151  PointStyle (POINT_SHAPE_CIRCLE,
152  RADIUS,
153  POINT_LINE_WIDTH,
154  POINT_COLOR));
155  curveStyles.setCurveStyle (CURVE_NAME, curveStyle);
156  if (isLog) {
157  m_modelCoords.setCoordScaleXTheta (COORD_SCALE_LOG);
158  m_modelCoords.setCoordScaleYRadius (COORD_SCALE_LOG);
159  } else {
160  m_modelCoords.setCoordScaleXTheta (COORD_SCALE_LINEAR);
161  m_modelCoords.setCoordScaleYRadius (COORD_SCALE_LINEAR);
162  }
163  m_modelCoords.setCoordsType (COORDS_TYPE_CARTESIAN);
164  m_modelGeneral.setCursorSize (3);
165  m_modelGeneral.setExtraPrecision (1);
166 
167  m_modelExportOverride.setPointsSelectionFunctions (EXPORT_POINTS_SELECTION_FUNCTIONS_INTERPOLATE_FIRST_CURVE);
168  m_modelExportOverride.setDelimiter (delimiter);
169 
170  m_document->setModelExport (m_modelExportOverride);
171  m_document->setModelCurveStyles (curveStyles);
172  m_document->setModelCoords (m_modelCoords);
173  m_document->setModelGeneral (m_modelGeneral);
174 
175  m_modelMainWindow.setLocale (QLocale::English,
176  country);
177 
178  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (845, 305), "Curve1\t0", 0);
179  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (850, 294), "Curve1\t1", 1);
180  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (862, 272), "Curve1\t2", 2);
181  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (876, 244), "Curve1\t3", 3);
182  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (887, 222), "Curve1\t4", 4);
183  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (899, 200), "Curve1\t5", 5);
184  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (910, 177), "Curve1\t6", 6);
185  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (922, 155), "Curve1\t7", 7);
186  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (933, 133), "Curve1\t8", 8);
187  m_document->addPointGraphWithSpecifiedIdentifier (CURVE_NAME, QPointF (945, 110), "Curve1\t9", 9);
188 
189  m_xThetaValues.clear ();
190  m_xThetaValues << 0.0009999; // Just outside of the coordinates added to the document
191  m_xThetaValues << 0.001;
192  m_xThetaValues << 0.01;
193  m_xThetaValues << 0.1;
194  m_xThetaValues << 1;
195  m_xThetaValues << 10;
196  m_xThetaValues << 100;
197  m_xThetaValues << 1000;
198  QTransform matrixScreen ( 51, 52, 1123,
199  548, 10, 548,
200  1, 1, 1);
201  QTransform matrixGraph (qLn (0.001), qLn (0.001), qLn (1000),
202  qLn ( 1), qLn ( 100), qLn ( 1),
203  1, 1, 1);
204  m_transformation.updateTransformFromMatrices (matrixScreen,
205  matrixGraph);
206  m_transformation.setModelCoords (m_modelCoords,
207  m_modelGeneral,
208  m_modelMainWindow);
209 }
210 
211 void TestExport::initTestCase ()
212 {
213  initializeLogging ("engauge_test",
214  "engauge_test.log",
215  DEBUG_FLAG);
216 
217  m_mainWindow = new MainWindow (NO_ERROR_REPORT_LOG_FILE,
218  NO_REGRESSION_OPEN_FILE,
219  NO_REGRESSION_IMPORT,
220  NO_GNUPLOT_LOG_FILES,
221  NO_RESET,
222  NO_EXPORT_ONLY,
223  NO_EXTRACT_IMAGE_ONLY,
224  NO_EXTRACT_IMAGE_EXTENSION,
225  NO_LOAD_STARTUP_FILES,
226  NO_COMMAND_LINE);
227 
228  m_mainWindow->show ();
229 }
230 
231 void TestExport::testCommasInFunctionsForCommasSwitzerland ()
232 {
233  QString outputExpectedIfCommaSeparator =
234  "x,Curve1\n"
235  "\"0,001\",\"-1,27563\"\n"
236  "\"0,001\",\"-1,27563\"\n"
237  "\"0,01\",\"-1,26683\"\n"
238  "\"0,1\",\"-1,17881\"\n"
239  "1,\"-0,29658\"\n"
240  "10,\"-706,15184\"\n"
241  "100,\"-3997814,14355\"\n"
242  "1000,\"-4541901224,06376\"\n";
243  QString outputExpectedIfPeriodSeparator =
244  "x,Curve1\n"
245  "0.001,-1.27563\n"
246  "0.001,-1.27563\n"
247  "0.01,-1.26683\n"
248  "0.1,-1.17881\n"
249  "1,-0.29658\n"
250  "10,-706.15184\n"
251  "100,-3997814.14355\n"
252  "1000,-4541901224.06376\n";
253 
254  QString outputGot;
255  bool success = checkCommasInFunctionsForDelimiter (EXPORT_DELIMITER_COMMA,
256  QLocale::Switzerland,
257  outputGot);
258  if (!success) {
259  outputGot = "";
260  }
261 
262  QVERIFY (outputGot == outputExpectedIfCommaSeparator ||
263  outputGot == outputExpectedIfPeriodSeparator);
264 }
265 
266 void TestExport::testCommasInFunctionsForCommasUnitedStates ()
267 {
268  QString outputExpected =
269  "x,Curve1\n"
270  "0.001,-1.27563\n"
271  "0.001,-1.27563\n"
272  "0.01,-1.26683\n"
273  "0.1,-1.17881\n"
274  "1,-0.29658\n"
275  "10,-706.15184\n"
276  "100,-3997814.14355\n"
277  "1000,-4541901224.06376\n";
278 
279  QString outputGot;
280  bool success = checkCommasInFunctionsForDelimiter (EXPORT_DELIMITER_COMMA,
281  QLocale::UnitedStates,
282  outputGot);
283  if (!success) {
284  outputGot = "";
285  }
286 
287  QVERIFY (outputGot == outputExpected);
288 }
289 
290 void TestExport::testCommasInFunctionsForTabsSwitzerland ()
291 {
292  QString outputExpectedIfCommaSeparator =
293  "x\tCurve1\n"
294  "0,001\t-1,27563\n"
295  "0,001\t-1,27563\n"
296  "0,01\t-1,26683\n"
297  "0,1\t-1,17881\n"
298  "1\t-0,29658\n"
299  "10\t-706,15184\n"
300  "100\t-3997814,14355\n"
301  "1000\t-4541901224,06376\n";
302  QString outputExpectedIfPeriodSeparator =
303  "x\tCurve1\n"
304  "0.001\t-1.27563\n"
305  "0.001\t-1.27563\n"
306  "0.01\t-1.26683\n"
307  "0.1\t-1.17881\n"
308  "1\t-0.29658\n"
309  "10\t-706.15184\n"
310  "100\t-3997814.14355\n"
311  "1000\t-4541901224.06376\n";
312 
313  QString outputGot;
314  bool success = checkCommasInFunctionsForDelimiter (EXPORT_DELIMITER_TAB,
315  QLocale::Switzerland,
316  outputGot);
317  if (!success) {
318  outputGot = "";
319  }
320 
321  QVERIFY (outputGot == outputExpectedIfCommaSeparator ||
322  outputGot == outputExpectedIfPeriodSeparator);
323 }
324 
325 void TestExport::testCommasInFunctionsForTabsUnitedStates ()
326 {
327  QString outputExpected =
328  "x\tCurve1\n"
329  "0.001\t-1.27563\n"
330  "0.001\t-1.27563\n"
331  "0.01\t-1.26683\n"
332  "0.1\t-1.17881\n"
333  "1\t-0.29658\n"
334  "10\t-706.15184\n"
335  "100\t-3997814.14355\n"
336  "1000\t-4541901224.06376\n";
337 
338  QString outputGot;
339  bool success = checkCommasInFunctionsForDelimiter (EXPORT_DELIMITER_TAB,
340  QLocale::UnitedStates,
341  outputGot);
342  if (!success) {
343  outputGot = "";
344  }
345 
346  QVERIFY (outputGot == outputExpected);
347 }
348 
349 void TestExport::testCommasInRelationsForCommasSwitzerland ()
350 {
351  QString outputExpectedIfCommaSeparator =
352  "x,Curve1\n"
353  "\"3,3192\",\"2,08003\"\n"
354  "\"3,3723\",\"2,15796\"\n"
355  "\"3,432\",\"2,23368\"\n"
356  "\"3,4935\",\"2,30883\"\n"
357  "\"3,5539\",\"2,38438\"\n"
358  "\"3,6113\",\"2,46094\"\n"
359  "\"3,6687\",\"2,5375\"\n"
360  "\"3,7261\",\"2,61406\"\n"
361  "\"3,7836\",\"2,69062\"\n"
362  "\"3,841\",\"2,76718\"\n"
363  "\"3,9012\",\"2,84276\"\n"
364  "\"3,9628\",\"2,91791\"\n"
365  "\"4,0231\",\"2,99345\"\n"
366  "\"4,0785\",\"3,07067\"\n"
367  "\"4,1339\",\"3,14789\"\n"
368  "\"4,1932\",\"3,22378\"\n"
369  "\"4,2547\",\"3,29893\"\n"
370  "\"4,3156\",\"3,37426\"\n"
371  "\"4,3731\",\"3,45082\"\n"
372  "\"4,4305\",\"3,52738\"\n"
373  "\"4,4892\",\"3,60349\"\n"
374  "\"4,5486\",\"3,67938\"\n";
375  QString outputExpectedIfPeriodSeparator =
376  "x,Curve1\n"
377  "3.3192,2.08003\n"
378  "3.3723,2.15796\n"
379  "3.432,2.23368\n"
380  "3.4935,2.30883\n"
381  "3.5539,2.38438\n"
382  "3.6113,2.46094\n"
383  "3.6687,2.5375\n"
384  "3.7261,2.61406\n"
385  "3.7836,2.69062\n"
386  "3.841,2.76718\n"
387  "3.9012,2.84276\n"
388  "3.9628,2.91791\n"
389  "4.0231,2.99345\n"
390  "4.0785,3.07067\n"
391  "4.1339,3.14789\n"
392  "4.1932,3.22378\n"
393  "4.2547,3.29893\n"
394  "4.3156,3.37426\n"
395  "4.3731,3.45082\n"
396  "4.4305,3.52738\n"
397  "4.4892,3.60349\n"
398  "4.5486,3.67938\n";
399 
400  QString outputGot;
401  bool success = checkCommasInRelationsForDelimiter (EXPORT_DELIMITER_COMMA,
402  QLocale::Switzerland,
403  outputGot);
404  if (!success) {
405  outputGot = "";
406  }
407 
408  QVERIFY (outputGot == outputExpectedIfCommaSeparator ||
409  outputGot == outputExpectedIfPeriodSeparator);
410 }
411 
412 void TestExport::testCommasInRelationsForCommasUnitedStates ()
413 {
414  QString outputExpected =
415  "x,Curve1\n"
416  "3.3192,2.08003\n"
417  "3.3723,2.15796\n"
418  "3.432,2.23368\n"
419  "3.4935,2.30883\n"
420  "3.5539,2.38438\n"
421  "3.6113,2.46094\n"
422  "3.6687,2.5375\n"
423  "3.7261,2.61406\n"
424  "3.7836,2.69062\n"
425  "3.841,2.76718\n"
426  "3.9012,2.84276\n"
427  "3.9628,2.91791\n"
428  "4.0231,2.99345\n"
429  "4.0785,3.07067\n"
430  "4.1339,3.14789\n"
431  "4.1932,3.22378\n"
432  "4.2547,3.29893\n"
433  "4.3156,3.37426\n"
434  "4.3731,3.45082\n"
435  "4.4305,3.52738\n"
436  "4.4892,3.60349\n"
437  "4.5486,3.67938\n";
438 
439  QString outputGot;
440  bool success = checkCommasInRelationsForDelimiter (EXPORT_DELIMITER_COMMA,
441  QLocale::UnitedStates,
442  outputGot);
443  if (!success) {
444  outputGot = "";
445  }
446 
447  QVERIFY (outputGot == outputExpected);
448 }
449 
450 void TestExport::testCommasInRelationsForTabsSwitzerland ()
451 {
452  QString outputExpectedIfCommaSeparator =
453  "x\tCurve1\n"
454  "3,3192\t2,08003\n"
455  "3,3723\t2,15796\n"
456  "3,432\t2,23368\n"
457  "3,4935\t2,30883\n"
458  "3,5539\t2,38438\n"
459  "3,6113\t2,46094\n"
460  "3,6687\t2,5375\n"
461  "3,7261\t2,61406\n"
462  "3,7836\t2,69062\n"
463  "3,841\t2,76718\n"
464  "3,9012\t2,84276\n"
465  "3,9628\t2,91791\n"
466  "4,0231\t2,99345\n"
467  "4,0785\t3,07067\n"
468  "4,1339\t3,14789\n"
469  "4,1932\t3,22378\n"
470  "4,2547\t3,29893\n"
471  "4,3156\t3,37426\n"
472  "4,3731\t3,45082\n"
473  "4,4305\t3,52738\n"
474  "4,4892\t3,60349\n"
475  "4,5486\t3,67938\n";
476  QString outputExpectedIfPeriodSeparator =
477  "x\tCurve1\n"
478  "3.3192\t2.08003\n"
479  "3.3723\t2.15796\n"
480  "3.432\t2.23368\n"
481  "3.4935\t2.30883\n"
482  "3.5539\t2.38438\n"
483  "3.6113\t2.46094\n"
484  "3.6687\t2.5375\n"
485  "3.7261\t2.61406\n"
486  "3.7836\t2.69062\n"
487  "3.841\t2.76718\n"
488  "3.9012\t2.84276\n"
489  "3.9628\t2.91791\n"
490  "4.0231\t2.99345\n"
491  "4.0785\t3.07067\n"
492  "4.1339\t3.14789\n"
493  "4.1932\t3.22378\n"
494  "4.2547\t3.29893\n"
495  "4.3156\t3.37426\n"
496  "4.3731\t3.45082\n"
497  "4.4305\t3.52738\n"
498  "4.4892\t3.60349\n"
499  "4.5486\t3.67938\n";
500 
501  QString outputGot;
502  bool success = checkCommasInRelationsForDelimiter (EXPORT_DELIMITER_TAB,
503  QLocale::Switzerland,
504  outputGot);
505  if (!success) {
506  outputGot = "";
507  }
508 
509  QVERIFY (outputGot == outputExpectedIfCommaSeparator ||
510  outputGot == outputExpectedIfPeriodSeparator);
511 }
512 
513 void TestExport::testCommasInRelationsForTabsUnitedStates ()
514 {
515  QString outputExpected =
516  "x\tCurve1\n"
517  "3.3192\t2.08003\n"
518  "3.3723\t2.15796\n"
519  "3.432\t2.23368\n"
520  "3.4935\t2.30883\n"
521  "3.5539\t2.38438\n"
522  "3.6113\t2.46094\n"
523  "3.6687\t2.5375\n"
524  "3.7261\t2.61406\n"
525  "3.7836\t2.69062\n"
526  "3.841\t2.76718\n"
527  "3.9012\t2.84276\n"
528  "3.9628\t2.91791\n"
529  "4.0231\t2.99345\n"
530  "4.0785\t3.07067\n"
531  "4.1339\t3.14789\n"
532  "4.1932\t3.22378\n"
533  "4.2547\t3.29893\n"
534  "4.3156\t3.37426\n"
535  "4.3731\t3.45082\n"
536  "4.4305\t3.52738\n"
537  "4.4892\t3.60349\n"
538  "4.5486\t3.67938\n";
539 
540  QString outputGot;
541  bool success = checkCommasInRelationsForDelimiter (EXPORT_DELIMITER_TAB,
542  QLocale::UnitedStates,
543  outputGot);
544  if (!success) {
545  outputGot = "";
546  }
547 
548  QVERIFY (outputGot == outputExpected);
549 }
550 
551 void TestExport::testExportOnlyNonRegressionLowerCase ()
552 {
553  m_mainWindow->m_isErrorReportRegressionTest = NO_REGRESSION_IMPORT;
554  m_mainWindow->setCurrentFile (STARTUP_DIG_LOWER_CASE);
555 
556  QString outputGot = m_mainWindow->fileNameForExportOnly ();
557  QString outputWanted = STARTUP_DIG_LOWER_CASE;
558  outputWanted = outputWanted.replace (".dig", ".csv");
559 
560  QVERIFY (outputGot == outputWanted);
561 }
562 
563 void TestExport::testExportOnlyNonRegressionUpperCase ()
564 {
565  m_mainWindow->m_isErrorReportRegressionTest = NO_REGRESSION_IMPORT;
566  m_mainWindow->setCurrentFile (STARTUP_DIG_UPPER_CASE);
567 
568  QString outputGot = m_mainWindow->fileNameForExportOnly ();
569  QString outputWanted = STARTUP_DIG_UPPER_CASE;
570  outputWanted = outputWanted.replace (".DIG", ".csv");
571 
572  QVERIFY (outputGot == outputWanted);
573 }
574 
575 void TestExport::testExportOnlyRegressionLowerCase ()
576 {
577  m_mainWindow->m_isErrorReportRegressionTest = REGRESSION_IMPORT;
578  m_mainWindow->m_regressionFile = STARTUP_DIG_LOWER_CASE;
579 
580  QString outputGot = m_mainWindow->fileNameForExportOnly ();
581  QString outputWanted = STARTUP_DIG_LOWER_CASE;
582  outputWanted = outputWanted.replace (".dig", ".csv_actual_1");
583 
584  QVERIFY (outputGot == outputWanted);
585 }
586 
587 void TestExport::testExportOnlyRegressionUpperCase ()
588 {
589  m_mainWindow->m_isErrorReportRegressionTest = REGRESSION_IMPORT;
590  m_mainWindow->m_regressionFile = STARTUP_DIG_UPPER_CASE;
591 
592  QString outputGot = m_mainWindow->fileNameForExportOnly ();
593  QString outputWanted = STARTUP_DIG_UPPER_CASE;
594  outputWanted = outputWanted.replace (".DIG", ".csv_actual_1");
595 
596  QVERIFY (outputGot == outputWanted);
597 }
598 
599 void TestExport::testLogExtrapolationFunctionsAll ()
600 {
601  initData (true,
602  EXPORT_DELIMITER_COMMA,
603  QLocale::UnitedStates);
604 
605  bool success = true;
606  QString dummy;
607  QTextStream str (&dummy);
608 
609  try {
610  bool isLogXTheta = (m_modelCoords.coordScaleXTheta() == COORD_SCALE_LOG);
611  bool isLogYRadius = (m_modelCoords.coordScaleYRadius() == COORD_SCALE_LOG);
612  unsigned int numWritesSoFar = 0;
613 
614  ExportFileFunctions exportFile;
615  CurveLimits curveLimitsMin, curveLimitsMax; // Empty containers mean no limits are in effect
616  exportFile.exportAllPerLineXThetaValuesMerged (m_modelExportOverride,
617  *m_document,
618  m_modelMainWindow,
619  m_curvesIncluded,
620  m_xThetaValues,
621  " ",
622  m_transformation,
623  isLogXTheta,
624  isLogYRadius,
625  curveLimitsMin,
626  curveLimitsMax,
627  str,
628  numWritesSoFar);
629  }
630  catch (...)
631  {
632  success = false;
633  }
634 
635  QVERIFY (success);
636 }
void setPointsSelectionFunctions(ExportPointsSelectionFunctions exportPointsSelectionFunctions)
Set method for point selection for functions.
void setCursorSize(int cursorSize)
Set method for effective cursor size.
void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
Definition: Document.cpp:1012
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
const CoordSystem & coordSystem() const
Currently active CoordSystem.
Definition: Document.cpp:298
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
void addPointGraphWithSpecifiedIdentifier(const QString &curveName, const QPointF &posScreen, const QString &identifier, double ordinal)
Add a single graph point with the specified point identifer. Note that PointStyle is not applied to t...
Definition: Document.cpp:206
void setCoordScaleYRadius(CoordScale coordScale)
Set method for linear/log scale on y/radius.
void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
Definition: Document.cpp:974
void setDelimiter(ExportDelimiter exportDelimiter)
Set method for delimiter.
void setLocale(QLocale::Language language, QLocale::Country country)
Set method for locale given attributes.
Unit test of Export classes.
Definition: TestExport.h:16
void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
Definition: Document.cpp:1005
Details for a specific Point.
Definition: PointStyle.h:20
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
Strategy class for exporting to a file. This strategy is external to the Document class so that class...
void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
Definition: Document.cpp:981
Container for LineStyle and PointStyle for one Curve.
Definition: CurveStyle.h:18
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
Details for a specific Line.
Definition: LineStyle.h:19
Strategy class for exporting to a file. This strategy is external to the Document class so that class...
void setExtraPrecision(int extraPrecision)
Set method for extra digits of precision.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:91
void setCoordScaleXTheta(CoordScale coordScale)
Set method for linear/log scale on x/theta.
void setCoordsType(CoordsType coordsType)
Set method for coordinates type.