Added minute sync to time drift control

This commit is contained in:
Jordan Sherer 2019-11-12 20:45:27 -05:00
parent e855a84bb9
commit 1621670d1f
3 changed files with 122 additions and 84 deletions

View File

@ -8987,6 +8987,20 @@ void MainWindow::on_driftSyncEndButton_clicked(){
setDrift(n * 1000);
}
void MainWindow::on_driftSyncMinuteButton_clicked(){
auto now = QDateTime::currentDateTimeUtc();
int n = 0;
int s = now.time().second();
if(s < 30){
n = -s;
} else {
n = 60 - s;
}
setDrift(n * 1000);
}
void MainWindow::on_driftSyncResetButton_clicked(){
setDrift(0);
resetTimeDeltaAverage();

View File

@ -354,6 +354,7 @@ private slots:
void on_driftSpinBox_valueChanged(int n);
void on_driftSyncButton_clicked();
void on_driftSyncEndButton_clicked();
void on_driftSyncMinuteButton_clicked();
void on_driftSyncResetButton_clicked();
void setDrift(int n);
void on_rptSpinBox_valueChanged(int n);

View File

@ -2008,92 +2008,115 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF
</widget>
</item>
<item>
<widget class="QSpinBox" name="driftSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QGridLayout" name="gridLayout_12" rowminimumheight="0,0,0" columnminimumwidth="0,0,0">
<property name="leftMargin">
<number>0</number>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>30</height>
</size>
<property name="topMargin">
<number>0</number>
</property>
<property name="wrapping">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="suffix">
<string> ms</string>
</property>
<property name="prefix">
<string>Time Drift </string>
</property>
<property name="minimum">
<number>-30000</number>
</property>
<property name="maximum">
<number>30000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="driftSyncButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Observe signals in the waterfall and click this to synchronize your time drift with the start of a TX cycle.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sync Time Drift to Now (TX Start)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="driftSyncEndButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Observe signals in the waterfall and click this to synchronize your time drift with the end of a TX cycle.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sync Time Drift to Now (TX End)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="driftSyncResetButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Reset your time drift to zero.</string>
</property>
<property name="text">
<string>Reset Time Drift</string>
</property>
</widget>
<item row="0" column="2">
<widget class="QPushButton" name="driftSyncMinuteButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Sync Time Drift to Now (Minute Start)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="driftSyncButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Observe signals in the waterfall and click this to synchronize your time drift with the start of a TX cycle.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sync Time Drift to Now (TX Start)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="driftSyncEndButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Observe signals in the waterfall and click this to synchronize your time drift with the end of a TX cycle.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sync Time Drift to Now (TX End)</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="driftSyncResetButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Reset your time drift to zero.</string>
</property>
<property name="text">
<string>Reset Time Drift</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSpinBox" name="driftSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>30</height>
</size>
</property>
<property name="wrapping">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="suffix">
<string> ms</string>
</property>
<property name="prefix">
<string>Time Drift </string>
</property>
<property name="minimum">
<number>-30000</number>
</property>
<property name="maximum">
<number>30000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>