PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::data::MathSignal Class Reference

#include <mathsignal.hpp>

Inheritance diagram for pv::data::MathSignal:
Collaboration diagram for pv::data::MathSignal:

Signals

void expression_changed (QString expression)
 
- Signals inherited from pv::data::SignalBase
void enabled_changed (const bool &value)
 
void name_changed (const QString &name)
 
void color_changed (const QColor &color)
 
void error_message_changed (QString msg)
 
void conversion_type_changed (const ConversionType t)
 
void samples_cleared ()
 
void samples_added (uint64_t segment_id, uint64_t start_sample, uint64_t end_sample)
 
void min_max_changed (float min, float max)
 

Public Member Functions

 MathSignal (pv::Session &session)
 
virtual ~MathSignal ()
 
virtual void save_settings (QSettings &settings) const
 
virtual void restore_settings (QSettings &settings)
 
QString get_expression () const
 
void set_expression (QString expression)
 
- Public Member Functions inherited from pv::data::SignalBase
 SignalBase (shared_ptr< sigrok::Channel > channel, ChannelType channel_type)
 
virtual ~SignalBase ()
 
shared_ptr< sigrok::Channel > channel () const
 
bool is_generated () const
 
bool enabled () const
 
void set_enabled (bool value)
 
ChannelType type () const
 
unsigned int index () const
 
void set_index (unsigned int index)
 
unsigned int logic_bit_index () const
 
void set_group (SignalGroup *group)
 
SignalGroupgroup () const
 
QString name () const
 
QString internal_name () const
 
void set_internal_name (QString internal_name)
 
QString display_name () const
 
virtual void set_name (QString name)
 
QColor color () const
 
virtual void set_color (QColor color)
 
QColor bgcolor () const
 
virtual QString get_error_message () const
 
void set_data (shared_ptr< pv::data::SignalData > data)
 
void clear_sample_data ()
 
shared_ptr< pv::data::Analoganalog_data () const
 
shared_ptr< pv::data::Logiclogic_data () const
 
shared_ptr< pv::data::SignalDatadata () const
 
bool segment_is_complete (uint32_t segment_id) const
 
bool has_samples () const
 
virtual double get_samplerate () const
 
ConversionType get_conversion_type () const
 
void set_conversion_type (ConversionType t)
 
map< QString, QVariant > get_conversion_options () const
 
bool set_conversion_option (QString key, QVariant value)
 
vector< double > get_conversion_thresholds (const ConversionType t=NoConversion, const bool always_custom=false) const
 
vector< pair< QString, int > > get_conversion_presets () const
 
ConversionPreset get_current_conversion_preset () const
 
void set_conversion_preset (ConversionPreset id)
 
void start_conversion (bool delayed_start=false)
 

Properties

QString expression
 
- Properties inherited from pv::data::SignalBase
QString error_message
 

Private Slots

void on_capture_state_changed (int state)
 
void on_data_received ()
 
void on_enabled_changed ()
 

Private Member Functions

void set_error (uint8_t type, QString msg)
 
uint64_t get_working_sample_count (uint32_t segment_id) const
 
void update_completeness (uint32_t segment_id, uint64_t output_sample_count)
 
void reset_generation ()
 
virtual void begin_generation ()
 
uint64_t generate_samples (uint32_t segment_id, const uint64_t start_sample, const int64_t sample_count)
 
void generation_proc ()
 
signal_datasignal_from_name (const std::string &name)
 
void update_signal_sample (signal_data *sig_data, uint32_t segment_id, uint64_t sample_num)
 
bool all_input_signals_enabled (QString &disabled_signals) const
 

Private Attributes

pv::Sessionsession_
 
uint64_t custom_sample_rate_
 
uint64_t custom_sample_count_
 
bool use_custom_sample_rate_
 
bool use_custom_sample_count_
 
uint64_t generation_chunk_size_
 
map< std::string, signal_datainput_signals_
 
QString expression_
 
uint8_t error_type_
 
mutex input_mutex_
 
condition_variable gen_input_cond_
 
std::thread gen_thread_
 
atomic< bool > gen_interrupt_
 
exprtk::symbol_table< double > * exprtk_unknown_symbol_table_
 
exprtk::symbol_table< double > * exprtk_symbol_table_
 
exprtk::expression< double > * exprtk_expression_
 
exprtk::parser< double > * exprtk_parser_
 
double exprtk_current_time_
 
double exprtk_current_sample_
 
fnc_sample< double > * fnc_sample_
 

Static Private Attributes

static const int64_t ChunkLength = 256 * 1024
 

Friends

struct fnc_sample< double >
 

Additional Inherited Members

- Public Types inherited from pv::data::SignalBase
enum  ChannelType { AnalogChannel = 1, LogicChannel, DecodeChannel, MathChannel }
 
enum  ConversionType { NoConversion = 0, A2LConversionByThreshold = 1, A2LConversionBySchmittTrigger = 2 }
 
enum  ConversionPreset { NoPreset = -1, DynamicPreset = 0 }
 
- Static Public Attributes inherited from pv::data::SignalBase
static const QColor AnalogSignalColors [8]
 
static const QColor LogicSignalColors [10]
 
- Protected Member Functions inherited from pv::data::SignalBase
virtual void set_error_message (QString msg)
 
- Protected Attributes inherited from pv::data::SignalBase
shared_ptr< sigrok::Channel > channel_
 
ChannelType channel_type_
 
SignalGroupgroup_
 
shared_ptr< pv::data::SignalDatadata_
 
shared_ptr< pv::data::SignalDataconverted_data_
 
ConversionType conversion_type_
 
map< QString, QVariant > conversion_options_
 
float min_value_
 
float max_value_
 
std::thread conversion_thread_
 
atomic< bool > conversion_interrupt_
 
mutex conversion_input_mutex_
 
condition_variable conversion_input_cond_
 
QTimer delayed_conversion_starter_
 
QString internal_name_
 
QString name_
 
QColor color_
 
QColor bgcolor_
 
unsigned int index_
 
QString error_message_
 

Detailed Description

Definition at line 63 of file mathsignal.hpp.

Constructor & Destructor Documentation

pv::data::MathSignal::MathSignal ( pv::Session session)

Definition at line 93 of file mathsignal.cpp.

Here is the call graph for this function:

pv::data::MathSignal::~MathSignal ( )
virtual

Definition at line 116 of file mathsignal.cpp.

Here is the call graph for this function:

Member Function Documentation

bool pv::data::MathSignal::all_input_signals_enabled ( QString &  disabled_signals) const
private

Definition at line 571 of file mathsignal.cpp.

Here is the caller graph for this function:

void pv::data::MathSignal::begin_generation ( )
privatevirtual

Definition at line 301 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::expression_changed ( QString  expression)
signal

Definition at line 184 of file moc_mathsignal.cpp.

uint64_t pv::data::MathSignal::generate_samples ( uint32_t  segment_id,
const uint64_t  start_sample,
const int64_t  sample_count 
)
private

Definition at line 386 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::generation_proc ( )
private

Definition at line 430 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString pv::data::MathSignal::get_expression ( ) const

Definition at line 153 of file mathsignal.cpp.

uint64_t pv::data::MathSignal::get_working_sample_count ( uint32_t  segment_id) const
private

Returns the number of samples that can be worked on, i.e. the number of samples where samples are available for all connected channels. If the math signal uses no input channels, this is the number of samples in the session.

Definition at line 175 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::on_capture_state_changed ( int  state)
privateslot

Definition at line 590 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::on_data_received ( )
privateslot

Definition at line 600 of file mathsignal.cpp.

Here is the caller graph for this function:

void pv::data::MathSignal::on_enabled_changed ( )
privateslot

Definition at line 605 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::reset_generation ( )
private

Definition at line 255 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::restore_settings ( QSettings settings)
virtual

Reimplemented from pv::data::SignalBase.

Definition at line 133 of file mathsignal.cpp.

Here is the call graph for this function:

void pv::data::MathSignal::save_settings ( QSettings settings) const
virtual

Reimplemented from pv::data::SignalBase.

Definition at line 121 of file mathsignal.cpp.

Here is the call graph for this function:

void pv::data::MathSignal::set_error ( uint8_t  type,
QString  msg 
)
private

Definition at line 165 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::set_expression ( QString  expression)

Definition at line 158 of file mathsignal.cpp.

Here is the call graph for this function:

signal_data * pv::data::MathSignal::signal_from_name ( const std::string &  name)
private

Definition at line 500 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::update_completeness ( uint32_t  segment_id,
uint64_t  output_sample_count 
)
private

Definition at line 213 of file mathsignal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::MathSignal::update_signal_sample ( signal_data sig_data,
uint32_t  segment_id,
uint64_t  sample_num 
)
private

Definition at line 542 of file mathsignal.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

friend struct fnc_sample< double >
friend

Definition at line 143 of file mathsignal.hpp.

Member Data Documentation

const int64_t pv::data::MathSignal::ChunkLength = 256 * 1024
staticprivate

Definition at line 69 of file mathsignal.hpp.

uint64_t pv::data::MathSignal::custom_sample_count_
private

Definition at line 120 of file mathsignal.hpp.

uint64_t pv::data::MathSignal::custom_sample_rate_
private

Definition at line 119 of file mathsignal.hpp.

uint8_t pv::data::MathSignal::error_type_
private

Definition at line 127 of file mathsignal.hpp.

QString pv::data::MathSignal::expression_
private

Definition at line 125 of file mathsignal.hpp.

double pv::data::MathSignal::exprtk_current_sample_
private

Definition at line 138 of file mathsignal.hpp.

double pv::data::MathSignal::exprtk_current_time_
private

Definition at line 138 of file mathsignal.hpp.

exprtk::expression<double>* pv::data::MathSignal::exprtk_expression_
private

Definition at line 136 of file mathsignal.hpp.

exprtk::parser<double>* pv::data::MathSignal::exprtk_parser_
private

Definition at line 137 of file mathsignal.hpp.

exprtk::symbol_table<double> * pv::data::MathSignal::exprtk_symbol_table_
private

Definition at line 135 of file mathsignal.hpp.

exprtk::symbol_table<double>* pv::data::MathSignal::exprtk_unknown_symbol_table_
private

Definition at line 135 of file mathsignal.hpp.

fnc_sample<double>* pv::data::MathSignal::fnc_sample_
private

Definition at line 140 of file mathsignal.hpp.

condition_variable pv::data::MathSignal::gen_input_cond_
mutableprivate

Definition at line 130 of file mathsignal.hpp.

atomic<bool> pv::data::MathSignal::gen_interrupt_
private

Definition at line 133 of file mathsignal.hpp.

std::thread pv::data::MathSignal::gen_thread_
private

Definition at line 132 of file mathsignal.hpp.

uint64_t pv::data::MathSignal::generation_chunk_size_
private

Definition at line 122 of file mathsignal.hpp.

mutex pv::data::MathSignal::input_mutex_
mutableprivate

Definition at line 129 of file mathsignal.hpp.

map<std::string, signal_data> pv::data::MathSignal::input_signals_
private

Definition at line 123 of file mathsignal.hpp.

pv::Session& pv::data::MathSignal::session_
private

Definition at line 117 of file mathsignal.hpp.

bool pv::data::MathSignal::use_custom_sample_count_
private

Definition at line 121 of file mathsignal.hpp.

bool pv::data::MathSignal::use_custom_sample_rate_
private

Definition at line 121 of file mathsignal.hpp.

Property Documentation

QString pv::data::MathSignal::expression
readwrite

Definition at line 66 of file mathsignal.hpp.


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