Showing with 16 additions and 10 deletions.
  1. +6 −0 src/datasources/ascii/asciisource.cpp
  2. +3 −3 src/libkstapp/csddialog.cpp
  3. +5 −5 src/libkstmath/csd.cpp
  4. +2 −2 src/libkstmath/csdfactory.cpp
6 changes: 6 additions & 0 deletions src/datasources/ascii/asciisource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,12 @@ int AsciiSource::splitHeaderLine(const QByteArray& line, const AsciiSourceConfig
if (!stringList) {
//MeasureTime t("AsciiDataReader::countColumns()");
int columns = AsciiDataReader::splitColumns(line, AsciiCharacterTraits::IsWhiteSpace());

// The following assert crashes (sometimes?) when kst is pointed at an
// executable. So... rather than crashing, lets just bail.
if (columns != QString(line).trimmed().split(QRegExp("\\s"), QString::SkipEmptyParts).size()) {
return 0;
}
Q_ASSERT(columns == QString(line).trimmed().split(QRegExp("\\s"), QString::SkipEmptyParts).size());
return columns;
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/libkstapp/csddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CSDTab::CSDTab(QWidget *parent)
: DataTab(parent) {

setupUi(this);
setTabTitle(tr("Cumulative Spectral Decay"));
setTabTitle(tr("Spectrogram"));
connect(_vector, SIGNAL(selectionChanged(QString)), this, SLOT(selectionChanged()));
connect(_FFTOptions, SIGNAL(modified()), this, SIGNAL(modified()));
connect(_vector, SIGNAL(selectionChanged(QString)), this, SIGNAL(modified()));
Expand Down Expand Up @@ -129,9 +129,9 @@ CSDDialog::CSDDialog(ObjectPtr dataObject, QWidget *parent)
: DataDialog(dataObject, parent) {

if (editMode() == Edit)
setWindowTitle(tr("Edit Cumulative Spectral Decay"));
setWindowTitle(tr("Edit Spectrogram"));
else
setWindowTitle(tr("New Cumulative Spectral Decay"));
setWindowTitle(tr("New Spectrogram"));

_CSDTab = new CSDTab(this);
addDataTab(_CSDTab);
Expand Down
10 changes: 5 additions & 5 deletions src/libkstmath/csd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* *
***************************************************************************/

/** A class for handling cumulative spectral decays for kst
/** A class for handling spectrograms for kst
*/

#include "csd.h"
Expand All @@ -35,7 +35,7 @@ extern "C" void rdft(int n, int isgn, double *a);

namespace Kst {

const QString CSD::staticTypeString = "Cumulative Spectral Decay";
const QString CSD::staticTypeString = "Spectrogram";
const QString CSD::staticTypeTag = "csd";

static const QLatin1String CSD_INVECTOR = QLatin1String("I");
Expand All @@ -45,7 +45,7 @@ static const QLatin1String& OUTMATRIX = QLatin1String("M");
CSD::CSD(ObjectStore *store)
: DataObject(store) {
_typeString = staticTypeString;
_type = "Cumulative Spectral Decay";
_type = "Spectrogram";

_initializeShortName();

Expand Down Expand Up @@ -127,7 +127,7 @@ void CSD::internalUpdate() {
_outMatrix->setValueRaw(xSize, j, tempOutput[j]);
}
} else {
Debug::self()->log(tr("Could not allocate sufficient memory for CSD."), Debug::Error);
Debug::self()->log(tr("Could not allocate sufficient memory for Spectrogram."), Debug::Error);
break;
}

Expand Down Expand Up @@ -192,7 +192,7 @@ bool CSD::slaveVectorsUsed() const {


QString CSD::propertyString() const {
return tr("CSD: %1").arg(_inputVectors[CSD_INVECTOR]->Name());
return tr("Spectrogram: %1").arg(_inputVectors[CSD_INVECTOR]->Name());
}


Expand Down
4 changes: 2 additions & 2 deletions src/libkstmath/csdfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ DataObjectPtr CSDFactory::generateObject(ObjectStore *store, QXmlStreamReader& x
if (n == CSD::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating CSD from Kst file."), Debug::Warning);
Debug::self()->log(QObject::tr("Error creating Spectrogram from Kst file."), Debug::Warning);
return 0;
}
}
Expand All @@ -85,7 +85,7 @@ DataObjectPtr CSDFactory::generateObject(ObjectStore *store, QXmlStreamReader& x
}

if (!vector) {
Debug::self()->log(QObject::tr("Error creating CSD from Kst file. Could not find Vector."), Debug::Warning);
Debug::self()->log(QObject::tr("Error creating Spectrogram from Kst file. Could not find Vector."), Debug::Warning);
return 0;
}

Expand Down