Skip to content

Commit

Permalink
NetworkAnalyzer: add buttons for zooming and enable it
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Guramulta <[email protected]>
  • Loading branch information
DanielGuramulta committed Jan 22, 2018
1 parent 90ddfef commit 9d5211a
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/network_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ NetworkAnalyzer::NetworkAnalyzer(struct iio_context *ctx, Filter *filt,

api->setObjectName(QString::fromStdString(Filter::tool_name(
TOOL_NETWORK_ANALYZER)));

ui->xygraph->enableZooming(ui->btnZoomIn, ui->btnZoomOut);

api->load(*settings);
api->js_register(engine);
}
Expand Down
183 changes: 176 additions & 7 deletions ui/network_analyzer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,174 @@ QPushButton:!checked {
<pointsize>14</pointsize>
</font>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>48</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame {

border: 1px solid rgba(255, 255, 255, 120);
border-radius: 4px;

}</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="btnZoomIn">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:hover {
border-image: url(:/icons/sba_up_btn_hover.svg);
}
QPushButton {
border-image: url(:/icons/sba_up_btn.svg);
border: 5px solid white;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnZoomOut">
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton:hover {
border-image: url(:/icons/sba_dn_btn_hover.svg);
}
QPushButton {
border-image: url(:/icons/sba_dn_btn.svg);
border: 5px solid white;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -830,12 +998,6 @@ QPushButton:!checked {
<header>menu_anim.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>adiscope::dBgraph</class>
<extends>QFrame</extends>
<header>dbgraph.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>adiscope::ScaleSpinButton</class>
<extends>QWidget</extends>
Expand All @@ -848,6 +1010,12 @@ QPushButton:!checked {
<header>spinbox_a.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>adiscope::dBgraph</class>
<extends>QFrame</extends>
<header>dbgraph.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>adiscope::NyquistGraph</class>
<extends>QFrame</extends>
Expand All @@ -857,6 +1025,7 @@ QPushButton:!checked {
</customwidgets>
<resources>
<include location="../resources/resources.qrc"/>
<include location="../resources/resources.qrc"/>
</resources>
<connections>
<connection>
Expand Down Expand Up @@ -1277,7 +1446,7 @@ QPushButton:!checked {
</connection>
</connections>
<buttongroups>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>

0 comments on commit 9d5211a

Please sign in to comment.