adjusted custom expressions to handle power sweep data
This commit is contained in:
parent
dda149f3d5
commit
6fdbaea55f
@ -41,11 +41,13 @@ void Math::Expression::edit()
|
|||||||
exp = ui->expEdit->text();
|
exp = ui->expEdit->text();
|
||||||
expressionChanged();
|
expressionChanged();
|
||||||
});
|
});
|
||||||
// TODO add power domain
|
switch(dataType) {
|
||||||
if(dataType == DataType::Time) {
|
case DataType::Frequency: ui->stackedWidget->setCurrentIndex(0); break;
|
||||||
// select the label explaining the time domain variables (frequency label is the default)
|
case DataType::Time: ui->stackedWidget->setCurrentIndex(1); break;
|
||||||
ui->stackedWidget->setCurrentIndex(1);
|
case DataType::Power: ui->stackedWidget->setCurrentIndex(2); break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->show();
|
d->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +80,7 @@ void Math::Expression::inputSamplesChanged(unsigned int begin, unsigned int end)
|
|||||||
for(unsigned int i=begin;i<end;i++) {
|
for(unsigned int i=begin;i<end;i++) {
|
||||||
t = in[i].x;
|
t = in[i].x;
|
||||||
f = in[i].x;
|
f = in[i].x;
|
||||||
|
P = in[i].x;
|
||||||
w = in[i].x * 2 * M_PI;
|
w = in[i].x * 2 * M_PI;
|
||||||
d = root()->timeToDistance(t);
|
d = root()->timeToDistance(t);
|
||||||
x = in[i].y;
|
x = in[i].y;
|
||||||
@ -103,6 +106,7 @@ void Math::Expression::expressionChanged()
|
|||||||
parser->RemoveVar("d");
|
parser->RemoveVar("d");
|
||||||
parser->RemoveVar("f");
|
parser->RemoveVar("f");
|
||||||
parser->RemoveVar("w");
|
parser->RemoveVar("w");
|
||||||
|
parser->RemoveVar("P");
|
||||||
switch(dataType) {
|
switch(dataType) {
|
||||||
case DataType::Time:
|
case DataType::Time:
|
||||||
parser->DefineVar("t", Variable(&t));
|
parser->DefineVar("t", Variable(&t));
|
||||||
@ -112,6 +116,9 @@ void Math::Expression::expressionChanged()
|
|||||||
parser->DefineVar("f", Variable(&f));
|
parser->DefineVar("f", Variable(&f));
|
||||||
parser->DefineVar("w", Variable(&w));
|
parser->DefineVar("w", Variable(&w));
|
||||||
break;
|
break;
|
||||||
|
case DataType::Power:
|
||||||
|
parser->DefineVar("P", Variable(&P));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
QString exp;
|
QString exp;
|
||||||
mup::ParserX *parser;
|
mup::ParserX *parser;
|
||||||
mup::Value t, d, f, w, x;
|
mup::Value t, d, f, w, x, P;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p>Available variables:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x: the S parameter as a (complex) voltage vector. </li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">f: measurement frequency in Hz</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">w: angular measurement frequency (w = 2πf)</li></ul><p>Examples:<br/>Add 10db to the trace (10db = exp10(10/20) = sqrt(10)):</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x * sqrt(10)</li></ul><p>Clip trace at 0db (0db = exp10(0/20) = 1) while preserving phase:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">abs(x) &lt; 1 ? x : exp(i*arg(x))</li></ul></body></html></string>
|
<string><html><head/><body><p>Available variables:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x: the S parameter as a (complex) voltage vector. </li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">f: measurement frequency in Hz</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">w: angular measurement frequency (w = 2πf)</li></ul><p>Examples:<br/>Add 10db to the trace (10db = exp10(10/20) = sqrt(10)):</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x * sqrt(10)</li></ul><p>Clip trace at 0db (0db = exp10(0/20) = 1) while preserving phase:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">abs(x) &lt; 1 ? x : exp(i*arg(x))</li></ul></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -61,6 +61,20 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="powerPage">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Available variables:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x: the S parameter as a (complex) voltage vector. </li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">P: power of the stimulus signal in dBm</li></ul><p>Examples:<br/>Add 10db to the trace (10db = exp10(10/20) = sqrt(10)):</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x * sqrt(10)</li></ul><p>Clip trace at 0db (0db = exp10(0/20) = 1) while preserving phase:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">abs(x) &lt; 1 ? x : exp(i*arg(x))</li></ul></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
Reference in New Issue
Block a user