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); 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(){ void MainWindow::on_driftSyncResetButton_clicked(){
setDrift(0); setDrift(0);
resetTimeDeltaAverage(); resetTimeDeltaAverage();

View File

@ -354,6 +354,7 @@ private slots:
void on_driftSpinBox_valueChanged(int n); void on_driftSpinBox_valueChanged(int n);
void on_driftSyncButton_clicked(); void on_driftSyncButton_clicked();
void on_driftSyncEndButton_clicked(); void on_driftSyncEndButton_clicked();
void on_driftSyncMinuteButton_clicked();
void on_driftSyncResetButton_clicked(); void on_driftSyncResetButton_clicked();
void setDrift(int n); void setDrift(int n);
void on_rptSpinBox_valueChanged(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> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="driftSpinBox"> <layout class="QGridLayout" name="gridLayout_12" rowminimumheight="0,0,0" columnminimumwidth="0,0,0">
<property name="sizePolicy"> <property name="leftMargin">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <number>0</number>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="topMargin">
<size> <number>0</number>
<width>100</width>
<height>30</height>
</size>
</property> </property>
<property name="wrapping"> <item row="0" column="2">
<bool>false</bool> <widget class="QPushButton" name="driftSyncMinuteButton">
</property> <property name="minimumSize">
<property name="alignment"> <size>
<set>Qt::AlignCenter</set> <width>0</width>
</property> <height>30</height>
<property name="buttonSymbols"> </size>
<enum>QAbstractSpinBox::PlusMinus</enum> </property>
</property> <property name="text">
<property name="suffix"> <string>Sync Time Drift to Now (Minute Start)</string>
<string> ms</string> </property>
</property> </widget>
<property name="prefix"> </item>
<string>Time Drift </string> <item row="0" column="1">
</property> <widget class="QPushButton" name="driftSyncButton">
<property name="minimum"> <property name="minimumSize">
<number>-30000</number> <size>
</property> <width>0</width>
<property name="maximum"> <height>30</height>
<number>30000</number> </size>
</property> </property>
<property name="singleStep"> <property name="toolTip">
<number>100</number> <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>
</widget> <property name="text">
</item> <string>Sync Time Drift to Now (TX Start)</string>
<item> </property>
<widget class="QPushButton" name="driftSyncButton"> </widget>
<property name="minimumSize"> </item>
<size> <item row="2" column="1">
<width>0</width> <widget class="QPushButton" name="driftSyncEndButton">
<height>30</height> <property name="minimumSize">
</size> <size>
</property> <width>0</width>
<property name="toolTip"> <height>30</height>
<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> </size>
</property> </property>
<property name="text"> <property name="toolTip">
<string>Sync Time Drift to Now (TX Start)</string> <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>
</widget> <property name="text">
</item> <string>Sync Time Drift to Now (TX End)</string>
<item> </property>
<widget class="QPushButton" name="driftSyncEndButton"> </widget>
<property name="minimumSize"> </item>
<size> <item row="2" column="2">
<width>0</width> <widget class="QPushButton" name="driftSyncResetButton">
<height>30</height> <property name="minimumSize">
</size> <size>
</property> <width>0</width>
<property name="toolTip"> <height>30</height>
<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> </size>
</property> </property>
<property name="text"> <property name="toolTip">
<string>Sync Time Drift to Now (TX End)</string> <string>Reset your time drift to zero.</string>
</property> </property>
</widget> <property name="text">
</item> <string>Reset Time Drift</string>
<item> </property>
<widget class="QPushButton" name="driftSyncResetButton"> </widget>
<property name="minimumSize"> </item>
<size> <item row="0" column="0">
<width>0</width> <widget class="QSpinBox" name="driftSpinBox">
<height>30</height> <property name="sizePolicy">
</size> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
</property> <horstretch>0</horstretch>
<property name="toolTip"> <verstretch>0</verstretch>
<string>Reset your time drift to zero.</string> </sizepolicy>
</property> </property>
<property name="text"> <property name="minimumSize">
<string>Reset Time Drift</string> <size>
</property> <width>100</width>
</widget> <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> </item>
</layout> </layout>
</widget> </widget>