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();
|
||||
expressionChanged();
|
||||
});
|
||||
// TODO add power domain
|
||||
if(dataType == DataType::Time) {
|
||||
// select the label explaining the time domain variables (frequency label is the default)
|
||||
ui->stackedWidget->setCurrentIndex(1);
|
||||
switch(dataType) {
|
||||
case DataType::Frequency: ui->stackedWidget->setCurrentIndex(0); break;
|
||||
case DataType::Time: ui->stackedWidget->setCurrentIndex(1); break;
|
||||
case DataType::Power: ui->stackedWidget->setCurrentIndex(2); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
d->show();
|
||||
}
|
||||
|
||||
@ -78,6 +80,7 @@ void Math::Expression::inputSamplesChanged(unsigned int begin, unsigned int end)
|
||||
for(unsigned int i=begin;i<end;i++) {
|
||||
t = in[i].x;
|
||||
f = in[i].x;
|
||||
P = in[i].x;
|
||||
w = in[i].x * 2 * M_PI;
|
||||
d = root()->timeToDistance(t);
|
||||
x = in[i].y;
|
||||
@ -103,6 +106,7 @@ void Math::Expression::expressionChanged()
|
||||
parser->RemoveVar("d");
|
||||
parser->RemoveVar("f");
|
||||
parser->RemoveVar("w");
|
||||
parser->RemoveVar("P");
|
||||
switch(dataType) {
|
||||
case DataType::Time:
|
||||
parser->DefineVar("t", Variable(&t));
|
||||
@ -112,6 +116,9 @@ void Math::Expression::expressionChanged()
|
||||
parser->DefineVar("f", Variable(&f));
|
||||
parser->DefineVar("w", Variable(&w));
|
||||
break;
|
||||
case DataType::Power:
|
||||
parser->DefineVar("P", Variable(&P));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ private slots:
|
||||
private:
|
||||
QString exp;
|
||||
mup::ParserX *parser;
|
||||
mup::Value t, d, f, w, x;
|
||||
mup::Value t, d, f, w, x, P;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
@ -61,6 +61,20 @@
|
||||
</item>
|
||||
</layout>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
Reference in New Issue
Block a user