1/*
2 *    Copyright (C) 2017 - 2021
3 *    Albrecht Lohofener (albrechtloh@gmx.de)
4 *
5 *    This file is part of the welle.io.
6 *    Many of the ideas as implemented in welle.io are derived from
7 *    other work, made available through the GNU general Public License.
8 *    All copyrights of the original authors are recognized.
9 *
10 *    welle.io is free software; you can redistribute it and/or modify
11 *    it under the terms of the GNU General Public License as published by
12 *    the Free Software Foundation; either version 2 of the License, or
13 *    (at your option) any later version.
14 *
15 *    welle.io is distributed in the hope that it will be useful,
16 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 *    GNU General Public License for more details.
19 *
20 *    You should have received a copy of the GNU General Public License
21 *    along with welle.io; if not, write to the Free Software
22 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23 *
24 */
25
26import QtQuick 2.0
27import QtQuick.Layouts 1.1
28import Qt.labs.settings 1.0
29
30// Import custom styles
31import "../texts"
32import "../components"
33
34ViewBaseFrame {
35    labelText: qsTr("Null Symbol")
36
37    Settings {
38        property alias isNullSymbolWaterfall: spectrum.isWaterfall
39    }
40
41    content: WSpectrum {
42        id: spectrum
43    }
44
45    Connections{
46        target: guiHelper
47
48        onSetNullSymbolAxis: {
49            spectrum.yMax = Ymax
50            spectrum.freqMin = Xmin
51            spectrum.freqMax = Xmax
52        }
53    }
54
55    Connections {
56        target: spectrum
57
58        onIsWaterfallChanged: {
59            __registerSeries();
60        }
61    }
62
63    Timer {
64        id: refreshTimer
65        interval: 1 / 10 * 1000 // 10 Hz
66        running: parent.visible ? true : false // Trigger new data only if spectrum is showed
67        repeat: true
68        onTriggered: {
69           guiHelper.updateNullSymbol();
70        }
71    }
72
73    Component.onCompleted: {
74        __registerSeries();
75    }
76
77    function __registerSeries() {
78       if(spectrum.isWaterfall)
79           guiHelper.registerNullSymbolWaterfall(spectrum.waterfallObject);
80       else
81           guiHelper.registerNullSymbolSeries(spectrum.spectrumObject.series(0))
82    }
83}
84