Skip to content
Permalink
Browse files

radar as tool window

  • Loading branch information...
ri
ri committed Apr 16, 2019
1 parent 47b3807 commit b9f936b80968a7fc06017465e07933b42902877c
Showing with 21 additions and 4 deletions.
  1. +6 −3 SWindow.cpp
  2. +13 −0 ogl/RadarWidget.cpp
  3. +2 −1 ogl/RadarWidget.h
@@ -105,8 +105,10 @@ SWindow::SWindow(SatViewer *satviewer) {
// readSettings();
// enumSatModelList();
radarWidget = new RadarWidget(satviewer, this);
radarWidget->setWindowFlags(Qt::Tool);
radarWidget->resize(512, 512);
radarWidget->move(0, 0);
// radarWidget->move(0, 0);
// connect(radarWidget, SIGNAL(initialized()), this, SLOT(onStart()));
// radarWidget->setWindowFlags(Qt::Tool);
// radarWidget->show();
QTimer::singleShot(0, this, SLOT(onStart()));
@@ -321,7 +323,9 @@ void SWindow::addZRVMessage(QString text) {

void SWindow::onStart() {
// radarWidget->setWindowFlags(Qt::Tool);
// radarWidget->show();
// radarWidget->resize(512, 512);
// radarWidget->move(0, 0);
radarWidget->show();
}

void SWindow::onTimer() {
@@ -345,7 +349,6 @@ void SWindow::onTimer() {
}

m_satviewer->setTime(time);

}

void SWindow::onPlayClick() {
@@ -26,6 +26,13 @@ void RadarWidget::initializeGL() {
dir.cd("satviewer/icons");
sprite_current.load(dir.filePath("current.png"), this);
sprite_sun.load(dir.filePath("sun.png"), this);

connect(
m_satviewer,
SIGNAL(currentChanged(Satellite *, Location *, double *)),
this,
SLOT(onCurrentChanged(Satellite *, Location *, double *))
);
}

void RadarWidget::compileMapList() {
@@ -249,3 +256,9 @@ void RadarWidget::paintEvent(QPaintEvent *event) {

painter.end();
}

void RadarWidget::onCurrentChanged(Satellite *sat, Location *loc, double *time) {
Q_UNUSED(sat);
Q_UNUSED(time);
setWindowTitle(loc->name());
}
@@ -35,7 +35,8 @@ class RadarWidget : public GLSatAbstractWidget {
// float zoom(float value = 0.0) {}
// float moveX(float value = 0.0) {}
// float moveY(float value = 0.0) {}

private slots:
void onCurrentChanged(Satellite *sat, Location *loc, double *time);
};

#endif /* RADARWIDGET_H */

0 comments on commit b9f936b

Please sign in to comment.
You can’t perform that action at this time.