cctw  0.2.1
Public Slots | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
CctwqtMainWindow Class Reference

#include <cctwqtmainwindow.h>

Inheritance diagram for CctwqtMainWindow:
Inheritance graph
Collaboration diagram for CctwqtMainWindow:
Collaboration graph

Public Slots

void printLine (QString line)
 
void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime())
 
void doEvaluateCommand ()
 
void doExecuteScriptFile ()
 
void doBrowseInputFile ()
 
void doCheckDataFile (QString path)
 
void doBrowseInputDataset (QString entry)
 
void doCheckDataset (QString name)
 
void doSetupOutput ()
 
void doSetupTransform ()
 
void doTransform ()
 
void doCheckTransform ()
 
void doHalt ()
 
void doLoadSettings ()
 
void doSaveSettings ()
 
void doSaveDependencies ()
 
void doLoadDependencies ()
 
void reportInputDependencies ()
 
void reportOutputDependencies ()
 
void onProgressUpdate ()
 
void doAnalyzePEMetaData ()
 
void doAnalyzeSpecDataFile ()
 
void possiblyClose ()
 
void plotCurves (QwtPlotCurve *c1, QwtPlotCurve *c2, QwtPlotCurve *c3, QwtPlotCurve *c4)
 
void doCompareHDF5 ()
 
void doBrowseProject ()
 
void doProjectInput ()
 
void doProjectOutput ()
 

Public Member Functions

 CctwqtMainWindow (CctwApplication *app, QWidget *parent=0)
 
 ~CctwqtMainWindow ()
 
CctwApplicationcctwApplication ()
 

Public Attributes

Ui::CctwqtMainWindow * ui
 

Private Member Functions

bool wantToClose ()
 
void closeEvent (QCloseEvent *event)
 
void reportDependencies (CctwChunkedData *data, QString title)
 

Private Attributes

CctwApplicationm_Application
 
CctwqtTransformTesterm_TransformTester
 
QPointer< CctwqtSetupOutputDialogm_SetupOutputDialog
 
QPointer< CctwqtSetupTransformDialogm_SetupTransformDialog
 
QPointer< CctwqtSetupCheckImportDialogm_SetupCheckImportDialog
 
QPointer< CctwqtSetupCompareDialogm_SetupCompareDialog
 
QwtLegend * m_Legend
 
QwtPlotPanner * m_Panner
 
QwtPlotMagnifier * m_Magnifier
 
QwtPlotZoomer * m_Zoomer
 

Detailed Description

Definition at line 27 of file cctwqtmainwindow.h.

Constructor & Destructor Documentation

CctwqtMainWindow::CctwqtMainWindow ( CctwApplication app,
QWidget *  parent = 0 
)
explicit

Definition at line 17 of file cctwqtmainwindow.cpp.

References doAnalyzePEMetaData(), doAnalyzeSpecDataFile(), doBrowseInputDataset(), doBrowseInputFile(), doBrowseProject(), doCheckDataFile(), doCheckDataset(), doCheckTransform(), doCompareHDF5(), doEvaluateCommand(), doExecuteScriptFile(), doHalt(), doLoadDependencies(), doLoadSettings(), doProjectInput(), doProjectOutput(), doSaveDependencies(), doSaveSettings(), doSetupOutput(), doSetupTransform(), doTransform(), m_Application, CctwApplication::m_InputData, m_Legend, m_Magnifier, CctwApplication::m_OutputData, m_Panner, CctwApplication::m_Parameters, CctwApplication::m_Transformer, m_TransformTester, m_Zoomer, onProgressUpdate(), CctwApplication::parameters(), possiblyClose(), reportInputDependencies(), reportOutputDependencies(), and ui.

17  :
18  QMainWindow(parent),
19  ui(new Ui::CctwqtMainWindow),
20  m_Application(app),
21  m_TransformTester(NULL),
22  m_SetupOutputDialog(NULL),
24  m_Legend(NULL),
25  m_Panner(NULL),
26  m_Magnifier(NULL),
27  m_Zoomer(NULL)
28 {
29  ui->setupUi(this);
30 
31  connect(ui->m_CommandInput, SIGNAL(returnPressed()), this, SLOT(doEvaluateCommand()));
32 
33 #ifdef WANT_IMPORT_COMMANDS
34  connect(ui->m_ActionSetupDataImport, SIGNAL(triggered()), this, SLOT(doSetupImport()));
35  connect(ui->m_SetupImportButton, SIGNAL(clicked()), this, SLOT(doSetupImport()));
36 
37  connect(ui->m_ActionImportData, SIGNAL(triggered()), this, SLOT(doImport()));
38  connect(ui->m_ImportButton, SIGNAL(clicked()), this, SLOT(doImport()));
39 #endif
40 
41  connect(ui->m_ActionExecuteScriptFile, SIGNAL(triggered()), this, SLOT(doExecuteScriptFile()));
42  connect(ui->m_ActionSetupOutputData, SIGNAL(triggered()), this, SLOT(doSetupOutput()));
43  connect(ui->m_SetupOutputButton, SIGNAL(clicked()), this, SLOT(doSetupOutput()));
44 
45  connect(ui->m_ActionSetupTransform, SIGNAL(triggered()), this, SLOT(doSetupTransform()));
46  connect(ui->m_SetupTransformButton, SIGNAL(clicked()), this, SLOT(doSetupTransform()));
47 
48  connect(ui->m_ActionPerformTransform, SIGNAL(triggered()), this, SLOT(doTransform()));
49  connect(ui->m_TransformButton, SIGNAL(clicked()), this, SLOT(doTransform()));
50 
51  connect(ui->m_ActionCheckTransform, SIGNAL(triggered()), this, SLOT(doCheckTransform()));
52  connect(ui->m_CheckTransformButton, SIGNAL(clicked()), this, SLOT(doCheckTransform()));
53 
54  connect(ui->m_HaltButton, SIGNAL(clicked()), this, SLOT(doHalt()));
55 
56  connect(ui->m_ActionDependencies, SIGNAL(triggered()), m_Application, SLOT(calculateDependencies()));
57  connect(ui->m_DependenciesButton, SIGNAL(clicked()), m_Application, SLOT(calculateDependencies()));
58 
59  connect(ui->m_ActionReportInputDependencies, SIGNAL(triggered()), this, SLOT(reportInputDependencies()));
60  connect(ui->m_ReportInputDepsButton, SIGNAL(clicked()), this, SLOT(reportInputDependencies()));
61 
62  connect(ui->m_ActionReportOutputDependencies, SIGNAL(triggered()), this, SLOT(reportOutputDependencies()));
63  connect(ui->m_ReportOutputDepsButton, SIGNAL(clicked()), this, SLOT(reportOutputDependencies()));
64 
65  connect(ui->m_ActionSaveDependencies, SIGNAL(triggered()), this, SLOT(doSaveDependencies()));
66  connect(ui->m_SaveDepsButton, SIGNAL(clicked()), this, SLOT(doSaveDependencies()));
67 
68  connect(ui->m_ActionLoadDependencies, SIGNAL(triggered()), this, SLOT(doLoadDependencies()));
69  connect(ui->m_LoadDepsButton, SIGNAL(clicked()), this, SLOT(doLoadDependencies()));
70 
71 
72 #ifdef WANT_IMPORT_COMMANDS
73  connect(ui->m_ActionCheckImportedData, SIGNAL(triggered()), this, SLOT(doCheckImportedData()));
74 #endif
75 
76  connect(ui->m_ActionLoadSettings, SIGNAL(triggered()), this, SLOT(doLoadSettings()));
77  connect(ui->m_ActionSaveSettings, SIGNAL(triggered()), this, SLOT(doSaveSettings()));
78  connect(ui->m_ActionSaveCurrentSettings, SIGNAL(triggered()), m_Application, SLOT(writeSettings()));
79 
80  connect(ui->m_ActionQuit, SIGNAL(triggered()), this, SLOT(possiblyClose()));
81 
82  app->prop_Halting()->linkTo(ui->m_Halting);
83 
84 #ifdef WANT_ANALYSIS_COMMANDS
85  connect(ui->m_ActionAnalyzePEMetaData, SIGNAL(triggered()), this, SLOT(doAnalyzePEMetaData()));
86  connect(ui->m_PEMetaDataButton, SIGNAL(clicked()), this, SLOT(doAnalyzePEMetaData()));
87 
88  connect(ui->m_ActionAnalyseSpecDataFile, SIGNAL(triggered()), this, SLOT(doAnalyzeSpecDataFile()));
89  connect(ui->m_AnalyzeSpecDataButton, SIGNAL(clicked()), this, SLOT(doAnalyzeSpecDataFile()));
90 
91  connect(ui->m_ActionCompareTwoHDF5, SIGNAL(triggered()), this, SLOT(doCompareHDF5()));
92 #else
93  ui->m_ParametersTabs->removeTab(5);
94  ui->m_Menubar->removeAction(ui->m_AnalysisMenu->menuAction());
95 #endif
96 
97 #ifdef WANT_IMPORT_COMMANDS
98  CctwImporter *import = app->m_ImportData;
99 
100  if (import) {
101  import->prop_DarkImagePath()->linkTo(ui->m_ImportDarkImagePath);
102  import->prop_ImageDirectory()->linkTo(ui->m_ImportDataDirectory);
103  import->prop_OutputPath()->linkTo(ui->m_ImportOutputPath);
104  import->prop_OutputDataset()->linkTo(ui->m_ImportOutputDataset);
105  import->prop_Compression()->linkTo(ui->m_ImportOutputCompression);
106 
107  connect(import->prop_ImagePaths(), SIGNAL(valueChanged(QStringList,int)), this, SLOT(updateImportImagePaths(QStringList)));
108 
109  import->prop_ChunkSize()->linkTo(ui->m_ImportOutputChunkX,
110  ui->m_ImportOutputChunkY,
111  ui->m_ImportOutputChunkZ);
112 
113  updateImportImagePaths(import->get_ImagePaths());
114  }
115 #else
116  ui->m_ParametersTabs->removeTab(0);
117  ui->m_FileMenu->removeAction(ui->m_ActionSetupDataImport);
118  ui->m_FileMenu->removeAction(ui->m_ActionImportData);
119 #endif
120 
121  CctwChunkedData *inputData = app->m_InputData;
122 
123  if (inputData) {
124  inputData->prop_DataFileName()->linkTo(ui->m_InputDataFileName);
125  inputData->prop_DataSetName()->linkTo(ui->m_InputDataSetName);
126  inputData->prop_ChunksRead()->linkTo(ui->m_ChunksRead);
127 
128  inputData->prop_Compression()->linkTo(ui->m_InputCompression);
129  inputData->prop_ChunksRead()->linkTo(ui->m_ChunksRead);
130 
131  inputData->prop_Dimensions()->linkTo(ui->m_InputDimensionsX,
132  ui->m_InputDimensionsY,
133  ui->m_InputDimensionsZ);
134 
135  inputData->prop_ChunkSize()->linkTo(ui->m_InputChunkX,
136  ui->m_InputChunkY,
137  ui->m_InputChunkZ);
138 
139  inputData->prop_ChunkCount()->linkTo(ui->m_InputCountX,
140  ui->m_InputCountY,
141  ui->m_InputCountZ);
142 
143  inputData->prop_HDFChunkSize()->linkTo(ui->m_InputHDFChunkX,
144  ui->m_InputHDFChunkY,
145  ui->m_InputHDFChunkZ);
146  }
147 
148  connect(ui->m_BrowseInputFile, SIGNAL(clicked()), this, SLOT(doBrowseInputFile()));
149  connect(ui->m_InputDataFileName, SIGNAL(textChanged(QString)), this, SLOT(doCheckDataFile(QString)));
150  connect(ui->m_BrowseInputDataset, SIGNAL(currentIndexChanged(QString)), this, SLOT(doBrowseInputDataset(QString)));
151  connect(ui->m_InputDataSetName, SIGNAL(textChanged(QString)), this, SLOT(doCheckDataset(QString)));
152 
153  CctwChunkedData *outputData = app->m_OutputData;
154 
155  if (outputData) {
156  outputData->prop_DataFileName()->linkTo(ui->m_OutputDataFileName);
157  outputData->prop_DataSetName()->linkTo(ui->m_OutputDataSetName);
158  outputData->prop_ChunksWritten()->linkTo(ui->m_ChunksWritten);
159  outputData->prop_ChunksHeld()->linkTo(ui->m_ChunksHeld);
160  outputData->prop_ChunksHeldMax()->linkTo(ui->m_ChunksHeldMax);
161 
162  outputData->prop_Compression()->linkTo(ui->m_OutputCompression);
163  outputData->prop_ChunksWritten()->linkTo(ui->m_ChunksWritten);
164 
165  outputData->prop_Dimensions()->linkTo(ui->m_OutputDimensionsX,
166  ui->m_OutputDimensionsY,
167  ui->m_OutputDimensionsZ);
168 
169  outputData->prop_ChunkSize()->linkTo(ui->m_OutputChunkX,
170  ui->m_OutputChunkY,
171  ui->m_OutputChunkZ);
172 
173  outputData->prop_ChunkCount()->linkTo(ui->m_OutputCountX,
174  ui->m_OutputCountY,
175  ui->m_OutputCountZ);
176 
177  outputData->prop_HDFChunkSize()->linkTo(ui->m_OutputHDFChunkX,
178  ui->m_OutputHDFChunkY,
179  ui->m_OutputHDFChunkZ);
180  }
181 
182  CctwTransformer *xform = app->m_Transformer;
183 
184  if (xform) {
185  xform->prop_ProjectX()->linkTo(ui->m_ProjectX);
186  xform->prop_ProjectY()->linkTo(ui->m_ProjectY);
187  xform->prop_ProjectZ()->linkTo(ui->m_ProjectZ);
188  xform->prop_ProjectDestination()->linkTo(ui->m_ProjectDestination);
189  xform->prop_OversampleX()->linkTo(ui->m_OversampleX);
190  xform->prop_OversampleY()->linkTo(ui->m_OversampleY);
191  xform->prop_OversampleZ()->linkTo(ui->m_OversampleZ);
192  }
193 
195 
196  if (parms) {
197  parms->prop_ExtraFlip()->linkTo(ui->m_ExtraFlip);
198  }
199 
200  connect(ui->m_ActionProjectBrowse, SIGNAL(triggered()), this, SLOT(doBrowseProject()));
201  connect(ui->m_ProjectBrowseButton, SIGNAL(clicked()), this, SLOT(doBrowseProject()));
202 
203  connect(ui->m_ActionProjectInput, SIGNAL(triggered()), this, SLOT(doProjectInput()));
204  connect(ui->m_ProjectInputButton, SIGNAL(clicked()), this, SLOT(doProjectInput()));
205 
206  connect(ui->m_ActionProjectOutput, SIGNAL(triggered()), this, SLOT(doProjectOutput()));
207  connect(ui->m_ProjectOutputButton, SIGNAL(clicked()), this, SLOT(doProjectOutput()));
208 
209  connect(app->prop_Progress(), SIGNAL(valueChanged(int,int)), this, SLOT(onProgressUpdate()));
210  connect(app->prop_ProgressLimit(), SIGNAL(valueChanged(int,int)), this, SLOT(onProgressUpdate()));
211 
212  qRegisterMetaType<QwtPlotCurve*>("QwtPlotCurve*");
213 
214  m_Panner = new QwtPlotPanner(ui->m_CctwGraph->canvas());
215  m_Panner -> setMouseButton(Qt::MidButton);
216  m_Panner -> setEnabled(true);
217 
218  m_Zoomer = new QwtPlotZoomer(QwtPlot::xBottom, QwtPlot::yLeft, ui->m_CctwGraph->canvas());
219  m_Zoomer -> setTrackerMode(QwtPicker::AlwaysOn);
220  m_Zoomer -> setMousePattern(QwtEventPattern::MouseSelect2,
221  Qt::LeftButton, Qt::ControlModifier | Qt::ShiftModifier);
222  m_Zoomer -> setMousePattern(QwtEventPattern::MouseSelect3,
223  Qt::LeftButton, Qt::ControlModifier);
224 // m_Zoomer -> setSelectionFlags(QwtPicker::DragSelection | QwtPicker::CornerToCorner);
225 
226  m_Magnifier = new QwtPlotMagnifier(ui->m_CctwGraph->canvas());
227  m_Magnifier -> setMouseFactor(1.0);
228 
229  m_Legend = new QwtLegend;
230  m_Legend -> setFrameStyle(QFrame::Box|QFrame::Sunken);
231 // m_Legend -> setItemMode(QwtLegend::CheckableItem);
232 
233  ui->m_CctwGraph -> insertLegend(m_Legend, QwtPlot::BottomLegend);
234 
235  m_TransformTester = new CctwqtTransformTester(this, app->m_Parameters, this);
236 }
CctwChunkedData * m_OutputData
CctwChunkedData * m_InputData
QwtPlotZoomer * m_Zoomer
CctwCrystalCoordinateParameters * m_Parameters
QPointer< CctwqtSetupTransformDialog > m_SetupTransformDialog
Ui::CctwqtMainWindow * ui
CctwTransformer * m_Transformer
void doCheckDataFile(QString path)
CctwqtTransformTester * m_TransformTester
QwtPlotMagnifier * m_Magnifier
QPointer< CctwqtSetupOutputDialog > m_SetupOutputDialog
CctwApplication * m_Application
QwtLegend * m_Legend
CctwCrystalCoordinateParameters * parameters() const
void doBrowseInputDataset(QString entry)
void doCheckDataset(QString name)
QwtPlotPanner * m_Panner
CctwqtMainWindow::~CctwqtMainWindow ( )

Definition at line 238 of file cctwqtmainwindow.cpp.

References ui.

239 {
240  delete ui;
241 }
Ui::CctwqtMainWindow * ui

Member Function Documentation

CctwApplication * CctwqtMainWindow::cctwApplication ( )

Definition at line 243 of file cctwqtmainwindow.cpp.

References m_Application.

Referenced by CctwqtSetupOutputDialog::accept(), and CctwqtSetupOutputDialog::CctwqtSetupOutputDialog().

244 {
245  return m_Application;
246 }
CctwApplication * m_Application
void CctwqtMainWindow::closeEvent ( QCloseEvent *  event)
private

Definition at line 248 of file cctwqtmainwindow.cpp.

References wantToClose().

249 {
250  if (wantToClose()) {
251  event -> accept();
252  } else {
253  event -> ignore();
254  }
255 }
void CctwqtMainWindow::doAnalyzePEMetaData ( )
slot

Definition at line 577 of file cctwqtmainwindow.cpp.

References CctwApplication::analyzePEMetaData(), and m_Application.

Referenced by CctwqtMainWindow().

578 {
579  QString path = QFileDialog::getOpenFileName(this, "Spec Data File for PE rotscan runs...",
580  m_Application->get_SpecDataFilePath());
581 
582  if (path.length()) {
584  }
585 }
void analyzePEMetaData(QString path)
CctwApplication * m_Application
void CctwqtMainWindow::doAnalyzeSpecDataFile ( )
slot

Definition at line 587 of file cctwqtmainwindow.cpp.

References CctwApplication::analyzeSpecDataFile(), and m_Application.

Referenced by CctwqtMainWindow().

588 {
589  QString path = QFileDialog::getOpenFileName(this, "Spec Data File for PE rotscan runs...",
590  m_Application->get_SpecDataFilePath());
591 
592  if (path.length()) {
594  }
595 }
void analyzeSpecDataFile(QString path)
CctwApplication * m_Application
void CctwqtMainWindow::doBrowseInputDataset ( QString  entry)
slot

Definition at line 400 of file cctwqtmainwindow.cpp.

References ui.

Referenced by CctwqtMainWindow().

401 {
402 // if (m_Window) {
403 // m_Window->printMessage(tr("CctwqtMainWindow::doBrowseInputDataset(%1)").arg(entry));
404 // }
405 
406  ui->m_InputDataSetName->setText(entry);
407 }
Ui::CctwqtMainWindow * ui
void CctwqtMainWindow::doBrowseInputFile ( )
slot

Definition at line 320 of file cctwqtmainwindow.cpp.

References m_Application, and CctwApplication::m_InputData.

Referenced by CctwqtMainWindow().

321 {
323 
324  if (inputData) {
325  QString path = QFileDialog::getOpenFileName(this, "Input File",
326  inputData->get_DataFileName());
327 
328  if (path.length() > 0) {
329  inputData->set_DataFileName(path);
330  }
331  }
332 }
CctwChunkedData * m_InputData
CctwApplication * m_Application
void CctwqtMainWindow::doBrowseProject ( )
slot

Definition at line 669 of file cctwqtmainwindow.cpp.

References m_Application, and CctwApplication::m_Transformer.

Referenced by CctwqtMainWindow().

670 {
672 
673  if (xform) {
674  QString s = QFileDialog::getExistingDirectory(this, "Destination", xform->get_ProjectDestination());
675 
676  if (s.length()) {
677  xform->set_ProjectDestination(s);
678  }
679  }
680 }
CctwTransformer * m_Transformer
CctwApplication * m_Application
void CctwqtMainWindow::doCheckDataFile ( QString  path)
slot

Definition at line 387 of file cctwqtmainwindow.cpp.

References iterateHDF5datasets(), and ui.

Referenced by CctwqtMainWindow().

388 {
389 // if (m_Window) {
390 // m_Window->printMessage(tr("CctwqtMainWindow::doCheckDataFile(\"%1\")").arg(path));
391 // }
392 
393  QStringList paths = iterateHDF5datasets(path);
394 
395  ui->m_BrowseInputDataset->clear();
396  ui->m_BrowseInputDataset->addItem("");
397  ui->m_BrowseInputDataset->addItems(paths);
398 }
static QStringList iterateHDF5datasets(QString path)
Ui::CctwqtMainWindow * ui
void CctwqtMainWindow::doCheckDataset ( QString  name)
slot

Definition at line 409 of file cctwqtmainwindow.cpp.

Referenced by CctwqtMainWindow().

410 {
411 // if (m_Window) {
412 // m_Window->printMessage(tr("CctwqtMainWindow::doCheckDataset(\"%1\")").arg(name));
413 // }
414 }
void CctwqtMainWindow::doCheckTransform ( )
slot

Definition at line 443 of file cctwqtmainwindow.cpp.

References CctwTransformer::checkTransform(), m_Application, and CctwApplication::m_Transformer.

Referenced by CctwqtMainWindow().

444 {
446 }
CctwTransformer * m_Transformer
CctwApplication * m_Application
void CctwqtMainWindow::doCompareHDF5 ( )
slot

Definition at line 645 of file cctwqtmainwindow.cpp.

References m_Application, CctwApplication::m_CompareData, and m_SetupCompareDialog.

Referenced by CctwqtMainWindow().

646 {
647  if (m_SetupCompareDialog == NULL) {
649  m_SetupCompareDialog -> show();
650  }
651 
652  m_SetupCompareDialog->raise();
653  m_SetupCompareDialog->activateWindow();
654 }
QPointer< CctwqtSetupCompareDialog > m_SetupCompareDialog
CctwComparer * m_CompareData
CctwApplication * m_Application
void CctwqtMainWindow::doEvaluateCommand ( )
slot

Definition at line 289 of file cctwqtmainwindow.cpp.

References m_Application, and ui.

Referenced by CctwqtMainWindow().

290 {
291  QString cmd = ui->m_CommandInput->text();
292 
293  QMetaObject::invokeMethod(m_Application, "evaluateCommand", Q_ARG(QString, cmd));
294 }
Ui::CctwqtMainWindow * ui
CctwApplication * m_Application
void CctwqtMainWindow::doExecuteScriptFile ( )
slot

Definition at line 453 of file cctwqtmainwindow.cpp.

References CctwApplication::executeScriptFile(), and m_Application.

Referenced by CctwqtMainWindow().

454 {
455  QString path = QFileDialog::getOpenFileName(this, "Execute Script from...",
456  m_Application->get_ScriptPath());
457 
458  if (path.length()) {
460  m_Application->set_ScriptPath(path);
461  }
462 }
void executeScriptFile(QString path)
CctwApplication * m_Application
void CctwqtMainWindow::doHalt ( )
slot

Definition at line 448 of file cctwqtmainwindow.cpp.

References m_Application.

Referenced by CctwqtMainWindow().

449 {
450  m_Application->set_Halting(true);
451 }
CctwApplication * m_Application
void CctwqtMainWindow::doLoadDependencies ( )
slot

Definition at line 497 of file cctwqtmainwindow.cpp.

References CctwApplication::loadDependencies(), and m_Application.

Referenced by CctwqtMainWindow().

498 {
499  QString path = QFileDialog::getOpenFileName(this, "Load Dependencies from...",
500  m_Application->get_DependenciesPath());
501 
502  if (path.length()) {
503  m_Application->set_DependenciesPath(path);
505  }
506 }
void loadDependencies(QString path)
CctwApplication * m_Application
void CctwqtMainWindow::doLoadSettings ( )
slot

Definition at line 475 of file cctwqtmainwindow.cpp.

References m_Application, and CctwApplication::readSettings().

Referenced by CctwqtMainWindow().

476 {
477  QString path = QFileDialog::getOpenFileName(this, "Load Settings from...",
478  m_Application->get_SettingsPath());
479 
480  if (path.length()) {
482  m_Application->set_SettingsPath(path);
483  }
484 }
CctwApplication * m_Application
void CctwqtMainWindow::doProjectInput ( )
slot

Definition at line 682 of file cctwqtmainwindow.cpp.

References CctwApplication::evaluateCommand(), m_Application, CctwApplication::m_InputData, and CctwApplication::m_Transformer.

Referenced by CctwqtMainWindow().

683 {
685 
686  if (xform) {
687  int flags = (xform->get_ProjectX() ? 1 : 0) +
688  (xform->get_ProjectY() ? 2 : 0) +
689  (xform->get_ProjectZ() ? 4 : 0);
690 
691  QString inputPath = m_Application->m_InputData->get_DataFileName();
692 
693  QFileInfo info(inputPath);
694 
695  QString dst = xform->get_ProjectDestination() + "/" + info.completeBaseName();
696  QString cmd = tr("transformer.inputProject(\"%1\", %2)").arg(dst).arg(flags);
697 
699  }
700 }
CctwChunkedData * m_InputData
CctwTransformer * m_Transformer
CctwApplication * m_Application
void evaluateCommand(QString cmd)
void CctwqtMainWindow::doProjectOutput ( )
slot

Definition at line 702 of file cctwqtmainwindow.cpp.

References CctwApplication::evaluateCommand(), m_Application, CctwApplication::m_OutputData, and CctwApplication::m_Transformer.

Referenced by CctwqtMainWindow().

703 {
705 
706  if (xform) {
707  int flags = (xform->get_ProjectX() ? 1 : 0) +
708  (xform->get_ProjectY() ? 2 : 0) +
709  (xform->get_ProjectZ() ? 4 : 0);
710 
711  QString outputPath = m_Application->m_OutputData->get_DataFileName();
712 
713  QFileInfo info(outputPath);
714 
715  QString dst = xform->get_ProjectDestination() + "/" + info.completeBaseName();
716  QString cmd = tr("transformer.outputProject(\"%1\", %2)").arg(dst).arg(flags);
717 
719  }
720 }
CctwChunkedData * m_OutputData
CctwTransformer * m_Transformer
CctwApplication * m_Application
void evaluateCommand(QString cmd)
void CctwqtMainWindow::doSaveDependencies ( )
slot

Definition at line 486 of file cctwqtmainwindow.cpp.

References m_Application, and CctwApplication::saveDependencies().

Referenced by CctwqtMainWindow().

487 {
488  QString path = QFileDialog::getSaveFileName(this, "Save Dependencies in...",
489  m_Application->get_DependenciesPath());
490 
491  if (path.length()) {
492  m_Application->set_DependenciesPath(path);
494  }
495 }
void saveDependencies(QString path)
CctwApplication * m_Application
void CctwqtMainWindow::doSaveSettings ( )
slot

Definition at line 464 of file cctwqtmainwindow.cpp.

References m_Application, and CctwApplication::writeSettings().

Referenced by CctwqtMainWindow().

465 {
466  QString path = QFileDialog::getSaveFileName(this, "Save Settings in...",
467  m_Application->get_SettingsPath());
468 
469  if (path.length()) {
470  m_Application->set_SettingsPath(path);
472  }
473 }
CctwApplication * m_Application
void CctwqtMainWindow::doSetupOutput ( )
slot

Definition at line 416 of file cctwqtmainwindow.cpp.

References m_Application, CctwApplication::m_OutputData, and m_SetupOutputDialog.

Referenced by CctwqtMainWindow().

417 {
418  if (m_SetupOutputDialog == NULL) {
420  m_SetupOutputDialog -> show();
421  }
422 
423  m_SetupOutputDialog->raise();
424  m_SetupOutputDialog->activateWindow();
425 }
CctwChunkedData * m_OutputData
QPointer< CctwqtSetupOutputDialog > m_SetupOutputDialog
CctwApplication * m_Application
void CctwqtMainWindow::doSetupTransform ( )
slot

Definition at line 427 of file cctwqtmainwindow.cpp.

References m_Application, and m_SetupTransformDialog.

Referenced by CctwqtMainWindow().

428 {
429  if (m_SetupTransformDialog == NULL) {
431  m_SetupTransformDialog -> show();
432  }
433 
434  m_SetupTransformDialog->raise();
435  m_SetupTransformDialog->activateWindow();
436 }
QPointer< CctwqtSetupTransformDialog > m_SetupTransformDialog
CctwApplication * m_Application
void CctwqtMainWindow::doTransform ( )
slot

Definition at line 438 of file cctwqtmainwindow.cpp.

References m_Application, CctwApplication::m_Transformer, and CctwTransformer::transform().

Referenced by CctwqtMainWindow().

439 {
441 }
CctwTransformer * m_Transformer
CctwApplication * m_Application
void CctwqtMainWindow::onProgressUpdate ( )
slot

Definition at line 597 of file cctwqtmainwindow.cpp.

References m_Application, and ui.

Referenced by CctwqtMainWindow().

598 {
599  int prog = m_Application->get_Progress();
600  int lim = m_Application->get_ProgressLimit();
601 
602  ui->m_ProgressBar->setMaximum(lim);
603  ui->m_ProgressBar->setValue(prog);
604 }
Ui::CctwqtMainWindow * ui
CctwApplication * m_Application
void CctwqtMainWindow::plotCurves ( QwtPlotCurve *  c1,
QwtPlotCurve *  c2,
QwtPlotCurve *  c3,
QwtPlotCurve *  c4 
)
slot

Definition at line 606 of file cctwqtmainwindow.cpp.

References m_Zoomer, and ui.

Referenced by CctwApplication::plotCurves().

607 {
608  if (QThread::currentThread() != thread()) {
609  QMetaObject::invokeMethod(this,
610  "plotCurves",
611  Q_ARG(QwtPlotCurve*, c1),
612  Q_ARG(QwtPlotCurve*, c2),
613  Q_ARG(QwtPlotCurve*, c3),
614  Q_ARG(QwtPlotCurve*, c4));
615  } else {
616  c1->setBrush(QBrush(Qt::red));
617  c1->setStyle(QwtPlotCurve::NoCurve);
618  c1->setSymbol(new QwtSymbol(QwtSymbol::Rect,QBrush(Qt::red),QPen(Qt::red),QSize(3,3)));
619 
620  c2->setBrush(QBrush(Qt::blue));
621  c2->setStyle(QwtPlotCurve::NoCurve);
622  c2->setSymbol(new QwtSymbol(QwtSymbol::Rect,QBrush(Qt::blue),QPen(Qt::blue),QSize(3,3)));
623 
624  c3->setBrush(QBrush(Qt::green));
625  c3->setStyle(QwtPlotCurve::NoCurve);
626  c3->setSymbol(new QwtSymbol(QwtSymbol::Rect,QBrush(Qt::green),QPen(Qt::green),QSize(3,3)));
627 
628  c4->setBrush(QBrush(Qt::black));
629  c4->setStyle(QwtPlotCurve::NoCurve);
630  c4->setSymbol(new QwtSymbol(QwtSymbol::Rect,QBrush(Qt::black),QPen(Qt::black),QSize(3,3)));
631 
632  c1 -> attach(ui->m_CctwGraph);
633  c2 -> attach(ui->m_CctwGraph);
634  c3 -> attach(ui->m_CctwGraph);
635  c4 -> attach(ui->m_CctwGraph);
636 
637  ui->m_CctwGraph -> setAxisAutoScale(QwtPlot::xBottom);
638  ui->m_CctwGraph -> setAxisAutoScale(QwtPlot::yLeft);
639  ui->m_CctwGraph -> setAxisAutoScale(QwtPlot::yRight);
640 
641  m_Zoomer->setZoomBase();
642  }
643 }
QwtPlotZoomer * m_Zoomer
Ui::CctwqtMainWindow * ui
void CctwqtMainWindow::possiblyClose ( )
slot

Definition at line 257 of file cctwqtmainwindow.cpp.

Referenced by CctwqtMainWindow().

258 {
259  close();
260 }
void CctwqtMainWindow::printLine ( QString  line)
slot

Definition at line 271 of file cctwqtmainwindow.cpp.

References ui.

Referenced by CctwApplication::printLine().

272 {
273  if (QThread::currentThread() != thread()) {
274  QMetaObject::invokeMethod(this, "printLine", Q_ARG(QString, line));
275  } else {
276  ui->m_OutputMessages->append(line);
277  }
278 }
Ui::CctwqtMainWindow * ui
void CctwqtMainWindow::printMessage ( QString  msg,
QDateTime  dt = QDateTime::currentDateTime() 
)
slot

Definition at line 280 of file cctwqtmainwindow.cpp.

References ui.

Referenced by CctwApplication::printMessage().

281 {
282  if (QThread::currentThread() != thread()) {
283  QMetaObject::invokeMethod(this, "printMessage", Q_ARG(QString, msg), Q_ARG(QDateTime, dt));
284  } else {
285  ui->m_OutputMessages->append(dt.toString("yyyy MMM dd hh:mm:ss.zzz: ")+msg);
286  }
287 }
Ui::CctwqtMainWindow * ui
void CctwqtMainWindow::reportDependencies ( CctwChunkedData data,
QString  title 
)
private

Definition at line 508 of file cctwqtmainwindow.cpp.

References CctwChunkedData::chunk(), CctwChunkedData::chunkCount, CctwDataChunk::dependency(), CctwDataChunk::dependencyCount(), ui, and CctwVector3D< T >::volume().

Referenced by reportInputDependencies(), and reportOutputDependencies().

509 {
510  if (data) {
511  int maxdeps = 0;
512  int ndeps = 0;
513  int sumdeps = 0;
514  int nchnk = data->chunkCount().volume();
515 
516  for (int i=0; i < nchnk; i++) {
517  CctwDataChunk *chunk = data->chunk(i);
518 
519  if (chunk) {
520  int ct = chunk->dependencyCount();
521 
522  if (ct >= 1) {
523  ndeps++;
524  }
525 
526  if (ct > maxdeps) {
527  maxdeps = ct;
528  }
529 
530  sumdeps += ct;
531  }
532  }
533 
534  ui->m_DependenciesTable->clear();
535  ui->m_DependenciesTable->setRowCount(ndeps + 3);
536  ui->m_DependenciesTable->setColumnCount((maxdeps+1)>4 ? (maxdeps+1):4);
537 
538  ui->m_DependenciesTable->setItem(0, 0, new QTableWidgetItem(title));
539  ui->m_DependenciesTable->setItem(1, 0, new QTableWidgetItem(tr("%1 Deps").arg(ndeps)));
540  ui->m_DependenciesTable->setItem(1, 1, new QTableWidgetItem(tr("%1 Max").arg(maxdeps)));
541  ui->m_DependenciesTable->setItem(1, 2, new QTableWidgetItem(tr("%1 Sum").arg(sumdeps)));
542  ui->m_DependenciesTable->setItem(1, 3, new QTableWidgetItem(tr("%1 Avg").arg(double(sumdeps)/double(nchnk))));
543  ui->m_DependenciesTable->setItem(1, 4, new QTableWidgetItem(tr("%1 Avg-NZ").arg(double(sumdeps)/double(ndeps))));
544 
545  int r = 0;
546 
547  for (int i=0; i < nchnk; i++) {
548  CctwDataChunk *chunk = data->chunk(i);
549 
550  if (chunk) {
551  int ct = chunk->dependencyCount();
552 
553  if (ct >= 1) {
554  ui->m_DependenciesTable->setItem(r+3, 0, new QTableWidgetItem(tr("%1->[%2]").arg(i).arg(ct)));
555 
556  for (int i=0; i<ct; i++) {
557  ui->m_DependenciesTable->setItem(r+3, 1+i, new QTableWidgetItem(tr("%1").arg(chunk->dependency(i))));
558  }
559 
560  r++;
561  }
562  }
563  }
564  }
565 }
int dependencyCount() const
CctwDataChunk * chunk(int n)
CctwIntVector3D chunkCount
Ui::CctwqtMainWindow * ui
int dependency(int n) const
T volume() const
void CctwqtMainWindow::reportInputDependencies ( )
slot

Definition at line 567 of file cctwqtmainwindow.cpp.

References m_Application, CctwApplication::m_InputData, and reportDependencies().

Referenced by CctwqtMainWindow().

568 {
569  reportDependencies(m_Application->m_InputData, "Input Dependencies");
570 }
CctwChunkedData * m_InputData
void reportDependencies(CctwChunkedData *data, QString title)
CctwApplication * m_Application
void CctwqtMainWindow::reportOutputDependencies ( )
slot

Definition at line 572 of file cctwqtmainwindow.cpp.

References m_Application, CctwApplication::m_OutputData, and reportDependencies().

Referenced by CctwqtMainWindow().

573 {
574  reportDependencies(m_Application->m_OutputData, "Output Dependencies");
575 }
CctwChunkedData * m_OutputData
void reportDependencies(CctwChunkedData *data, QString title)
CctwApplication * m_Application
bool CctwqtMainWindow::wantToClose ( )
private

Definition at line 262 of file cctwqtmainwindow.cpp.

Referenced by closeEvent().

263 {
264  THREAD_CHECK;
265 
266  return QMessageBox::question(this, tr("Really Close?"),
267  tr("Do you really want to close the window?"),
268  QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok;
269 }

Member Data Documentation

CctwApplication* CctwqtMainWindow::m_Application
private
QwtLegend* CctwqtMainWindow::m_Legend
private

Definition at line 96 of file cctwqtmainwindow.h.

Referenced by CctwqtMainWindow().

QwtPlotMagnifier* CctwqtMainWindow::m_Magnifier
private

Definition at line 98 of file cctwqtmainwindow.h.

Referenced by CctwqtMainWindow().

QwtPlotPanner* CctwqtMainWindow::m_Panner
private

Definition at line 97 of file cctwqtmainwindow.h.

Referenced by CctwqtMainWindow().

QPointer<CctwqtSetupCheckImportDialog> CctwqtMainWindow::m_SetupCheckImportDialog
private

Definition at line 93 of file cctwqtmainwindow.h.

QPointer<CctwqtSetupCompareDialog> CctwqtMainWindow::m_SetupCompareDialog
private

Definition at line 94 of file cctwqtmainwindow.h.

Referenced by doCompareHDF5().

QPointer<CctwqtSetupOutputDialog> CctwqtMainWindow::m_SetupOutputDialog
private

Definition at line 91 of file cctwqtmainwindow.h.

Referenced by doSetupOutput().

QPointer<CctwqtSetupTransformDialog> CctwqtMainWindow::m_SetupTransformDialog
private

Definition at line 92 of file cctwqtmainwindow.h.

Referenced by doSetupTransform().

CctwqtTransformTester* CctwqtMainWindow::m_TransformTester
private

Definition at line 86 of file cctwqtmainwindow.h.

Referenced by CctwqtMainWindow().

QwtPlotZoomer* CctwqtMainWindow::m_Zoomer
private

Definition at line 99 of file cctwqtmainwindow.h.

Referenced by CctwqtMainWindow(), and plotCurves().

Ui::CctwqtMainWindow* CctwqtMainWindow::ui

The documentation for this class was generated from the following files: