forked from Ivasoft/DSView
Remove SIGNAL_TYPE type, and update Trace class
This commit is contained in:
@@ -440,7 +440,7 @@ void DecoderStack::do_decode_work()
|
||||
for (auto dec : _stack) {
|
||||
if (!dec->channels().empty()) {
|
||||
for(auto s : _session->get_signals()) {
|
||||
if(s->get_index() == (*dec->channels().begin()).second && s->signal_type() == LOGIC_SIGNAL)
|
||||
if(s->get_index() == (*dec->channels().begin()).second && s->signal_type() == SR_CHANNEL_LOGIC)
|
||||
{
|
||||
_snapshot = ((pv::view::LogicSignal*)s)->data();
|
||||
if (_snapshot != NULL)
|
||||
|
||||
@@ -173,7 +173,7 @@ void SpectrumStack::calc_fft()
|
||||
pv::view::DsoSignal *dsoSig = NULL;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_index() == _index && dsoSig->enabled()) {
|
||||
data = dsoSig->data();
|
||||
|
||||
@@ -282,7 +282,7 @@ DsComboBox* DecoderOptionsDlg::create_probe_selector(
|
||||
|
||||
for(auto s : sigs)
|
||||
{
|
||||
if (s->signal_type() == LOGIC_SIGNAL && s->enabled()){
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC && s->enabled()){
|
||||
selector->addItem(s->get_name(),QVariant::fromValue(s->get_index()));
|
||||
|
||||
if (probe_iter != _dec->channels().end()) {
|
||||
|
||||
@@ -57,7 +57,7 @@ DsoMeasure::DsoMeasure(SigSession *session, View &parent,
|
||||
_measure_tab->setUsesScrollButtons(false);
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL && s->enabled()) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO && s->enabled()) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
QWidget *measure_widget = new QWidget(this);
|
||||
this->add_measure(measure_widget, dsoSig);
|
||||
@@ -161,7 +161,7 @@ void DsoMeasure::accept()
|
||||
enum DSO_MEASURE_TYPE ms_type = DSO_MEASURE_TYPE(id.toInt());
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (_measure_tab->currentWidget()->property("index").toInt() == dsoSig->get_index()) {
|
||||
_view.get_viewstatus()->set_measure(_position, false, dsoSig->get_index(), ms_type);
|
||||
|
||||
@@ -69,7 +69,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession *session) :
|
||||
|
||||
// setup _ch_combobox
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
_ch_combobox->addItem(dsoSig->get_name(), QVariant::fromValue(dsoSig->get_index()));
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ LissajousOptions::LissajousOptions(SigSession *session, QWidget *parent) :
|
||||
QHBoxLayout *ylayout = new QHBoxLayout();
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
QString index_str = QString::number(dsoSig->get_index());
|
||||
QRadioButton *xradio = new QRadioButton(index_str, _x_group);
|
||||
@@ -183,7 +183,7 @@ void LissajousOptions::accept()
|
||||
_session->lissajous_rebuild(enable, xindex, yindex, _percent->value());
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->set_show(!enable);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ MathOptions::MathOptions(SigSession *session, QWidget *parent) :
|
||||
QHBoxLayout *src2_layout = new QHBoxLayout();
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
QString index_str = QString::number(dsoSig->get_index());
|
||||
QRadioButton *xradio = new QRadioButton(index_str, _src1_group);
|
||||
@@ -208,7 +208,7 @@ void MathOptions::accept()
|
||||
view::DsoSignal *dsoSig2 = NULL;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_index() == src1)
|
||||
dsoSig1 = dsoSig;
|
||||
|
||||
@@ -53,7 +53,7 @@ Search::Search(QWidget *parent, SigSession *session, std::map<uint16_t, QString>
|
||||
int index = 0;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
QLineEdit *search_lineEdit = new QLineEdit(this);
|
||||
if (pattern.find(logicSig->get_index()) != pattern.end())
|
||||
@@ -113,7 +113,7 @@ std::map<uint16_t, QString> Search::get_pattern()
|
||||
|
||||
int index = 0;
|
||||
for(auto s :_session->get_signals()) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
pattern[logicSig->get_index()] = _search_lineEdit_vec[index]->text();
|
||||
index++;
|
||||
|
||||
@@ -185,7 +185,7 @@ void WaitingDialog::changeText()
|
||||
if (_device_agent->get_config_bool(SR_CONF_ZERO_COMB_FGAIN, zero_fgain) && zero_fgain) {
|
||||
|
||||
for(auto s : _session->get_signals()){
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->set_enable(dsoSig->get_index() == 0);
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ void DsoTriggerDock::update_view()
|
||||
_channel_comboBox->clear();
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
_channel_comboBox->addItem(dsoSig->get_name(), QVariant::fromValue(dsoSig->get_index()));
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ void MeasureDock::update_edge()
|
||||
const auto &sigs = _session->get_signals();
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC
|
||||
&& s->enabled()
|
||||
&& s->get_index() == _edge_ch_cmb_vec[edge_index]->currentText().toInt())
|
||||
{
|
||||
@@ -663,7 +663,7 @@ void MeasureDock::update_probe_selector(DsComboBox *selector)
|
||||
selector->clear();
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL && s->enabled()){
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC && s->enabled()){
|
||||
selector->addItem(QString::number(s->get_index()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,7 +907,7 @@ void TriggerDock::try_commit_trigger()
|
||||
{
|
||||
/* simple trigger check trigger_enable */
|
||||
for(auto s : _session->get_signals()){
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
if (logicSig->commit_trig())
|
||||
num++;
|
||||
@@ -929,7 +929,7 @@ void TriggerDock::try_commit_trigger()
|
||||
|
||||
if (msg.mBox()->clickedButton() == cancelButton) {
|
||||
for(auto s : _session->get_signals()){
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
logicSig->set_trig(view::LogicSignal::NONTRIG);
|
||||
logicSig->commit_trig();
|
||||
|
||||
@@ -704,6 +704,7 @@ namespace pv
|
||||
{
|
||||
QJsonObject s_obj;
|
||||
s_obj["index"] = s->get_index();
|
||||
s_obj["view_index"] = s->get_view_index();
|
||||
s_obj["type"] = s->get_type();
|
||||
s_obj["enabled"] = s->enabled();
|
||||
s_obj["name"] = s->get_name();
|
||||
@@ -719,7 +720,7 @@ namespace pv
|
||||
s_obj["strigger"] = logicSig->get_trig();
|
||||
}
|
||||
|
||||
if (s->signal_type() == DSO_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
{
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
s_obj["vdiv"] = QJsonValue::fromVariant(static_cast<qulonglong>(dsoSig->get_vDialValue()));
|
||||
@@ -729,7 +730,7 @@ namespace pv
|
||||
s_obj["zeroPos"] = dsoSig->get_zero_ratio();
|
||||
}
|
||||
|
||||
if (s->signal_type() == ANALOG_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_ANALOG)
|
||||
{
|
||||
view::AnalogSignal *analogSig = (view::AnalogSignal*)s;
|
||||
s_obj["vdiv"] = QJsonValue::fromVariant(static_cast<qulonglong>(analogSig->get_vdiv()));
|
||||
@@ -928,8 +929,8 @@ namespace pv
|
||||
{
|
||||
QJsonObject obj = value.toObject();
|
||||
|
||||
if ((probe->index == obj["index"].toDouble()) &&
|
||||
(probe->type == obj["type"].toDouble()))
|
||||
if ((probe->index == obj["index"].toInt()) &&
|
||||
(probe->type == obj["type"].toInt()))
|
||||
{
|
||||
isEnabled = true;
|
||||
QString chan_name = obj["name"].toString().trimmed();
|
||||
@@ -976,7 +977,7 @@ namespace pv
|
||||
{
|
||||
s->set_colour(QColor(obj["colour"].toString()));
|
||||
|
||||
if (s->signal_type() == DSO_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
{
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->load_settings();
|
||||
@@ -996,8 +997,8 @@ namespace pv
|
||||
for (const QJsonValue &value : sessionObj["channel"].toArray())
|
||||
{
|
||||
QJsonObject obj = value.toObject();
|
||||
if ((s->get_index() == obj["index"].toDouble()) &&
|
||||
(s->get_type() == obj["type"].toDouble()))
|
||||
if ((s->get_index() == obj["index"].toInt()) &&
|
||||
(s->get_type() == obj["type"].toInt()))
|
||||
{
|
||||
QString chan_name = obj["name"].toString().trimmed();
|
||||
if (chan_name == ""){
|
||||
@@ -1013,7 +1014,7 @@ namespace pv
|
||||
logicSig->set_trig(obj["strigger"].toDouble());
|
||||
}
|
||||
|
||||
if (s->signal_type() == DSO_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
{
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->load_settings();
|
||||
@@ -1022,13 +1023,18 @@ namespace pv
|
||||
dsoSig->commit_settings();
|
||||
}
|
||||
|
||||
if (s->signal_type() == ANALOG_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_ANALOG)
|
||||
{
|
||||
view::AnalogSignal *analogSig = (view::AnalogSignal*)s;
|
||||
analogSig->set_zero_ratio(obj["zeroPos"].toDouble());
|
||||
analogSig->commit_settings();
|
||||
}
|
||||
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC && obj.contains("view_index"))
|
||||
{
|
||||
_session->set_channel_view_index(s->get_index(), obj["view_index"].toInt());
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1214,7 +1220,7 @@ namespace pv
|
||||
case Qt::Key_0:
|
||||
for (auto s : sigs)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
{
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_index() == 0)
|
||||
@@ -1230,7 +1236,7 @@ namespace pv
|
||||
case Qt::Key_1:
|
||||
for (auto s : sigs)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
{
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_index() == 1)
|
||||
@@ -1246,7 +1252,7 @@ namespace pv
|
||||
case Qt::Key_Up:
|
||||
for (auto s : sigs)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_vDialActive())
|
||||
{
|
||||
@@ -1261,7 +1267,7 @@ namespace pv
|
||||
case Qt::Key_Down:
|
||||
for (auto s : sigs)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_vDialActive())
|
||||
{
|
||||
|
||||
@@ -437,11 +437,11 @@ namespace pv
|
||||
// update current hw offset
|
||||
for (auto s : _signals)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->set_zero_ratio(dsoSig->get_zero_ratio());
|
||||
}
|
||||
else if (s->signal_type() == ANALOG_SIGNAL){
|
||||
else if (s->signal_type() == SR_CHANNEL_ANALOG){
|
||||
view::AnalogSignal *analogSig = (view::AnalogSignal*)s;
|
||||
analogSig->set_zero_ratio(analogSig->get_zero_ratio());
|
||||
}
|
||||
@@ -584,7 +584,7 @@ namespace pv
|
||||
{
|
||||
// reset measure of dso signal
|
||||
for (auto s : _signals){
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->set_mValid(false);
|
||||
}
|
||||
@@ -914,7 +914,7 @@ namespace pv
|
||||
{
|
||||
if ((*i)->get_index() == probe->index)
|
||||
{
|
||||
if ((*i)->signal_type() == LOGIC_SIGNAL){
|
||||
if ((*i)->signal_type() == SR_CHANNEL_LOGIC){
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)(*i);
|
||||
signal = new view::LogicSignal(logicSig, _view_data->get_logic(), probe);
|
||||
}
|
||||
@@ -941,7 +941,7 @@ namespace pv
|
||||
{
|
||||
if ((*i)->get_index() == probe->index)
|
||||
{
|
||||
if ((*i)->signal_type() == ANALOG_SIGNAL){
|
||||
if ((*i)->signal_type() == SR_CHANNEL_ANALOG){
|
||||
view::AnalogSignal *analogSig = (view::AnalogSignal*)(*i);
|
||||
signal = new view::AnalogSignal(analogSig, _view_data->get_analog(), probe);
|
||||
}
|
||||
@@ -1132,7 +1132,7 @@ namespace pv
|
||||
// reset scale of dso signal
|
||||
for (auto s : _signals)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->set_scale(dsoSig->get_view_rect().height());
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ namespace pv
|
||||
|
||||
for (auto s : _signals)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL && (s->enabled())){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO && (s->enabled())){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->paint_prepare();
|
||||
}
|
||||
@@ -1211,7 +1211,7 @@ namespace pv
|
||||
// reset scale of analog signal
|
||||
for (auto s : _signals)
|
||||
{
|
||||
if (s->signal_type() == ANALOG_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_ANALOG){
|
||||
view::AnalogSignal *analogSig = (view::AnalogSignal*)s;
|
||||
analogSig->set_scale(analogSig->get_totalHeight());
|
||||
}
|
||||
@@ -1348,11 +1348,11 @@ namespace pv
|
||||
if (!s->enabled())
|
||||
continue;
|
||||
|
||||
if (s->signal_type() == LOGIC_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC)
|
||||
logic_ch_num++;
|
||||
else if (s->signal_type() == DSO_SIGNAL)
|
||||
else if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
dso_ch_num++;
|
||||
else if (s->signal_type() == ANALOG_SIGNAL)
|
||||
else if (s->signal_type() == SR_CHANNEL_ANALOG)
|
||||
analog_ch_num++;
|
||||
}
|
||||
}
|
||||
@@ -1552,7 +1552,7 @@ namespace pv
|
||||
|
||||
for (auto s : _signals)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
has_dso_signal = true;
|
||||
// check already have
|
||||
auto iter = _spectrum_traces.begin();
|
||||
@@ -1676,7 +1676,7 @@ namespace pv
|
||||
{
|
||||
for (auto s : _signals)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL)
|
||||
if (s->signal_type() == SR_CHANNEL_DSO)
|
||||
{
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->auto_end();
|
||||
@@ -2223,15 +2223,15 @@ namespace pv
|
||||
for (auto sig : _signals){
|
||||
int type = sig->signal_type();
|
||||
switch(type){
|
||||
case LOGIC_SIGNAL:
|
||||
case SR_CHANNEL_LOGIC:
|
||||
s1 = (view::LogicSignal*)sig;
|
||||
s1->set_data(data->get_logic());
|
||||
break;
|
||||
case ANALOG_SIGNAL:
|
||||
case SR_CHANNEL_ANALOG:
|
||||
s2 = (view::AnalogSignal*)sig;
|
||||
s2->set_data(data->get_analog());
|
||||
break;
|
||||
case DSO_SIGNAL:
|
||||
case SR_CHANNEL_DSO:
|
||||
s3 = (view::DsoSignal*)sig;
|
||||
s3->set_data(data->get_dso());
|
||||
break;
|
||||
@@ -2312,4 +2312,22 @@ namespace pv
|
||||
}
|
||||
}
|
||||
|
||||
view::Trace* SigSession::get_channel_by_index(int orgIndex)
|
||||
{
|
||||
for(auto t : _signals){
|
||||
if (t->get_index() == orgIndex){
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void SigSession::set_channel_view_index(int orgIndex, int viewIndex)
|
||||
{
|
||||
auto trace = get_channel_by_index(orgIndex);
|
||||
if (trace != NULL){
|
||||
trace->set_view_index(viewIndex);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace pv
|
||||
|
||||
@@ -428,6 +428,8 @@ public:
|
||||
_decoder_pannel = pannel;
|
||||
}
|
||||
|
||||
void set_channel_view_index(int orgIndex, int viewIndex);
|
||||
|
||||
private:
|
||||
void set_cur_samplelimits(uint64_t samplelimits);
|
||||
void set_cur_snap_samplerate(uint64_t samplerate);
|
||||
@@ -516,6 +518,8 @@ private:
|
||||
inline void data_unlock(){
|
||||
_data_lock = false;
|
||||
}
|
||||
|
||||
view::Trace* get_channel_by_index(int orgIndex);
|
||||
|
||||
private:
|
||||
mutable std::mutex _sampling_mutex;
|
||||
|
||||
@@ -322,7 +322,7 @@ namespace pv
|
||||
{
|
||||
for (auto s : _session->get_signals())
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->set_enable(true);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ namespace pv
|
||||
{
|
||||
for (auto s : _session->get_signals())
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->commit_settings();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ AnalogSignal::AnalogSignal(data::AnalogSnapshot *data, sr_channel *probe) :
|
||||
_typeWidth = 5;
|
||||
_colour = SignalColours[probe->index % countof(SignalColours)];
|
||||
|
||||
_signal_type = ANALOG_SIGNAL;
|
||||
uint32_t ui32;
|
||||
|
||||
// channel bits
|
||||
@@ -92,9 +91,7 @@ AnalogSignal::AnalogSignal(view::AnalogSignal *s, pv::data::AnalogSnapshot *data
|
||||
_hover_index(0),
|
||||
_hover_point(QPointF(-1, -1)),
|
||||
_hover_value(0)
|
||||
{
|
||||
_signal_type = ANALOG_SIGNAL;
|
||||
|
||||
{
|
||||
_typeWidth = 5;
|
||||
_bits = s->get_bits();
|
||||
_ref_min = s->get_ref_min();
|
||||
|
||||
@@ -381,7 +381,7 @@ void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
|
||||
const double mark_end = a.end_sample() / samples_per_pixel - pixels_offset;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if((s->get_index() == iter.second) && s->signal_type() == LOGIC_SIGNAL) {
|
||||
if((s->get_index() == iter.second) && s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
logicSig->paint_mark(p, start, mark_end, type/100);
|
||||
break;
|
||||
|
||||
@@ -64,8 +64,6 @@ DsoSignal::DsoSignal(data::DsoSnapshot *data,
|
||||
for(uint64_t i = 0; i < vDialUnitCount; i++){
|
||||
vUnit.append(vDialUnit[i]);
|
||||
}
|
||||
|
||||
_signal_type = DSO_SIGNAL;
|
||||
|
||||
_vDial = NULL;
|
||||
_period = 0;
|
||||
|
||||
@@ -200,7 +200,7 @@ void Header::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
for(auto t : traces){
|
||||
if (t->signal_type() == LOGIC_SIGNAL && _view.session().is_working()){
|
||||
if (t->signal_type() == SR_CHANNEL_LOGIC && _view.session().is_working()){
|
||||
// Disable set trigger from left pannel when capturing.
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,7 @@ LogicSignal::LogicSignal(data::LogicSnapshot *data,
|
||||
Signal(probe),
|
||||
_data(data)
|
||||
{
|
||||
_trig = NONTRIG;
|
||||
_signal_type = LOGIC_SIGNAL;
|
||||
_trig = NONTRIG;
|
||||
_paint_align_sample_count = 0;
|
||||
}
|
||||
|
||||
@@ -55,8 +54,7 @@ LogicSignal::LogicSignal(view::LogicSignal *s,
|
||||
Signal(*s, probe),
|
||||
_data(data),
|
||||
_trig(s->get_trig())
|
||||
{
|
||||
_signal_type = LOGIC_SIGNAL;
|
||||
{
|
||||
_paint_align_sample_count = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ SpectrumTrace::SpectrumTrace(pv::SigSession *session,
|
||||
_typeWidth = 0;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL && index == s->get_index()){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO && index == s->get_index()){
|
||||
_colour = s->get_colour();
|
||||
}
|
||||
}
|
||||
@@ -304,7 +304,7 @@ void SpectrumTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QCo
|
||||
double vfactor = 0;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if(dsoSig->get_index() == _spectrum_stack->get_index()) {
|
||||
vdiv = dsoSig->get_vDialValue();
|
||||
|
||||
@@ -58,7 +58,7 @@ Trace::Trace(QString name, uint16_t index, int type) :
|
||||
_typeWidth(SquareNum)
|
||||
{
|
||||
_index_list.push_back(index);
|
||||
_signal_type = UNKNOWN_SIGNAL;
|
||||
_view_index = 0;
|
||||
}
|
||||
|
||||
Trace::Trace(QString name, std::list<int> index_list, int type, int sec_index) :
|
||||
@@ -71,7 +71,7 @@ Trace::Trace(QString name, std::list<int> index_list, int type, int sec_index) :
|
||||
_totalHeight(30),
|
||||
_typeWidth(SquareNum)
|
||||
{
|
||||
_signal_type = UNKNOWN_SIGNAL;
|
||||
_view_index = 0;
|
||||
}
|
||||
|
||||
Trace::Trace(const Trace &t) :
|
||||
@@ -87,13 +87,9 @@ Trace::Trace(const Trace &t) :
|
||||
_typeWidth(t._typeWidth),
|
||||
_text_size(t._text_size)
|
||||
{
|
||||
_signal_type = UNKNOWN_SIGNAL;
|
||||
_view_index = 0;
|
||||
}
|
||||
|
||||
QString Trace::get_name()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
int Trace::get_name_width()
|
||||
{
|
||||
@@ -108,32 +104,6 @@ void Trace::set_name(QString name)
|
||||
_name = name;
|
||||
}
|
||||
|
||||
QColor Trace::get_colour()
|
||||
{
|
||||
return _colour;
|
||||
}
|
||||
|
||||
void Trace::set_colour(QColor colour)
|
||||
{
|
||||
_colour = colour;
|
||||
}
|
||||
|
||||
int Trace::get_v_offset()
|
||||
{
|
||||
return _v_offset;
|
||||
}
|
||||
|
||||
void Trace::set_v_offset(int v_offset)
|
||||
{
|
||||
_v_offset = v_offset;
|
||||
}
|
||||
|
||||
|
||||
int Trace::get_type()
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
int Trace::get_index()
|
||||
{
|
||||
if(_index_list.size() == 0){
|
||||
@@ -143,11 +113,6 @@ int Trace::get_index()
|
||||
return _index_list.front();
|
||||
}
|
||||
|
||||
std::list<int> Trace::get_index_list()
|
||||
{
|
||||
return _index_list;
|
||||
}
|
||||
|
||||
void Trace::set_index_list(const std::list<int> &index_list)
|
||||
{
|
||||
if (index_list.size() == 0){
|
||||
@@ -157,44 +122,13 @@ void Trace::set_index_list(const std::list<int> &index_list)
|
||||
_index_list = index_list;
|
||||
}
|
||||
|
||||
int Trace::get_sec_index()
|
||||
{
|
||||
return _sec_index;
|
||||
}
|
||||
|
||||
void Trace::set_sec_index(int sec_index)
|
||||
{
|
||||
_sec_index = sec_index;
|
||||
}
|
||||
|
||||
int Trace::get_old_v_offset()
|
||||
{
|
||||
return _old_v_offset;
|
||||
}
|
||||
|
||||
void Trace::set_old_v_offset(int v_offset)
|
||||
{
|
||||
_old_v_offset = v_offset;
|
||||
}
|
||||
|
||||
int Trace::get_zero_vpos()
|
||||
{
|
||||
return _v_offset;
|
||||
}
|
||||
|
||||
int Trace::get_totalHeight()
|
||||
{
|
||||
return _totalHeight;
|
||||
}
|
||||
|
||||
void Trace::set_totalHeight(int height)
|
||||
{
|
||||
_totalHeight = height;
|
||||
}
|
||||
|
||||
void Trace::resize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Trace::set_view(pv::view::View *view)
|
||||
@@ -204,23 +138,12 @@ void Trace::set_view(pv::view::View *view)
|
||||
connect(_view, SIGNAL(resize()), this, SLOT(resize()));
|
||||
}
|
||||
|
||||
pv::view::View* Trace::get_view()
|
||||
{
|
||||
return _view;
|
||||
}
|
||||
|
||||
void Trace::set_viewport(pv::view::Viewport *viewport)
|
||||
{
|
||||
assert(viewport);
|
||||
_viewport = viewport;
|
||||
}
|
||||
|
||||
pv::view::Viewport* Trace::get_viewport()
|
||||
{
|
||||
return _viewport;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Trace::paint_prepare()
|
||||
{
|
||||
assert(_view);
|
||||
@@ -414,11 +337,6 @@ QRect Trace::get_view_rect()
|
||||
return QRect(0, 0, _view->viewport()->width(), _view->viewport()->height());
|
||||
}
|
||||
|
||||
int Trace::get_y()
|
||||
{
|
||||
return _v_offset;
|
||||
}
|
||||
|
||||
QColor Trace::get_text_colour()
|
||||
{
|
||||
return (_colour.lightness() > 64) ? Qt::black : Qt::white;
|
||||
@@ -441,21 +359,6 @@ int Trace::rows_size()
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Trace::get_leftWidth()
|
||||
{
|
||||
return SquareWidth/2 + Margin;
|
||||
}
|
||||
|
||||
int Trace::get_rightWidth()
|
||||
{
|
||||
return 2 * Margin + _typeWidth * SquareWidth + 1.5 * SquareWidth;
|
||||
}
|
||||
|
||||
int Trace::get_headerHeight()
|
||||
{
|
||||
return SquareWidth;
|
||||
}
|
||||
|
||||
QRectF Trace::get_rect(const char *s, int y, int right)
|
||||
{
|
||||
const QSizeF color_size(get_leftWidth() - Margin, SquareWidth);
|
||||
|
||||
@@ -36,14 +36,6 @@
|
||||
|
||||
class QFormLayout;
|
||||
|
||||
enum SIGNAL_TYPE
|
||||
{
|
||||
UNKNOWN_SIGNAL = 0,
|
||||
LOGIC_SIGNAL = 1,
|
||||
DSO_SIGNAL = 2,
|
||||
ANALOG_SIGNAL = 3,
|
||||
};
|
||||
|
||||
namespace pv {
|
||||
namespace view {
|
||||
|
||||
@@ -81,7 +73,10 @@ public:
|
||||
/**
|
||||
* Gets the name of this signal.
|
||||
*/
|
||||
QString get_name();
|
||||
inline QString get_name(){
|
||||
return _name;
|
||||
}
|
||||
|
||||
virtual int get_name_width();
|
||||
|
||||
/**
|
||||
@@ -92,63 +87,99 @@ public:
|
||||
/**
|
||||
* Get the colour of the signal.
|
||||
*/
|
||||
QColor get_colour();
|
||||
inline QColor get_colour(){
|
||||
return _colour;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the colour of the signal.
|
||||
*/
|
||||
void set_colour(QColor colour);
|
||||
inline void set_colour(QColor colour){
|
||||
_colour = colour;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vertical layout offset of this signal.
|
||||
*/
|
||||
int get_v_offset();
|
||||
inline int get_v_offset(){
|
||||
return _v_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the vertical layout offset of this signal.
|
||||
*/
|
||||
void set_v_offset(int v_offset);
|
||||
inline void set_v_offset(int v_offset){
|
||||
_v_offset = v_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets trace type
|
||||
*/
|
||||
int get_type();
|
||||
inline int get_type(){
|
||||
return _type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Index process
|
||||
*/
|
||||
int get_index();
|
||||
std::list<int> get_index_list();
|
||||
|
||||
inline std::list<int> get_index_list(){
|
||||
return _index_list;
|
||||
}
|
||||
|
||||
void set_index_list(const std::list<int> &index_list);
|
||||
int get_sec_index();
|
||||
void set_sec_index(int sec_index);
|
||||
|
||||
inline int get_sec_index(){
|
||||
return _sec_index;
|
||||
}
|
||||
|
||||
inline void set_sec_index(int sec_index){
|
||||
_sec_index = sec_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the height of this signal.
|
||||
*/
|
||||
int get_totalHeight();
|
||||
inline int get_totalHeight(){
|
||||
return _totalHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the height of this signal.
|
||||
*/
|
||||
void set_totalHeight(int height);
|
||||
inline void set_totalHeight(int height){
|
||||
_totalHeight = height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Geom
|
||||
*/
|
||||
int get_leftWidth();
|
||||
int get_rightWidth();
|
||||
int get_headerHeight();
|
||||
inline int get_leftWidth(){
|
||||
return SquareWidth/2 + Margin;
|
||||
}
|
||||
|
||||
inline int get_rightWidth(){
|
||||
return 2 * Margin + _typeWidth * SquareWidth + 1.5 * SquareWidth;
|
||||
}
|
||||
|
||||
inline int get_headerHeight(){
|
||||
return SquareWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the old vertical layout offset of this signal.
|
||||
*/
|
||||
int get_old_v_offset();
|
||||
inline int get_old_v_offset(){
|
||||
return _old_v_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the old vertical layout offset of this signal.
|
||||
*/
|
||||
void set_old_v_offset(int v_offset);
|
||||
inline void set_old_v_offset(int v_offset){
|
||||
_old_v_offset = v_offset;
|
||||
}
|
||||
|
||||
virtual int get_zero_vpos();
|
||||
|
||||
@@ -158,9 +189,16 @@ public:
|
||||
virtual bool enabled() = 0;
|
||||
|
||||
virtual void set_view(pv::view::View *view);
|
||||
pv::view::View* get_view();
|
||||
|
||||
inline pv::view::View* get_view(){
|
||||
return _view;
|
||||
}
|
||||
|
||||
virtual void set_viewport(pv::view::Viewport *viewport);
|
||||
pv::view::Viewport* get_viewport();
|
||||
|
||||
inline pv::view::Viewport* get_viewport(){
|
||||
return _viewport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paints prepare
|
||||
@@ -203,7 +241,9 @@ public:
|
||||
/**
|
||||
* Gets the y-offset of the axis.
|
||||
*/
|
||||
int get_y();
|
||||
inline int get_y(){
|
||||
return _v_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a point is in the header rect.
|
||||
@@ -243,8 +283,16 @@ public:
|
||||
|
||||
virtual bool mouse_wheel(int right, const QPoint pt, const int shift);
|
||||
|
||||
inline SIGNAL_TYPE signal_type(){
|
||||
return _signal_type;
|
||||
inline int signal_type(){
|
||||
return get_type();
|
||||
}
|
||||
|
||||
inline void set_view_index(int index){
|
||||
_view_index = index;
|
||||
}
|
||||
|
||||
inline int get_view_index(){
|
||||
return _view_index;
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -296,9 +344,9 @@ protected:
|
||||
int _old_v_offset;
|
||||
int _totalHeight;
|
||||
int _typeWidth;
|
||||
int _view_index;
|
||||
|
||||
QSizeF _text_size;
|
||||
SIGNAL_TYPE _signal_type;
|
||||
QSizeF _text_size;
|
||||
};
|
||||
|
||||
} // namespace view
|
||||
|
||||
@@ -591,6 +591,8 @@ void View::signals_changed()
|
||||
std::vector<Trace*> time_traces;
|
||||
std::vector<Trace*> fft_traces;
|
||||
std::vector<Trace*> traces;
|
||||
std::vector<Trace*> logic_traces;
|
||||
std::vector<Trace*> decoder_traces;
|
||||
|
||||
get_traces(ALL_VIEW, traces);
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ void Viewport::paintSignals(QPainter &p, QColor fore, QColor back)
|
||||
for(auto t : traces){
|
||||
if (t->enabled()){
|
||||
|
||||
if (t->signal_type() == LOGIC_SIGNAL)
|
||||
if (t->signal_type() == SR_CHANNEL_LOGIC)
|
||||
{
|
||||
LogicSignal *logic_signal = (LogicSignal*)t;
|
||||
|
||||
@@ -629,7 +629,7 @@ void Viewport::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
for(auto s : _view.session().get_signals())
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL && s->enabled()) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO && s->enabled()) {
|
||||
DsoSignal *dsoSig = (DsoSignal*)s;
|
||||
if (dsoSig->get_trig_rect(0, _view.get_view_width()).contains(_mouse_point)) {
|
||||
_drag_sig = s;
|
||||
@@ -694,7 +694,7 @@ void Viewport::mousePressEvent(QMouseEvent *event)
|
||||
bool no_dsoSig = true;
|
||||
|
||||
while (true) {
|
||||
if ((*s)->signal_type() == DSO_SIGNAL && (*s)->enabled()) {
|
||||
if ((*s)->signal_type() == SR_CHANNEL_DSO && (*s)->enabled()) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)(*s);
|
||||
no_dsoSig = false;
|
||||
if (sig_looped) {
|
||||
@@ -768,7 +768,7 @@ void Viewport::mouseMoveEvent(QMouseEvent *event)
|
||||
if ((event->buttons() & Qt::LeftButton) ||
|
||||
!(event->buttons() | Qt::NoButton)) {
|
||||
if (_action_type == DSO_TRIG_MOVE) {
|
||||
if (_drag_sig && _drag_sig->signal_type() == DSO_SIGNAL) {
|
||||
if (_drag_sig && _drag_sig->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)_drag_sig;
|
||||
dsoSig->set_trig_vpos(event->pos().y());
|
||||
_dso_trig_moved = true;
|
||||
@@ -783,14 +783,14 @@ void Viewport::mouseMoveEvent(QMouseEvent *event)
|
||||
bool logic = false;
|
||||
|
||||
for(auto s : _view.session().get_signals()) {
|
||||
if (mode == LOGIC && s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (mode == LOGIC && s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
if (logicSig->measure(event->pos(), index0, index1, index2)) {
|
||||
logic = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mode == DSO && s->signal_type() == DSO_SIGNAL) {
|
||||
if (mode == DSO && s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
curX = min(dsoSig->get_view_rect().right(), curX);
|
||||
break;
|
||||
@@ -924,7 +924,7 @@ void Viewport::mouseReleaseEvent(QMouseEvent *event)
|
||||
const auto &sigs = _view.session().get_signals();
|
||||
|
||||
for(auto s : sigs) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
if (logicSig->edge(event->pos(), _edge_start, 10)) {
|
||||
_action_type = LOGIC_JUMP;
|
||||
@@ -1124,7 +1124,7 @@ void Viewport::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
|
||||
if (mode == LOGIC) {
|
||||
for(auto s : _view.session().get_signals()) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
if (logicSig->measure(event->pos(), index0, index1, index2)) {
|
||||
logic = true;
|
||||
@@ -1262,7 +1262,7 @@ void Viewport::wheelEvent(QWheelEvent *event)
|
||||
const auto &sigs = _view.session().get_signals();
|
||||
for (auto s : sigs)
|
||||
{
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
dsoSig->auto_end();
|
||||
}
|
||||
@@ -1400,7 +1400,7 @@ void Viewport::measure()
|
||||
const uint64_t sample_rate = _view.session().cur_snap_samplerate();
|
||||
|
||||
for(auto s : _view.session().get_signals()) {
|
||||
if (s->signal_type() == LOGIC_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_LOGIC) {
|
||||
view::LogicSignal *logicSig = (view::LogicSignal*)s;
|
||||
if (_action_type == NO_ACTION) {
|
||||
if (logicSig->measure(_mouse_point, _cur_sample, _nxt_sample, _thd_sample)) {
|
||||
@@ -1452,7 +1452,7 @@ void Viewport::measure()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s->signal_type() == DSO_SIGNAL) {
|
||||
else if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = ( view::DsoSignal*)s;
|
||||
if (s->enabled()) {
|
||||
if (_measure_en && dsoSig->measure(_view.hover_point())) {
|
||||
@@ -1463,7 +1463,7 @@ void Viewport::measure()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s->signal_type() == ANALOG_SIGNAL) {
|
||||
else if (s->signal_type() == SR_CHANNEL_ANALOG) {
|
||||
view::AnalogSignal *analogSig = (view::AnalogSignal*)s;
|
||||
if (s->enabled()) {
|
||||
if (_measure_en && analogSig->measure(_view.hover_point())) {
|
||||
@@ -1558,7 +1558,7 @@ void Viewport::paintMeasure(QPainter &p, QColor fore, QColor back)
|
||||
_measure_type == DSO_VALUE) {
|
||||
|
||||
for(auto s : _view.session().get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
uint64_t index;
|
||||
double value;
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
@@ -1570,7 +1570,7 @@ void Viewport::paintMeasure(QPainter &p, QColor fore, QColor back)
|
||||
hpoint.x(), dsoSig->get_view_rect().bottom());
|
||||
}
|
||||
}
|
||||
else if (s->signal_type() == ANALOG_SIGNAL) {
|
||||
else if (s->signal_type() == SR_CHANNEL_ANALOG) {
|
||||
uint64_t index;
|
||||
double value;
|
||||
QPointF hpoint;
|
||||
@@ -1587,7 +1587,7 @@ void Viewport::paintMeasure(QPainter &p, QColor fore, QColor back)
|
||||
|
||||
if (_dso_ym_valid) {
|
||||
for(auto s : _view.session().get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO) {
|
||||
view::DsoSignal *dsoSig = (view::DsoSignal*)s;
|
||||
if (dsoSig->get_index() == _dso_ym_sig_index) {
|
||||
p.setPen(QPen(dsoSig->get_colour(), 1, Qt::DotLine));
|
||||
|
||||
@@ -90,7 +90,7 @@ void ViewStatus::paintEvent(QPaintEvent *)
|
||||
view::DsoSignal *dsoSig = NULL;
|
||||
|
||||
for(auto s : _session->get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL && s->enabled()) {
|
||||
if (s->signal_type() == SR_CHANNEL_DSO && s->enabled()) {
|
||||
dsoSig = (view::DsoSignal*)s;
|
||||
if (sig_index == dsoSig->get_index())
|
||||
break;
|
||||
|
||||
@@ -47,7 +47,7 @@ XCursor::XCursor(View &view, QColor &colour,
|
||||
_sig_index = -1;
|
||||
|
||||
for(auto s : _view.session().get_signals()) {
|
||||
if (s->signal_type() == DSO_SIGNAL){
|
||||
if (s->signal_type() == SR_CHANNEL_DSO){
|
||||
DsoSignal *dsoSig = (DsoSignal*)s;
|
||||
if (dsoSig->enabled()) {
|
||||
_dsoSig = dsoSig;
|
||||
|
||||
Reference in New Issue
Block a user