Handle csv import/export with power traces

This commit is contained in:
Jan Käberich 2021-07-13 18:40:40 +02:00
parent deefe30beb
commit fa4e954f73
5 changed files with 38 additions and 12 deletions

View file

@ -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) {

View file

@ -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;