![]() |
PulseView
unreleased development snapshot
A Qt-based sigrok GUI
|
#include <session.hpp>
Public Types | |
enum | capture_state { Stopped, AwaitingTrigger, Running } |
Public Slots | |
void | on_data_saved () |
Signals | |
void | capture_state_changed (int state) |
void | device_changed () |
void | signals_changed () |
void | name_changed () |
void | trigger_event (int segment_id, util::Timestamp location) |
void | new_segment (int new_segment_id) |
void | segment_completed (int segment_id) |
void | data_received () |
void | add_view (ViewType type, Session *session) |
void | session_error_raised (const QString text, const QString info_text) |
Public Member Functions | |
Session (DeviceManager &device_manager, QString name) | |
~Session () | |
DeviceManager & | device_manager () |
const DeviceManager & | device_manager () const |
shared_ptr< sigrok::Session > | session () const |
shared_ptr< devices::Device > | device () const |
QString | name () const |
void | set_name (QString name) |
QString | save_path () const |
void | set_save_path (QString path) |
const vector< shared_ptr< views::ViewBase > > | views () const |
shared_ptr< views::ViewBase > | main_view () const |
shared_ptr< pv::toolbars::MainBar > | main_bar () const |
void | set_main_bar (shared_ptr< pv::toolbars::MainBar > main_bar) |
bool | data_saved () const |
void | save_setup (QSettings &settings) const |
void | save_settings (QSettings &settings) const |
void | restore_setup (QSettings &settings) |
void | restore_settings (QSettings &settings) |
void | select_device (shared_ptr< devices::Device > device) |
void | set_device (shared_ptr< devices::Device > device) |
void | set_default_device () |
bool | using_file_device () const |
void | load_init_file (const string &file_name, const string &format, const string &setup_file_name) |
void | load_file (QString file_name, QString setup_file_name=QString(), shared_ptr< sigrok::InputFormat > format=nullptr, const map< string, Glib::VariantBase > &options=map< string, Glib::VariantBase >()) |
capture_state | get_capture_state () const |
void | start_capture (function< void(const QString)> error_handler) |
void | stop_capture () |
double | get_samplerate () const |
Glib::DateTime | get_acquisition_start_time () const |
uint32_t | get_highest_segment_id () const |
uint64_t | get_segment_sample_count (uint32_t segment_id) const |
vector< util::Timestamp > | get_triggers (uint32_t segment_id) const |
void | register_view (shared_ptr< views::ViewBase > view) |
void | deregister_view (shared_ptr< views::ViewBase > view) |
bool | has_view (shared_ptr< views::ViewBase > view) |
const vector< shared_ptr< data::SignalBase > > | signalbases () const |
uint32_t | get_signal_count (data::SignalBase::ChannelType type) const |
uint32_t | get_next_signal_index (data::SignalBase::ChannelType type) |
void | add_generated_signal (shared_ptr< data::SignalBase > signal) |
void | remove_generated_signal (shared_ptr< data::SignalBase > signal) |
bool | all_segments_complete (uint32_t segment_id) const |
MetadataObjManager * | metadata_obj_manager () |
Static Public Attributes | |
static shared_ptr< sigrok::Context > | sr_context |
Private Member Functions | |
void | set_capture_state (capture_state state) |
void | update_signals () |
shared_ptr< data::SignalBase > | signalbase_from_channel (shared_ptr< sigrok::Channel > channel) const |
void | sample_thread_proc (function< void(const QString)> error_handler) |
void | free_unused_memory () |
void | signal_new_segment () |
void | signal_segment_completed () |
void | feed_in_header () |
void | feed_in_meta (shared_ptr< sigrok::Meta > meta) |
void | feed_in_trigger () |
void | feed_in_frame_begin () |
void | feed_in_frame_end () |
void | feed_in_logic (shared_ptr< sigrok::Logic > logic) |
void | feed_in_analog (shared_ptr< sigrok::Analog > analog) |
void | data_feed_in (shared_ptr< sigrok::Device > device, shared_ptr< sigrok::Packet > packet) |
Static Private Member Functions | |
static map< string, Glib::VariantBase > | input_format_options (vector< string > user_spec, map< string, shared_ptr< Option >> fmt_opts) |
Definition at line 117 of file session.hpp.
Enumerator | |
---|---|
Stopped | |
AwaitingTrigger | |
Running |
Definition at line 122 of file session.hpp.
pv::Session::Session | ( | DeviceManager & | device_manager, |
QString | name | ||
) |
Definition at line 120 of file session.cpp.
pv::Session::~Session | ( | ) |
void pv::Session::add_generated_signal | ( | shared_ptr< data::SignalBase > | signal | ) |
Definition at line 974 of file session.cpp.
|
signal |
bool pv::Session::all_segments_complete | ( | uint32_t | segment_id | ) | const |
|
signal |
|
private |
Definition at line 1640 of file session.cpp.
|
signal |
bool pv::Session::data_saved | ( | ) | const |
Indicates whether the captured data was saved to disk already or not
Definition at line 216 of file session.cpp.
void pv::Session::deregister_view | ( | shared_ptr< views::ViewBase > | view | ) |
Definition at line 887 of file session.cpp.
shared_ptr< devices::Device > pv::Session::device | ( | ) | const |
|
signal |
DeviceManager & pv::Session::device_manager | ( | ) |
const DeviceManager & pv::Session::device_manager | ( | ) | const |
Definition at line 151 of file session.cpp.
|
private |
Definition at line 1564 of file session.cpp.
|
private |
|
private |
Definition at line 1492 of file session.cpp.
|
private |
|
private |
Definition at line 1517 of file session.cpp.
|
private |
|
private |
Definition at line 1447 of file session.cpp.
|
private |
Definition at line 1321 of file session.cpp.
Glib::DateTime pv::Session::get_acquisition_start_time | ( | ) | const |
Session::capture_state pv::Session::get_capture_state | ( | ) | const |
uint32_t pv::Session::get_highest_segment_id | ( | ) | const |
uint32_t pv::Session::get_next_signal_index | ( | data::SignalBase::ChannelType | type | ) |
double pv::Session::get_samplerate | ( | ) | const |
Definition at line 910 of file session.cpp.
uint64_t pv::Session::get_segment_sample_count | ( | uint32_t | segment_id | ) | const |
uint32_t pv::Session::get_signal_count | ( | data::SignalBase::ChannelType | type | ) | const |
Definition at line 962 of file session.cpp.
vector< util::Timestamp > pv::Session::get_triggers | ( | uint32_t | segment_id | ) | const |
bool pv::Session::has_view | ( | shared_ptr< views::ViewBase > | view | ) |
Definition at line 901 of file session.cpp.
|
staticprivate |
Convert generic options to data types that are specific to InputFormat.
[in] | user_spec | Vector of tokenized words, string format. |
[in] | fmt_opts | Input format's options, result of InputFormat::options(). |
Definition at line 666 of file session.cpp.
void pv::Session::load_file | ( | QString | file_name, |
QString | setup_file_name = QString() , |
||
shared_ptr< sigrok::InputFormat > | format = nullptr , |
||
const map< string, Glib::VariantBase > & | options = map<string, Glib::VariantBase>() |
||
) |
Definition at line 735 of file session.cpp.
void pv::Session::load_init_file | ( | const string & | file_name, |
const string & | format, | ||
const string & | setup_file_name | ||
) |
shared_ptr< pv::toolbars::MainBar > pv::Session::main_bar | ( | ) | const |
shared_ptr< views::ViewBase > pv::Session::main_view | ( | ) | const |
MetadataObjManager * pv::Session::metadata_obj_manager | ( | ) |
QString pv::Session::name | ( | ) | const |
|
signal |
|
signal |
|
slot |
Definition at line 1713 of file session.cpp.
void pv::Session::register_view | ( | shared_ptr< views::ViewBase > | view | ) |
void pv::Session::remove_generated_signal | ( | shared_ptr< data::SignalBase > | signal | ) |
Definition at line 984 of file session.cpp.
void pv::Session::restore_settings | ( | QSettings & | settings | ) |
void pv::Session::restore_setup | ( | QSettings & | settings | ) |
Definition at line 376 of file session.cpp.
|
private |
Definition at line 1224 of file session.cpp.
QString pv::Session::save_path | ( | ) | const |
void pv::Session::save_settings | ( | QSettings & | settings | ) | const |
void pv::Session::save_setup | ( | QSettings & | settings | ) | const |
Definition at line 221 of file session.cpp.
|
signal |
void pv::Session::select_device | ( | shared_ptr< devices::Device > | device | ) |
Attempts to set device instance, may fall back to demo if needed
Definition at line 551 of file session.cpp.
shared_ptr< sigrok::Session > pv::Session::session | ( | ) | const |
|
signal |
|
private |
void pv::Session::set_default_device | ( | ) |
Definition at line 631 of file session.cpp.
void pv::Session::set_device | ( | shared_ptr< devices::Device > | device | ) |
Sets device instance that will be used in the next capture session.
Definition at line 563 of file session.cpp.
void pv::Session::set_main_bar | ( | shared_ptr< pv::toolbars::MainBar > | main_bar | ) |
void pv::Session::set_name | ( | QString | name | ) |
Definition at line 173 of file session.cpp.
void pv::Session::set_save_path | ( | QString | path | ) |
|
private |
Definition at line 1331 of file session.cpp.
|
private |
Definition at line 1362 of file session.cpp.
|
private |
const vector< shared_ptr< data::SignalBase > > pv::Session::signalbases | ( | ) | const |
|
signal |
void pv::Session::start_capture | ( | function< void(const QString)> | error_handler | ) |
Definition at line 794 of file session.cpp.
void pv::Session::stop_capture | ( | ) |
Definition at line 838 of file session.cpp.
|
signal |
|
private |
Definition at line 1073 of file session.cpp.
bool pv::Session::using_file_device | ( | ) | const |
const vector< shared_ptr< views::ViewBase > > pv::Session::views | ( | ) | const |
|
private |
Definition at line 318 of file session.hpp.
|
private |
Definition at line 317 of file session.hpp.
|
private |
Definition at line 295 of file session.hpp.
|
private |
Definition at line 292 of file session.hpp.
|
private |
Definition at line 307 of file session.hpp.
|
private |
Definition at line 305 of file session.hpp.
|
private |
Definition at line 304 of file session.hpp.
|
mutableprivate |
Definition at line 302 of file session.hpp.
|
private |
Definition at line 314 of file session.hpp.
|
private |
Definition at line 284 of file session.hpp.
|
private |
Definition at line 283 of file session.hpp.
|
private |
Definition at line 282 of file session.hpp.
|
private |
Definition at line 315 of file session.hpp.
|
private |
Definition at line 308 of file session.hpp.
|
private |
Definition at line 303 of file session.hpp.
|
private |
Definition at line 289 of file session.hpp.
|
private |
Definition at line 287 of file session.hpp.
|
private |
Definition at line 320 of file session.hpp.
|
private |
Definition at line 284 of file session.hpp.
|
private |
Definition at line 297 of file session.hpp.
|
private |
Definition at line 313 of file session.hpp.
|
mutableprivate |
Protects access to capture_state_.
Definition at line 291 of file session.hpp.
|
private |
Definition at line 311 of file session.hpp.
|
private |
Definition at line 284 of file session.hpp.
|
private |
Definition at line 309 of file session.hpp.
|
private |
Definition at line 280 of file session.hpp.
|
private |
Definition at line 296 of file session.hpp.
|
private |
Definition at line 294 of file session.hpp.
|
static |
Definition at line 128 of file session.hpp.
|
private |
trigger_list_ contains pairs of <segment_id, timestamp> values
Definition at line 300 of file session.hpp.
|
private |
Definition at line 286 of file session.hpp.