moved frequency meter to its place
authorcamargo <camargo@lisha.ufsc.br>
Thu, 12 May 2016 21:20:47 +0000 (18:20 -0300)
committercamargo <camargo@lisha.ufsc.br>
Thu, 12 May 2016 21:20:47 +0000 (18:20 -0300)
20 files changed:
instr-sound-tiva/instrumentation-frequency-qt/deployment.pri [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/main.cpp [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/main.qml [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qdaudioserialport.cpp [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qdaudioserialport.h [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qdserialport.cpp [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qdserialport.h [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qml.qrc [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qmldash.pro [deleted file]
instr-sound-tiva/instrumentation-frequency-qt/qmldash.pro.user [deleted file]
qt/instrumentation-frequency-qt/deployment.pri [new file with mode: 0644]
qt/instrumentation-frequency-qt/main.cpp [new file with mode: 0644]
qt/instrumentation-frequency-qt/main.qml [new file with mode: 0644]
qt/instrumentation-frequency-qt/qdaudioserialport.cpp [new file with mode: 0644]
qt/instrumentation-frequency-qt/qdaudioserialport.h [new file with mode: 0644]
qt/instrumentation-frequency-qt/qdserialport.cpp [new file with mode: 0644]
qt/instrumentation-frequency-qt/qdserialport.h [new file with mode: 0644]
qt/instrumentation-frequency-qt/qml.qrc [new file with mode: 0644]
qt/instrumentation-frequency-qt/qmldash.pro [new file with mode: 0644]
qt/instrumentation-frequency-qt/qmldash.pro.user [new file with mode: 0644]

diff --git a/instr-sound-tiva/instrumentation-frequency-qt/deployment.pri b/instr-sound-tiva/instrumentation-frequency-qt/deployment.pri
deleted file mode 100644 (file)
index c89af25..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-unix:!android {
-    isEmpty(target.path) {
-        qnx {
-            target.path = /tmp/$${TARGET}/bin
-        } else {
-            target.path = /opt/$${TARGET}/bin
-        }
-        export(target.path)
-    }
-    INSTALLS += target
-}
-
-export(INSTALLS)
-
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/main.cpp b/instr-sound-tiva/instrumentation-frequency-qt/main.cpp
deleted file mode 100644 (file)
index 0877982..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-
-#include "qdserialport.h"
-#include "qdaudioserialport.h"
-#include <QtQml>
-#include <QIcon>
-
-int main(int argc, char *argv[])
-{
-    QGuiApplication app(argc, argv);
-    app.setApplicationDisplayName("qmldash");
-
-    QIcon ico("/usr/share/icons/breeze/devices/64/audio-card.svg");
-    app.setWindowIcon(ico);
-
-    //qmlRegisterType<QDSerialPort>("qmldash", 1, 0, "SerialPort");
-    qmlRegisterType<QDAudioSerialPort>("qmldash", 1, 0, "AudioSerialPort");
-
-    QQmlApplicationEngine engine;
-    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
-
-    return app.exec();
-}
-
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/main.qml b/instr-sound-tiva/instrumentation-frequency-qt/main.qml
deleted file mode 100644 (file)
index 0719ac3..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-import QtQuick 2.5
-import QtQuick.Window 2.2
-import QtQuick.Controls 1.4
-import QtQuick.Layouts 1.1
-
-import qmldash 1.0
-
-ApplicationWindow {
-    id: window
-    visible: true
-
-    width: 450
-    height: 332
-
-    title: "Frequency Meter"
-
-    color: "transparent"
-    flags: Qt.FramelessWindowHint
-    Rectangle
-    {
-        color: "#333"
-        anchors.fill: parent
-        radius: 5
-    }
-
-    AudioSerialPort
-    {
-        id: serial
-        portName: getPortNameByIndex(0)
-        baudRate: 921600
-
-        property bool ready: false
-        property real smoothLevel: level
-        Behavior on smoothLevel { NumberAnimation{ duration: 250; easing.type: Easing.InOutQuart} }
-
-        onProcessed:
-        {
-            ready = true;
-            activity.on = true;
-            waveform.requestPaint();
-            fft.requestPaint();
-        }
-
-        Component.onCompleted: openSerial();
-    }
-
-    Rectangle
-    {
-        id: mainPane
-        x: 5
-        y: 5
-        radius: 5
-        color: "#111"
-        width: parent.width - 10
-        height: parent.height - 30
-
-        Text
-        {
-            id: appTitle
-
-            font.pixelSize: 20
-            font.family: "Oxygen-Sans"
-            text: "Frequency Meter"
-            color: "#eee"
-
-            x: 10
-            y: 10
-        }
-
-        Text
-        {
-            id: freqLabel
-
-            font.pixelSize: 70
-            font.family: "Oxygen Mono"
-            text: serial.fftPeakFrequency
-            opacity: serial.level > 0.10? 1 : 0.5
-            horizontalAlignment: Text.AlignRight
-            width: 220
-            anchors.right: parent.right
-            anchors.rightMargin: 70
-            height: 80
-            verticalAlignment: Text.AlignBottom
-            color: "#eee"
-
-            Behavior on opacity{NumberAnimation{}}
-        }
-
-        Text
-        {
-            id: levelWarning
-            x: 10
-            y: 50
-            text: serial.cutoff? "Level is too high!" : "Level is too low!"
-            font.pixelSize: 14
-            opacity: serial.level > 0.10 || serial.cutoff? 0 : 1
-            Behavior on opacity{NumberAnimation{}}
-            color: "#f55"
-        }
-
-        Text
-        {
-            id: freqUnit
-            anchors.right: parent.right
-            anchors.rightMargin: 20
-            height: 76
-            verticalAlignment: Text.AlignBottom
-            text: "Hz"
-            font.pixelSize: 40
-            color: "#eee"
-        }
-
-        Rectangle
-        {
-            id: levelBar
-
-            y: 85
-            width: parent.width
-            height: 10
-            color: "#080808"
-
-            Rectangle
-            {
-                x: 0
-                y: 2
-                height: parent.height - 4
-                width: parent.width * Math.min(serial.smoothLevel, 1)
-                color: serial.cutoff? "#f55" : "#6ff"
-                Behavior on color{ColorAnimation{}}
-            }
-        }
-
-        Canvas
-        {
-            id: waveform
-            width: parent.width
-            height: (parent.height - 100) / 2
-            x: 0
-            y: 100
-            contextType: "2d"
-            property color waveColor: "#6ff"
-            property color lineColor: "#181818"
-            property color waveColorCutoff: "#f66"
-
-            onPaint:
-            {
-                if(!available) return;
-                if(!serial.ready) return;
-
-                context.clearRect(0,0,width, height);
-
-                context.strokeWidth = 1;
-
-
-                context.strokeStyle = lineColor;
-                context.beginPath();
-                context.moveTo(0, height/2);
-                context.lineTo(width, height/2);
-                context.stroke();
-
-                context.strokeStyle = serial.cutoff? waveColorCutoff : waveColor;
-                context.beginPath();
-                context.moveTo(0, height);
-
-                var points = serial.bufferSize;
-                var dx = width / points;
-                var increment = Math.max(1, Math.round(points/width/4) );
-
-                for(var i = 0; i < points; i+= increment)
-                {
-                    context.lineTo(i*dx, height * (0.5 - serial.sample(i)) );
-                }
-
-                context.stroke();
-            }
-
-            Text
-            {
-                text: "Normalization " + (serial.normalizationEnabled? "On" : "Off")
-                anchors.right: parent.right
-                anchors.top: parent.top
-                anchors.margins: 10
-                anchors.topMargin: 0
-                color: serial.normalizationEnabled? "#6ff" : "#666"
-
-                MouseArea
-                {
-                    anchors.fill: parent
-                    onClicked: serial.normalizationEnabled = !serial.normalizationEnabled
-                }
-            }
-        }
-
-        Rectangle
-        {
-            color: "#080808"
-            width: parent.width
-            height: 2
-            x: 0
-            anchors.top: waveform.bottom
-            anchors.topMargin: -1
-
-        }
-
-        Canvas
-        {
-            id: fft
-            width: parent.width
-            anchors.top: waveform.bottom
-            anchors.bottom: parent.bottom
-            anchors.bottomMargin: 2
-            x: 0
-            y: 200
-            contextType: "2d"
-            property color waveColor: "#ff6"
-            property color lineColor: "#181818"
-            property color markerColor: waveColor
-            property int freqInterval: 200
-
-            onPaint:
-            {
-                if(!available) return;
-                if(!serial.ready) return;
-
-                context.clearRect(0,0,width, height);
-
-                var hh = height / 2;
-                context.lineWidth = 1;
-
-
-                var points = serial.bufferSize/2;
-                var dx = width / points;
-                var fftLevel = serial.fftLevel;
-
-                var freqSpacing = 1.0 * serial.bufferSize / serial.sampleRate;
-                var freqX = freqInterval * freqSpacing * dx;
-                var peakX = dx * serial.fftPeakFrequency * freqSpacing;
-
-                context.strokeStyle = lineColor;
-                context.lineWidth = 1.5;
-                context.beginPath();
-                while(freqX < width)
-                {
-                    context.moveTo(freqX, 2);
-                    context.lineTo(freqX, height);
-                    freqX += freqInterval * freqSpacing * dx;
-                }
-                context.stroke();
-
-                context.fillStyle = markerColor;
-                context.beginPath();
-
-                context.moveTo(peakX-5, 0);
-                context.lineTo(peakX+5, 0);
-                context.lineTo(peakX, 5);
-                context.closePath();
-
-                context.fill();
-
-
-                context.strokeStyle = waveColor;
-                context.lineWidth = 1;
-
-                context.beginPath();
-                context.moveTo(0, height);
-                for(var i = 0; i < points; i++)
-                {
-                    context.lineTo(i*dx, (height-1) * (1.0 - serial.fftSample(i)/fftLevel) );
-                }
-                context.stroke();
-
-            }
-
-            Text
-            {
-                text: fft.freqInterval + " Hz / div"
-                anchors.right: parent.right
-                anchors.bottom: parent.bottom
-                anchors.margins: 10
-                color: "#666"
-            }
-
-            Text
-            {
-                text: "Hann Window " + (serial.hannWindowEnabled? "On" : "Off")
-                anchors.right: parent.right
-                anchors.top: parent.top
-                anchors.margins: 10
-                color: serial.hannWindowEnabled? "#ff6" : "#666"
-
-                MouseArea
-                {
-                    anchors.fill: parent
-                    onClicked: serial.hannWindowEnabled = !serial.hannWindowEnabled
-                }
-            }
-        }
-
-    }
-
-
-    Rectangle {
-
-        id: statusbar
-        color: "transparent"
-        width: parent.width
-        height: 20
-        anchors.bottom: parent.bottom
-
-        Text {
-            text: serial.portName + " @ " + serial.baudRate + " baud "
-            color: "#666"
-            x: 6
-        }
-
-
-        Item {
-            height: parent.height
-            width: 20
-
-            Layout.alignment: Qt.AlignRight
-            anchors.right: parent.right
-
-            Rectangle
-            {
-                id: led
-                property bool on: serial.serialPort !== null && serial.state == AudioSerialPort.STATE_OPEN
-                property bool error: serial.state == AudioSerialPort.STATE_ERROR
-                anchors.centerIn: parent
-                width: 8
-                height: 8
-                radius: 4
-
-                color: error? "red" : (on? "lime" : "#80000000")
-            }
-        }
-
-        Item {
-            height: parent.height
-            width: 20
-
-            anchors.right: parent.right
-            anchors.rightMargin: 14
-
-            Rectangle
-            {
-                id: activity
-                property bool on: false
-                anchors.centerIn: parent
-                width: 8
-                height: 8
-                radius: 4
-
-                color: on? "skyblue" : "#80000000"
-
-                onOnChanged: if(on){ activityOffTimer.start(); }
-
-                Timer
-                {
-                    id: activityOffTimer
-                    interval: 200
-                    onTriggered: activity.on = false
-                }
-            }
-        }
-
-    }
-
-    function openSerial()
-    {
-        console.log("Opening serial...");
-        serial.open();
-    }
-
-
-}
-
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qdaudioserialport.cpp b/instr-sound-tiva/instrumentation-frequency-qt/qdaudioserialport.cpp
deleted file mode 100644 (file)
index e6f1215..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#include "qdaudioserialport.h"
-#include "qserialport.h"
-
-#include <QtMath>
-#include <complex>
-
-QDAudioSerialPort::QDAudioSerialPort(QObject *parent):
-  QDSerialPort(parent),
-  m_frequency(0.0),
-  m_cutoff(false),
-  m_bufferSize(AUDIO_BUFFER_SIZE),
-  m_level(0),
-  m_fftLevel(0),
-  m_sampleRate(AUDIO_SAMPLE_RATE),
-  m_fftPeakIndex(0),
-  m_fftPeakFrequency(0),
-  m_hannWindowEnabled(true),
-  m_normalizationEnabled(false)
-{
-    connect(this, &QDSerialPort::readyRead, this, &QDAudioSerialPort::onSuperReadyRead);
-    initFFT();
-}
-
-void QDAudioSerialPort::onSuperReadyRead()
-{
-    while(bytesAvailable() >= AUDIO_BUFFER_SIZE )
-    {
-        QSerialPort * port = (QSerialPort*) serialPort();
-        if(port && port->isOpen())
-        {
-            port->read((char*)buffer, AUDIO_BUFFER_SIZE);
-            processBuffer();
-        }
-    }
-
-}
-
-void QDAudioSerialPort::initFFT()
-{
-    m_fft_in = fftw_alloc_real(AUDIO_BUFFER_SIZE);
-    m_fft_out = fftw_alloc_complex(AUDIO_BUFFER_SIZE);
-    Q_ASSERT(m_fft_in && m_fft_out);
-
-    for (int a = 0; a < AUDIO_BUFFER_SIZE; a++) {
-        m_fft_in[a] = 0;
-        m_fft_out[a][0] = 0;
-        m_fft_out[a][1] = 0;
-    }
-
-    m_fft_plan = fftw_plan_dft_r2c_1d(AUDIO_BUFFER_SIZE, m_fft_in, m_fft_out, 0);
-    Q_ASSERT(m_fft_plan);
-}
-
-void QDAudioSerialPort::processBuffer()
-{
-    bool cutoff = false;
-
-    int maxRange = qMin(255 - AUDIO_ZERO_LEVEL, AUDIO_ZERO_LEVEL);
-    float floatScale = 1.0f / maxRange;
-
-    float level = 0.0f;
-    bool positive = false;
-    int zeroPasses = 0;
-
-    for(int i = 0; i < AUDIO_BUFFER_SIZE; i++)
-    {
-        m_fft_in[i] = (bufferScaled[i] = floatScale * (static_cast<int>(buffer[i]) - AUDIO_ZERO_LEVEL));
-        level = qMax(level, qAbs(bufferScaled[i]));
-
-        if( (bufferScaled[i] > 0) != positive)
-        {
-            positive = !positive;
-            zeroPasses++;
-        }
-
-        if(buffer[i] > CUTOFF_THRESHOLD)
-            cutoff = true;
-    }
-
-    if(m_normalizationEnabled)
-    {
-        for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) {
-            bufferScaled[i] /= level;
-        }
-    }
-
-    if(m_hannWindowEnabled)
-    {
-        applyHannWindow();
-    }
-
-    // fft part
-
-    fftw_execute(m_fft_plan);
-
-    double fftLevel = 0.0;
-    int fftMaxIndex = 0;
-
-    for(int i = 0; i < AUDIO_BUFFER_SIZE; i++)
-    {
-        m_fft_in[i] = std::abs(std::complex<double>(m_fft_out[i][0], m_fft_out[i][1]));
-        if(m_fft_in[i] > fftLevel)
-        {
-            fftLevel = m_fft_in[i];
-            fftMaxIndex = i;
-        }
-
-    }
-
-    setFrequency(zeroPasses * 2);
-    setLevel(level);
-    setFftLevel(fftLevel);
-    setFftPeakFrequency(fftMaxIndex * AUDIO_SAMPLE_RATE / AUDIO_BUFFER_SIZE);
-    setFftPeakIndex(fftMaxIndex);
-    setCutoff(cutoff);
-
-    emit processed();
-}
-
-void QDAudioSerialPort::applyHannWindow()
-{
-    for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) {
-        double multiplier = 0.5 * (1 - qCos(M_2_PI*i/(AUDIO_BUFFER_SIZE - 1)));
-        m_fft_in[i] = multiplier * m_fft_in[i];
-    }
-}
-
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qdaudioserialport.h b/instr-sound-tiva/instrumentation-frequency-qt/qdaudioserialport.h
deleted file mode 100644 (file)
index ddd3c00..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-#ifndef QDAUDIOSERIALPORT_H
-#define QDAUDIOSERIALPORT_H
-
-#include "qdserialport.h"
-#include <cstdint>
-
-#define AUDIO_ZERO_LEVEL    (125)
-#define AUDIO_SAMPLE_RATE   (22050)
-#define CUTOFF_THRESHOLD    (251)
-#define AUDIO_BUFFER_SIZE   (AUDIO_SAMPLE_RATE/8)
-
-#include <fftw3.h>
-
-class QDAudioSerialPort : public QDSerialPort
-{
-
-    Q_OBJECT
-    Q_PROPERTY(qreal frequency READ frequency WRITE setFrequency NOTIFY frequencyChanged)
-    Q_PROPERTY(qreal level READ level WRITE setLevel NOTIFY levelChanged)
-    Q_PROPERTY(qreal fftLevel READ fftLevel WRITE setFftLevel NOTIFY fftLevelChanged)
-    Q_PROPERTY(qreal fftPeakFrequency READ fftPeakFrequency WRITE setFftPeakFrequency NOTIFY fftPeakFrequencyChanged)
-    Q_PROPERTY(int fftPeakIndex READ fftPeakIndex WRITE setFftPeakIndex NOTIFY fftPeakIndexChanged)
-    Q_PROPERTY(bool cutoff READ cutoff WRITE setCutoff NOTIFY cutoffChanged)
-    Q_PROPERTY(int bufferSize READ bufferSize NOTIFY bufferSizeChanged)
-    Q_PROPERTY(int sampleRate READ sampleRate WRITE setSampleRate NOTIFY sampleRateChanged)
-    Q_PROPERTY(bool hannWindowEnabled READ hannWindowEnabled WRITE setHannWindowEnabled NOTIFY hannWindowEnabledChanged)
-    Q_PROPERTY(bool normalizationEnabled READ normalizationEnabled WRITE setNormalizationEnabled NOTIFY normalizationEnabledChanged)
-public:
-    QDAudioSerialPort(QObject * parent = 0);
-
-    qreal frequency() const
-    {
-        return m_frequency;
-    }
-
-    bool cutoff() const
-    {
-        return m_cutoff;
-    }
-
-    int bufferSize() const
-    {
-        return m_bufferSize;
-    }
-
-    qreal level() const
-    {
-        return m_level;
-    }
-
-    qreal fftLevel() const
-    {
-        return m_fftLevel;
-    }
-
-    int sampleRate() const
-    {
-        return m_sampleRate;
-    }
-
-    int fftPeakIndex() const
-    {
-        return m_fftPeakIndex;
-    }
-
-    qreal fftPeakFrequency() const
-    {
-        return m_fftPeakFrequency;
-    }
-
-    bool hannWindowEnabled() const
-    {
-        return m_hannWindowEnabled;
-    }
-
-    bool normalizationEnabled() const
-    {
-        return m_normalizationEnabled;
-    }
-
-signals:
-
-    void frequencyChanged(qreal frequency);
-    void processed();
-
-    void cutoffChanged(bool cutoff);
-
-    void bufferSizeChanged(int bufferSize);
-
-    void levelChanged(qreal level);
-
-    void fftLevelChanged(qreal fftLevel);
-
-    void sampleRateChanged(int sampleRate);
-
-    void fftPeakIndexChanged(int fftPeakIndex);
-
-    void fftPeakFrequencyChanged(qreal fftPeakFrequency);
-
-    void hannWindowEnabledChanged(bool hannWindowEnabled);
-
-    void normalizationEnabledChanged(bool normalizationEnabled);
-
-public slots:
-    void onSuperReadyRead();
-
-    void setFrequency(qreal frequency)
-    {
-        if (m_frequency == frequency)
-            return;
-
-        m_frequency = frequency;
-        emit frequencyChanged(frequency);
-    }
-
-    void setCutoff(bool cutoff)
-    {
-        if (m_cutoff == cutoff)
-            return;
-
-        m_cutoff = cutoff;
-        emit cutoffChanged(cutoff);
-    }
-
-    qreal sample(int index)
-    {
-        return bufferScaled[index];
-    }
-
-    qreal fftSample(int index)
-    {
-        return m_fft_in[index];
-    }
-
-    void setLevel(qreal level)
-    {
-        if (m_level == level)
-            return;
-
-        m_level = level;
-        emit levelChanged(level);
-    }
-
-    void setFftLevel(qreal fftLevel)
-    {
-        if (m_fftLevel == fftLevel)
-            return;
-
-        m_fftLevel = fftLevel;
-        emit fftLevelChanged(fftLevel);
-    }
-
-    void setSampleRate(int sampleRate)
-    {
-        if (m_sampleRate == sampleRate)
-            return;
-
-        m_sampleRate = sampleRate;
-        emit sampleRateChanged(sampleRate);
-    }
-
-    void setFftPeakIndex(int fftPeakIndex)
-    {
-        if (m_fftPeakIndex == fftPeakIndex)
-            return;
-
-        m_fftPeakIndex = fftPeakIndex;
-        emit fftPeakIndexChanged(fftPeakIndex);
-    }
-
-    void setFftPeakFrequency(qreal fftPeakFrequency)
-    {
-        if (m_fftPeakFrequency == fftPeakFrequency)
-            return;
-
-        m_fftPeakFrequency = fftPeakFrequency;
-        emit fftPeakFrequencyChanged(fftPeakFrequency);
-    }
-
-    void setHannWindowEnabled(bool hannWindowEnabled)
-    {
-        if (m_hannWindowEnabled == hannWindowEnabled)
-            return;
-
-        m_hannWindowEnabled = hannWindowEnabled;
-        emit hannWindowEnabledChanged(hannWindowEnabled);
-    }
-
-    void setNormalizationEnabled(bool normalizationEnabled)
-    {
-        if (m_normalizationEnabled == normalizationEnabled)
-            return;
-
-        m_normalizationEnabled = normalizationEnabled;
-        emit normalizationEnabledChanged(normalizationEnabled);
-    }
-
-private:
-    void initFFT();
-    void processBuffer();
-    void applyHannWindow();
-
-
-    float bufferScaled[AUDIO_BUFFER_SIZE];
-    uint8_t buffer[AUDIO_BUFFER_SIZE];
-
-    qreal m_frequency;
-    bool m_cutoff;
-    int m_bufferSize;
-    qreal m_level;
-
-    fftw_plan m_fft_plan;
-    double * m_fft_in;
-    fftw_complex *m_fft_out;
-    qreal m_fftLevel;
-    int m_sampleRate;
-    int m_fftPeakIndex;
-    qreal m_fftPeakFrequency;
-    bool m_hannWindowEnabled;
-    bool m_normalizationEnabled;
-};
-
-#endif // QDAUDIOSERIALPORT_H
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qdserialport.cpp b/instr-sound-tiva/instrumentation-frequency-qt/qdserialport.cpp
deleted file mode 100644 (file)
index 2220ae3..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#include "qdserialport.h"
-
-#include <QSerialPort>
-#include <QSerialPortInfo>
-
-QDSerialPort::QDSerialPort(QObject *parent) :
-  QObject(parent),
-  m_serialPort(0),
-  m_portName(""),
-  m_baudRate(9600),
-  m_state(STATE_CLOSED)
-{
-
-}
-
-bool QDSerialPort::open()
-{
-    if(m_serialPort)
-    {
-        return m_state == STATE_OPEN;
-    }
-
-    QSerialPort * newPort = new QSerialPort(m_portName, this);
-    newPort->setBaudRate(m_baudRate);
-    connect(newPort, &QSerialPort::readyRead, this, &QDSerialPort::onPortReadyRead);
-
-    if(newPort->open(QIODevice::ReadWrite))
-    {
-        m_serialPort = newPort;
-        setState(STATE_OPEN);
-        emit serialPortChanged(newPort);
-
-        return true;
-    }
-    else
-    {
-        setState(STATE_ERROR);
-        delete newPort;
-
-        return false;
-    }
-}
-
-bool QDSerialPort::canReadLine()
-{
-    if(m_serialPort)
-    {
-        return m_serialPort->canReadLine();
-    }
-
-    else return false;
-}
-
-int QDSerialPort::bytesAvailable()
-{
-    if(m_serialPort)
-    {
-        return m_serialPort->bytesAvailable();
-    }
-
-    else return 0;
-}
-
-QString QDSerialPort::readLine()
-{
-    QString str;
-
-    if(m_serialPort)
-    {
-        str = m_serialPort->readLine();
-        m_lastLine = str;
-        emit lastLineChanged(m_lastLine);
-    }
-
-    return str;
-
-}
-
-void QDSerialPort::setBaudRate(int baudRate)
-{
-    if (m_baudRate == baudRate)
-        return;
-
-    m_baudRate = baudRate;
-    emit baudRateChanged(baudRate);
-
-    if(m_serialPort)
-        m_serialPort->setBaudRate(baudRate);
-}
-
-int QDSerialPort::getPortCount()
-{
-    return QSerialPortInfo::availablePorts().size();
-}
-
-QString QDSerialPort::getPortNameByIndex(int index)
-{
-    return QSerialPortInfo::availablePorts().at(index).portName();
-}
-
-void QDSerialPort::onPortReadyRead()
-{
-    emit readyRead();
-    if( canReadLine() ) emit readyReadLine();
-}
-
-void QDSerialPort::setState(QDSerialPort::State s)
-{
-    if(s == m_state) return;
-
-    m_state = s;
-
-    emit stateChanged(s);
-}
-
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qdserialport.h b/instr-sound-tiva/instrumentation-frequency-qt/qdserialport.h
deleted file mode 100644 (file)
index de03c7a..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef QDSERIALPORT_H
-#define QDSERIALPORT_H
-
-#include <QObject>
-
-class QSerialPort;
-
-class QDSerialPort : public QObject
-{
-    Q_OBJECT
-    Q_ENUMS(State)
-    Q_PROPERTY(QString portName READ portName WRITE setPortName NOTIFY portNameChanged)
-    Q_PROPERTY(QObject * serialPort READ serialPort NOTIFY serialPortChanged)
-    Q_PROPERTY(int baudRate READ baudRate WRITE setBaudRate NOTIFY baudRateChanged)
-    Q_PROPERTY(State state READ state NOTIFY stateChanged)
-    Q_PROPERTY(QString lastLine READ lastLine NOTIFY lastLineChanged)
-public:
-    explicit QDSerialPort(QObject *parent = 0);
-
-    enum State {
-        STATE_UNKNOWN,
-        STATE_OPEN,
-        STATE_CLOSED,
-        STATE_ERROR
-    };
-
-    QString portName() const
-    {
-        return m_portName;
-    }
-
-    int baudRate() const
-    {
-        return m_baudRate;
-    }
-
-    State state() const
-    {
-        return m_state;
-    }
-
-    QObject * serialPort() const
-    {
-        return (QObject *) m_serialPort;
-    }
-
-    QString lastLine() const
-    {
-        return m_lastLine;
-    }
-
-signals:
-
-    void readyRead();
-    void readyReadLine();
-
-    void portNameChanged(QString portName);
-
-    void baudRateChanged(int baudRate);
-
-    void stateChanged(State state);
-
-    void serialPortChanged(QObject * serialPort);
-
-
-    void lastLineChanged(QString lastLine);
-
-public slots:
-    bool open();
-
-    bool canReadLine();
-    int bytesAvailable();
-
-    QString readLine();
-
-    void setPortName(QString portName)
-    {
-        if (m_portName == portName)
-            return;
-
-        m_portName = portName;
-        emit portNameChanged(portName);
-    }
-
-    void setBaudRate(int baudRate);
-
-    static int getPortCount();
-    static QString getPortNameByIndex(int index);
-
-    void onPortReadyRead();
-
-private:
-    void setState(State s);
-
-    QSerialPort * m_serialPort;
-    QString m_portName;
-    int m_baudRate;
-    State m_state;
-    QString m_lastLine;
-};
-
-#endif // QDSERIALPORT_H
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qml.qrc b/instr-sound-tiva/instrumentation-frequency-qt/qml.qrc
deleted file mode 100644 (file)
index 5f6483a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file>main.qml</file>
-    </qresource>
-</RCC>
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qmldash.pro b/instr-sound-tiva/instrumentation-frequency-qt/qmldash.pro
deleted file mode 100644 (file)
index f671cb5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick serialport
-CONFIG += c++11
-
-SOURCES += main.cpp \
-    qdserialport.cpp \
-    qdaudioserialport.cpp
-
-RESOURCES += qml.qrc
-
-# Additional import path used to resolve QML modules in Qt Creator's code model
-QML_IMPORT_PATH =
-
-# Default rules for deployment.
-include(deployment.pri)
-
-HEADERS += \
-    qdserialport.h \
-    qdaudioserialport.h
-
-LIBS += -lfftw3
-
diff --git a/instr-sound-tiva/instrumentation-frequency-qt/qmldash.pro.user b/instr-sound-tiva/instrumentation-frequency-qt/qmldash.pro.user
deleted file mode 100644 (file)
index 5cf5b82..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.5.0, 2015-10-20T14:06:47. -->
-<qtcreator>
- <data>
-  <variable>EnvironmentId</variable>
-  <value type="QByteArray">{ba3ee1e2-9b9f-40e6-8b82-093534e16440}</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.ActiveTarget</variable>
-  <value type="int">0</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.EditorSettings</variable>
-  <valuemap type="QVariantMap">
-   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
-   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
-   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
-   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
-    <value type="QString" key="language">Cpp</value>
-    <valuemap type="QVariantMap" key="value">
-     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
-    </valuemap>
-   </valuemap>
-   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
-    <value type="QString" key="language">QmlJS</value>
-    <valuemap type="QVariantMap" key="value">
-     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
-    </valuemap>
-   </valuemap>
-   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
-   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
-   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
-   <value type="int" key="EditorConfiguration.IndentSize">4</value>
-   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
-   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
-   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
-   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
-   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
-   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
-   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
-   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
-   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
-   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
-   <value type="int" key="EditorConfiguration.TabSize">8</value>
-   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
-   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
-   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
-   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
-   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
-   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
-  </valuemap>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.PluginSettings</variable>
-  <valuemap type="QVariantMap"/>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.Target.0</variable>
-  <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.0 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.0 GCC 64bit</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.55.gcc_64_kit</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/camargo/build-qmldash-Desktop_Qt_5_5_0_GCC_64bit-Debug</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
-      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
-    </valuemap>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
-    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
-    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
-   </valuemap>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/camargo/build-qmldash-Desktop_Qt_5_5_0_GCC_64bit-Release</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
-      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
-    </valuemap>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
-    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
-    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
-    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
-    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
-    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
-    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
-    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
-    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
-    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
-    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
-    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
-    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
-     <value type="int">0</value>
-     <value type="int">1</value>
-     <value type="int">2</value>
-     <value type="int">3</value>
-     <value type="int">4</value>
-     <value type="int">5</value>
-     <value type="int">6</value>
-     <value type="int">7</value>
-     <value type="int">8</value>
-     <value type="int">9</value>
-     <value type="int">10</value>
-     <value type="int">11</value>
-     <value type="int">12</value>
-     <value type="int">13</value>
-     <value type="int">14</value>
-    </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
-    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmldash</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/camargo/qmldash/qmldash.pro</value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">qmldash.pro</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
-    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
-    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
-  </valuemap>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.TargetCount</variable>
-  <value type="int">1</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
-  <value type="int">18</value>
- </data>
- <data>
-  <variable>Version</variable>
-  <value type="int">18</value>
- </data>
-</qtcreator>
diff --git a/qt/instrumentation-frequency-qt/deployment.pri b/qt/instrumentation-frequency-qt/deployment.pri
new file mode 100644 (file)
index 0000000..c89af25
--- /dev/null
@@ -0,0 +1,14 @@
+unix:!android {
+    isEmpty(target.path) {
+        qnx {
+            target.path = /tmp/$${TARGET}/bin
+        } else {
+            target.path = /opt/$${TARGET}/bin
+        }
+        export(target.path)
+    }
+    INSTALLS += target
+}
+
+export(INSTALLS)
+
diff --git a/qt/instrumentation-frequency-qt/main.cpp b/qt/instrumentation-frequency-qt/main.cpp
new file mode 100644 (file)
index 0000000..0877982
--- /dev/null
@@ -0,0 +1,25 @@
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+#include "qdserialport.h"
+#include "qdaudioserialport.h"
+#include <QtQml>
+#include <QIcon>
+
+int main(int argc, char *argv[])
+{
+    QGuiApplication app(argc, argv);
+    app.setApplicationDisplayName("qmldash");
+
+    QIcon ico("/usr/share/icons/breeze/devices/64/audio-card.svg");
+    app.setWindowIcon(ico);
+
+    //qmlRegisterType<QDSerialPort>("qmldash", 1, 0, "SerialPort");
+    qmlRegisterType<QDAudioSerialPort>("qmldash", 1, 0, "AudioSerialPort");
+
+    QQmlApplicationEngine engine;
+    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+    return app.exec();
+}
+
diff --git a/qt/instrumentation-frequency-qt/main.qml b/qt/instrumentation-frequency-qt/main.qml
new file mode 100644 (file)
index 0000000..0719ac3
--- /dev/null
@@ -0,0 +1,377 @@
+import QtQuick 2.5
+import QtQuick.Window 2.2
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.1
+
+import qmldash 1.0
+
+ApplicationWindow {
+    id: window
+    visible: true
+
+    width: 450
+    height: 332
+
+    title: "Frequency Meter"
+
+    color: "transparent"
+    flags: Qt.FramelessWindowHint
+    Rectangle
+    {
+        color: "#333"
+        anchors.fill: parent
+        radius: 5
+    }
+
+    AudioSerialPort
+    {
+        id: serial
+        portName: getPortNameByIndex(0)
+        baudRate: 921600
+
+        property bool ready: false
+        property real smoothLevel: level
+        Behavior on smoothLevel { NumberAnimation{ duration: 250; easing.type: Easing.InOutQuart} }
+
+        onProcessed:
+        {
+            ready = true;
+            activity.on = true;
+            waveform.requestPaint();
+            fft.requestPaint();
+        }
+
+        Component.onCompleted: openSerial();
+    }
+
+    Rectangle
+    {
+        id: mainPane
+        x: 5
+        y: 5
+        radius: 5
+        color: "#111"
+        width: parent.width - 10
+        height: parent.height - 30
+
+        Text
+        {
+            id: appTitle
+
+            font.pixelSize: 20
+            font.family: "Oxygen-Sans"
+            text: "Frequency Meter"
+            color: "#eee"
+
+            x: 10
+            y: 10
+        }
+
+        Text
+        {
+            id: freqLabel
+
+            font.pixelSize: 70
+            font.family: "Oxygen Mono"
+            text: serial.fftPeakFrequency
+            opacity: serial.level > 0.10? 1 : 0.5
+            horizontalAlignment: Text.AlignRight
+            width: 220
+            anchors.right: parent.right
+            anchors.rightMargin: 70
+            height: 80
+            verticalAlignment: Text.AlignBottom
+            color: "#eee"
+
+            Behavior on opacity{NumberAnimation{}}
+        }
+
+        Text
+        {
+            id: levelWarning
+            x: 10
+            y: 50
+            text: serial.cutoff? "Level is too high!" : "Level is too low!"
+            font.pixelSize: 14
+            opacity: serial.level > 0.10 || serial.cutoff? 0 : 1
+            Behavior on opacity{NumberAnimation{}}
+            color: "#f55"
+        }
+
+        Text
+        {
+            id: freqUnit
+            anchors.right: parent.right
+            anchors.rightMargin: 20
+            height: 76
+            verticalAlignment: Text.AlignBottom
+            text: "Hz"
+            font.pixelSize: 40
+            color: "#eee"
+        }
+
+        Rectangle
+        {
+            id: levelBar
+
+            y: 85
+            width: parent.width
+            height: 10
+            color: "#080808"
+
+            Rectangle
+            {
+                x: 0
+                y: 2
+                height: parent.height - 4
+                width: parent.width * Math.min(serial.smoothLevel, 1)
+                color: serial.cutoff? "#f55" : "#6ff"
+                Behavior on color{ColorAnimation{}}
+            }
+        }
+
+        Canvas
+        {
+            id: waveform
+            width: parent.width
+            height: (parent.height - 100) / 2
+            x: 0
+            y: 100
+            contextType: "2d"
+            property color waveColor: "#6ff"
+            property color lineColor: "#181818"
+            property color waveColorCutoff: "#f66"
+
+            onPaint:
+            {
+                if(!available) return;
+                if(!serial.ready) return;
+
+                context.clearRect(0,0,width, height);
+
+                context.strokeWidth = 1;
+
+
+                context.strokeStyle = lineColor;
+                context.beginPath();
+                context.moveTo(0, height/2);
+                context.lineTo(width, height/2);
+                context.stroke();
+
+                context.strokeStyle = serial.cutoff? waveColorCutoff : waveColor;
+                context.beginPath();
+                context.moveTo(0, height);
+
+                var points = serial.bufferSize;
+                var dx = width / points;
+                var increment = Math.max(1, Math.round(points/width/4) );
+
+                for(var i = 0; i < points; i+= increment)
+                {
+                    context.lineTo(i*dx, height * (0.5 - serial.sample(i)) );
+                }
+
+                context.stroke();
+            }
+
+            Text
+            {
+                text: "Normalization " + (serial.normalizationEnabled? "On" : "Off")
+                anchors.right: parent.right
+                anchors.top: parent.top
+                anchors.margins: 10
+                anchors.topMargin: 0
+                color: serial.normalizationEnabled? "#6ff" : "#666"
+
+                MouseArea
+                {
+                    anchors.fill: parent
+                    onClicked: serial.normalizationEnabled = !serial.normalizationEnabled
+                }
+            }
+        }
+
+        Rectangle
+        {
+            color: "#080808"
+            width: parent.width
+            height: 2
+            x: 0
+            anchors.top: waveform.bottom
+            anchors.topMargin: -1
+
+        }
+
+        Canvas
+        {
+            id: fft
+            width: parent.width
+            anchors.top: waveform.bottom
+            anchors.bottom: parent.bottom
+            anchors.bottomMargin: 2
+            x: 0
+            y: 200
+            contextType: "2d"
+            property color waveColor: "#ff6"
+            property color lineColor: "#181818"
+            property color markerColor: waveColor
+            property int freqInterval: 200
+
+            onPaint:
+            {
+                if(!available) return;
+                if(!serial.ready) return;
+
+                context.clearRect(0,0,width, height);
+
+                var hh = height / 2;
+                context.lineWidth = 1;
+
+
+                var points = serial.bufferSize/2;
+                var dx = width / points;
+                var fftLevel = serial.fftLevel;
+
+                var freqSpacing = 1.0 * serial.bufferSize / serial.sampleRate;
+                var freqX = freqInterval * freqSpacing * dx;
+                var peakX = dx * serial.fftPeakFrequency * freqSpacing;
+
+                context.strokeStyle = lineColor;
+                context.lineWidth = 1.5;
+                context.beginPath();
+                while(freqX < width)
+                {
+                    context.moveTo(freqX, 2);
+                    context.lineTo(freqX, height);
+                    freqX += freqInterval * freqSpacing * dx;
+                }
+                context.stroke();
+
+                context.fillStyle = markerColor;
+                context.beginPath();
+
+                context.moveTo(peakX-5, 0);
+                context.lineTo(peakX+5, 0);
+                context.lineTo(peakX, 5);
+                context.closePath();
+
+                context.fill();
+
+
+                context.strokeStyle = waveColor;
+                context.lineWidth = 1;
+
+                context.beginPath();
+                context.moveTo(0, height);
+                for(var i = 0; i < points; i++)
+                {
+                    context.lineTo(i*dx, (height-1) * (1.0 - serial.fftSample(i)/fftLevel) );
+                }
+                context.stroke();
+
+            }
+
+            Text
+            {
+                text: fft.freqInterval + " Hz / div"
+                anchors.right: parent.right
+                anchors.bottom: parent.bottom
+                anchors.margins: 10
+                color: "#666"
+            }
+
+            Text
+            {
+                text: "Hann Window " + (serial.hannWindowEnabled? "On" : "Off")
+                anchors.right: parent.right
+                anchors.top: parent.top
+                anchors.margins: 10
+                color: serial.hannWindowEnabled? "#ff6" : "#666"
+
+                MouseArea
+                {
+                    anchors.fill: parent
+                    onClicked: serial.hannWindowEnabled = !serial.hannWindowEnabled
+                }
+            }
+        }
+
+    }
+
+
+    Rectangle {
+
+        id: statusbar
+        color: "transparent"
+        width: parent.width
+        height: 20
+        anchors.bottom: parent.bottom
+
+        Text {
+            text: serial.portName + " @ " + serial.baudRate + " baud "
+            color: "#666"
+            x: 6
+        }
+
+
+        Item {
+            height: parent.height
+            width: 20
+
+            Layout.alignment: Qt.AlignRight
+            anchors.right: parent.right
+
+            Rectangle
+            {
+                id: led
+                property bool on: serial.serialPort !== null && serial.state == AudioSerialPort.STATE_OPEN
+                property bool error: serial.state == AudioSerialPort.STATE_ERROR
+                anchors.centerIn: parent
+                width: 8
+                height: 8
+                radius: 4
+
+                color: error? "red" : (on? "lime" : "#80000000")
+            }
+        }
+
+        Item {
+            height: parent.height
+            width: 20
+
+            anchors.right: parent.right
+            anchors.rightMargin: 14
+
+            Rectangle
+            {
+                id: activity
+                property bool on: false
+                anchors.centerIn: parent
+                width: 8
+                height: 8
+                radius: 4
+
+                color: on? "skyblue" : "#80000000"
+
+                onOnChanged: if(on){ activityOffTimer.start(); }
+
+                Timer
+                {
+                    id: activityOffTimer
+                    interval: 200
+                    onTriggered: activity.on = false
+                }
+            }
+        }
+
+    }
+
+    function openSerial()
+    {
+        console.log("Opening serial...");
+        serial.open();
+    }
+
+
+}
+
diff --git a/qt/instrumentation-frequency-qt/qdaudioserialport.cpp b/qt/instrumentation-frequency-qt/qdaudioserialport.cpp
new file mode 100644 (file)
index 0000000..e6f1215
--- /dev/null
@@ -0,0 +1,127 @@
+#include "qdaudioserialport.h"
+#include "qserialport.h"
+
+#include <QtMath>
+#include <complex>
+
+QDAudioSerialPort::QDAudioSerialPort(QObject *parent):
+  QDSerialPort(parent),
+  m_frequency(0.0),
+  m_cutoff(false),
+  m_bufferSize(AUDIO_BUFFER_SIZE),
+  m_level(0),
+  m_fftLevel(0),
+  m_sampleRate(AUDIO_SAMPLE_RATE),
+  m_fftPeakIndex(0),
+  m_fftPeakFrequency(0),
+  m_hannWindowEnabled(true),
+  m_normalizationEnabled(false)
+{
+    connect(this, &QDSerialPort::readyRead, this, &QDAudioSerialPort::onSuperReadyRead);
+    initFFT();
+}
+
+void QDAudioSerialPort::onSuperReadyRead()
+{
+    while(bytesAvailable() >= AUDIO_BUFFER_SIZE )
+    {
+        QSerialPort * port = (QSerialPort*) serialPort();
+        if(port && port->isOpen())
+        {
+            port->read((char*)buffer, AUDIO_BUFFER_SIZE);
+            processBuffer();
+        }
+    }
+
+}
+
+void QDAudioSerialPort::initFFT()
+{
+    m_fft_in = fftw_alloc_real(AUDIO_BUFFER_SIZE);
+    m_fft_out = fftw_alloc_complex(AUDIO_BUFFER_SIZE);
+    Q_ASSERT(m_fft_in && m_fft_out);
+
+    for (int a = 0; a < AUDIO_BUFFER_SIZE; a++) {
+        m_fft_in[a] = 0;
+        m_fft_out[a][0] = 0;
+        m_fft_out[a][1] = 0;
+    }
+
+    m_fft_plan = fftw_plan_dft_r2c_1d(AUDIO_BUFFER_SIZE, m_fft_in, m_fft_out, 0);
+    Q_ASSERT(m_fft_plan);
+}
+
+void QDAudioSerialPort::processBuffer()
+{
+    bool cutoff = false;
+
+    int maxRange = qMin(255 - AUDIO_ZERO_LEVEL, AUDIO_ZERO_LEVEL);
+    float floatScale = 1.0f / maxRange;
+
+    float level = 0.0f;
+    bool positive = false;
+    int zeroPasses = 0;
+
+    for(int i = 0; i < AUDIO_BUFFER_SIZE; i++)
+    {
+        m_fft_in[i] = (bufferScaled[i] = floatScale * (static_cast<int>(buffer[i]) - AUDIO_ZERO_LEVEL));
+        level = qMax(level, qAbs(bufferScaled[i]));
+
+        if( (bufferScaled[i] > 0) != positive)
+        {
+            positive = !positive;
+            zeroPasses++;
+        }
+
+        if(buffer[i] > CUTOFF_THRESHOLD)
+            cutoff = true;
+    }
+
+    if(m_normalizationEnabled)
+    {
+        for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) {
+            bufferScaled[i] /= level;
+        }
+    }
+
+    if(m_hannWindowEnabled)
+    {
+        applyHannWindow();
+    }
+
+    // fft part
+
+    fftw_execute(m_fft_plan);
+
+    double fftLevel = 0.0;
+    int fftMaxIndex = 0;
+
+    for(int i = 0; i < AUDIO_BUFFER_SIZE; i++)
+    {
+        m_fft_in[i] = std::abs(std::complex<double>(m_fft_out[i][0], m_fft_out[i][1]));
+        if(m_fft_in[i] > fftLevel)
+        {
+            fftLevel = m_fft_in[i];
+            fftMaxIndex = i;
+        }
+
+    }
+
+    setFrequency(zeroPasses * 2);
+    setLevel(level);
+    setFftLevel(fftLevel);
+    setFftPeakFrequency(fftMaxIndex * AUDIO_SAMPLE_RATE / AUDIO_BUFFER_SIZE);
+    setFftPeakIndex(fftMaxIndex);
+    setCutoff(cutoff);
+
+    emit processed();
+}
+
+void QDAudioSerialPort::applyHannWindow()
+{
+    for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) {
+        double multiplier = 0.5 * (1 - qCos(M_2_PI*i/(AUDIO_BUFFER_SIZE - 1)));
+        m_fft_in[i] = multiplier * m_fft_in[i];
+    }
+}
+
diff --git a/qt/instrumentation-frequency-qt/qdaudioserialport.h b/qt/instrumentation-frequency-qt/qdaudioserialport.h
new file mode 100644 (file)
index 0000000..ddd3c00
--- /dev/null
@@ -0,0 +1,223 @@
+#ifndef QDAUDIOSERIALPORT_H
+#define QDAUDIOSERIALPORT_H
+
+#include "qdserialport.h"
+#include <cstdint>
+
+#define AUDIO_ZERO_LEVEL    (125)
+#define AUDIO_SAMPLE_RATE   (22050)
+#define CUTOFF_THRESHOLD    (251)
+#define AUDIO_BUFFER_SIZE   (AUDIO_SAMPLE_RATE/8)
+
+#include <fftw3.h>
+
+class QDAudioSerialPort : public QDSerialPort
+{
+
+    Q_OBJECT
+    Q_PROPERTY(qreal frequency READ frequency WRITE setFrequency NOTIFY frequencyChanged)
+    Q_PROPERTY(qreal level READ level WRITE setLevel NOTIFY levelChanged)
+    Q_PROPERTY(qreal fftLevel READ fftLevel WRITE setFftLevel NOTIFY fftLevelChanged)
+    Q_PROPERTY(qreal fftPeakFrequency READ fftPeakFrequency WRITE setFftPeakFrequency NOTIFY fftPeakFrequencyChanged)
+    Q_PROPERTY(int fftPeakIndex READ fftPeakIndex WRITE setFftPeakIndex NOTIFY fftPeakIndexChanged)
+    Q_PROPERTY(bool cutoff READ cutoff WRITE setCutoff NOTIFY cutoffChanged)
+    Q_PROPERTY(int bufferSize READ bufferSize NOTIFY bufferSizeChanged)
+    Q_PROPERTY(int sampleRate READ sampleRate WRITE setSampleRate NOTIFY sampleRateChanged)
+    Q_PROPERTY(bool hannWindowEnabled READ hannWindowEnabled WRITE setHannWindowEnabled NOTIFY hannWindowEnabledChanged)
+    Q_PROPERTY(bool normalizationEnabled READ normalizationEnabled WRITE setNormalizationEnabled NOTIFY normalizationEnabledChanged)
+public:
+    QDAudioSerialPort(QObject * parent = 0);
+
+    qreal frequency() const
+    {
+        return m_frequency;
+    }
+
+    bool cutoff() const
+    {
+        return m_cutoff;
+    }
+
+    int bufferSize() const
+    {
+        return m_bufferSize;
+    }
+
+    qreal level() const
+    {
+        return m_level;
+    }
+
+    qreal fftLevel() const
+    {
+        return m_fftLevel;
+    }
+
+    int sampleRate() const
+    {
+        return m_sampleRate;
+    }
+
+    int fftPeakIndex() const
+    {
+        return m_fftPeakIndex;
+    }
+
+    qreal fftPeakFrequency() const
+    {
+        return m_fftPeakFrequency;
+    }
+
+    bool hannWindowEnabled() const
+    {
+        return m_hannWindowEnabled;
+    }
+
+    bool normalizationEnabled() const
+    {
+        return m_normalizationEnabled;
+    }
+
+signals:
+
+    void frequencyChanged(qreal frequency);
+    void processed();
+
+    void cutoffChanged(bool cutoff);
+
+    void bufferSizeChanged(int bufferSize);
+
+    void levelChanged(qreal level);
+
+    void fftLevelChanged(qreal fftLevel);
+
+    void sampleRateChanged(int sampleRate);
+
+    void fftPeakIndexChanged(int fftPeakIndex);
+
+    void fftPeakFrequencyChanged(qreal fftPeakFrequency);
+
+    void hannWindowEnabledChanged(bool hannWindowEnabled);
+
+    void normalizationEnabledChanged(bool normalizationEnabled);
+
+public slots:
+    void onSuperReadyRead();
+
+    void setFrequency(qreal frequency)
+    {
+        if (m_frequency == frequency)
+            return;
+
+        m_frequency = frequency;
+        emit frequencyChanged(frequency);
+    }
+
+    void setCutoff(bool cutoff)
+    {
+        if (m_cutoff == cutoff)
+            return;
+
+        m_cutoff = cutoff;
+        emit cutoffChanged(cutoff);
+    }
+
+    qreal sample(int index)
+    {
+        return bufferScaled[index];
+    }
+
+    qreal fftSample(int index)
+    {
+        return m_fft_in[index];
+    }
+
+    void setLevel(qreal level)
+    {
+        if (m_level == level)
+            return;
+
+        m_level = level;
+        emit levelChanged(level);
+    }
+
+    void setFftLevel(qreal fftLevel)
+    {
+        if (m_fftLevel == fftLevel)
+            return;
+
+        m_fftLevel = fftLevel;
+        emit fftLevelChanged(fftLevel);
+    }
+
+    void setSampleRate(int sampleRate)
+    {
+        if (m_sampleRate == sampleRate)
+            return;
+
+        m_sampleRate = sampleRate;
+        emit sampleRateChanged(sampleRate);
+    }
+
+    void setFftPeakIndex(int fftPeakIndex)
+    {
+        if (m_fftPeakIndex == fftPeakIndex)
+            return;
+
+        m_fftPeakIndex = fftPeakIndex;
+        emit fftPeakIndexChanged(fftPeakIndex);
+    }
+
+    void setFftPeakFrequency(qreal fftPeakFrequency)
+    {
+        if (m_fftPeakFrequency == fftPeakFrequency)
+            return;
+
+        m_fftPeakFrequency = fftPeakFrequency;
+        emit fftPeakFrequencyChanged(fftPeakFrequency);
+    }
+
+    void setHannWindowEnabled(bool hannWindowEnabled)
+    {
+        if (m_hannWindowEnabled == hannWindowEnabled)
+            return;
+
+        m_hannWindowEnabled = hannWindowEnabled;
+        emit hannWindowEnabledChanged(hannWindowEnabled);
+    }
+
+    void setNormalizationEnabled(bool normalizationEnabled)
+    {
+        if (m_normalizationEnabled == normalizationEnabled)
+            return;
+
+        m_normalizationEnabled = normalizationEnabled;
+        emit normalizationEnabledChanged(normalizationEnabled);
+    }
+
+private:
+    void initFFT();
+    void processBuffer();
+    void applyHannWindow();
+
+
+    float bufferScaled[AUDIO_BUFFER_SIZE];
+    uint8_t buffer[AUDIO_BUFFER_SIZE];
+
+    qreal m_frequency;
+    bool m_cutoff;
+    int m_bufferSize;
+    qreal m_level;
+
+    fftw_plan m_fft_plan;
+    double * m_fft_in;
+    fftw_complex *m_fft_out;
+    qreal m_fftLevel;
+    int m_sampleRate;
+    int m_fftPeakIndex;
+    qreal m_fftPeakFrequency;
+    bool m_hannWindowEnabled;
+    bool m_normalizationEnabled;
+};
+
+#endif // QDAUDIOSERIALPORT_H
diff --git a/qt/instrumentation-frequency-qt/qdserialport.cpp b/qt/instrumentation-frequency-qt/qdserialport.cpp
new file mode 100644 (file)
index 0000000..2220ae3
--- /dev/null
@@ -0,0 +1,115 @@
+#include "qdserialport.h"
+
+#include <QSerialPort>
+#include <QSerialPortInfo>
+
+QDSerialPort::QDSerialPort(QObject *parent) :
+  QObject(parent),
+  m_serialPort(0),
+  m_portName(""),
+  m_baudRate(9600),
+  m_state(STATE_CLOSED)
+{
+
+}
+
+bool QDSerialPort::open()
+{
+    if(m_serialPort)
+    {
+        return m_state == STATE_OPEN;
+    }
+
+    QSerialPort * newPort = new QSerialPort(m_portName, this);
+    newPort->setBaudRate(m_baudRate);
+    connect(newPort, &QSerialPort::readyRead, this, &QDSerialPort::onPortReadyRead);
+
+    if(newPort->open(QIODevice::ReadWrite))
+    {
+        m_serialPort = newPort;
+        setState(STATE_OPEN);
+        emit serialPortChanged(newPort);
+
+        return true;
+    }
+    else
+    {
+        setState(STATE_ERROR);
+        delete newPort;
+
+        return false;
+    }
+}
+
+bool QDSerialPort::canReadLine()
+{
+    if(m_serialPort)
+    {
+        return m_serialPort->canReadLine();
+    }
+
+    else return false;
+}
+
+int QDSerialPort::bytesAvailable()
+{
+    if(m_serialPort)
+    {
+        return m_serialPort->bytesAvailable();
+    }
+
+    else return 0;
+}
+
+QString QDSerialPort::readLine()
+{
+    QString str;
+
+    if(m_serialPort)
+    {
+        str = m_serialPort->readLine();
+        m_lastLine = str;
+        emit lastLineChanged(m_lastLine);
+    }
+
+    return str;
+
+}
+
+void QDSerialPort::setBaudRate(int baudRate)
+{
+    if (m_baudRate == baudRate)
+        return;
+
+    m_baudRate = baudRate;
+    emit baudRateChanged(baudRate);
+
+    if(m_serialPort)
+        m_serialPort->setBaudRate(baudRate);
+}
+
+int QDSerialPort::getPortCount()
+{
+    return QSerialPortInfo::availablePorts().size();
+}
+
+QString QDSerialPort::getPortNameByIndex(int index)
+{
+    return QSerialPortInfo::availablePorts().at(index).portName();
+}
+
+void QDSerialPort::onPortReadyRead()
+{
+    emit readyRead();
+    if( canReadLine() ) emit readyReadLine();
+}
+
+void QDSerialPort::setState(QDSerialPort::State s)
+{
+    if(s == m_state) return;
+
+    m_state = s;
+
+    emit stateChanged(s);
+}
+
diff --git a/qt/instrumentation-frequency-qt/qdserialport.h b/qt/instrumentation-frequency-qt/qdserialport.h
new file mode 100644 (file)
index 0000000..de03c7a
--- /dev/null
@@ -0,0 +1,102 @@
+#ifndef QDSERIALPORT_H
+#define QDSERIALPORT_H
+
+#include <QObject>
+
+class QSerialPort;
+
+class QDSerialPort : public QObject
+{
+    Q_OBJECT
+    Q_ENUMS(State)
+    Q_PROPERTY(QString portName READ portName WRITE setPortName NOTIFY portNameChanged)
+    Q_PROPERTY(QObject * serialPort READ serialPort NOTIFY serialPortChanged)
+    Q_PROPERTY(int baudRate READ baudRate WRITE setBaudRate NOTIFY baudRateChanged)
+    Q_PROPERTY(State state READ state NOTIFY stateChanged)
+    Q_PROPERTY(QString lastLine READ lastLine NOTIFY lastLineChanged)
+public:
+    explicit QDSerialPort(QObject *parent = 0);
+
+    enum State {
+        STATE_UNKNOWN,
+        STATE_OPEN,
+        STATE_CLOSED,
+        STATE_ERROR
+    };
+
+    QString portName() const
+    {
+        return m_portName;
+    }
+
+    int baudRate() const
+    {
+        return m_baudRate;
+    }
+
+    State state() const
+    {
+        return m_state;
+    }
+
+    QObject * serialPort() const
+    {
+        return (QObject *) m_serialPort;
+    }
+
+    QString lastLine() const
+    {
+        return m_lastLine;
+    }
+
+signals:
+
+    void readyRead();
+    void readyReadLine();
+
+    void portNameChanged(QString portName);
+
+    void baudRateChanged(int baudRate);
+
+    void stateChanged(State state);
+
+    void serialPortChanged(QObject * serialPort);
+
+
+    void lastLineChanged(QString lastLine);
+
+public slots:
+    bool open();
+
+    bool canReadLine();
+    int bytesAvailable();
+
+    QString readLine();
+
+    void setPortName(QString portName)
+    {
+        if (m_portName == portName)
+            return;
+
+        m_portName = portName;
+        emit portNameChanged(portName);
+    }
+
+    void setBaudRate(int baudRate);
+
+    static int getPortCount();
+    static QString getPortNameByIndex(int index);
+
+    void onPortReadyRead();
+
+private:
+    void setState(State s);
+
+    QSerialPort * m_serialPort;
+    QString m_portName;
+    int m_baudRate;
+    State m_state;
+    QString m_lastLine;
+};
+
+#endif // QDSERIALPORT_H
diff --git a/qt/instrumentation-frequency-qt/qml.qrc b/qt/instrumentation-frequency-qt/qml.qrc
new file mode 100644 (file)
index 0000000..5f6483a
--- /dev/null
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>main.qml</file>
+    </qresource>
+</RCC>
diff --git a/qt/instrumentation-frequency-qt/qmldash.pro b/qt/instrumentation-frequency-qt/qmldash.pro
new file mode 100644 (file)
index 0000000..f671cb5
--- /dev/null
@@ -0,0 +1,23 @@
+TEMPLATE = app
+
+QT += qml quick serialport
+CONFIG += c++11
+
+SOURCES += main.cpp \
+    qdserialport.cpp \
+    qdaudioserialport.cpp
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH =
+
+# Default rules for deployment.
+include(deployment.pri)
+
+HEADERS += \
+    qdserialport.h \
+    qdaudioserialport.h
+
+LIBS += -lfftw3
+
diff --git a/qt/instrumentation-frequency-qt/qmldash.pro.user b/qt/instrumentation-frequency-qt/qmldash.pro.user
new file mode 100644 (file)
index 0000000..5cf5b82
--- /dev/null
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 3.5.0, 2015-10-20T14:06:47. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{ba3ee1e2-9b9f-40e6-8b82-093534e16440}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap"/>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.0 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.0 GCC 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.55.gcc_64_kit</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/camargo/build-qmldash-Desktop_Qt_5_5_0_GCC_64bit-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/camargo/build-qmldash-Desktop_Qt_5_5_0_GCC_64bit-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
+       <value type="QString">-w</value>
+       <value type="QString">-r</value>
+      </valuelist>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmldash</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/camargo/qmldash/qmldash.pro</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">qmldash.pro</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">18</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">18</value>
+ </data>
+</qtcreator>