ngscopeclient v0.1.1
MainWindow.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* ngscopeclient *
4* *
5* Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef MainWindow_h
36#define MainWindow_h
37
38#include "Dialog.h"
39#include "Session.h"
40#include "FontManager.h"
41#include "TextureManager.h"
42#include "VulkanWindow.h"
43#include "WaveformGroup.h"
44
45#include "FilterGraphEditor.h"
48#include "StreamBrowserDialog.h"
50#include "Workspace.h"
51#include "imgui_markdown.h"
52
53#include "../scopehal/PacketDecoder.h"
54
57class HistoryDialog;
58class FileBrowser;
60
62{
63public:
64 SplitGroupRequest(std::shared_ptr<WaveformGroup> group, ImGuiDir direction, StreamDescriptor stream)
65 : m_group(group)
66 , m_direction(direction)
67 , m_stream(stream)
68 {
69 auto schan = dynamic_cast<OscilloscopeChannel*>(stream.m_channel);
70 if(schan)
71 schan->AddRef();
72 }
73
75 : m_group(rhs.m_group)
76 , m_direction(rhs.m_direction)
77 , m_stream(rhs.m_stream)
78 {
79 auto schan = dynamic_cast<OscilloscopeChannel*>(rhs.m_stream.m_channel);
80 if(schan)
81 schan->AddRef();
82 }
83
84 SplitGroupRequest& operator=(const SplitGroupRequest& /*rhs*/) =delete;
85
87 {
88 auto schan = dynamic_cast<OscilloscopeChannel*>(m_stream.m_channel);
89 if(schan)
90 schan->Release();
91 }
92
93 std::shared_ptr<WaveformGroup> m_group;
94 ImGuiDir m_direction;
95 StreamDescriptor m_stream;
96};
97
102{
103public:
104 DockDialogRequest(std::shared_ptr<Dialog> dlg)
105 : m_dlg(dlg)
106 {}
107
108 std::shared_ptr<Dialog> m_dlg;
109};
110
115{
116public:
117 MainWindow(std::shared_ptr<QueueHandle> queue);
118 virtual ~MainWindow();
119
120 static bool OnMemoryPressureStatic(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize);
121 bool OnMemoryPressure(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize);
122 void LogMemoryUsage();
123
124 void AddDialog(std::shared_ptr<Dialog> dlg);
125 void RemoveFunctionGenerator(std::shared_ptr<SCPIFunctionGenerator> gen);
126
127 void OnScopeAdded(std::shared_ptr<Oscilloscope> scope, bool createViews);
128
129 void QueueSplitGroup(std::shared_ptr<WaveformGroup> group, ImGuiDir direction, StreamDescriptor stream)
130 { m_splitRequests.push_back(SplitGroupRequest(group, direction, stream)); }
131
132 void ShowChannelProperties(OscilloscopeChannel* channel);
133 void ShowInstrumentProperties(std::shared_ptr<Instrument> instrumet);
134 void ShowTriggerProperties();
135 void ShowManageInstruments();
136 void ShowSyncWizard(std::shared_ptr<TriggerGroup> group, std::shared_ptr<Oscilloscope> secondary);
137
138 void OnCursorMoved(int64_t offset);
139
141 int64_t stamp,
142 int64_t duration = 0,
143 StreamDescriptor target = StreamDescriptor(nullptr, 0));
144
149 {
151 m_streamBrowser->FlushConfigCache();
152 }
153
158 {
160 m_triggerDialog->Refresh();
161 }
162
163 void ToneMapAllWaveforms(vk::raii::CommandBuffer& cmdbuf);
164
165 void RenderWaveformTextures(
166 vk::raii::CommandBuffer& cmdbuf,
167 std::vector<std::shared_ptr<DisplayedChannel> >& channels);
168
169 void SetNeedRender()
170 { m_needRender = true; }
171
172 void ClearPersistence()
173 {
174 m_clearPersistence = true;
175 SetNeedRender();
176 }
177
178 virtual void Render();
179
180 void QueueCloseSession()
181 { m_sessionClosing = true; }
182
183 Session& GetSession()
184 { return m_session; }
185
186 float GetTraceAlpha()
187 { return m_traceAlpha; }
188
189 float GetPersistDecay()
190 { return m_persistenceDecay; }
191
192 void SetPersistDecay(float f)
193 { m_persistenceDecay = f; }
194
196 const std::string& name,
197 WaveformArea* area,
198 StreamDescriptor initialStream,
199 bool showProperties = true,
200 bool addToArea = true);
202
204
205 const std::vector<std::string>& GetEyeGradients()
206 { return m_eyeGradients; }
207
208 std::string GetEyeGradientFriendlyName(std::string internalName)
209 { return m_eyeGradientFriendlyNames[internalName]; }
210
214 std::shared_ptr<MeasurementsDialog> GetMeasurementsDialog(bool createIfNotExisting);
215
217
221 std::map<uintptr_t, std::string> GetGraphEditorGroups()
222 { return m_graphEditorGroups; }
223
224 void SetStartupSession(const std::string& path)
225 { m_startupSession = path; }
226
227protected:
228 virtual void DoRender(vk::raii::CommandBuffer& cmdBuf);
229
230 void CloseSession();
232
234 // GUI handlers
235
236 virtual void RenderUI();
237 void MainMenu();
238 void FileMenu();
239 void FileRecentMenu();
240 void ViewMenu();
241 void AddMenu();
242 void DoAddSubMenu(
243 std::vector<time_t>& timestamps,
244 std::map<time_t, std::vector<std::string> >& reverseMap,
245 const std::string& typePretty,
246 const std::string& defaultName,
247 const std::string& typeInternal
248 );
249 void AddChannelsMenu();
250 void AddImportMenu();
251 void AddGenerateMenu();
252 void SetupMenu();
253 void WindowMenu();
254 void WindowAnalyzerMenu();
255 void WindowGeneratorMenu();
256 void WindowPSUMenu();
258 void DebugMenu();
260 void HelpMenu();
261 void Toolbar();
262 void LoadToolbarIcons();
263 void ToolbarButtons();
264 void TriggerStartDropdown(float buttonsize);
265 void TriggerSingleDropdown(float buttonsize);
266 void TriggerForceDropdown(float buttonsize);
267 void TriggerStopDropdown(float buttonsize);
268 void DoTriggerDropdown(const char* action, std::shared_ptr<TriggerGroup>& group, bool& all);
269 void DockingArea();
270 void StatusBar(float height);
271
272 void LoadGradients();
273 void LoadGradient(const std::string& friendlyName, const std::string& internalName);
274 std::map<std::string, std::string> m_eyeGradientFriendlyNames;
275 std::vector<std::string> m_eyeGradients;
276
277 void LoadFilterIcons();
278 void LoadStatusBarIcons();
280 void LoadAppIcon();
281
284
286 ImVec2 m_workPos;
287
290
292 std::set< std::shared_ptr<Workspace> > m_workspaces;
293
295 std::set< std::shared_ptr<Dialog> > m_dialogs;
296
298 std::map<std::shared_ptr<SCPIMultimeter>, std::shared_ptr<Dialog> > m_meterDialogs;
299
301 std::map<std::shared_ptr<SCPIPowerSupply>, std::shared_ptr<Dialog> > m_psuDialogs;
302
304 std::map<std::shared_ptr<SCPIFunctionGenerator>, std::shared_ptr<Dialog> > m_generatorDialogs;
305
307 std::map<std::shared_ptr<SCPIBERT>, std::shared_ptr<Dialog> > m_bertDialogs;
308
310 std::map<std::shared_ptr<SCPIRFSignalGenerator>, std::shared_ptr<Dialog> > m_rfgeneratorDialogs;
311
313 std::map<std::shared_ptr<SCPILoad>, std::shared_ptr<Dialog> > m_loadDialogs;
314
316 std::map<std::shared_ptr<SCPIInstrument>, std::shared_ptr<Dialog> > m_scpiConsoleDialogs;
317
319 std::map<InstrumentChannel*, std::shared_ptr<Dialog> > m_channelPropertiesDialogs;
320
322 std::map<PacketDecoder*, std::shared_ptr<ProtocolAnalyzerDialog> > m_protocolAnalyzerDialogs;
323
325 std::vector<std::shared_ptr<WaveformGroup> > m_waveformGroups;
326
328 std::recursive_mutex m_waveformGroupsMutex;
329
331 std::vector<std::shared_ptr<WaveformGroup> > m_newWaveformGroups;
332
335
336 std::string NameNewWaveformGroup();
337
339 std::shared_ptr<Dialog> m_logViewerDialog;
340
342 std::shared_ptr<Dialog> m_metricsDialog;
343
345 std::shared_ptr<Dialog> m_preferenceDialog;
346
348 std::shared_ptr<HistoryDialog> m_historyDialog;
349
351 std::shared_ptr<TriggerPropertiesDialog> m_triggerDialog;
352
354 std::shared_ptr<ManageInstrumentsDialog> m_manageInstrumentsDialog;
355
357 std::shared_ptr<Dialog> m_persistenceDialog;
358
360 std::shared_ptr<Dialog> m_notesDialog;
361
363 std::shared_ptr<FilterGraphEditor> m_graphEditor;
364
366 std::shared_ptr<StreamBrowserDialog> m_streamBrowser;
367
369 std::shared_ptr<CreateFilterBrowser> m_filterPalette;
370
373
375 std::map<uintptr_t, std::string> m_graphEditorGroups;
376
378 std::shared_ptr<MeasurementsDialog> m_measurementsDialog;
379
380 void OnDialogClosed(const std::shared_ptr<Dialog>& dlg);
381
383 std::vector<SplitGroupRequest> m_splitRequests;
384
386 std::shared_ptr<Workspace> m_initialWorkspaceDockRequest;
387
389 std::vector<size_t> m_groupsToClose;
390
391 std::shared_ptr<WaveformGroup> GetBestGroupForWaveform(StreamDescriptor stream);
392
395
398
401
403 std::set< std::pair<OscilloscopeChannel*, WaveformArea*> > m_pendingChannelDisplayRequests;
404
406 std::string m_startupSession;
407
409 // Session state
410
413
416
417 SCPITransport* MakeTransport(const std::string& trans, const std::string& args);
418
420 // Serialization
421
422 void OnOpenFile(bool online);
423 void DoOpenFile(const std::string& sessionPath, bool online);
424 bool PreLoadSessionFromYaml(const YAML::Node& node, const std::string& dataDir, bool online);
425 bool LoadSessionFromYaml(const YAML::Node& node, const std::string& dataDir, bool online);
426public:
427 bool LoadUIConfiguration(int version, const YAML::Node& node);
428
429 void OnGraphEditorConfigModified(const std::string& blob)
430 { m_graphEditorConfigBlob = blob; }
431
432 const std::string& GetGraphEditorConfigBlob()
433 { return m_graphEditorConfigBlob; }
434
435protected:
436 void OnSaveAs();
437 void DoSaveFile(std::string sessionPath);
438 bool SaveSessionToYaml(YAML::Node& node, const std::string& dataDir);
439 void SaveLabNotes(const std::string& dataDir);
440 void LoadLabNotes(const std::string& dataDir);
441 bool SetupDataDirectory(const std::string& dataDir);
442 YAML::Node SerializeUIConfiguration();
443 YAML::Node SerializeDialogs();
444 bool LoadDialogs(const YAML::Node& node);
445
446 void RenderFileBrowser();
447
448 enum
449 {
450 BROWSE_OPEN_SESSION,
451 BROWSE_SAVE_SESSION
452 } m_fileBrowserMode;
453
455 std::shared_ptr<FileBrowser> m_fileBrowser;
456
458 std::vector<YAML::Node> m_fileBeingLoaded;
459
462
464 std::string m_sessionFileName;
465
467 std::string m_sessionDataDir;
468
470 std::string m_lastWindowTitle;
471
472public:
473 std::string GetDataDir()
474 { return m_sessionDataDir; }
475
476protected:
477
480
481protected:
482
484 // Recent item lists
485
489 std::map<std::string, time_t> m_recentInstruments;
490
491 void LoadRecentInstrumentList();
492 void SaveRecentInstrumentList();
493
497 std::map<std::string, time_t> m_recentFiles;
498
499 void LoadRecentFileList();
500 void SaveRecentFileList();
501
502public:
503 void AddToRecentInstrumentList(std::shared_ptr<SCPIInstrument> inst);
504
505protected:
506
508 // Error handling
509
510 std::string m_errorPopupTitle;
511 std::string m_errorPopupMessage;
512
513 bool m_showingLoadWarnings;
514 bool m_loadConfirmationChecked;
515
517 void RenderErrorPopup();
519public:
520 void ShowErrorPopup(const std::string& title, const std::string& msg);
521
522protected:
524 // Graphics items
525
526 TextureManager m_texmgr;
527
534
538 std::atomic<bool> m_clearPersistence;
539
541 std::unique_ptr<vk::raii::CommandPool> m_cmdPool;
542
544 std::unique_ptr<vk::raii::CommandBuffer> m_cmdBuffer;
545
546 bool DropdownButton(const char* id, float height);
547
548public:
549
550 void ResetStyle();
551
555 FontWithSize GetFontPref(const std::string& name)
556 {
557 auto desc = m_session.GetPreferences().GetFont(name.c_str());
558 return std::pair<ImFont*, float>(m_fontmgr.GetFont(desc), desc.second);
559 }
560
561 ImU32 GetColorPref(const std::string& name)
562 { return m_session.GetPreferences().GetColor(name); }
563
564 ImTextureID GetTexture(const std::string& name)
565 { return m_texmgr.GetTexture(name); }
566
567 TextureManager* GetTextureManager()
568 { return &m_texmgr; }
569
570 std::string GetIconForFilter(Filter* f);
571
573
574 ImGui::MarkdownConfig GetMarkdownConfig();
575
576protected:
577 FontManager m_fontmgr;
578
580 std::map<std::type_index, std::string> m_filterIconMap;
581
583 std::map<FunctionGenerator::WaveShape, std::string> m_waveformShapeIconMap;
584
585 void UpdateFonts();
586
588 // Status bar
589public:
590
591 void AddStatusHelp(const std::string& icon, const std::string& text)
592 { m_statusHelp[icon] = text; }
593
594protected:
595 std::map<std::string, std::string> m_statusHelp;
596
598 // Performance counters
599
600protected:
601 int64_t m_toneMapTime;
602
603public:
604 int64_t GetToneMapTime()
605 { return m_toneMapTime; }
606};
607
608#endif
MemoryPressureLevel
Levels of memory pressure.
Definition: AcceleratorBuffer.h:67
MemoryPressureType
Types of memory pressure.
Definition: AcceleratorBuffer.h:84
Declaration of Dialog.
Declaration of FilterGraphEditor.
Declaration of FontManager.
Declaration of ManageInstrumentsDialog.
Declaration of ProtocolAnalyzerDialog.
Declaration of Session.
Declaration of StreamBrowserDialog.
Declaration of TextureManager.
Declaration of TriggerPropertiesDialog.
Declaration of VulkanWindow.
Declaration of WaveformGroup.
Declaration of Workspace.
Definition: CreateFilterBrowser.h:44
Pending request to dock a dialog as a top level tab (TODO other options)
Definition: MainWindow.h:102
Abstract base class for a dialog that displays a file picker window.
Definition: FileBrowser.h:44
Abstract base class for all filter graph blocks which are not physical instrument channels.
Definition: Filter.h:95
Definition: FontManager.h:49
ImFont * GetFont(FontDescription desc)
Gets the font, if any, for the provided description.
Definition: FontManager.h:59
WaveShape
Predefined waveform shapes.
Definition: FunctionGenerator.h:55
UI for the history system.
Definition: HistoryDialog.h:47
Top level application window.
Definition: MainWindow.h:115
void DebugSCPIConsoleMenu()
Runs the Debug | SCPI Console menu.
Definition: MainWindow_Menus.cpp:815
std::string m_lastWindowTitle
Last window title set (glfw doesnt let us get this)
Definition: MainWindow.h:470
std::vector< YAML::Node > m_fileBeingLoaded
YAML structure for file we're currently loading.
Definition: MainWindow.h:458
void AddChannelsMenu()
Run the Add | Channels menu.
Definition: MainWindow_Menus.cpp:368
void AddAreaForStreamIfNotAlreadyVisible(StreamDescriptor stream)
Makes sure we have at least one waveform area displaying a given stream.
Definition: MainWindow.cpp:342
std::shared_ptr< CreateFilterBrowser > m_filterPalette
Filter palette.
Definition: MainWindow.h:369
std::map< std::shared_ptr< SCPIBERT >, std::shared_ptr< Dialog > > m_bertDialogs
Map of BERTs to BERT control dialogs.
Definition: MainWindow.h:307
std::vector< SplitGroupRequest > m_splitRequests
Pending requests to split waveform groups.
Definition: MainWindow.h:383
bool LoadSessionFromYaml(const YAML::Node &node, const std::string &dataDir, bool online)
Deserialize a YAML::Node (and associated data directory) to the current session.
Definition: MainWindow.cpp:2456
bool m_fileLoadInProgress
True if we're actively loading a file.
Definition: MainWindow.h:461
Filter * CreateFilter(const std::string &name, WaveformArea *area, StreamDescriptor initialStream, bool showProperties=true, bool addToArea=true)
Creates a filter optionally and adds all of its streams to the best waveform area.
Definition: MainWindow.cpp:1999
std::string m_sessionDataDir
Current session data directory.
Definition: MainWindow.h:467
void RemoveFunctionGenerator(std::shared_ptr< SCPIFunctionGenerator > gen)
Closes the function generator dialog, if we have one.
Definition: MainWindow.cpp:1959
void OnOpenFile(bool online)
Handler for file | open menu. Spawns the browser dialog.
Definition: MainWindow.cpp:2272
std::vector< std::shared_ptr< WaveformGroup > > m_newWaveformGroups
Set of newly created waveform groups that aren't yet docked.
Definition: MainWindow.h:331
std::string m_sessionFileName
Current session file path.
Definition: MainWindow.h:464
std::map< uintptr_t, std::string > GetGraphEditorGroups()
Returns the groups we have configured for our graph editor.
Definition: MainWindow.h:221
YAML::Node SerializeUIConfiguration()
Serialize waveform areas etc to a YAML::Node.
Definition: MainWindow.cpp:3236
void OnCursorMoved(int64_t offset)
Called when a cursor is moved, so protocol analyzers can move highlights as needed.
Definition: MainWindow.cpp:2260
int m_nextWaveformGroup
Name for next autogenerated waveform group.
Definition: MainWindow.h:334
std::shared_ptr< Dialog > m_logViewerDialog
Logfile viewer.
Definition: MainWindow.h:339
Session m_session
Our session object.
Definition: MainWindow.h:412
std::atomic< bool > m_clearPersistence
True if we should clear persistence on the next render pass.
Definition: MainWindow.h:538
bool m_openOnline
True if the pending file is to be opened online.
Definition: MainWindow.h:479
void WindowPSUMenu()
Run the Window | Power Supply menu.
Definition: MainWindow_Menus.cpp:741
std::string GetIconForFilter(Filter *f)
Gets the icon to use for a filter.
Definition: MainWindow_Icons.cpp:637
std::set< std::shared_ptr< Dialog > > m_dialogs
All dialogs and other pop-up UI elements.
Definition: MainWindow.h:295
void LoadStatusBarIcons()
Load icons for the status bar.
Definition: MainWindow_Icons.cpp:256
std::map< std::string, time_t > m_recentInstruments
List of recently used instruments.
Definition: MainWindow.h:489
void LoadToolbarIcons()
Load toolbar icons from disk if preferences changed.
Definition: MainWindow_Icons.cpp:799
void RefreshStreamBrowserDialog()
Update the timebase properties dialog.
Definition: MainWindow.h:148
static bool OnMemoryPressureStatic(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize)
Static wrapper for calling OnMemoryPressure.
Definition: MainWindow.cpp:3570
void WindowMenu()
Run the Window menu.
Definition: MainWindow_Menus.cpp:533
void DebugMenu()
Run the Debug menu.
Definition: MainWindow_Menus.cpp:850
void WindowGeneratorMenu()
Run the Window | Generator menu.
Definition: MainWindow_Menus.cpp:697
void RefreshTriggerPropertiesDialog()
Update the trigger properties dialog.
Definition: MainWindow.h:157
std::map< InstrumentChannel *, std::shared_ptr< Dialog > > m_channelPropertiesDialogs
Map of channels to properties dialogs.
Definition: MainWindow.h:319
std::shared_ptr< FileBrowser > m_fileBrowser
Browser for pending file loads.
Definition: MainWindow.h:455
std::string GetIconForWaveformShape(FunctionGenerator::WaveShape shape)
Gets the icon to use for a given wave shape.
Definition: MainWindow_Icons.cpp:787
std::shared_ptr< Workspace > m_initialWorkspaceDockRequest
Pending requests to dock initial stuff.
Definition: MainWindow.h:386
void ViewMenu()
Run the View menu.
Definition: MainWindow_Menus.cpp:225
void LoadFilterIcons()
Load icons for the filter graph.
Definition: MainWindow_Icons.cpp:278
std::vector< std::shared_ptr< WaveformGroup > > m_waveformGroups
Waveform groups.
Definition: MainWindow.h:325
std::map< std::shared_ptr< SCPIRFSignalGenerator >, std::shared_ptr< Dialog > > m_rfgeneratorDialogs
Map of RF generators to generator control dialogs.
Definition: MainWindow.h:310
ImVec2 m_workPos
Start position of the viewport minus the menu and toolbar.
Definition: MainWindow.h:286
void AddMenu()
Run the Add menu.
Definition: MainWindow_Menus.cpp:247
std::map< std::type_index, std::string > m_filterIconMap
Map of filter types to class names.
Definition: MainWindow.h:580
std::shared_ptr< Dialog > m_notesDialog
Lab notes.
Definition: MainWindow.h:360
void NavigateToTimestamp(int64_t stamp, int64_t duration=0, StreamDescriptor target=StreamDescriptor(nullptr, 0))
Scrolls all waveform groups so that the specified timestamp is visible.
Definition: MainWindow.cpp:1417
void FileRecentMenu()
Runs the File | Recent menu.
Definition: MainWindow_Menus.cpp:174
void AddImportMenu()
Run the Add | Import menu.
Definition: MainWindow_Menus.cpp:421
void RenderErrorPopup()
Popup message when something big goes wrong.
Definition: MainWindow.cpp:1763
std::shared_ptr< MeasurementsDialog > m_measurementsDialog
Measurements dialog.
Definition: MainWindow.h:378
std::shared_ptr< Dialog > m_preferenceDialog
Preferences.
Definition: MainWindow.h:345
FontWithSize GetFontPref(const std::string &name)
Returns a font, given the name of a preference setting.
Definition: MainWindow.h:555
std::map< std::shared_ptr< SCPIPowerSupply >, std::shared_ptr< Dialog > > m_psuDialogs
Map of PSUs to power supply control dialogs.
Definition: MainWindow.h:301
std::shared_ptr< Dialog > m_persistenceDialog
Persistence settings.
Definition: MainWindow.h:357
void RenderReconnectPopup()
Popup message when reconnecting to a session.
Definition: MainWindow.cpp:1722
std::map< uintptr_t, std::string > m_graphEditorGroups
Group IDs and names for the graph editor.
Definition: MainWindow.h:375
std::unique_ptr< vk::raii::CommandPool > m_cmdPool
Command pool for allocating our command buffers.
Definition: MainWindow.h:541
std::unique_ptr< vk::raii::CommandBuffer > m_cmdBuffer
Command buffer used during rendering operations.
Definition: MainWindow.h:544
bool SetupDataDirectory(const std::string &dataDir)
Make sure the data directory exists.
Definition: MainWindow.cpp:3150
void WindowAnalyzerMenu()
Run the Window | Analyzer menu.
Definition: MainWindow_Menus.cpp:650
void LoadWaveformShapeIcons()
Load icons for wave shape preview.
Definition: MainWindow_Icons.cpp:690
std::map< std::shared_ptr< SCPIInstrument >, std::shared_ptr< Dialog > > m_scpiConsoleDialogs
Map of instruments to SCPI console dialogs.
Definition: MainWindow.h:316
void LoadLabNotes(const std::string &dataDir)
Loads the lab notes from Markdown files in the data directory.
Definition: MainWindow.cpp:3052
void OnSaveAs()
Handler for file | save as menu. Spawns the browser dialog.
Definition: MainWindow.cpp:2288
std::map< PacketDecoder *, std::shared_ptr< ProtocolAnalyzerDialog > > m_protocolAnalyzerDialogs
Map of filters to analyzer dialogs.
Definition: MainWindow.h:322
std::map< FunctionGenerator::WaveShape, std::string > m_waveformShapeIconMap
Map of Waveform Shapes to icons.
Definition: MainWindow.h:583
bool PreLoadSessionFromYaml(const YAML::Node &node, const std::string &dataDir, bool online)
Sanity check a YAML::Node (and associated data directory) to the current session without fully loadin...
Definition: MainWindow.cpp:2422
void UpdateFonts()
Font.
Definition: MainWindow.cpp:1975
std::string m_graphEditorConfigBlob
Config blob for filter graph editor.
Definition: MainWindow.h:372
std::map< std::shared_ptr< SCPILoad >, std::shared_ptr< Dialog > > m_loadDialogs
Map of loads to control dialogs.
Definition: MainWindow.h:313
std::shared_ptr< TriggerPropertiesDialog > m_triggerDialog
Trigger properties.
Definition: MainWindow.h:351
float m_traceAlpha
Trace alpha.
Definition: MainWindow.h:397
std::shared_ptr< ManageInstrumentsDialog > m_manageInstrumentsDialog
Manage instruments.
Definition: MainWindow.h:354
void DoSaveFile(std::string sessionPath)
Actually save a file (may be triggered by file|save or file|save as)
Definition: MainWindow.cpp:2949
void FindAreaForStream(WaveformArea *area, StreamDescriptor stream)
Given a stream and optionally a WaveformArea, adds the stream to some area.
Definition: MainWindow.cpp:2075
float m_persistenceDecay
Persistence decay factor.
Definition: MainWindow.h:400
SCPITransport * MakeTransport(const std::string &trans, const std::string &args)
Helper function for creating a transport and printing an error if the connection is unsuccessful.
Definition: MainWindow.cpp:1670
void HelpMenu()
Run the Help menu.
Definition: MainWindow_Menus.cpp:874
std::map< std::shared_ptr< SCPIFunctionGenerator >, std::shared_ptr< Dialog > > m_generatorDialogs
Map of generators to generator control dialogs.
Definition: MainWindow.h:304
void ToneMapAllWaveforms(vk::raii::CommandBuffer &cmdbuf)
Run the tone-mapping shader on all of our waveforms.
Definition: MainWindow.cpp:560
std::shared_ptr< StreamBrowserDialog > m_streamBrowser
Stream browser.
Definition: MainWindow.h:366
bool LoadDialogs(const YAML::Node &node)
Load dialog configuration.
Definition: MainWindow.cpp:2729
ImVec2 m_workSize
Size position of the viewport minus the menu and toolbar.
Definition: MainWindow.h:289
std::shared_ptr< WaveformGroup > GetBestGroupForWaveform(StreamDescriptor stream)
Figure out what group to use for a newly added stream, based on unit compatibility etc.
Definition: MainWindow.cpp:366
void DoOpenFile(const std::string &sessionPath, bool online)
Actually open a file (may be triggered by dialog, command line request, or recent file menu)
Definition: MainWindow.cpp:2332
void AddGenerateMenu()
Run the Add | Generate menu.
Definition: MainWindow_Menus.cpp:456
void ShowErrorPopup(const std::string &title, const std::string &msg)
Opens the error popup.
Definition: MainWindow.cpp:1713
void LoadGradient(const std::string &friendlyName, const std::string &internalName)
Load a single gradient.
Definition: MainWindow.cpp:863
std::map< std::string, time_t > m_recentFiles
List of recently used files.
Definition: MainWindow.h:497
void InitializeDefaultSession()
Creates a new session initialized with some default windows.
Definition: MainWindow.cpp:215
std::set< std::pair< OscilloscopeChannel *, WaveformArea * > > m_pendingChannelDisplayRequests
Pending requests to display a channel in a waveform area (from CreateFilter())
Definition: MainWindow.h:403
void SetupMenu()
Run the Setup menu.
Definition: MainWindow_Menus.cpp:493
void SaveLabNotes(const std::string &dataDir)
Saves the lab notes to Markdown files in the data directory.
Definition: MainWindow.cpp:3004
std::map< std::shared_ptr< SCPIMultimeter >, std::shared_ptr< Dialog > > m_meterDialogs
Map of multimeters to meter control dialogs.
Definition: MainWindow.h:298
void LoadGradients()
Load gradient images.
Definition: MainWindow.cpp:844
std::shared_ptr< Dialog > m_metricsDialog
Performance metrics.
Definition: MainWindow.h:342
YAML::Node SerializeDialogs()
Serializes the list of open dialogs.
Definition: MainWindow.cpp:3318
std::string m_startupSession
Pending request to open a session.
Definition: MainWindow.h:406
void MainMenu()
Run the top level menu bar.
Definition: MainWindow_Menus.cpp:103
void WindowMultimeterMenu()
Run the Window | Multimeter menu.
Definition: MainWindow_Menus.cpp:778
bool SaveSessionToYaml(YAML::Node &node, const std::string &dataDir)
Serialize the current session to a YAML::Node.
Definition: MainWindow.cpp:3102
bool m_showDemo
Enable flag for main imgui demo window.
Definition: MainWindow.h:283
void DoAddSubMenu(std::vector< time_t > &timestamps, std::map< time_t, std::vector< std::string > > &reverseMap, const std::string &typePretty, const std::string &defaultName, const std::string &typeInternal)
Run the Add | (instrument type) submenu.
Definition: MainWindow_Menus.cpp:290
bool m_sessionClosing
True if a close-session request came in this frame.
Definition: MainWindow.h:415
void OnScopeAdded(std::shared_ptr< Oscilloscope > scope, bool createViews)
Handles creation of a new oscilloscope.
Definition: MainWindow.cpp:394
void OnFilterReconfigured(Filter *f)
Handle a filter being reconfigured.
Definition: MainWindow.cpp:2240
std::shared_ptr< HistoryDialog > m_historyDialog
History.
Definition: MainWindow.h:348
std::vector< size_t > m_groupsToClose
Pending requests to close waveform groups.
Definition: MainWindow.h:389
std::recursive_mutex m_waveformGroupsMutex
Mutex for controlling access to m_waveformGroups.
Definition: MainWindow.h:328
bool m_needRender
True if a resize or other event this frame requires we re-rasterize waveforms.
Definition: MainWindow.h:533
int m_toolbarIconSize
Cached toolbar icon size.
Definition: MainWindow.h:394
std::shared_ptr< MeasurementsDialog > GetMeasurementsDialog(bool createIfNotExisting)
Return the measurements dialog, if we have one.
Definition: MainWindow.cpp:1696
std::shared_ptr< FilterGraphEditor > m_graphEditor
Filter graph editor.
Definition: MainWindow.h:363
std::set< std::shared_ptr< Workspace > > m_workspaces
Workspaces (can't be with other dialogs because they can contain other stuff)
Definition: MainWindow.h:292
void RenderFileBrowser()
Runs the file browser dialog.
Definition: MainWindow.cpp:2303
void RenderLoadWarningPopup()
Popup message when loading a file that might not match the current hardware setup.
Definition: MainWindow.cpp:1811
void FileMenu()
Run the File menu.
Definition: MainWindow_Menus.cpp:121
Definition: MeasurementsDialog.h:42
Definition: MultimeterDialog.h:42
A single channel on an oscilloscope.
Definition: OscilloscopeChannel.h:49
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
A Session stores all of the instrument configuration and other state the user has open.
Definition: Session.h:95
Definition: MainWindow.h:62
Descriptor for a single stream coming off a channel.
Definition: StreamDescriptor.h:46
Manages loading and saving texture resources to files.
Definition: TextureManager.h:105
A GLFW window containing a Vulkan surface.
Definition: VulkanWindow.h:44
A WaveformArea is a plot that displays one or more OscilloscopeChannel's worth of data.
Definition: WaveformArea.h:446