mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 14:07:30 +00:00
Handle csv import/export with power traces
This commit is contained in:
parent
deefe30beb
commit
fa4e954f73
5 changed files with 38 additions and 12 deletions
|
|
@ -127,6 +127,31 @@ unsigned int TraceMath::numSamples()
|
|||
return data.size();
|
||||
}
|
||||
|
||||
QString TraceMath::dataTypeToString(TraceMath::DataType type)
|
||||
{
|
||||
switch(type) {
|
||||
case DataType::Frequency:
|
||||
return "Frequency";
|
||||
case DataType::Power:
|
||||
return "Power";
|
||||
case DataType::Time:
|
||||
return "Time";
|
||||
default:
|
||||
return "Invalid";
|
||||
}
|
||||
}
|
||||
|
||||
TraceMath::DataType TraceMath::dataTypeFromString(QString s)
|
||||
{
|
||||
for(unsigned int i=0;i<(int) DataType::Invalid;i++) {
|
||||
if(s.compare(dataTypeToString((DataType) i), Qt::CaseInsensitive) == 0) {
|
||||
return (DataType) i;
|
||||
}
|
||||
}
|
||||
// not found
|
||||
return DataType::Invalid;
|
||||
}
|
||||
|
||||
void TraceMath::removeInput()
|
||||
{
|
||||
if(input) {
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ public:
|
|||
Data getInterpolatedSample(double x);
|
||||
unsigned int numSamples();
|
||||
|
||||
static QString dataTypeToString(DataType type);
|
||||
static DataType dataTypeFromString(QString s);
|
||||
|
||||
// indicate whether this function produces time or frequency domain data
|
||||
virtual DataType outputType(DataType inputType) = 0;
|
||||
virtual QString description() = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue