#include <pv/dialogs/inputoutputoptions.hpp>
#include <pv/dialogs/storeprogress.hpp>
#include <pv/mainwindow.hpp>
-#include <pv/popups/deviceoptions.hpp>
#include <pv/popups/channels.hpp>
+#include <pv/popups/deviceoptions.hpp>
#include <pv/util.hpp>
#include <pv/view/view.hpp>
#include <pv/widgets/exportmenu.hpp>
#include <libsigrokcxx/libsigrokcxx.hpp>
using std::back_inserter;
-using std::cerr;
using std::copy;
-using std::endl;
using std::list;
+using std::make_pair;
using std::map;
using std::max;
using std::min;
+using std::pair;
+using std::set;
using std::shared_ptr;
using std::string;
using std::vector;
session.device_manager().context());
menu_file_export->setTitle(tr("&Export"));
connect(menu_file_export,
- SIGNAL(format_selected(std::shared_ptr<sigrok::OutputFormat>)),
- this, SLOT(export_file(std::shared_ptr<sigrok::OutputFormat>)));
+ SIGNAL(format_selected(shared_ptr<sigrok::OutputFormat>)),
+ this, SLOT(export_file(shared_ptr<sigrok::OutputFormat>)));
widgets::ImportMenu *menu_file_import = new widgets::ImportMenu(this,
session.device_manager().context());
menu_file_import->setTitle(tr("&Import"));
connect(menu_file_import,
- SIGNAL(format_selected(std::shared_ptr<sigrok::InputFormat>)),
- this, SLOT(import_file(std::shared_ptr<sigrok::InputFormat>)));
+ SIGNAL(format_selected(shared_ptr<sigrok::InputFormat>)),
+ this, SLOT(import_file(shared_ptr<sigrok::InputFormat>)));
action_connect_->setText(tr("&Connect to Device..."));
connect(action_connect_, SIGNAL(triggered(bool)),
widgets::ImportMenu *import_menu = new widgets::ImportMenu(this,
session.device_manager().context(), action_open_);
connect(import_menu,
- SIGNAL(format_selected(std::shared_ptr<sigrok::InputFormat>)),
+ SIGNAL(format_selected(shared_ptr<sigrok::InputFormat>)),
this,
- SLOT(import_file(std::shared_ptr<sigrok::InputFormat>)));
+ SLOT(import_file(shared_ptr<sigrok::InputFormat>)));
open_button_->setMenu(import_menu);
open_button_->setDefaultAction(action_open_);
session.device_manager().context(),
open_actions);
connect(export_menu,
- SIGNAL(format_selected(std::shared_ptr<sigrok::OutputFormat>)),
+ SIGNAL(format_selected(shared_ptr<sigrok::OutputFormat>)),
this,
- SLOT(export_file(std::shared_ptr<sigrok::OutputFormat>)));
+ SLOT(export_file(shared_ptr<sigrok::OutputFormat>)));
save_button_->setMenu(export_menu);
save_button_->setDefaultAction(action_save_as_);
connect(menu_decoders_add_, SIGNAL(decoder_selected(srd_decoder*)),
this, SLOT(add_decoder(srd_decoder*)));
- add_decoder_button_->setIcon(QIcon::fromTheme("add-decoder",
- QIcon(":/icons/add-decoder.svg")));
+ add_decoder_button_->setIcon(QIcon(":/icons/add-decoder.svg"));
add_decoder_button_->setPopupMode(QToolButton::InstantPopup);
add_decoder_button_->setMenu(menu_decoders_add_);
+ add_decoder_button_->setToolTip(tr("Add low-level, non-stacked protocol decoder"));
#endif
connect(&sample_count_, SIGNAL(value_changed()),
set_capture_state(pv::Session::Stopped);
configure_button_.setToolTip(tr("Configure Device"));
- configure_button_.setIcon(QIcon::fromTheme("configure",
- QIcon(":/icons/configure.png")));
+ configure_button_.setIcon(QIcon::fromTheme("preferences-system",
+ QIcon(":/icons/preferences-system.png")));
channels_button_.setToolTip(tr("Configure Channels"));
- channels_button_.setIcon(QIcon::fromTheme("channels",
- QIcon(":/icons/channels.svg")));
+ channels_button_.setIcon(QIcon(":/icons/channels.svg"));
add_toolbar_widgets();
update_device_config_widgets();
}
-
void MainBar::set_capture_state(pv::Session::capture_state state)
{
bool ui_enabled = (state == pv::Session::Stopped) ? true : false;
GVariant *gvar_list;
const uint64_t *elements = nullptr;
gsize num_elements;
- map< const ConfigKey*, std::set<Capability> > keys;
+ map< const ConfigKey*, set<Capability> > keys;
if (updating_sample_rate_) {
sample_rate_.show_none();
min_sample_count = min(max(min_sample_count, MinSampleCount),
max_sample_count);
- sample_count_.show_125_list(
- min_sample_count, max_sample_count);
+ sample_count_.show_125_list(min_sample_count, max_sample_count);
if (sr_dev->config_check(ConfigKey::LIMIT_SAMPLES, Capability::GET)) {
auto gvar = sr_dev->config_get(ConfigKey::LIMIT_SAMPLES);
#endif
}
-void MainBar::export_file(shared_ptr<OutputFormat> format,
- bool selection_only)
+void MainBar::export_file(shared_ptr<OutputFormat> format, bool selection_only)
{
using pv::dialogs::StoreProgress;
QSettings settings;
const QString dir = settings.value(SettingSaveDirectory).toString();
- std::pair<uint64_t, uint64_t> sample_range;
+ pair<uint64_t, uint64_t> sample_range;
// Selection only? Verify that the cursors are active and fetch their values
if (selection_only) {
const pv::util::Timestamp& start_time = trace_view->cursors()->first()->time();
const pv::util::Timestamp& end_time = trace_view->cursors()->second()->time();
- const uint64_t start_sample =
- std::max((double)0, start_time.convert_to<double>() * samplerate);
- const uint64_t end_sample = end_time.convert_to<double>() * samplerate;
+ const uint64_t start_sample = (uint64_t)max(
+ (double)0, start_time.convert_to<double>() * samplerate);
+ const uint64_t end_sample = (uint64_t)max(
+ (double)0, end_time.convert_to<double>() * samplerate);
- sample_range = std::make_pair(start_sample, end_sample);
+ sample_range = make_pair(start_sample, end_sample);
} else {
- sample_range = std::make_pair(0, 0);
+ sample_range = make_pair(0, 0);
}
// Construct the filter
void MainBar::on_config_changed()
{
commit_sample_count();
- commit_sample_rate();
+ commit_sample_rate();
}
void MainBar::on_actionNewView_triggered()