ngscopeclient 0.1-dev+51fbda87c
|
Public Member Functions | |
StreamBrowserDialog (Session &session, MainWindow *parent) | |
virtual bool | DoRender () override |
Renders the dialog and handles UI events. More... | |
![]() | |
Dialog (const std::string &title, const std::string &id, ImVec2 defaultSize=ImVec2(300, 100)) | |
virtual bool | Render () |
Renders the dialog and handles UI events. More... | |
void | RenderAsChild () |
Runs the dialog's contents directly into a parent window. | |
virtual bool | DoRender ()=0 |
const std::string & | GetID () |
std::string | GetTitleAndID () |
Protected Types | |
enum | InstrumentBadge { BADGE_ARMED , BADGE_STOPPED , BADGE_TRIGGERED , BADGE_BUSY , BADGE_AUTO } |
State of badges used in intrument node rendering. | |
Protected Member Functions | |
void | DoItemHelp () |
void | renderInfoLink (const char *label, const char *linktext, bool &clicked, bool &hovered) |
Render a link of the "Sample rate: 4 GSa/s" type that shows up in the scope properties box. | |
void | startBadgeLine () |
prepare rendering context to display a badge at the end of current line | |
bool | renderBadge (ImVec4 color,...) |
render a badge at the end of current line with provided color and text More... | |
bool | renderInstrumentBadge (std::shared_ptr< Instrument > inst, bool latched, InstrumentBadge badge) |
render a badge for an instrument node More... | |
bool | renderCombo (ImVec4 color, int &selected, const std::vector< string > &values, bool useColorForText=false, uint8_t cropTextTo=0) |
Render a combo box with provded color and values. More... | |
bool | renderCombo (ImVec4 color, int *selected,...) |
Render a combo box with provded color and values. More... | |
bool | renderToggle (ImVec4 color, bool curValue) |
Render a toggle button combo. More... | |
bool | renderOnOffToggle (bool curValue) |
Render an on/off toggle button combo. More... | |
void | renderDownloadProgress (std::shared_ptr< Instrument > inst, InstrumentChannel *chan, bool isLast) |
Render a download progress bar for a given instrument channel. More... | |
void | renderPsuRows (bool isVoltage, bool cc, PowerSupplyChannel *chan, const char *setValue, const char *measuredValue, bool &clicked, bool &hovered) |
Render a PSU properties row. More... | |
void | renderAwgProperties (std::shared_ptr< FunctionGenerator > awg, FunctionGeneratorChannel *awgchan, bool &clicked, bool &hovered) |
Render AWG channel properties. More... | |
void | renderInstrumentNode (shared_ptr< Instrument > instrument) |
Rendering of an instrument node. More... | |
void | renderChannelNode (shared_ptr< Instrument > instrument, size_t channelIndex, bool isLast) |
Rendering of a channel node. More... | |
void | renderStreamNode (shared_ptr< Instrument > instrument, InstrumentChannel *channel, size_t streamIndex, bool renderName, bool renderProps, bool isLast) |
Rendering of a stream node. More... | |
void | renderFilterNode (Filter *filter) |
Rendering of a Filter node. More... | |
![]() | |
bool | FloatInputWithApplyButton (const std::string &label, float ¤tValue, float &committedValue) |
Helper for displaying a floating-point input box with an "apply" button. | |
bool | TextInputWithApplyButton (const std::string &label, std::string ¤tValue, std::string &committedValue) |
bool | IntInputWithImplicitApply (const std::string &label, int ¤tValue, int &committedValue) |
bool | UnitInputWithExplicitApply (const std::string &label, std::string ¤tValue, float &committedValue, Unit unit) |
Input box for a floating point value with an associated unit and an "apply" button. More... | |
void | RenderErrorPopup () |
Popup message when we fail to connect. | |
void | ShowErrorPopup (const std::string &title, const std::string &msg) |
Opens the error popup. | |
Protected Attributes | |
Session & | m_session |
MainWindow * | m_parent |
float | m_badgeXMin |
float | m_badgeXCur |
std::map< std::shared_ptr< Instrument >, bool > | m_instrumentDownloadIsSlow |
std::map< std::shared_ptr< Instrument >, pair< double, InstrumentBadge > > | m_instrumentLastBadge |
![]() | |
bool | m_open |
std::string | m_id |
std::string | m_title |
ImVec2 | m_defaultSize |
std::string | m_errorPopupTitle |
std::string | m_errorPopupMessage |
Additional Inherited Members | |
![]() | |
static bool | Combo (const std::string &label, const std::vector< std::string > &items, int &selection) |
Displays a combo box from a vector<string> | |
static bool | UnitInputWithImplicitApply (const std::string &label, std::string ¤tValue, float &committedValue, Unit unit) |
Input box for a floating point value with an associated unit. More... | |
static bool | UnitInputWithImplicitApply (const std::string &label, std::string ¤tValue, double &committedValue, Unit unit) |
Input box for a double precision floating point value with an associated unit. More... | |
static bool | UnitInputWithImplicitApply (const std::string &label, std::string ¤tValue, int64_t &committedValue, Unit unit) |
Input box for an integer value with an associated unit. More... | |
static bool | TextInputWithImplicitApply (const std::string &label, std::string ¤tValue, std::string &committedValue) |
static void | Tooltip (const std::string &str, bool allowDisabled=false) |
Helper based on imgui demo for displaying tooltip text over the previously rendered widget. | |
static void | HelpMarker (const std::string &str) |
static void | HelpMarker (const std::string &header, const std::vector< std::string > &bullets) |
|
overridevirtual |
Renders the dialog and handles UI events.
Implements Dialog.
|
protected |
Render AWG channel properties.
awg | the AWG to render channel properties for |
awgchan | the AWG channel to render properties for |
clicked | output param for clicked state |
hovered | output param for hovered state |
|
protected |
render a badge at the end of current line with provided color and text
color | the color of the badge |
... | a null terminated list of labels form the largest to the smallest to use as a badge label according to the available space |
|
protected |
Rendering of a channel node.
instrument | the instrument containing the instrument to render |
channelIndex | the index of the channel to render |
isLast | true if this is the last channel of the instrument |
|
protected |
Render a combo box with provded color and values.
color | the color of the combo box |
selected | the selected value index (in/out) |
values | the combo box values |
useColorForText | if true, use the provided color for text (and a darker version of it for background color) |
cropTextTo | if >0 crop the combo text up to this number of characters to have it fit the available space |
|
protected |
Render a combo box with provded color and values.
color | the color of the combo box |
selected | the selected value index (in/out) |
... | the combo box values |
|
protected |
Render a download progress bar for a given instrument channel.
inst | the instrument to render the progress channel for |
chan | the channel to render the progress for |
isLast | true if it is the last channel of the instrument |
hysteresis threshold for a channel finishing a download faster than this to be declared fast
hysteresis threshold for a channel finishing a still being in progress for longer than this to be declared slow
Width used to display progress bars (e.g. download progress bar)
|
protected |
Rendering of a Filter node.
filter | the filter to render |
|
protected |
render a badge for an instrument node
inst | the instrument to render the badge for |
latched | true if the redering of this batch should be latched (i.e. only renderd it previous badge has been here for more than a given time) |
badge | the badge type |
|
protected |
Rendering of an instrument node.
instrument | the instrument to render |
|
protected |
Render an on/off toggle button combo.
curValue | the value of the toggle button |
|
protected |
Render a PSU properties row.
isVoltage | true for voltage rows, false for current rows |
cc | true if the PSU channel is in constant current mode, false for constant voltage mode |
chan | the PSU channel to render properties for |
setValue | the set value text |
measuredValue | the measured value text |
clicked | output param for clicked state |
hovered | output param for hovered state |
|
protected |
Rendering of a stream node.
instrument | the instrument containing the stream to render (may be null if the stream is in a Filter) |
channel | the channel or the Filter containing the stream to render |
streamIndex | the index of the stream to render |
renderName | true if the name of the stream should be rendred as a selectable item |
renderProps | true if a properties block should be rendered for this stream |
isLast | true if this is the last stream of the channel |
|
protected |
Render a toggle button combo.
color | the color of the toggle button |
curValue | the value of the toggle button |