DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
WidefieldMicroscopeWidget.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
8#pragma once
9
10#include "stdafx.h"
11#include "DynExpCore.h"
14
15namespace Ui
16{
17 class WidefieldMicroscope;
18}
19
21{
22 class WidefieldMicroscope;
23 class WidefieldMicroscopeData;
24
25 enum class StateType {
26 DummyState, // To be temporarily replaced by a StataMachine's context.
32 Ready,
63 Waiting,
64 WaitingFinished, // To be temporarily replaced by a StataMachine's context.
95 };
96
98
100 {
101 Q_OBJECT
102
103 private:
123
125
126 public:
128
131
132 bool AllowResize() const noexcept override final { return true; }
133 bool AllowDocked() const noexcept override final { return false; }
134
135 const WidefieldMicroscope& GetCastOwner() const noexcept;
136
137 void InitializeUI(Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData);
138 void SetUIState(const StateMachineStateType* State, const Util::StateMachineContext<StateMachineStateType>* Context,
139 Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData);
140 void UpdateUIData(Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData);
141 void UpdateWidefieldUIData(Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData);
142 void UpdateConfocalUIData(Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData);
143 void UpdateHBTUIData(Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData);
144 void UpdateAutoMeasureUIData(Util::SynchronizedPointer<WidefieldMicroscopeData>& ModuleData, bool IsCharacterizingSample);
145
146 const auto GetUI() const noexcept { return ui.get(); }
148 const auto& GetMainGraphicsView() const noexcept { return MainGraphicsView; }
149 bool GetUIInitialized() const noexcept { return UIInitialized; }
150
151 void SetMainGraphicsImage(const QImage& Image) noexcept;
152 void UpdateScene();
153
154 private:
156
157 bool eventFilter(QObject* obj, QEvent* event) override;
158 virtual void resizeEvent(QResizeEvent* event) override;
159
165
166 std::unique_ptr<Ui::WidefieldMicroscope> ui;
168
170
173 QGraphicsPixmapItem* MainGraphicsPixmapItem;
174 QGraphicsScene* MainGraphicsScene;
177
179
185
188
190
191 bool UIInitialized = false;
192
193 QPoint MarkerPos;
194 QPointF SamplePos;
197
198 private slots:
199 void OnSaveImageClicked();
200 void OnZoomResetClicked();
201 void OnZoomInClicked();
202 void OnZoomOutClicked();
203 void OnZoomFitClicked(bool Checked);
204 void OnImageMouseMove(QMouseEvent* Event);
205 void OnCellIDContextMenuRequested(const QPoint& Position);
206 void OnEmitterListCellClicked(int Row, int Column);
207 void OnEmitterListCellDoubleClicked(int Row, int Column);
208 void OnEmitterListContextMenuRequested(const QPoint& Position);
219 };
220}
Defines DynExp's core module as an interface between the UI and DynExp objects.
C++ backend of the QDynExpLineGraph QML component.
C++ backend of the QDynExpSurfaceGraph QML component.
bool eventFilter(QObject *obj, QEvent *event) override
void UpdateHBTUIData(Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData)
Util::MarkerGraphicsView::MarkerType::IDType MarkerID
void UpdateConfocalUIData(Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData)
void SetUIState(const StateMachineStateType *State, const Util::StateMachineContext< StateMachineStateType > *Context, Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData)
void UpdateUIData(Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData)
bool StoreTWEmitterListSelection()
Stores the values of the respective cells of ui.TWEmitterList's currently selected row in MarkerPos a...
virtual void resizeEvent(QResizeEvent *event) override
void InitializeUI(Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData)
void UpdateAutoMeasureUIData(Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData, bool IsCharacterizingSample)
bool AllowResize() const noexcept override final
Indicates the resizing behavior of the user interface window. Override to adjust.
DynExpQuick::DynExpSurfaceGraphBackend * ConfocalGraph
void UpdateWidefieldUIData(Util::SynchronizedPointer< WidefieldMicroscopeData > &ModuleData)
const WidefieldMicroscope & GetCastOwner() const noexcept
bool AllowDocked() const noexcept override final
Indicates the docking behavior of the user interface window. Override to adjust.
Window class for Qt-based user interfaces belonging to DynExp modules. User interface Qt window class...
Definition Module.h:1396
QModuleBase & Owner
Module owning this user interface window (reference, because it should never change nor be nullptr).
Definition Module.h:1486
QModuleWidget(QModuleBase &Owner, QWidget *Parent=nullptr)
Constructs a QModuleWidget instance.
Definition Module.cpp:451
Implements a QGraphicsView the user can interact with to insert graphical markers....
Definition QtUtil.h:379
State machine context as used by class StateMachine. A state machine context holds a map with keys an...
Definition Util.h:1420
State machine state as used by class StateMachine. A state mainly wraps a state function of the membe...
Definition Util.h:1363
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
Accumulates include statements to provide a precompiled header.
const Util::StateMachineContext< StateMachineStateType > * CurrentContext