CurveDialog::CurveDialog(ObjectPtr dataObject, QWidget *parent) : DataDialog(dataObject, parent) { if (editMode() == Edit) setWindowTitle(tr("Edit Curve")); else setWindowTitle(tr("New Curve")); _curveTab = new CurveTab(this); addDataTab(_curveTab); if (editMode() == Edit) { configureTab(dataObject); } else { configureTab(0); } connect(_curveTab, SIGNAL(vectorsChanged()), this, SLOT(updateButtons())); connect(this, SIGNAL(editMultipleMode()), this, SLOT(editMultipleMode())); connect(this, SIGNAL(editSingleMode()), this, SLOT(editSingleMode())); connect(_curveTab, SIGNAL(modified()), this, SLOT(modified())); updateButtons(); }
CurveTab::CurveTab(QWidget *parent) : DataTab(parent) { setupUi(this); setTabTitle(tr("Curve")); _xError->setAllowEmptySelection(true); _yError->setAllowEmptySelection(true); _xMinusError->setAllowEmptySelection(true); _yMinusError->setAllowEmptySelection(true); _curvePlacement->setExistingPlots(Data::self()->plotList()); _xVectorLabel->setBuddy(_xVector->_vector); _yVectorLabel->setBuddy(_yVector->_vector); _xErrorLabel->setBuddy(_xError->_vector); _yErrorLabel->setBuddy(_yError->_vector); _xMinusErrorLabel->setBuddy(_xMinusError->_vector); _yMinusErrorLabel->setBuddy(_yMinusError->_vector); _xVector->setIsX(true); connect(_xVector, SIGNAL(selectionChanged(QString)), this, SIGNAL(vectorsChanged())); connect(_yVector, SIGNAL(selectionChanged(QString)), this, SIGNAL(vectorsChanged())); connect(_xMinusSameAsPlus, SIGNAL(toggled(bool)), this, SLOT(xCheckboxClicked())); connect(_yMinusSameAsPlus, SIGNAL(toggled(bool)), this, SLOT(yCheckboxClicked())); connect(_xError, SIGNAL(selectionChanged(QString)), this, SLOT(xErrorChanged())); connect(_yError, SIGNAL(selectionChanged(QString)), this, SLOT(xErrorChanged())); connect(_xVector, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified())); connect(_yVector, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified())); connect(_xError, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified())); connect(_yError, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified())); connect(_xMinusError, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified())); connect(_yMinusError, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified())); // if the content of any of the vector combos is changed (new or edit), update them all. connect(_xVector, SIGNAL(contentChanged()), this, SLOT(updateVectorCombos())); connect(_yVector, SIGNAL(contentChanged()), this, SLOT(updateVectorCombos())); connect(_xError, SIGNAL(contentChanged()), this, SLOT(updateVectorCombos())); connect(_yError, SIGNAL(contentChanged()), this, SLOT(updateVectorCombos())); connect(_xMinusError, SIGNAL(contentChanged()), this, SLOT(updateVectorCombos())); connect(_yMinusError, SIGNAL(contentChanged()), this, SLOT(updateVectorCombos())); connect(_curveAppearance, SIGNAL(modified()), this, SIGNAL(modified())); connect(_ignoreAutoScale, SIGNAL(stateChanged(int)), this, SIGNAL(modified())); connect(_xMinusSameAsPlus, SIGNAL(stateChanged(int)), this, SIGNAL(modified())); connect(_yMinusSameAsPlus, SIGNAL(stateChanged(int)), this, SIGNAL(modified())); _ignoreAutoScale->setProperty("si","I&gnore in automatic axes range calculations"); _xVectorLabel->setProperty("si","&X-axis vector:"); _yVectorLabel->setProperty("si","&Y-axis vector:"); _xErrorLabel->setProperty("si","+X e&rror bar:"); _yErrorLabel->setProperty("si","&+Y error bar:"); _xMinusErrorLabel->setProperty("si","-X error bar:"); _yMinusErrorLabel->setProperty("si","&-Y error bar:"); _xMinusSameAsPlus->setProperty("si","&Use +X error bar for -X"); _yMinusSameAsPlus->setProperty("si","U&se +Y error bar for -Y"); }
void MainWindow::setupConnections() { // Importing connect(importButton, SIGNAL(clicked()), this, SLOT(launchImageImport())); connect(filedata, SIGNAL(imagesImported()), aListWidget, SLOT(populate())); connect(filedata, SIGNAL(imagesImported()), bListWidget, SLOT(populate())); connect(filedata, SIGNAL(imagesImported()), vectorListWidget, SLOT(populate())); connect(filedata, SIGNAL(imagesImported()), this, SLOT(notifyFolderChange())); connect(filedata, SIGNAL(vectorListUpdated()), vectorListWidget, SLOT(update())); // Image selection connect(aListWidget, SIGNAL(fileClicked(int)), this, SLOT(pivAclicked(int))); connect(bListWidget, SIGNAL(fileClicked(int)), this, SLOT(pivBclicked(int))); connect(vectorListWidget, SIGNAL(fileClicked(int)), this, SLOT(vectorClicked(int))); connect(forwardButton, SIGNAL(clicked()), this, SLOT(forwardOne())); connect(backButton, SIGNAL(clicked()), this, SLOT(backwardOne())); // Image/vector viewing connect(zoomInButton, SIGNAL(clicked()), pivDisplay, SLOT(zoomIn())); connect(zoomOutButton, SIGNAL(clicked()), pivDisplay, SLOT(zoomOut())); connect(zoomFitButton, SIGNAL(clicked()), pivDisplay, SLOT(zoomFit())); // The following should be moved into settings connect(vectorToggle, SIGNAL(toggled(bool)), pivDisplay, SLOT(vectorsToggled(bool))); // connect(colourButtonFiltered, SIGNAL(clicked()), this, SLOT(chooseFilteredColour())); connect(colourButtonUnfiltered, SIGNAL(clicked()), this, SLOT(chooseUnfilteredColour())); connect(scaleSpin, SIGNAL(valueChanged(double)), settings, SLOT(setVectorScale(double))); connect(subSpin, SIGNAL(valueChanged(double)), settings, SLOT(setVectorSub(double))); connect(settings, SIGNAL(vectorSettingChanged()), pivDisplay, SLOT(vectorsChanged())); // Masking connect(maskButton, SIGNAL(clicked()), maskButton, SLOT(showMenu())); connect(filedata,SIGNAL(imagesImported()), maskDropDown, SLOT(imageLoaded())); connect(maskDropDown, SIGNAL(importMaskClicked()), filedata, SLOT(importMask())); connect(filedata, SIGNAL(maskLoaded()), maskDropDown, SLOT(maskLoaded())); connect(maskDropDown, SIGNAL(gridToggled(bool)), pivDisplay, SLOT(maskToggled(bool))); connect(maskDropDown, SIGNAL(clearMask(bool)), settings, SLOT(setIsMask(bool))); // Process tab connect(hSizeCombo, SIGNAL(activated(int)), settings, SLOT(setIntLengthX(int))); connect(vSizeCombo, SIGNAL(activated(int)), settings, SLOT(setIntLengthY(int))); connect(hSpaceSpin, SIGNAL(valueChanged(int)), settings, SLOT(setDeltaX(int))); connect(vSpaceSpin, SIGNAL(valueChanged(int)), settings, SLOT(setDeltaY(int))); // Filter tab connect(globalRangeCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged())); connect(minUedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(maxUedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(minVedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(maxVedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(globalStDevCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged())); connect(nStdDevSpin, SIGNAL(valueChanged(double)), this, SLOT(setFilterValues())); connect(localCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged())); connect(localMethodCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues())); connect(localNxNCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues())); connect(localUedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(localVedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(interpolateCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged())); connect(interpolateMethodCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues())); connect(interpolateNxNCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues())); connect(smoothCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged())); connect(smoothRadiusEdit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues())); connect(smoothNxNCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues())); // DoingPIV connect(outputFolderEdit, SIGNAL(textEdited(QString)), this, SLOT(setOutput())); connect(outputFolderButton, SIGNAL(clicked()), this, SLOT(chooseOutputFolder())); connect(outputFormatCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setOutput())); connect(correlateButton, SIGNAL(clicked()), process, SLOT(processCurrentImagePair())); connect(process, SIGNAL(currentProcessed()), pivDisplay, SLOT(displayCurrent())); connect(process, SIGNAL(currentProcessed()), output, SLOT(outputCurrent())); connect(filterButton, SIGNAL(clicked()), analysis, SLOT(filterCurrent())); connect(analysis, SIGNAL(currentFiltered()), pivDisplay, SLOT(displayCurrent())); connect(analysis, SIGNAL(currentFiltered()), output, SLOT(outputCurrent())); connect(batchButton, SIGNAL(clicked()), process, SLOT(launchBatchWindow())); connect(process, SIGNAL(batchProcessed()), this, SLOT(batchDone())); connect(pivDisplay, SIGNAL(mouseMoved(QPointF)), this, SLOT(updatePositionLabel(QPointF))); // Data Quality connect(filterSNRCheck, SIGNAL(toggled(bool)), this, SLOT(qualityChanged())); connect(snrEdit, SIGNAL(textEdited(QString)), this, SLOT(qualityChanged())); connect(filterIntCheck, SIGNAL(toggled(bool)), this, SLOT(qualityChanged())); connect(intensityEdit, SIGNAL(textEdited(QString)), this, SLOT(qualityChanged())); }