PulseView  0.3.0
A Qt-based sigrok GUI
pv::Session Class Reference

#include <session.hpp>

Inheritance diagram for pv::Session:
Collaboration diagram for pv::Session:

Public Types

enum  capture_state { Stopped, AwaitingTrigger, Running }
 

Signals

void capture_state_changed (int state)
 
void device_selected ()
 
void signals_changed ()
 
void trigger_event (util::Timestamp location)
 
void frame_began ()
 
void data_received ()
 
void frame_ended ()
 

Public Member Functions

 Session (DeviceManager &device_manager)
 
 ~Session ()
 
DeviceManagerdevice_manager ()
 
const DeviceManagerdevice_manager () const
 
std::shared_ptr< sigrok::Session > session () const
 
std::shared_ptr< devices::Devicedevice () const
 
void set_device (std::shared_ptr< devices::Device > device)
 
void set_default_device ()
 
capture_state get_capture_state () const
 
void start_capture (std::function< void(const QString)> error_handler)
 
void stop_capture ()
 
std::set< std::shared_ptr< data::SignalData > > get_data () const
 
double get_samplerate () const
 
const std::unordered_set< std::shared_ptr< view::Signal > > signals () const
 

Private Member Functions

void set_capture_state (capture_state state)
 
void update_signals ()
 
std::shared_ptr< view::Signalsignal_from_channel (std::shared_ptr< sigrok::Channel > channel) const
 
void sample_thread_proc (std::shared_ptr< devices::Device > device, std::function< void(const QString)> error_handler)
 
void feed_in_header ()
 
void feed_in_meta (std::shared_ptr< sigrok::Meta > meta)
 
void feed_in_trigger ()
 
void feed_in_frame_begin ()
 
void feed_in_logic (std::shared_ptr< sigrok::Logic > logic)
 
void feed_in_analog (std::shared_ptr< sigrok::Analog > analog)
 
void data_feed_in (std::shared_ptr< sigrok::Device > device, std::shared_ptr< sigrok::Packet > packet)
 

Private Attributes

DeviceManagerdevice_manager_
 
std::shared_ptr< devices::Devicedevice_
 
std::vector< std::shared_ptr< view::DecodeTrace > > decode_traces_
 
std::mutex sampling_mutex_
 Protects access to capture_state_. More...
 
capture_state capture_state_
 
boost::shared_mutex signals_mutex_
 
std::unordered_set< std::shared_ptr< view::Signal > > signals_
 
std::recursive_mutex data_mutex_
 
std::shared_ptr< data::Logiclogic_data_
 
uint64_t cur_samplerate_
 
std::shared_ptr< data::LogicSegmentcur_logic_segment_
 
std::map< std::shared_ptr< sigrok::Channel >, std::shared_ptr< data::AnalogSegment > > cur_analog_segments_
 
std::thread sampling_thread_
 
bool out_of_memory_
 

Detailed Description

Definition at line 80 of file session.hpp.

Member Enumeration Documentation

Enumerator
Stopped 
AwaitingTrigger 
Running 

Definition at line 85 of file session.hpp.

Constructor & Destructor Documentation

pv::Session::Session ( DeviceManager device_manager)

Definition at line 96 of file session.cpp.

pv::Session::~Session ( )

Definition at line 103 of file session.cpp.

Here is the call graph for this function:

Member Function Documentation

void pv::Session::capture_state_changed ( int  state)
signal

Definition at line 187 of file moc_session.cpp.

Here is the caller graph for this function:

void pv::Session::data_feed_in ( std::shared_ptr< sigrok::Device >  device,
std::shared_ptr< sigrok::Packet >  packet 
)
private

Definition at line 623 of file session.cpp.

Here is the caller graph for this function:

void pv::Session::data_received ( )
signal

Definition at line 219 of file moc_session.cpp.

Here is the caller graph for this function:

shared_ptr< devices::Device > pv::Session::device ( ) const

Definition at line 126 of file session.cpp.

Here is the caller graph for this function:

DeviceManager & pv::Session::device_manager ( )

Definition at line 109 of file session.cpp.

Here is the caller graph for this function:

const DeviceManager & pv::Session::device_manager ( ) const

Definition at line 114 of file session.cpp.

void pv::Session::device_selected ( )
signal

Definition at line 194 of file moc_session.cpp.

Here is the caller graph for this function:

void pv::Session::feed_in_analog ( std::shared_ptr< sigrok::Analog >  analog)
private

Definition at line 562 of file session.cpp.

Here is the call graph for this function:

void pv::Session::feed_in_frame_begin ( )
private

Definition at line 520 of file session.cpp.

void pv::Session::feed_in_header ( )
private

Definition at line 473 of file session.cpp.

void pv::Session::feed_in_logic ( std::shared_ptr< sigrok::Logic >  logic)
private

Definition at line 526 of file session.cpp.

Here is the call graph for this function:

void pv::Session::feed_in_meta ( std::shared_ptr< sigrok::Meta >  meta)
private

Definition at line 478 of file session.cpp.

void pv::Session::feed_in_trigger ( )
private

Definition at line 499 of file session.cpp.

Here is the call graph for this function:

void pv::Session::frame_began ( )
signal

Definition at line 213 of file moc_session.cpp.

Here is the caller graph for this function:

void pv::Session::frame_ended ( )
signal

Definition at line 225 of file moc_session.cpp.

Session::capture_state pv::Session::get_capture_state ( ) const

Definition at line 170 of file session.cpp.

Here is the caller graph for this function:

set< shared_ptr< data::SignalData > > pv::Session::get_data ( ) const

Definition at line 213 of file session.cpp.

Here is the caller graph for this function:

double pv::Session::get_samplerate ( ) const

Definition at line 225 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::Session::sample_thread_proc ( std::shared_ptr< devices::Device device,
std::function< void(const QString)>  error_handler 
)
private

Definition at line 438 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

shared_ptr< sigrok::Session > pv::Session::session ( ) const

Definition at line 119 of file session.cpp.

Here is the caller graph for this function:

void pv::Session::set_capture_state ( capture_state  state)
private

Definition at line 320 of file session.cpp.

Here is the caller graph for this function:

void pv::Session::set_default_device ( )

Definition at line 154 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::Session::set_device ( std::shared_ptr< devices::Device device)

Sets device instance that will be used in the next capture session.

Definition at line 131 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

shared_ptr< view::Signal > pv::Session::signal_from_channel ( std::shared_ptr< sigrok::Channel >  channel) const
private

Definition at line 426 of file session.cpp.

Here is the caller graph for this function:

const unordered_set< shared_ptr< view::Signal > > pv::Session::signals ( ) const

Definition at line 244 of file session.cpp.

Here is the caller graph for this function:

void pv::Session::signals_changed ( )
signal

Definition at line 200 of file moc_session.cpp.

Here is the caller graph for this function:

void pv::Session::start_capture ( std::function< void(const QString)>  error_handler)

Definition at line 176 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::Session::stop_capture ( )

Definition at line 203 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::Session::trigger_event ( util::Timestamp  location)
signal

Definition at line 206 of file moc_session.cpp.

Here is the caller graph for this function:

void pv::Session::update_signals ( )
private

Definition at line 334 of file session.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

capture_state pv::Session::capture_state_
private

Definition at line 167 of file session.hpp.

std::map< std::shared_ptr<sigrok::Channel>, std::shared_ptr<data::AnalogSegment> > pv::Session::cur_analog_segments_
private

Definition at line 177 of file session.hpp.

std::shared_ptr<data::LogicSegment> pv::Session::cur_logic_segment_
private

Definition at line 175 of file session.hpp.

uint64_t pv::Session::cur_samplerate_
private

Definition at line 174 of file session.hpp.

std::recursive_mutex pv::Session::data_mutex_
mutableprivate

Definition at line 172 of file session.hpp.

std::vector< std::shared_ptr<view::DecodeTrace> > pv::Session::decode_traces_
private

Definition at line 164 of file session.hpp.

std::shared_ptr<devices::Device> pv::Session::device_
private

Definition at line 162 of file session.hpp.

DeviceManager& pv::Session::device_manager_
private

Definition at line 161 of file session.hpp.

std::shared_ptr<data::Logic> pv::Session::logic_data_
private

Definition at line 173 of file session.hpp.

bool pv::Session::out_of_memory_
private

Definition at line 181 of file session.hpp.

std::mutex pv::Session::sampling_mutex_
mutableprivate

Protects access to capture_state_.

Definition at line 166 of file session.hpp.

std::thread pv::Session::sampling_thread_
private

Definition at line 179 of file session.hpp.

std::unordered_set< std::shared_ptr<view::Signal> > pv::Session::signals_
private

Definition at line 170 of file session.hpp.

boost::shared_mutex pv::Session::signals_mutex_
mutableprivate

Definition at line 169 of file session.hpp.


The documentation for this class was generated from the following files: