Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Commit df7c523

Browse files
authored
Merge pull request #10 from Yang-Wu-Altran/master
Bug fix: playback drag slider when playing; quit when playing.
2 parents bccc8e0 + 3c184e3 commit df7c523

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

include/glwidget.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions_4_3_Core
4040
void SetTrackingEnabled(bool enable);
4141

4242
public slots:
43-
// void ZoomPlus();
44-
// void ZoomMinus();
43+
4544
void UpdateGrid();
4645
void Disconnected();
47-
// void StopTracking();
4846
void StartTracking();
4947
void ResetCameraAll();
5048
void ResetCameraOrient();

src/mainwindow.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,10 @@ MainWindow::MainWindow(QWidget *parent)
8282
ui_->glLayout_2->addWidget(glWidget2_);
8383
glWidget2_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
8484

85-
// installEventFilter(this);
8685
ConnectSignalsToSlots();
87-
InitLoadConfigure();
8886
InitComboBoxes();
8987
InitLaneTypeMenu();
88+
InitLoadConfigure();
9089

9190
QSurfaceFormat format;
9291
format.setDepthBufferSize(24);
@@ -788,13 +787,13 @@ MainWindow::UpdateConfigure()
788787
config_.ch1PlaybackDataType_ = (DataType)ui_->playbackDataType->currentIndex();
789788
}
790789

791-
if(hasChange)
792-
config_.Save();
793-
794790
if(config_.ch1DeltaDelay_ != ui_->deltaDelay->text().toInt())
795791
{
796792
config_.ch1DeltaDelay_ = ui_->deltaDelay->text().toInt();
793+
config_.Save();
797794
}
795+
else if(hasChange)
796+
config_.Save();
798797

799798
return hasChange;
800799
}
@@ -834,13 +833,13 @@ MainWindow::UpdateConfigure2()
834833
config_.ch2PlaybackDataType_ = (DataType)ui_->playbackDataType_2->currentIndex();
835834
}
836835

837-
if(hasChange)
838-
config_.Save();
839-
840836
if(config_.ch2DeltaDelay_ != ui_->deltaDelay_2->text().toInt())
841837
{
842838
config_.ch2DeltaDelay_ = ui_->deltaDelay_2->text().toInt();
839+
config_.Save();
843840
}
841+
else if(hasChange)
842+
config_.Save();
844843

845844
return hasChange;
846845
}
@@ -864,6 +863,7 @@ MainWindow::InitLoadConfigure()
864863
ui_->playbackDataType_2->setCurrentIndex( static_cast<int>(config_.ch2PlaybackDataType_) );
865864
ui_->deltaDelay_2->setText(QString::number(config_.ch2DeltaDelay_));
866865

866+
ui_->actionCombiCh->setChecked(config_.combineChannel_);
867867
ui_->actionShowGrid->setChecked(config_.showGrid_);
868868
ui_->actionShowObject->setChecked(config_.showObjectDetails_);
869869
ui_->actionLockCamera->setChecked(config_.lockCamera_);
@@ -988,6 +988,7 @@ void
988988
MainWindow::CombineChannels()
989989
{
990990
config_.combineChannel_ = !config_.combineChannel_;
991+
config_.Save();
991992
}
992993

993994
void

src/mainwindow.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<rect>
1010
<x>0</x>
1111
<y>0</y>
12-
<width>1514</width>
13-
<height>1029</height>
12+
<width>1076</width>
13+
<height>926</height>
1414
</rect>
1515
</property>
1616
<property name="sizePolicy">
@@ -1411,7 +1411,7 @@
14111411
<rect>
14121412
<x>0</x>
14131413
<y>0</y>
1414-
<width>1514</width>
1414+
<width>1076</width>
14151415
<height>22</height>
14161416
</rect>
14171417
</property>

src/osireader.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ void
286286
OsiReader::SendMessageLoop()
287287
{
288288
std::ifstream inputFile (osiFileName_.toStdString().c_str());
289+
bool isFirstMessage (true);
289290

290291
while(isRunning_)
291292
{
@@ -301,9 +302,9 @@ OsiReader::SendMessageLoop()
301302

302303
uint64_t firstTimeStamp (0);
303304
uint64_t preTimeStamp (0);
304-
bool isFirstMessage (true);
305+
bool isRefreshMessage (true);
305306

306-
while(getline(inputFile, str_line_input) && !isPaused_)
307+
while(getline(inputFile, str_line_input) && !isPaused_ && isRunning_)
307308
{
308309
if(iterChanged_)
309310
break;
@@ -332,9 +333,15 @@ OsiReader::SendMessageLoop()
332333
if(isFirstMessage)
333334
{
334335
firstTimeStamp = curStamp;
335-
preTimeStamp = curStamp;
336336
isFirstMessage = false;
337337
}
338+
339+
if(isRefreshMessage)
340+
{
341+
preTimeStamp = curStamp;
342+
isRefreshMessage = false;
343+
}
344+
338345
int64_t sleep = curStamp - preTimeStamp;
339346
if(sleep < 0)
340347
sleep = 0;

0 commit comments

Comments
 (0)