2 #include "ScopeDefines.h"
3 #include "HistogramView.h"
4 #include "controllers/ScopeController.h"
6 #include "helpers/Active.h"
7 #include "ThirdParty/ToolbarHelper.h"
14 typedef CWinTraits<WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE>
CHistogramFrameTraits;
18 :
public CFrameWindowImpl<CHistogramFrame, CWindow, CHistogramFrameTraits>
19 ,
public CUpdateUI<CHistogramFrame>
20 ,
public CToolBarHelper<CHistogramFrame>
75 DECLARE_FRAME_WND_CLASS(NULL, IDR_HISTOGRAM)
84 UPDATE_ELEMENT(IDC_OPTIMIZE, UPDUI_TOOLBAR)
85 UPDATE_ELEMENT(IDC_FULLRANGE, UPDUI_TOOLBAR)
86 UPDATE_ELEMENT(IDC_LOGHISTOGRAM, UPDUI_TOOLBAR)
87 UPDATE_ELEMENT(0, UPDUI_STATUSBAR)
88 UPDATE_ELEMENT(1, UPDUI_STATUSBAR)
89 UPDATE_ELEMENT(2, UPDUI_STATUSBAR)
95 COMMAND_ID_HANDLER_EX(IDC_OPTIMIZE,
OnOptimize)
101 CHAIN_MSG_MAP(CHistogramFrameType)
102 CHAIN_CLIENT_COMMANDS()
106 void OnToolBarCombo(HWND hWndCombo, UINT nID,
int nSel, LPCTSTR lpszText, DWORD_PTR dwItemData) {}
111 virtual void OnFinalMessage(HWND );
117 int OnCreate(LPCREATESTRUCT lpCreateStruct);
123 void OnSizing(UINT fwSide, LPRECT pRect);
126 void OnOptimize(UINT uNotifyCode,
int nID, CWindow wndCtl);
129 void OnFullRange(UINT uNotifyCode,
int nID, CWindow wndCtl);
Main controller of microscope hardware and acquisition, also interface to the GUI.
const uint32_t channels
number of channels for this area
Thread-safe lock-free bool to signal a requested stop to the worker function currently executed in th...
void OnFullRange(UINT uNotifyCode, int nID, CWindow wndCtl)
Calls CHistogramView::FullRange on view.
An active object implementation.
const uint32_t area
which area is the histogram for
CCommandBarCtrl m_CmdBar
the command bar.
void UpdateStatus(const RunState &_rs)
Updates the statusstr and send RunUpdateStatusbar to the Active object.
void HistoGramAndRender(scope::SCOPE_MULTIIMAGECPTR_T const _multi)
Sends the worker function 'RunHistoGramAndRender' to the ActiveObject.
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
std::wstring limitsstr
holds the current limits as string (we need a member since the lifetime of a local variable is too sh...
CWinTraits< WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, WS_EX_APPWINDOW|WS_EX_WINDOWEDGE > CHistogramFrameTraits
Traits for this window are standard CFramwWinTraits but without WS_THICKFRAME => no resize possible...
LRESULT OnUpdateHistogramLimits(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Limit bar movements are handled in the client window (CHistogramView) but we want also an update of C...
uint32_t framecount
number of the currently displayed histogram
bool attached
are we attached to ScopeController?
In here all declarations for all kinds of datatypes Scope needs.
bool RunUpdateStatusbar(StopCondition *const ac)
Worker function for all statusbar updates which will run in the Active's thread.
Manages the display of histograms.
CHistogramView view
The view inside the client window.
CFrameWindowImpl< CHistogramFrame, CWindow, CHistogramFrameTraits > CHistogramFrameType
Need to typedef this, otherwise problems with CHAIN_MSG_MAP macro...
bool loghist
do we want a logarithmic count histogram
CToolBarCtrl toolbar
the toolbar
CHistogramView is a holder for the renderer, calculates histograms, and takes care of window resizes ...
void OnLogHistogram(UINT uNotifyCode, int nID, CWindow wndCtl)
Switches between normal and logarithmic histogram.
scope::ScopeController scope_controller
our ScopeController here
CMultiPaneStatusBarCtrl m_wndStatusBar
the statusbar (multipane)
void OnOptimize(UINT uNotifyCode, int nID, CWindow wndCtl)
Calls CHistogramView::Optimize on view.
std::wstring statusstr
holds the current run status as string (we need a member since the lifetime of a local variable is to...
void OnDestroy()
Detaches frame from ScopeController, because after OnDestroy the HWND is not valid anymore...
int OnCreate(LPCREATESTRUCT lpCreateStruct)
Creates view, toolbar, statusbar etc., resizes window correctly.
void OnSizing(UINT fwSide, LPRECT pRect)
Keeps an aspect ratio of 1 by adapting pRect.