ngscopeclient v0.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
52#include "../scopehal/PacketDecoder.h"
53
56class HistoryDialog;
57class FileBrowser;
59
61{
62public:
63 SplitGroupRequest(std::shared_ptr<WaveformGroup> group, ImGuiDir direction, StreamDescriptor stream)
64 : m_group(group)
65 , m_direction(direction)
66 , m_stream(stream)
67 {
68 auto schan = dynamic_cast<OscilloscopeChannel*>(stream.m_channel);
69 if(schan)
70 schan->AddRef();
71 }
72
74 : m_group(rhs.m_group)
75 , m_direction(rhs.m_direction)
76 , m_stream(rhs.m_stream)
77 {
78 auto schan = dynamic_cast<OscilloscopeChannel*>(rhs.m_stream.m_channel);
79 if(schan)
80 schan->AddRef();
81 }
82
83 SplitGroupRequest& operator=(const SplitGroupRequest& /*rhs*/) =delete;
84
86 {
87 auto schan = dynamic_cast<OscilloscopeChannel*>(m_stream.m_channel);
88 if(schan)
89 schan->Release();
90 }
91
92 std::shared_ptr<WaveformGroup> m_group;
93 ImGuiDir m_direction;
94 StreamDescriptor m_stream;
95};
96
101{
102public:
103 DockDialogRequest(std::shared_ptr<Dialog> dlg)
104 : m_dlg(dlg)
105 {}
106
107 std::shared_ptr<Dialog> m_dlg;
108};
109
114{
115public:
116 MainWindow(std::shared_ptr<QueueHandle> queue);
117 virtual ~MainWindow();
118
119 static bool OnMemoryPressureStatic(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize);
120 bool OnMemoryPressure(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize);
121 void LogMemoryUsage();
122
123 void AddDialog(std::shared_ptr<Dialog> dlg);
124 void RemoveFunctionGenerator(std::shared_ptr<SCPIFunctionGenerator> gen);
125
126 void OnScopeAdded(std::shared_ptr<Oscilloscope> scope, bool createViews);
127
128 void QueueSplitGroup(std::shared_ptr<WaveformGroup> group, ImGuiDir direction, StreamDescriptor stream)
129 { m_splitRequests.push_back(SplitGroupRequest(group, direction, stream)); }
130
131 void ShowChannelProperties(OscilloscopeChannel* channel);
132 void ShowInstrumentProperties(std::shared_ptr<Instrument> instrumet);
133 void ShowTriggerProperties();
134 void ShowManageInstruments();
135 void ShowSyncWizard(std::shared_ptr<TriggerGroup> group, std::shared_ptr<Oscilloscope> secondary);
136
137 void OnCursorMoved(int64_t offset);
138
140 int64_t stamp,
141 int64_t duration = 0,
142 StreamDescriptor target = StreamDescriptor(nullptr, 0));
143
148 {
150 m_streamBrowser->FlushConfigCache();
151 }
152
157 {
159 m_triggerDialog->Refresh();
160 }
161
162 void ToneMapAllWaveforms(vk::raii::CommandBuffer& cmdbuf);
163
164 void RenderWaveformTextures(
165 vk::raii::CommandBuffer& cmdbuf,
166 std::vector<std::shared_ptr<DisplayedChannel> >& channels);
167
168 void SetNeedRender()
169 { m_needRender = true; }
170
171 void ClearPersistence()
172 {
173 m_clearPersistence = true;
174 SetNeedRender();
175 }
176
177 virtual void Render();
178
179 void QueueCloseSession()
180 { m_sessionClosing = true; }
181
182 Session& GetSession()
183 { return m_session; }
184
185 float GetTraceAlpha()
186 { return m_traceAlpha; }
187
188 float GetPersistDecay()
189 { return m_persistenceDecay; }
190
191 void SetPersistDecay(float f)
192 { m_persistenceDecay = f; }
193
195 const std::string& name,
196 WaveformArea* area,
197 StreamDescriptor initialStream,
198 bool showProperties = true,
199 bool addToArea = true);
201
203
204 const std::vector<std::string>& GetEyeGradients()
205 { return m_eyeGradients; }
206
207 std::string GetEyeGradientFriendlyName(std::string internalName)
208 { return m_eyeGradientFriendlyNames[internalName]; }
209
213 std::shared_ptr<MeasurementsDialog> GetMeasurementsDialog(bool createIfNotExisting);
214
216
220 std::map<uintptr_t, std::string> GetGraphEditorGroups()
221 { return m_graphEditorGroups; }
222
223 void SetStartupSession(const std::string& path)
224 { m_startupSession = path; }
225
226protected:
227 virtual void DoRender(vk::raii::CommandBuffer& cmdBuf);
228
229 void CloseSession();
231
233 // GUI handlers
234
235 virtual void RenderUI();
236 void MainMenu();
237 void FileMenu();
238 void FileRecentMenu();
239 void ViewMenu();
240 void AddMenu();
241 void DoAddSubMenu(
242 std::vector<time_t>& timestamps,
243 std::map<time_t, std::vector<std::string> >& reverseMap,
244 const std::string& typePretty,
245 const std::string& defaultName,
246 const std::string& typeInternal
247 );
248 void AddChannelsMenu();
249 void AddImportMenu();
250 void AddGenerateMenu();
251 void SetupMenu();
252 void WindowMenu();
253 void WindowAnalyzerMenu();
254 void WindowGeneratorMenu();
255 void WindowPSUMenu();
257 void DebugMenu();
259 void HelpMenu();
260 void Toolbar();
261 void LoadToolbarIcons();
262 void ToolbarButtons();
263 void TriggerStartDropdown(float buttonsize);
264 void TriggerSingleDropdown(float buttonsize);
265 void TriggerForceDropdown(float buttonsize);
266 void TriggerStopDropdown(float buttonsize);
267 void DoTriggerDropdown(const char* action, std::shared_ptr<TriggerGroup>& group, bool& all);
268 void DockingArea();
269 void StatusBar(float height);
270
271 void LoadGradients();
272 void LoadGradient(const std::string& friendlyName, const std::string& internalName);
273 std::map<std::string, std::string> m_eyeGradientFriendlyNames;
274 std::vector<std::string> m_eyeGradients;
275
276 void LoadFilterIcons();
277 void LoadStatusBarIcons();
279 void LoadAppIcon();
280
283
285 ImVec2 m_workPos;
286
289
291 std::set< std::shared_ptr<Workspace> > m_workspaces;
292
294 std::set< std::shared_ptr<Dialog> > m_dialogs;
295
297 std::map<std::shared_ptr<SCPIMultimeter>, std::shared_ptr<Dialog> > m_meterDialogs;
298
300 std::map<std::shared_ptr<SCPIPowerSupply>, std::shared_ptr<Dialog> > m_psuDialogs;
301
303 std::map<std::shared_ptr<SCPIFunctionGenerator>, std::shared_ptr<Dialog> > m_generatorDialogs;
304
306 std::map<std::shared_ptr<SCPIBERT>, std::shared_ptr<Dialog> > m_bertDialogs;
307
309 std::map<std::shared_ptr<SCPIRFSignalGenerator>, std::shared_ptr<Dialog> > m_rfgeneratorDialogs;
310
312 std::map<std::shared_ptr<SCPILoad>, std::shared_ptr<Dialog> > m_loadDialogs;
313
315 std::map<std::shared_ptr<SCPIInstrument>, std::shared_ptr<Dialog> > m_scpiConsoleDialogs;
316
318 std::map<InstrumentChannel*, std::shared_ptr<Dialog> > m_channelPropertiesDialogs;
319
321 std::map<PacketDecoder*, std::shared_ptr<ProtocolAnalyzerDialog> > m_protocolAnalyzerDialogs;
322
324 std::vector<std::shared_ptr<WaveformGroup> > m_waveformGroups;
325
327 std::recursive_mutex m_waveformGroupsMutex;
328
330 std::vector<std::shared_ptr<WaveformGroup> > m_newWaveformGroups;
331
334
335 std::string NameNewWaveformGroup();
336
338 std::shared_ptr<Dialog> m_logViewerDialog;
339
341 std::shared_ptr<Dialog> m_metricsDialog;
342
344 std::shared_ptr<Dialog> m_preferenceDialog;
345
347 std::shared_ptr<HistoryDialog> m_historyDialog;
348
350 std::shared_ptr<TriggerPropertiesDialog> m_triggerDialog;
351
353 std::shared_ptr<ManageInstrumentsDialog> m_manageInstrumentsDialog;
354
356 std::shared_ptr<Dialog> m_persistenceDialog;
357
359 std::shared_ptr<Dialog> m_notesDialog;
360
362 std::shared_ptr<FilterGraphEditor> m_graphEditor;
363
365 std::shared_ptr<StreamBrowserDialog> m_streamBrowser;
366
368 std::shared_ptr<CreateFilterBrowser> m_filterPalette;
369
372
374 std::map<uintptr_t, std::string> m_graphEditorGroups;
375
377 std::shared_ptr<MeasurementsDialog> m_measurementsDialog;
378
379 void OnDialogClosed(const std::shared_ptr<Dialog>& dlg);
380
382 std::vector<SplitGroupRequest> m_splitRequests;
383
385 std::shared_ptr<Workspace> m_initialWorkspaceDockRequest;
386
388 std::vector<size_t> m_groupsToClose;
389
390 std::shared_ptr<WaveformGroup> GetBestGroupForWaveform(StreamDescriptor stream);
391
394
397
400
402 std::set< std::pair<OscilloscopeChannel*, WaveformArea*> > m_pendingChannelDisplayRequests;
403
405 std::string m_startupSession;
406
408 // Session state
409
412
415
416 SCPITransport* MakeTransport(const std::string& trans, const std::string& args);
417
419 // Serialization
420
421 void OnOpenFile(bool online);
422 void DoOpenFile(const std::string& sessionPath, bool online);
423 bool PreLoadSessionFromYaml(const YAML::Node& node, const std::string& dataDir, bool online);
424 bool LoadSessionFromYaml(const YAML::Node& node, const std::string& dataDir, bool online);
425public:
426 bool LoadUIConfiguration(int version, const YAML::Node& node);
427
428 void OnGraphEditorConfigModified(const std::string& blob)
429 { m_graphEditorConfigBlob = blob; }
430
431 const std::string& GetGraphEditorConfigBlob()
432 { return m_graphEditorConfigBlob; }
433
434protected:
435 void OnSaveAs();
436 void DoSaveFile(std::string sessionPath);
437 bool SaveSessionToYaml(YAML::Node& node, const std::string& dataDir);
438 void SaveLabNotes(const std::string& dataDir);
439 void LoadLabNotes(const std::string& dataDir);
440 bool SetupDataDirectory(const std::string& dataDir);
441 YAML::Node SerializeUIConfiguration();
442 YAML::Node SerializeDialogs();
443 bool LoadDialogs(const YAML::Node& node);
444
445 void RenderFileBrowser();
446
447 enum
448 {
449 BROWSE_OPEN_SESSION,
450 BROWSE_SAVE_SESSION
451 } m_fileBrowserMode;
452
454 std::shared_ptr<FileBrowser> m_fileBrowser;
455
457 std::vector<YAML::Node> m_fileBeingLoaded;
458
461
463 std::string m_sessionFileName;
464
466 std::string m_sessionDataDir;
467
469 std::string m_lastWindowTitle;
470
471public:
472 std::string GetDataDir()
473 { return m_sessionDataDir; }
474
475protected:
476
479
480protected:
481
483 // Recent item lists
484
488 std::map<std::string, time_t> m_recentInstruments;
489
490 void LoadRecentInstrumentList();
491 void SaveRecentInstrumentList();
492
496 std::map<std::string, time_t> m_recentFiles;
497
498 void LoadRecentFileList();
499 void SaveRecentFileList();
500
501public:
502 void AddToRecentInstrumentList(std::shared_ptr<SCPIInstrument> inst);
503
504protected:
505
507 // Error handling
508
509 std::string m_errorPopupTitle;
510 std::string m_errorPopupMessage;
511
512 bool m_showingLoadWarnings;
513 bool m_loadConfirmationChecked;
514
516 void RenderErrorPopup();
518public:
519 void ShowErrorPopup(const std::string& title, const std::string& msg);
520
521protected:
523 // Graphics items
524
525 TextureManager m_texmgr;
526
533
537 std::atomic<bool> m_clearPersistence;
538
540 std::unique_ptr<vk::raii::CommandPool> m_cmdPool;
541
543 std::unique_ptr<vk::raii::CommandBuffer> m_cmdBuffer;
544
545 bool DropdownButton(const char* id, float height);
546
547public:
548
552 FontWithSize GetFontPref(const std::string& name)
553 {
554 auto desc = m_session.GetPreferences().GetFont(name.c_str());
555 return std::pair<ImFont*, float>(m_fontmgr.GetFont(desc), desc.second * GetFontScale());
556 }
557
564 { return ImGui::GetFontSize() / 13; }
565
566 ImU32 GetColorPref(const std::string& name)
567 { return m_session.GetPreferences().GetColor(name); }
568
569 ImTextureID GetTexture(const std::string& name)
570 { return m_texmgr.GetTexture(name); }
571
572 TextureManager* GetTextureManager()
573 { return &m_texmgr; }
574
575 std::string GetIconForFilter(Filter* f);
576
578
579protected:
580 FontManager m_fontmgr;
581
583 std::map<std::type_index, std::string> m_filterIconMap;
584
586 std::map<FunctionGenerator::WaveShape, std::string> m_waveformShapeIconMap;
587
588 void UpdateFonts();
589
591 // Status bar
592public:
593
594 void AddStatusHelp(const std::string& icon, const std::string& text)
595 { m_statusHelp[icon] = text; }
596
597protected:
598 std::map<std::string, std::string> m_statusHelp;
599
601 // Performance counters
602
603protected:
604 int64_t m_toneMapTime;
605
606public:
607 int64_t GetToneMapTime()
608 { return m_toneMapTime; }
609};
610
611#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:101
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:114
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:469
std::vector< YAML::Node > m_fileBeingLoaded
YAML structure for file we're currently loading.
Definition: MainWindow.h:457
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:331
std::shared_ptr< CreateFilterBrowser > m_filterPalette
Filter palette.
Definition: MainWindow.h:368
std::map< std::shared_ptr< SCPIBERT >, std::shared_ptr< Dialog > > m_bertDialogs
Map of BERTs to BERT control dialogs.
Definition: MainWindow.h:306
std::vector< SplitGroupRequest > m_splitRequests
Pending requests to split waveform groups.
Definition: MainWindow.h:382
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:2412
bool m_fileLoadInProgress
True if we're actively loading a file.
Definition: MainWindow.h:460
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:1955
std::string m_sessionDataDir
Current session data directory.
Definition: MainWindow.h:466
void RemoveFunctionGenerator(std::shared_ptr< SCPIFunctionGenerator > gen)
Closes the function generator dialog, if we have one.
Definition: MainWindow.cpp:1915
void OnOpenFile(bool online)
Handler for file | open menu. Spawns the browser dialog.
Definition: MainWindow.cpp:2228
std::vector< std::shared_ptr< WaveformGroup > > m_newWaveformGroups
Set of newly created waveform groups that aren't yet docked.
Definition: MainWindow.h:330
std::string m_sessionFileName
Current session file path.
Definition: MainWindow.h:463
std::map< uintptr_t, std::string > GetGraphEditorGroups()
Returns the groups we have configured for our graph editor.
Definition: MainWindow.h:220
YAML::Node SerializeUIConfiguration()
Serialize waveform areas etc to a YAML::Node.
Definition: MainWindow.cpp:3192
void OnCursorMoved(int64_t offset)
Called when a cursor is moved, so protocol analyzers can move highlights as needed.
Definition: MainWindow.cpp:2216
int m_nextWaveformGroup
Name for next autogenerated waveform group.
Definition: MainWindow.h:333
std::shared_ptr< Dialog > m_logViewerDialog
Logfile viewer.
Definition: MainWindow.h:338
Session m_session
Our session object.
Definition: MainWindow.h:411
std::atomic< bool > m_clearPersistence
True if we should clear persistence on the next render pass.
Definition: MainWindow.h:537
bool m_openOnline
True if the pending file is to be opened online.
Definition: MainWindow.h:478
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:294
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:488
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:147
static bool OnMemoryPressureStatic(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize)
Static wrapper for calling OnMemoryPressure.
Definition: MainWindow.cpp:3526
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:156
std::map< InstrumentChannel *, std::shared_ptr< Dialog > > m_channelPropertiesDialogs
Map of channels to properties dialogs.
Definition: MainWindow.h:318
std::shared_ptr< FileBrowser > m_fileBrowser
Browser for pending file loads.
Definition: MainWindow.h:454
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:385
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:324
std::map< std::shared_ptr< SCPIRFSignalGenerator >, std::shared_ptr< Dialog > > m_rfgeneratorDialogs
Map of RF generators to generator control dialogs.
Definition: MainWindow.h:309
ImVec2 m_workPos
Start position of the viewport minus the menu and toolbar.
Definition: MainWindow.h:285
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:583
std::shared_ptr< Dialog > m_notesDialog
Lab notes.
Definition: MainWindow.h:359
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:1395
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:1725
std::shared_ptr< MeasurementsDialog > m_measurementsDialog
Measurements dialog.
Definition: MainWindow.h:377
std::shared_ptr< Dialog > m_preferenceDialog
Preferences.
Definition: MainWindow.h:344
FontWithSize GetFontPref(const std::string &name)
Returns a font, given the name of a preference setting.
Definition: MainWindow.h:552
std::map< std::shared_ptr< SCPIPowerSupply >, std::shared_ptr< Dialog > > m_psuDialogs
Map of PSUs to power supply control dialogs.
Definition: MainWindow.h:300
std::shared_ptr< Dialog > m_persistenceDialog
Persistence settings.
Definition: MainWindow.h:356
void RenderReconnectPopup()
Popup message when reconnecting to a session.
Definition: MainWindow.cpp:1684
std::map< uintptr_t, std::string > m_graphEditorGroups
Group IDs and names for the graph editor.
Definition: MainWindow.h:374
std::unique_ptr< vk::raii::CommandPool > m_cmdPool
Command pool for allocating our command buffers.
Definition: MainWindow.h:540
std::unique_ptr< vk::raii::CommandBuffer > m_cmdBuffer
Command buffer used during rendering operations.
Definition: MainWindow.h:543
bool SetupDataDirectory(const std::string &dataDir)
Make sure the data directory exists.
Definition: MainWindow.cpp:3106
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:315
void LoadLabNotes(const std::string &dataDir)
Loads the lab notes from Markdown files in the data directory.
Definition: MainWindow.cpp:3008
float GetFontScale()
Get scaling factor for fonts being drawn with ImDrawList.
Definition: MainWindow.h:563
void OnSaveAs()
Handler for file | save as menu. Spawns the browser dialog.
Definition: MainWindow.cpp:2244
std::map< PacketDecoder *, std::shared_ptr< ProtocolAnalyzerDialog > > m_protocolAnalyzerDialogs
Map of filters to analyzer dialogs.
Definition: MainWindow.h:321
std::map< FunctionGenerator::WaveShape, std::string > m_waveformShapeIconMap
Map of Waveform Shapes to icons.
Definition: MainWindow.h:586
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:2378
void UpdateFonts()
Font.
Definition: MainWindow.cpp:1931
std::string m_graphEditorConfigBlob
Config blob for filter graph editor.
Definition: MainWindow.h:371
std::map< std::shared_ptr< SCPILoad >, std::shared_ptr< Dialog > > m_loadDialogs
Map of loads to control dialogs.
Definition: MainWindow.h:312
std::shared_ptr< TriggerPropertiesDialog > m_triggerDialog
Trigger properties.
Definition: MainWindow.h:350
float m_traceAlpha
Trace alpha.
Definition: MainWindow.h:396
std::shared_ptr< ManageInstrumentsDialog > m_manageInstrumentsDialog
Manage instruments.
Definition: MainWindow.h:353
void DoSaveFile(std::string sessionPath)
Actually save a file (may be triggered by file|save or file|save as)
Definition: MainWindow.cpp:2905
void FindAreaForStream(WaveformArea *area, StreamDescriptor stream)
Given a stream and optionally a WaveformArea, adds the stream to some area.
Definition: MainWindow.cpp:2031
float m_persistenceDecay
Persistence decay factor.
Definition: MainWindow.h:399
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:1632
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:303
void ToneMapAllWaveforms(vk::raii::CommandBuffer &cmdbuf)
Run the tone-mapping shader on all of our waveforms.
Definition: MainWindow.cpp:549
std::shared_ptr< StreamBrowserDialog > m_streamBrowser
Stream browser.
Definition: MainWindow.h:365
bool LoadDialogs(const YAML::Node &node)
Load dialog configuration.
Definition: MainWindow.cpp:2685
ImVec2 m_workSize
Size position of the viewport minus the menu and toolbar.
Definition: MainWindow.h:288
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:355
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:2288
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:1675
void LoadGradient(const std::string &friendlyName, const std::string &internalName)
Load a single gradient.
Definition: MainWindow.cpp:841
std::map< std::string, time_t > m_recentFiles
List of recently used files.
Definition: MainWindow.h:496
void InitializeDefaultSession()
Creates a new session initialized with some default windows.
Definition: MainWindow.cpp:204
std::set< std::pair< OscilloscopeChannel *, WaveformArea * > > m_pendingChannelDisplayRequests
Pending requests to display a channel in a waveform area (from CreateFilter())
Definition: MainWindow.h:402
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:2960
std::map< std::shared_ptr< SCPIMultimeter >, std::shared_ptr< Dialog > > m_meterDialogs
Map of multimeters to meter control dialogs.
Definition: MainWindow.h:297
void LoadGradients()
Load gradient images.
Definition: MainWindow.cpp:822
std::shared_ptr< Dialog > m_metricsDialog
Performance metrics.
Definition: MainWindow.h:341
YAML::Node SerializeDialogs()
Serializes the list of open dialogs.
Definition: MainWindow.cpp:3274
std::string m_startupSession
Pending request to open a session.
Definition: MainWindow.h:405
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:3058
bool m_showDemo
Enable flag for main imgui demo window.
Definition: MainWindow.h:282
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:414
void OnScopeAdded(std::shared_ptr< Oscilloscope > scope, bool createViews)
Handles creation of a new oscilloscope.
Definition: MainWindow.cpp:383
void OnFilterReconfigured(Filter *f)
Handle a filter being reconfigured.
Definition: MainWindow.cpp:2196
std::shared_ptr< HistoryDialog > m_historyDialog
History.
Definition: MainWindow.h:347
std::vector< size_t > m_groupsToClose
Pending requests to close waveform groups.
Definition: MainWindow.h:388
std::recursive_mutex m_waveformGroupsMutex
Mutex for controlling access to m_waveformGroups.
Definition: MainWindow.h:327
bool m_needRender
True if a resize or other event this frame requires we re-rasterize waveforms.
Definition: MainWindow.h:532
int m_toolbarIconSize
Cached toolbar icon size.
Definition: MainWindow.h:393
std::shared_ptr< MeasurementsDialog > GetMeasurementsDialog(bool createIfNotExisting)
Return the measurements dialog, if we have one.
Definition: MainWindow.cpp:1658
std::shared_ptr< FilterGraphEditor > m_graphEditor
Filter graph editor.
Definition: MainWindow.h:362
std::set< std::shared_ptr< Workspace > > m_workspaces
Workspaces (can't be with other dialogs because they can contain other stuff)
Definition: MainWindow.h:291
void RenderFileBrowser()
Runs the file browser dialog.
Definition: MainWindow.cpp:2259
void RenderLoadWarningPopup()
Popup message when loading a file that might not match the current hardware setup.
Definition: MainWindow.cpp:1747
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:61
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