5#include "moc_WidefieldMicroscopeWidget.cpp"
6#include "ui_WidefieldMicroscope.h"
12 : CurrentState(nullptr), CurrentContext(nullptr),
13 StateLabel(new QLabel(Owner)),
14 CellIDLabel(new QLabel(Owner)), CellIDContextMenu(new QMenu(Owner)),
15 HomePosLabel(new QLabel(Owner)),
16 PumpPowerLabel(new QLabel(Owner)),
17 ImageCoordinatesGroup(new QWidget(Owner)), ImageCoordinatesLayout(new QHBoxLayout),
18 XCoordLabel(new QLabel(Owner)), YCoordLabel(new QLabel(Owner))
20 CellIDLabel->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
22 XCoordLabel->setAlignment(Qt::AlignmentFlag::AlignRight);
23 YCoordLabel->setAlignment(Qt::AlignmentFlag::AlignRight);
31 if (CurrentContext && !std::string(CurrentContext->GetDescription()).empty())
32 StateLabel->setText(QString(
" ") + CurrentContext->GetDescription());
34 StateLabel->setText(CurrentState ? (QString(
" ") + CurrentState->GetDescription()) :
"< Unknown >");
39 StateLabel->setStyleSheet(
"");
60 this->addAction(
ui->action_Stop_current_action);
61 this->addAction(
ui->action_Optimize_positions);
62 this->addAction(
ui->action_Save_Image);
63 this->addAction(
ui->action_Save_Image);
64 this->addAction(
ui->action_Zoom_in);
65 this->addAction(
ui->action_Zoom_out);
66 this->addAction(
ui->action_Zoom_reset);
67 this->addAction(
ui->action_Zoom_fit);
68 this->addAction(
ui->action_EmitterList_Edit_name);
69 this->addAction(
ui->action_EmitterList_Remove_entry);
71 ui->action_Zoom_fit->setChecked(
true);
127 ConfocalGraph->scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPreset::CameraPresetDirectlyAbove);
128 ConfocalGraph->setShadowQuality(QAbstract3DGraph::ShadowQuality::ShadowQualityNone);
130 ConfocalGraph->setSelectionMode(QAbstract3DGraph::SelectionFlag::SelectionItem);
156 ui->HBTChart->setRenderHint(QPainter::Antialiasing);
159 HBTXAxis->setTitleText(
"time in ps");
189 auto WidefieldTabIndex =
ui->TabWidget->indexOf(
ui->TabWidefield);
190 auto ConfocalTabIndex =
ui->TabWidget->indexOf(
ui->TabConfocal);
191 auto HBTTabIndex =
ui->TabWidget->indexOf(
ui->TabHBT);
196 ui->SBGeneralWidefieldPower->setMinimum(ModuleData->GetMinPumpPower());
197 ui->SBGeneralWidefieldPower->setMaximum(ModuleData->GetMaxPumpPower());
198 ui->SBGeneralWidefieldPower->setSingleStep(std::abs(ModuleData->GetMaxPumpPower() - ModuleData->GetMinPumpPower()) / 100.0);
199 ui->SBGeneralConfocalPower->setMinimum(ModuleData->GetMinPumpPower());
200 ui->SBGeneralConfocalPower->setMaximum(ModuleData->GetMaxPumpPower());
201 ui->SBGeneralConfocalPower->setSingleStep(std::abs(ModuleData->GetMaxPumpPower() - ModuleData->GetMinPumpPower()) / 100.0);
204 ui->SBGeneralFocusCurrentVoltage->setMinimum(ModuleData->GetMinFocusVoltage());
205 ui->SBGeneralFocusCurrentVoltage->setMaximum(ModuleData->GetMaxFocusVoltage());
206 ui->SBGeneralFocusCurrentVoltage->setSingleStep(std::abs(ModuleData->GetMaxFocusVoltage() - ModuleData->GetMinFocusVoltage()) / 100.0);
207 ui->SBGeneralFocusZeroVoltage->setMinimum(ModuleData->GetMinFocusVoltage());
208 ui->SBGeneralFocusZeroVoltage->setMaximum(ModuleData->GetMaxFocusVoltage());
209 ui->SBGeneralFocusZeroVoltage->setSingleStep(std::abs(ModuleData->GetMaxFocusVoltage() - ModuleData->GetMinFocusVoltage()) / 100.0);
210 ui->SBGeneralFocusConfocalOffsetVoltage->setMinimum(-std::abs(ModuleData->GetMinFocusVoltage()) - std::abs(ModuleData->GetMaxFocusVoltage()));
211 ui->SBGeneralFocusConfocalOffsetVoltage->setMaximum(std::abs(ModuleData->GetMinFocusVoltage()) + std::abs(ModuleData->GetMaxFocusVoltage()));
212 ui->SBGeneralFocusConfocalOffsetVoltage->setSingleStep(std::abs(ModuleData->GetMaxFocusVoltage() - ModuleData->GetMinFocusVoltage()) / 100.0);
215 ui->GBGeneralFocus->setVisible(
false);
218 ui->LGeneralWidefieldPower->setText(
"Power in any mode");
219 ui->LGeneralConfocalPower->setVisible(
false);
220 ui->SBGeneralConfocalPower->setVisible(
false);
221 ui->LGeneralFocusConfocalOffsetVoltage->setVisible(
false);
222 ui->SBGeneralFocusConfocalOffsetVoltage->setVisible(
false);
225 ui->SBWidefieldLEDExposureTime->setMinimum(ModuleData->GetMinCameraExposureTime().count());
226 ui->SBWidefieldLEDExposureTime->setMaximum(ModuleData->GetMaxCameraExposureTime().count());
227 ui->SBWidefieldPumpExposureTime->setMinimum(ModuleData->GetMinCameraExposureTime().count());
228 ui->SBWidefieldPumpExposureTime->setMaximum(ModuleData->GetMaxCameraExposureTime().count());
252 StatusBar.
CellIDLabel->setText(ModuleData->HasCellID() ? QString::fromStdString(ModuleData->GetCellID().IDString) :
"< Unknown cell ID. >");
254 (
"(" + QString::number(ModuleData->GetCellID().X_id) +
", " + QString::number(ModuleData->GetCellID().Y_id) +
")") :
"n/a");
256 QString HomePosString =
"home: (" + QString::number(ModuleData->GetSampleHomePosition().x) +
" nm, " + QString::number(ModuleData->GetSampleHomePosition().y) +
" nm)";
257 StatusBar.
HomePosLabel->setText(ModuleData->GetSampleHomePosition().IsEmpty() ?
"< No home position set. >" : HomePosString);
260 (
" Pump power: " + QString::number(ModuleData->GetMeasuredPumpPower(),
'f', 2) +
" V") :
"");
261 if (ModuleData->GetPumpLightTurnedOn())
267 ui->action_Save_Image->setEnabled(IsReady);
268 ui->action_Stop_current_action->setEnabled(!IsReady);
277 ui->action_Reset_CellID->setEnabled(IsReady);
280 ui->SBWidefieldLEDExposureTime->setEnabled(IsReady &&
282 ui->BWidefieldApplyLEDExposureTime->setEnabled(IsReady &&
284 ui->SBWidefieldPumpExposureTime->setEnabled(IsReady &&
286 ui->BWidefieldApplyPumpExposureTime->setEnabled(IsReady &&
289 ui->BWidefieldLEDCapture->setEnabled(IsReady);
290 ui->BWidefieldCapture->setEnabled(IsReady);
294 ui->action_EmitterList_Edit_name->setEnabled(IsReady);
295 ui->action_EmitterList_Remove_entry->setEnabled(IsReady);
296 ui->action_EmitterList_Go_to_sample_position->setEnabled(IsReady);
297 ui->action_EmitterList_Bring_marker_to_confocal_spot->setEnabled(IsReady);
298 ui->action_EmitterList_Run_characterization_from_ID->setEnabled(IsReady);
299 ui->SBConfocalWidth->setEnabled(IsReady);
300 ui->SBConfocalHeight->setEnabled(IsReady);
301 ui->SBConfocalDistPerPixel->setEnabled(IsReady);
302 ui->SBConfocalSPDExposureTime->setEnabled(IsReady);
306 ui->BConfocalScan->setEnabled(IsReady);
307 ui->action_confocal_map_save_raw_data->setEnabled(IsReady);
308 ui->SBHBTBinWidth->setEnabled(IsReady);
309 ui->SBHBTBinCount->setEnabled(IsReady);
310 ui->BHBTSaveData->setEnabled(IsReady);
311 ui->BHBT->setEnabled(IsReady);
312 ui->GBAutoMeasureGeneralSettings->setEnabled(IsReady);
313 ui->GBAutoMeasureLocalizationSettings->setEnabled(IsReady);
314 ui->GBAutoMeasureCharacterizationSettings->setEnabled(IsReady);
315 ui->GBAutoMeasureCellSettings->setEnabled(IsReady);
317 ui->BAutoMeasureRunCharacterization->setEnabled(IsReady);
325 ui->action_Toogle_LED_light_source->setChecked(ModuleData->GetLEDLightTurnedOn());
326 ui->action_Toogle_pump_light_source->setChecked(ModuleData->GetPumpLightTurnedOn());
332 if (!
ui->SBGeneralWidefieldPower->hasFocus())
333 ui->SBGeneralWidefieldPower->setValue(ModuleData->GetWidefieldPumpPower());
334 if (!
ui->SBGeneralConfocalPower->hasFocus())
335 ui->SBGeneralConfocalPower->setValue(ModuleData->GetConfocalPumpPower());
336 if (!
ui->SBGeneralFocusCurrentVoltage->hasFocus())
337 ui->SBGeneralFocusCurrentVoltage->setValue(ModuleData->GetFocusCurrentVoltage());
338 if (!
ui->SBGeneralFocusZeroVoltage->hasFocus())
339 ui->SBGeneralFocusZeroVoltage->setValue(ModuleData->GetFocusZeroVoltage());
340 if (!
ui->SBGeneralFocusConfocalOffsetVoltage->hasFocus())
341 ui->SBGeneralFocusConfocalOffsetVoltage->setValue(ModuleData->GetFocusConfocalOffsetVoltage());
346 auto SamplePosition = ModuleData->GetSamplePosition();
355 if (!
ui->SBWidefieldLEDExposureTime->hasFocus())
356 ui->SBWidefieldLEDExposureTime->setValue(ModuleData->GetLEDCameraExposureTime().count());
358 if (!
ui->SBWidefieldPumpExposureTime->hasFocus())
359 ui->SBWidefieldPumpExposureTime->setValue(ModuleData->GetWidefieldCameraExposureTime().count());
361 if (ModuleData->IsCurrentImageAvlbl())
365 ModuleData->ResetCurrentImageAvlbl();
375 if (ModuleData->HaveLocalizedPositionsChanged())
378 for (
const auto& Position : ModuleData->GetLocalizedPositions())
381 ModuleData->ResetLocalizedPositionsChanged();
387 MainGraphicsView->
AddMarker(ModuleData->GetConfocalSpotImagePosition(), QColorConstants::Red,
false, -1,
"Confocal spot");
395 const auto LocalizedPositions = ModuleData->GetLocalizedPositions();
396 ModuleData->ClearLocalizedPositions();
398 bool SortingEnabled =
ui->TWEmitterList->isSortingEnabled();
399 ui->TWEmitterList->setSortingEnabled(
false);
401 ui->TWEmitterList->clearContents();
402 ui->TWEmitterList->setRowCount(0);
405 for (
const auto& Marker : Markers)
407 const auto Row =
ui->TWEmitterList->rowCount();
408 ui->TWEmitterList->insertRow(Row);
410 QTableWidgetItem* IDItem =
new QTableWidgetItem;
412 if (Marker.GetID() >= 0)
414 IDItem->setData(Qt::EditRole, Marker.GetID());
415 IDItem->setData(Qt::UserRole, Marker.GetID());
417 auto OldLocalizedPosition = LocalizedPositions.find(Marker.GetID());
418 if (OldLocalizedPosition != LocalizedPositions.cend())
419 LocalizedEmitterState = OldLocalizedPosition->second.State;
420 ModuleData->AppendLocalizedPosition({ Marker.GetID(), { Marker.GetMarkerPos(), LocalizedEmitterState } });
425 IDItem->setText(
"n/a");
434 ui->TWEmitterList->setItem(Row,
EmitterListColumnType::Sample_x,
new QTableWidgetItem(Marker.GetImagePos().isNull() ?
"n/a" : QString::number(Marker.GetImagePos().x(),
'f', 0)));
436 ui->TWEmitterList->setItem(Row,
EmitterListColumnType::Sample_y,
new QTableWidgetItem(Marker.GetImagePos().isNull() ?
"n/a" : QString::number(Marker.GetImagePos().y(),
'f', 0)));
442 ui->TWEmitterList->setSortingEnabled(SortingEnabled);
444 ModuleData->ResetLocalizedPositionsChanged();
445 ModuleData->ResetAutoMeasureCurrentEmitter();
448 if (ModuleData->HaveLocalizedPositionsStateChanged())
450 for (
int i = 0; i <
ui->TWEmitterList->rowCount(); ++i)
453 auto Emitter = ModuleData->GetLocalizedPositions().find(ID);
454 if (Emitter == ModuleData->GetLocalizedPositions().cend())
461 ModuleData->ClearLocalizedPositionsStateChanged();
484 if (!
ui->SBConfocalWidth->hasFocus())
485 ui->SBConfocalWidth->setValue(ModuleData->GetConfocalScanWidth());
486 if (!
ui->SBConfocalHeight->hasFocus())
487 ui->SBConfocalHeight->setValue(ModuleData->GetConfocalScanHeight());
488 if (!
ui->SBConfocalDistPerPixel->hasFocus())
489 ui->SBConfocalDistPerPixel->setValue(ModuleData->GetConfocalScanDistPerPixel());
490 if (!
ui->SBConfocalOptimizationInitXYStepSize->hasFocus())
491 ui->SBConfocalOptimizationInitXYStepSize->setValue(ModuleData->GetConfocalOptimizationInitXYStepSize());
492 if (!
ui->SBConfocalOptimizationInitZStepSize->hasFocus())
493 ui->SBConfocalOptimizationInitZStepSize->setValue(ModuleData->GetConfocalOptimizationInitZStepSize());
494 if (!
ui->SBConfocalOptimizationTolerance->hasFocus())
495 ui->SBConfocalOptimizationTolerance->setValue(ModuleData->GetConfocalOptimizationTolerance());
497 if (ModuleData->HasConfocalScanSurfacePlotRows())
499 auto Rows = ModuleData->GetConfocalScanSurfacePlotRows();
510 for (
auto& Row : Rows)
518 for (
auto i =
NumItemsInArray; i < ModuleData->GetConfocalScanResults().size(); ++i)
520 const auto& ResultItem = ModuleData->GetConfocalScanResults()[i];
521 if (ResultItem.first.RowIndex < 0 || ResultItem.first.ColumnIndex < 0)
524 auto& SurfaceItem =
ConfocalSurfaceDataArray->operator[](ResultItem.first.RowIndex)->
operator[](ResultItem.first.ColumnIndex);
526 SurfaceItem.setY(ResultItem.second);
542 if (!
ui->SBHBTBinWidth->hasFocus())
543 ui->SBHBTBinWidth->setValue(ModuleData->GetHBTBinWidth().count());
544 if (!
ui->SBHBTBinCount->hasFocus())
545 ui->SBHBTBinCount->setValue(Util::NumToT<int>(ModuleData->GetHBTBinCount()));
546 if (!
ui->SBHBTAcquisitionTime->hasFocus())
547 ui->SBHBTAcquisitionTime->setValue(
static_cast<double>(ModuleData->GetHBTMaxIntegrationTime().count()) / std::chrono::microseconds::period::den);
548 ui->LEHBTTotalIntegrationTime->setText(QString::number(ModuleData->GetHBTTotalIntegrationTime().count() / std::chrono::microseconds::period::den) +
" s");
550 if (
ui->HBTChart->isVisible())
557 HBTXAxis->setRange(ModuleData->GetHBTDataPointsMinValues().x(), ModuleData->GetHBTDataPointsMaxValues().x());
558 HBTYAxis->setRange(ModuleData->GetHBTDataPointsMinValues().y(), ModuleData->GetHBTDataPointsMaxValues().y());
559 ui->LEHBTMinValue->setText(QString::number(ModuleData->GetHBTDataPointsMinValues().y()));
570 const QSignalBlocker Blocker(
ui->LEAutoMeasureSavePath);
571 ui->LEAutoMeasureSavePath->setText(QString::fromUtf16(ModuleData->GetAutoMeasureSavePath().u16string().c_str()));
574 if (!
ui->SBAutoMeasureNumberImageSets->hasFocus())
575 ui->SBAutoMeasureNumberImageSets->setValue(ModuleData->GetAutoMeasureNumberImageSets());
576 if (!
ui->SBAutoMeasureInitialImageSetWaitTime->hasFocus())
577 ui->SBAutoMeasureInitialImageSetWaitTime->setValue(ModuleData->GetAutoMeasureInitialImageSetWaitTime().count());
578 if (!
ui->SBAutoMeasureImagePositionScatterRadius->hasFocus())
579 ui->SBAutoMeasureImagePositionScatterRadius->setValue(ModuleData->GetAutoMeasureImagePositionScatterRadius());
580 if (!
ui->CBAutoMeasureLocalize->hasFocus())
581 ui->CBAutoMeasureLocalize->setCurrentIndex(ModuleData->GetAutoMeasureLocalizationType());
582 if (!
ui->SBAutoMeasureOptimizationAttempts->hasFocus())
583 ui->SBAutoMeasureOptimizationAttempts->setValue(ModuleData->GetAutoMeasureNumOptimizationAttempts());
584 if (!
ui->SBAutoMeasureOptimizationReruns->hasFocus())
585 ui->SBAutoMeasureOptimizationReruns->setValue(ModuleData->GetAutoMeasureMaxOptimizationReruns());
586 if (!
ui->SBAutoMeasureOptimizationMaxDistance->hasFocus())
587 ui->SBAutoMeasureOptimizationMaxDistance->setValue(ModuleData->GetAutoMeasureOptimizationMaxDistance());
588 if (!
ui->SBAutoMeasureCountRateThreshold->hasFocus())
589 ui->SBAutoMeasureCountRateThreshold->setValue(ModuleData->GetAutoMeasureCountRateThreshold());
590 if (!
ui->SBAutoMeasureCellRangeFromX->hasFocus())
591 ui->SBAutoMeasureCellRangeFromX->setValue(ModuleData->GetAutoMeasureCellRangeFrom().x());
592 if (!
ui->SBAutoMeasureCellRangeFromY->hasFocus())
593 ui->SBAutoMeasureCellRangeFromY->setValue(ModuleData->GetAutoMeasureCellRangeFrom().y());
594 if (!
ui->SBAutoMeasureCellRangeToX->hasFocus())
595 ui->SBAutoMeasureCellRangeToX->setValue(ModuleData->GetAutoMeasureCellRangeTo().x());
596 if (!
ui->SBAutoMeasureCellRangeToY->hasFocus())
597 ui->SBAutoMeasureCellRangeToY->setValue(ModuleData->GetAutoMeasureCellRangeTo().y());
598 if (!
ui->SBAutoMeasureCellSkipX->hasFocus())
599 ui->SBAutoMeasureCellSkipX->setValue(ModuleData->GetAutoMeasureCellSkip().x());
600 if (!
ui->SBAutoMeasureCellSkipY->hasFocus())
601 ui->SBAutoMeasureCellSkipY->setValue(ModuleData->GetAutoMeasureCellSkip().y());
603 if (ModuleData->GetAutoMeasureCurrentImageSet() >= 0 && ModuleData->GetAutoMeasureCurrentImageSet() < ModuleData->GetAutoMeasureNumberImageSets())
605 ui->LAutoMeasureCellProgress->setText(
"Recording image set " + QString::number(ModuleData->GetAutoMeasureCurrentImageSet() + 1) +
606 " / " + QString::number(ModuleData->GetAutoMeasureNumberImageSets()));
607 ui->PBAutoMeasureCellProgress->setValue(
static_cast<int>(100.0 * ModuleData->GetAutoMeasureCurrentImageSet() / ModuleData->GetAutoMeasureNumberImageSets()));
608 ui->PBAutoMeasureCellProgress->setVisible(
true);
610 else if (ModuleData->IsAutoMeasureRunning())
612 const auto EmitterCount = std::distance(ModuleData->GetAutoMeasureFirstEmitter(), ModuleData->GetLocalizedPositions().end());
613 const auto CurrentEmitter = EmitterCount - std::distance(ModuleData->GetAutoMeasureCurrentEmitter(), ModuleData->GetLocalizedPositions().end());
615 ui->LAutoMeasureCellProgress->setText(
"Emitter " + QString::number(CurrentEmitter + 1) +
616 " / " + QString::number(EmitterCount) +
", " +
617 QString::number(ModuleData->GetNumFinishedLocalizedPositions()) +
" successful, " +
618 QString::number(ModuleData->GetNumFailedLocalizedPositions()) +
" failed");
619 ui->PBAutoMeasureCellProgress->setValue(
static_cast<int>(100.0 * CurrentEmitter / EmitterCount));
620 ui->PBAutoMeasureCellProgress->setVisible(
true);
624 ui->LAutoMeasureCellProgress->setText(
"Ready");
625 ui->PBAutoMeasureCellProgress->setVisible(
false);
628 ui->GBAutoMeasureSampleProgress->setVisible(IsCharacterizingSample && ModuleData->HasCellID());
629 if (IsCharacterizingSample && ModuleData->HasCellID())
631 const auto CurrentCell = ModuleData->GetAutoMeasureCurrentCellIndex();
632 const auto CellCount = ModuleData->GetAutoMeasureCellCount();
634 ui->LAutoMeasureSampleProgress->setText(
"Cell " + QString::number(CurrentCell + 1) +
635 " / " + QString::number(CellCount));
636 ui->PBAutoMeasureSampleProgress->setValue(
static_cast<int>(100.0 * CurrentCell / CellCount));
642 MainGraphicsPixmap = QPixmap::fromImage(Image);
643 MainGraphicsPixmap.detach();
662 if (event->type() == QEvent::MouseMove)
669 return QObject::eventFilter(obj, event);
679 if (
ui->TWEmitterList->selectedItems().empty())
682 const auto Row =
ui->TWEmitterList->selectedItems()[0]->row();
696 if (Filename.isEmpty())
704 ui->action_Zoom_fit->setChecked(
false);
710 ui->action_Zoom_fit->setChecked(
false);
716 ui->action_Zoom_fit->setChecked(
false);
728 auto LocalPoint =
MainGraphicsView->mapFromGlobal(Event->globalPosition().toPoint());
765 for (
int i = 0; i <
ui->TWEmitterList->selectedItems().size(); ++i)
767 const auto Row =
ui->TWEmitterList->selectedItems()[i]->row();
780 const auto Row =
ui->TWEmitterList->selectedItems()[0]->row();
783 bool OKClicked =
false;
784 QString NewName = QInputDialog::getText(
this,
"Edit name",
785 QString(
"Enter new name for marker \"") + OldName +
"\":", QLineEdit::Normal, OldName, &OKClicked);
811 ConfocalGraph->scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPreset::CameraPresetDirectlyAbove);
820 if (Filename.isEmpty())
823 std::stringstream CSVData;
825 auto ModuleData = DynExp::dynamic_ModuleData_cast<WidefieldMicroscope>(
GetOwner().GetModuleData());
827 CSVData = ModuleData->AssembleCSVHeader(
true,
false,
false);
828 ModuleData->WriteConfocalScanResults(CSVData);
832 QMessageBox::warning(
this,
"DynExp - Error",
"Error writing data to file.");
838 if (Filename.isEmpty())
841 std::stringstream CSVData;
843 auto ModuleData = DynExp::dynamic_ModuleData_cast<WidefieldMicroscope>(
GetOwner().GetModuleData());
845 CSVData = ModuleData->AssembleCSVHeader(
false,
true,
false);
846 ModuleData->WriteHBTResults(CSVData);
850 QMessageBox::warning(
this,
"DynExp - Error",
"Error writing data to file.");
856 ".csv",
" Comma-separated values file (*.csv)");
857 if (Filename.isEmpty())
861 ui->LEAutoMeasureSavePath->setText(Filename);
866 auto ModuleData = DynExp::dynamic_ModuleData_cast<WidefieldMicroscope>(
GetOwner().GetModuleData());
868 ui->action_CharacterizationSteps_Widefield_PLE->setChecked(ModuleData->GetAutoMeasureWidefieldPLEEnabled());
869 ui->action_CharacterizationSteps_Optimize->setChecked(ModuleData->GetAutoMeasureOptimizeEnabled());
870 ui->action_CharacterizationSteps_Spectrum->setChecked(ModuleData->GetAutoMeasureSpectrumEnabled());
871 ui->action_CharacterizationSteps_Confocal_PLE->setChecked(ModuleData->GetAutoMeasureConfocalPLEEnabled());
872 ui->action_CharacterizationSteps_HBT->setChecked(ModuleData->GetAutoMeasureHBTEnabled());
Implementation of a module to control a combined widefield and confocal microscope.
static QColor GetLocalizedEmitterColor(LocalizedEmitterStateType State)
LocalizedEmitterStateType
@ SpectrumInterModuleCommunicator
@ PLEInterModuleCommunicator
@ WidefieldConfocalSwitch
static const char * GetLocalizedEmitterStateString(LocalizedEmitterStateType State)
void OnRunCharacterizationFromID(DynExp::ModuleInstance *Instance, Util::MarkerGraphicsView::MarkerType::IDType ID) const
void OnGoToSamplePos(DynExp::ModuleInstance *Instance, QPointF SamplePos) const
void OnSaveCurrentImage(DynExp::ModuleInstance *Instance, QString Filename) const
void OnBringMarkerToConfocalSpot(DynExp::ModuleInstance *Instance, QPoint MarkerPos, QPointF SamplePos) const
Implements a QGraphicsView the user can interact with to insert graphical markers....
void ZoomReset()
Resets the zoom.
void DeselectMarkers()
Deselects all selected markers.
void EnableActions(bool Enable)
const std::vector< MarkerType > & GetMarkers() const noexcept
auto contextMenu() const noexcept
void RenameMarker(const QPoint &MarkerPos, std::string_view NewName)
Assigns a name to the marker at position MarkerPos. Affects MarkersChanged.
void SelectMarker(const QPoint &MarkerPos)
Selects the marker at position MarkerPos.
bool HaveMarkersChanged() noexcept
Returns whether a marker operation has changed the stored markers. Resets the flag.
void RemoveMarker(size_t Index, bool OnlyUserDeletableMarkers=false)
Removes the n-th marker specified by Index. Affects MarkersChanged.
void AddMarker(const QPoint &MarkerPos, const QColor &Color, bool IsUserDeletable=true, MarkerType::IDType ID=-1, std::string Name={})
Adds a marker to the graphics view at position MarkerPos assigning the properties passed as arguments...
void ZoomIn()
Zooms in one step.
void ZoomOut()
Zooms out one step.
void SetCurrentImagePos(const QPointF &Pos)
void RemoveMarkers(bool OnlyUserDeletableMarkers)
Removes all markers from the graphics view. Affects MarkersChanged.
State machine context as used by class StateMachine. A state machine context holds a map with keys an...
State machine state as used by class StateMachine. A state mainly wraps a state function of the membe...
constexpr StateEnumType GetState() const noexcept
Returns the state's unique identifier.
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
constexpr auto DefaultQChartTheme
constexpr auto StatusBarRunningStyleSheet
constexpr auto DefaultQ3DTheme
QLinearGradient GetDefaultLinearGradient()
constexpr auto StatusBarBusyStyleSheet
auto MakeEvent(ReceiverType *Receiver, typename DefaultEvent< ReceiverType, std::tuple< std::remove_reference_t< ArgsTs >... > >::EventFuncPtrType EventFuncPtr, ArgsTs &&...Args)
Creates an event of type DefaultEvent.
std::string ToStr(const T &Value, int Precision=-1)
Converts a (numeric) value of type T to a std::string using operator<< of std::stringstream.
bool SaveToFile(const QString &Filename, std::string_view Text)
Saves a std::string_view to a file (using QFile). Creates a new file or truncates an existing file's ...
QString PromptSaveFilePathModule(DynExp::QModuleWidget *Parent, const QString &Title, const QString &DefaultSuffix, const QString &NameFilter)
Works as PromptOpenFilePath() but asks the user to select a single file which does not need to exist....
Accumulates include statements to provide a precompiled header.