Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
Don't revert flip when chaning sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Xerbo committed Feb 27, 2022
1 parent f3b50bf commit a9c7318
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ void MainWindow::startDecode(std::string filename) {
}

if (compositors.count(satellite.default_imager)) {
sensor = satellite.default_imager;
default_sensor = sensor = satellite.default_imager;
} else {
sensor = (*data.imagers.begin()).first;
default_sensor = sensor = (*data.imagers.begin()).first;
}
sensor_actions.at(sensor_info.at(sensor).name)->setChecked(true);

Expand Down Expand Up @@ -382,6 +382,10 @@ void MainWindow::startDecode(std::string filename) {
pass_timestamp = timestamps[sensor][timestamps[sensor].size()/2];
}

if (have_tles && timestamps.count(default_sensor)) {
ui->actionFlip->setChecked(proj->is_northbound(timestamps.at(default_sensor)));
}

delete decoder;
decoder = nullptr;
}
Expand All @@ -393,7 +397,7 @@ void MainWindow::decodeFinished() {
return;
}

if (compositors.at(sensor)->height() == 0) {
if (compositors.at(default_sensor)->height() == 0) {
status->setText("Decode failed");
setState(WindowState::Idle);
return;
Expand All @@ -410,9 +414,6 @@ void MainWindow::decodeFinished() {
ui->gradientView->repaint();
status->setText(QString("%1 - %2: %3 lines").arg(QString::fromStdString(satellite_info.at(sat).name)).arg(QString::fromStdString(sensor_info.at(sensor).name)).arg(compositors.at(sensor)->height()));
setState(WindowState::Finished);
if (have_tles && timestamps.count(sensor)) {
ui->actionFlip->setChecked(proj->is_northbound(timestamps.at(sensor)));
}
on_actionFlip_triggered();
ui->actionEnable_Overlay->setChecked(false);
ui->actionIR_Blend->setChecked(false);
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class MainWindow : public QMainWindow {

// Sensor selection
Imager sensor;
Imager default_sensor;
QActionGroup *sensor_select;
std::map<std::string, QAction *> sensor_actions;

Expand Down

0 comments on commit a9c7318

Please sign in to comment.