Showing with 13 additions and 14 deletions.
  1. +6 −1 src/plugins/dataobject/activitylevel/activitylevel.cpp
  2. +7 −13 src/widgets/labelbuilder.cpp
7 changes: 6 additions & 1 deletion src/plugins/dataobject/activitylevel/activitylevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ QString ActivityLevelSource::_automaticDescriptiveName() const {

QString ActivityLevelSource::descriptionTip() const {
QString tip;
tip = tr("Activity Level: %1\n Sampling Time: %2 (ms)\n Window width: %3 (s)\n Noise Threshold: %4 \n").
tip = tr("Activity Level: %1\n Sampling Time: %2 (s)\n Window width: %3 (s)\n Noise Threshold: %4 \n").
arg(Name()).arg(samplingTime()->value()).arg(windowWidth()->value()).arg(noiseThreshold()->value());
tip += tr("\nInput: %1").arg(vector()->descriptionTip());
return tip;
Expand Down Expand Up @@ -196,6 +196,11 @@ bool ActivityLevelSource::algorithm() {
Kst::VectorPtr outputVectorDenoised = _outputVectors[VECTOR_OUT_DENOISED];

int i, length;
// Check for consistent values
if (windowWidth->value() < samplingTime->value() || samplingTime->value() == 0.0) {
return false;
}

int iSamplesForWindow = (int) (windowWidth->value() / samplingTime->value());
double dStandardDeviation = 0.0, dTotal = 0.0, dVariance = 0.0, dSquaredTotal = 0.0;
int iTrendPrevious = 0, iTrend = 0;
Expand Down
20 changes: 7 additions & 13 deletions src/widgets/labelbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,34 @@ void LabelBuilder::showHelp() {
"is updated, the label is updated. Scalar names are autocompleted. The format is:</P>"

"<P STYLE=\"margin-bottom: 0in\"><B>Scalar:</B> <FONT FACE=\"Courier New, monospace\">[</FONT><I>scalar"
"name</I><FONT FACE=\"Courier New, monospace\">]</FONT>, eg <FONT FACE=\"Courier New, monospace\">[GYRO1:Mean"
"name</I><FONT FACE=\"Courier New, monospace\">]</FONT>, e.g. <FONT FACE=\"Courier New, monospace\">[GYRO1:Mean"
"(X4)]</FONT></P>"
"<P STYLE=\"margin-bottom: 0in\"><B>Vector Element:</B>"
"<FONT FACE=\"Courier New, monospace\">[</FONT><I>vectorName</I><FONT FACE=\"Courier New, monospace\">[</FONT><I>index</I><FONT FACE=\"Courier New, monospace\">]]</FONT><FONT FACE=\"Times New Roman, serif\">,"
"eg, </FONT><FONT FACE=\"Courier New, monospace\">[GYRO1 (V2)[4]]</FONT>"
"<FONT FACE=\"Courier New, monospace\">[</FONT><I>vectorName</I><FONT FACE=\"Courier New, monospace\">[</FONT><I>index</I><FONT FACE=\"Courier New, monospace\">]]</FONT><FONT FACE=\"Times New Roman, serif\">, "
"e.g., </FONT><FONT FACE=\"Courier New, monospace\">[GYRO1 (V2)[4]]</FONT>"
"</P>"
"<P STYLE=\"margin-bottom: 0in\"><B>Equation:</B> <FONT FACE=\"Courier New, monospace\">[=</FONT><I>equation</I><FONT FACE=\"Courier New, monospace\">]</FONT>,"
"eg <FONT FACE=\"Courier New, monospace\">[=[GYRO1:Mean"
"<P STYLE=\"margin-bottom: 0in\"><B>Equation:</B> <FONT FACE=\"Courier New, monospace\">[=</FONT><I>equation</I><FONT FACE=\"Courier New, monospace\">]</FONT>, "
"e.g. <FONT FACE=\"Courier New, monospace\">[=[GYRO1:Mean"
"(X4)]/[GYRO1:Sigma (X4)]]</FONT></P>"

"<P ALIGN=LEFT STYLE=\"margin-bottom: 0in\"><FONT SIZE=4><B>Supported LaTeX Subset</B></FONT><br>"
"Labels in <i>kst</i> "
"support a derrivitive subset of LaTeX. For example, to display the equation for the area of a "
"support a derivative subset of LaTeX. For example, to display the equation for the area of a "
"circle, you could set the label to A=2\\pir^2. Unlike LaTeX, it is not necessary to enter math mode using '$'. Also, "
"unlike LaTeX, variables are not automatically displayed in italic font. If desired, this must "
"be done explicitly using \\textit{}. Supported sequences are:</P>"

"<P STYLE=\"margin-bottom: 0in\"><B>Greek letters:</B> \\<I>name</I> or "
"\\<I>Name</I>. eg: <FONT FACE=\"Courier New, monospace\">\\alpha</FONT></P>"
"\\<I>Name</I>. e.g.: <FONT FACE=\"Courier New, monospace\">\\alpha</FONT></P>"
"<P STYLE=\"margin-bottom: 0in\"><B>Other symbols:</B> <FONT FACE=\"Courier New, monospace\">\\approx</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\cdot</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\ge</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\geq</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\inf</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\approx</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\cdot</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\ge</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\geq</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\inf</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\int</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\le</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\leq</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\ne</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\n</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\partial</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\prod</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
"\\pm</FONT><FONT FACE=\"Times New Roman, serif\">,</FONT><FONT FACE=\"Courier New, monospace\">"
Expand Down