3 #include "ScopeDefines.h"
4 #include "controllers/ScopeController.h"
5 #include "ChannelView.h"
6 #include "helpers/ScopeOverlay.h"
7 #include "helpers/ScopeOverlayResonanceSW.h"
8 #include "helpers/Active.h"
9 #include "ThirdParty/ToolbarHelper.h"
14 class D2ChannelRender;
17 class SCOPE_MULTIIMAGE_T;
18 typedef std::shared_ptr<const SCOPE_MULTIIMAGE_T> SCOPE_MULTIIMAGECPTR_T;
27 :
public CFrameWindowImpl<CChannelFrame>
28 ,
public CUpdateUI<CChannelFrame>
29 ,
public CToolBarHelper<CChannelFrame>
101 DECLARE_FRAME_WND_CLASS(NULL, IDR_CHANNELFRAME)
111 UPDATE_ELEMENT(IDC_SAMESIZE, UPDUI_TOOLBAR)
112 UPDATE_ELEMENT(IDC_DOUBLESIZE, UPDUI_TOOLBAR)
113 UPDATE_ELEMENT(IDC_HALFSIZE, UPDUI_TOOLBAR)
114 UPDATE_ELEMENT(0, UPDUI_STATUSBAR)
115 UPDATE_ELEMENT(1, UPDUI_STATUSBAR)
116 UPDATE_ELEMENT(2, UPDUI_STATUSBAR)
125 COMMAND_ID_HANDLER_EX(IDC_SAMESIZE,
OnSameSize)
127 COMMAND_ID_HANDLER_EX(IDC_HALFSIZE,
OnHalfSize)
131 CHAIN_CLIENT_COMMANDS()
135 void OnToolBarCombo(HWND hWndCombo, UINT nID,
int nSel, LPCTSTR lpszText, DWORD_PTR dwItemData);
146 int OnCreate(LPCREATESTRUCT lpCreateStruct);
154 void OnSizing(UINT fwSide, LPRECT pRect);
157 BOOL
OnMouseWheel(UINT nFlags,
short zDelta, CPoint pt);
160 void OnSameSize(UINT uCode,
int nID, HWND hwncCtrl);
166 void OnHalfSize(UINT uCode,
int nID, HWND hwncCtrl);
183 virtual
void SetHistogramLimits(const uint32_t& _channel, const uint16_t& _lower, const uint16_t& _upper);
Main controller of microscope hardware and acquisition, also interface to the GUI.
std::wstring mouseposstr
holds the current mouse position as string
Thread-safe lock-free bool to signal a requested stop to the worker function currently executed in th...
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handles mouse wheel events to change zoom or pockels cell value (wheel+Ctrl)
An active object implementation.
std::wstring framecountstr
Holds the current frame count etc as string.
std::wstring statusstr
holds the current run status as string
bool RunLayOverAndRender(StopCondition *const sc, scope::SCOPE_MULTIIMAGECPTR_T const _multi)
Worker function which will run in the Active's thread.
D2D1_POINT_2F mousepos
current mouse position in device independent pixels (for the renderer)
const uint32_t channels
number of channels in this area
CChannelView is just a dumb holder for the renderer and takes care of window resizes etc...
scope::SCOPE_OVERLAY_T overlay
Overlay of channels of the currently displayed image, use shared_ptr because it is used from differen...
CToolBarCtrl toolbar
the toolbar
virtual BOOL OnIdle()
Updates toolbar and statusbar.
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
Manages the display of images.
LRESULT OnUpdateMousePixel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Mouse movements are received in the client window (CChannelView) with the correct coordinates...
static std::array< int32_t, 4 > colorcombo_resources
The resource IDs of the channel color combo boxes.
const uint32_t area
area for this CChannelFrame
void OnHalfSize(UINT uCode, int nID, HWND hwncCtrl)
Sets window size to half the real frame size.
std::vector< ColorProps > channel_colors
Ordered by channel number.
void UncheckScaleButtons()
Unchecks all scale buttons.
CCommandBarCtrl m_CmdBar
the command bar.
int OnCreate(LPCREATESTRUCT lpCreateStruct)
Create view, toolbar, and statusbar etc.
void OnDoubleSize(UINT uCode, int nID, HWND hwncCtrl)
Sets window size to double the real frame size.
CMultiPaneStatusBarCtrl m_wndStatusBar
the statusbar
virtual void OnFinalMessage(HWND)
delete this to free the memory
void UpdateScaleText()
Updates the scale text with current values from scope_controller::GuiParameters.
void OnSameSize(UINT uCode, int nID, HWND hwncCtrl)
Sets window size to match the real frame size.
virtual void LayOverAndRender(scope::SCOPE_MULTIIMAGECPTR_T const _multi)
Sends the worker function 'RunLayOverAndRender' to the ActiveObject.
void OnSizing(UINT fwSide, LPRECT pRect)
Keeps the aspect ratio.
bool attached
are we attached to ScopeController?
bool RunUpdateStatusbar(StopCondition *const sc, scope::SCOPE_MULTIIMAGECPTR_T const _multi)
Worker function for all statusbar updates which will run in the Active's thread.
scope::SCOPE_MULTIIMAGECPTR_T current_frame
currently displayed image
virtual void SetHistogramLimits(const uint32_t &_channel, const uint16_t &_lower, const uint16_t &_upper)
Sets upper and lower limit of displayed colors for a channel.
virtual void UpdateStatus(const RunState &_rs)
Updates the statusstr and send RunUpdateStatusbar to the Active object.
scope::ScopeController scope_controller
the ScopeController kept handy here
CChannelView view
The view inside the client window.
void OnDestroy()
Detaches frame from ScopeController, because after OnDestroy the HWND is not valid anymore...