Skip to content

Commit

Permalink
Minor update on the globe texture display. Only a part of Meteosat-10,
Browse files Browse the repository at this point in the history
-8, GOES-16 and Himawari-8 images are displayed on the globe texture.
  • Loading branch information
hvanruys committed Nov 3, 2017
1 parent d9fa5c6 commit ade2129
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 20 deletions.
34 changes: 26 additions & 8 deletions core/dialogpreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,33 @@ void DialogPreferences::dialogaccept()
qDebug() << "in accept";
opts.backgroundimage2D = ui->edtBackImage2D->text();

if( opts.backgroundimage3D != ui->edtBackImage3D->text())
if(ui->chkGray->isChecked() == false)
{
opts.texture_changed = true;
opts.backgroundimage3D = ui->edtBackImage3D->text();
QImage qim(opts.backgroundimage3D);
delete imageptrs->pmOriginal;
delete imageptrs->pmOut;
imageptrs->pmOriginal = new QPixmap(QPixmap::fromImage(qim));
imageptrs->pmOut = new QPixmap(QPixmap::fromImage(qim));
if( opts.backgroundimage3D != ui->edtBackImage3D->text() || opts.graytextureOn != ui->chkGray->isChecked() )
{
opts.texture_changed = true;
opts.backgroundimage3D = ui->edtBackImage3D->text();
QImage qim(opts.backgroundimage3D);
delete imageptrs->pmOriginal;
delete imageptrs->pmOut;
imageptrs->pmOriginal = new QPixmap(QPixmap::fromImage(qim));
imageptrs->pmOut = new QPixmap(QPixmap::fromImage(qim));
}
}
else
{
if(opts.graytextureOn != ui->chkGray->isChecked())
{
opts.texture_changed = true;
QImage qim(opts.backgroundimage3D);
delete imageptrs->pmOriginal;
delete imageptrs->pmOut;
imageptrs->pmOriginal = new QPixmap(qim.width(), qim.height());
imageptrs->pmOut = new QPixmap(qim.width(), qim.height());
imageptrs->pmOriginal->fill(Qt::gray);
imageptrs->pmOut->fill(Qt::gray);

}
}

opts.gshhsglobe1 = ui->edtGshhsGlobe1->text();
Expand Down
5 changes: 5 additions & 0 deletions core/formtoolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3821,6 +3821,11 @@ bool FormToolbox::comboColGeoOK()
cnt += ui->comboGeo9->currentIndex();
cnt += ui->comboGeo10->currentIndex();
cnt += ui->comboGeo11->currentIndex();
cnt += ui->comboGeo12->currentIndex();
cnt += ui->comboGeo13->currentIndex();
cnt += ui->comboGeo14->currentIndex();
cnt += ui->comboGeo15->currentIndex();
cnt += ui->comboGeo16->currentIndex();

if(cnt == 6)
return true;
Expand Down
40 changes: 33 additions & 7 deletions core/globe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,19 @@ Globe::Globe(QWidget *parent, SatelliteList *satlist, AVHRRSatellite *seglist ):

QImage qim(opts.backgroundimage3D);

imageptrs->pmOriginal = new QPixmap(QPixmap::fromImage(qim));
imageptrs->pmOut = new QPixmap(QPixmap::fromImage(qim));
if(opts.graytextureOn)
{
imageptrs->pmOriginal = new QPixmap(qim.width(), qim.height());
imageptrs->pmOut = new QPixmap(qim.width(), qim.height());
imageptrs->pmOriginal->fill(Qt::gray);
imageptrs->pmOut->fill(Qt::gray);
}
else
{
imageptrs->pmOriginal = new QPixmap(QPixmap::fromImage(qim));
imageptrs->pmOut = new QPixmap(QPixmap::fromImage(qim));
}

connect(&watcher, SIGNAL(finished()), this, SLOT(slotRender3DGeoFinished()));

}
Expand Down Expand Up @@ -1423,11 +1434,14 @@ void Globe::Render3DGeoSegment(int geoindex)

g_mutex.lock();

for (int i = 0; i < imageptrs->ptrimageGeostationary->height(); i++)

for (int i = 0; i < imageptrs->ptrimageGeostationary->height(); i=i+1)
Render3DGeoSegmentLine( i, geoindex);

g_mutex.unlock();

qDebug() << "Globe::Render3DGeoSegment(SegmentListMeteosat::eGeoSatellite sat)";

QApplication::restoreOverrideCursor();
opts.texture_changed = true;
emit renderingglobefinished(true);
Expand Down Expand Up @@ -1457,11 +1471,23 @@ void Globe::Render3DGeoSegmentLine(int heightinimage, int geoindex)

if(pixconv.pixcoord2geocoord(segs->seglgeo[geoindex]->geosatlon, pix, heightinimage, segs->seglgeo[geoindex]->COFF, segs->seglgeo[geoindex]->LOFF, segs->seglgeo[geoindex]->CFAC, segs->seglgeo[geoindex]->LFAC, &lat_deg, &lon_deg) == 0)
{
sphericalToPixel(lon_deg*PI/180.0, lat_deg*PI/180.0, x, y, imageptrs->pmOriginal->width(), imageptrs->pmOriginal->height());
fb_painter.setPen(rgbval);
fb_painter.drawPoint(x, y);
// if(segs->seglgeo[geoindex]->getGeoSatellite() == eGeoSatellite::MET_8 || segs->seglgeo[geoindex]->getGeoSatellite() == eGeoSatellite::H8 || segs->seglgeo[geoindex]->getGeoSatellite() == eGeoSatellite::GOES_16)
if(opts.geosatellites[geoindex].longitudelimit1 != 0.0 && opts.geosatellites[geoindex].longitudelimit2 != 0.0)
{
if(lon_deg > opts.geosatellites[geoindex].longitudelimit1 && lon_deg < opts.geosatellites[geoindex].longitudelimit2)
{
sphericalToPixel(lon_deg*PI/180.0, lat_deg*PI/180.0, x, y, imageptrs->pmOriginal->width(), imageptrs->pmOriginal->height());
fb_painter.setPen(rgbval);
fb_painter.drawPoint(x, y);
}
}
else
{
sphericalToPixel(lon_deg*PI/180.0, lat_deg*PI/180.0, x, y, imageptrs->pmOriginal->width(), imageptrs->pmOriginal->height());
fb_painter.setPen(rgbval);
fb_painter.drawPoint(x, y);
}
}

}

fb_painter.end();
Expand Down
10 changes: 5 additions & 5 deletions core/mapcyl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ void MapFieldCyl::paintEvent( QPaintEvent * )
}
}

if (opts.buttonMetop == false && opts.buttonNoaa == false && opts.buttonGAC == false &&
opts.buttonHRP == false && opts.buttonVIIRSM == false && opts.buttonVIIRSDNB == false &&
opts.buttonOLCIefr == false && opts.buttonOLCIerr == false && opts.buttonSLSTR == false &&
opts.buttonMetopAhrpt == false && opts.buttonMetopBhrpt == false && opts.buttonNoaa19hrpt == false && opts.buttonM01hrpt == false &&
opts.buttonM02hrpt == false)
// if (opts.buttonMetop == false && opts.buttonNoaa == false && opts.buttonGAC == false &&
// opts.buttonHRP == false && opts.buttonVIIRSM == false && opts.buttonVIIRSDNB == false &&
// opts.buttonOLCIefr == false && opts.buttonOLCIerr == false && opts.buttonSLSTR == false &&
// opts.buttonMetopAhrpt == false && opts.buttonMetopBhrpt == false && opts.buttonNoaa19hrpt == false && opts.buttonM01hrpt == false &&
// opts.buttonM02hrpt == false)
showSunPosition(&painter);

if (down)
Expand Down
20 changes: 20 additions & 0 deletions core/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[0].fullname = "Meteosat-10";
geosatellites[0].shortname = "MET_10";
geosatellites[0].longitude = 0.0;
geosatellites[0].longitudelimit1 = -45.0;
geosatellites[0].longitudelimit2 = 20.0;
geosatellites[0].protocol = "XRIT";
geosatellites[0].rss = false;
geosatellites[0].searchstring = "H-000-MSG3__-MSG3________";
Expand Down Expand Up @@ -683,6 +685,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[1].fullname = "Meteosat-9";
geosatellites[1].shortname = "MET_9";
geosatellites[1].longitude = 9.5;
geosatellites[1].longitudelimit1 = 0.0;
geosatellites[1].longitudelimit2 = 0.0;
geosatellites[1].protocol = "XRIT";
geosatellites[1].rss = true;
geosatellites[1].searchstring = "H-000-MSG2__-MSG2_RSS____";
Expand Down Expand Up @@ -724,6 +728,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[2].fullname = "Meteosat-8";
geosatellites[2].shortname = "MET_8";
geosatellites[2].longitude = 41.5;
geosatellites[2].longitudelimit1 = 20.0;
geosatellites[2].longitudelimit2 = 92.0;
geosatellites[2].protocol = "XRIT";
geosatellites[2].rss = false;
geosatellites[2].searchstring = "H-000-MSG1__-MSG1_IODC___";
Expand Down Expand Up @@ -780,6 +786,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[3].fullname = "Electro L2";
geosatellites[3].shortname = "GOMS2";
geosatellites[3].longitude = 76.1;
geosatellites[3].longitudelimit1 = 0.0;
geosatellites[3].longitudelimit2 = 0.0;
geosatellites[3].protocol = "XRIT";
geosatellites[3].rss = false;
geosatellites[3].searchstring = "H-000-GOMS2_-GOMS2_4_____";
Expand Down Expand Up @@ -833,6 +841,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[4].fullname = "FengYun 2E";
geosatellites[4].shortname = "FY2E";
geosatellites[4].longitude = 86.5;
geosatellites[4].longitudelimit1 = 0.0;
geosatellites[4].longitudelimit2 = 0.0;
geosatellites[4].protocol = "HDF";
geosatellites[4].rss = false;
geosatellites[4].searchstring = "FY2E_FDI";
Expand Down Expand Up @@ -885,6 +895,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[5].fullname = "FengYun 2G";
geosatellites[5].shortname = "FY2G";
geosatellites[5].longitude = 104.5;
geosatellites[5].longitudelimit1 = 0.0;
geosatellites[5].longitudelimit2 = 0.0;
geosatellites[5].protocol = "HDF";
geosatellites[5].rss = false;
geosatellites[5].searchstring = "FY2G_FDI";
Expand Down Expand Up @@ -935,6 +947,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[6].fullname = "GOES 13";
geosatellites[6].shortname = "GOES_13";
geosatellites[6].longitude = -74.9;
geosatellites[6].longitudelimit1 = 0.0;
geosatellites[6].longitudelimit2 = 0.0;
geosatellites[6].protocol = "XRIT";
geosatellites[6].rss = false;
geosatellites[6].searchstring = "L-000-MSG3__-GOES13______";
Expand Down Expand Up @@ -988,6 +1002,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[7].fullname = "GOES 15";
geosatellites[7].shortname = "GOES_15";
geosatellites[7].longitude = -135.2;
geosatellites[7].longitudelimit1 = 0.0;
geosatellites[7].longitudelimit2 = 0.0;
geosatellites[7].protocol = "XRIT";
geosatellites[7].rss = false;
geosatellites[7].searchstring = "L-000-MSG3__-GOES15______";
Expand Down Expand Up @@ -1039,6 +1055,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[8].fullname = "GOES 16";
geosatellites[8].shortname = "GOES_16";
geosatellites[8].longitude = -89.5;
geosatellites[8].longitudelimit1 = -154.4;
geosatellites[8].longitudelimit2 = -45.0;
geosatellites[8].protocol = "netCDF";
geosatellites[8].rss = false;
geosatellites[8].searchstring = "OR_ABI";
Expand Down Expand Up @@ -1094,6 +1112,8 @@ void Options::CreateGeoSatelliteIni()
geosatellites[9].fullname = "Himawari 8";
geosatellites[9].shortname = "H8";
geosatellites[9].longitude = 140.7;
geosatellites[9].longitudelimit1 = 92.0;
geosatellites[9].longitudelimit2 = 205.6;
geosatellites[9].protocol = "XRIT";
geosatellites[9].rss = false;
geosatellites[9].searchstring = "IMG_DK01";
Expand Down
2 changes: 2 additions & 0 deletions core/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ struct GeoSatellites
QString fullname;
QString shortname;
double longitude;
double longitudelimit1;
double longitudelimit2;
QString protocol;
bool rss;
QString searchstring;
Expand Down

0 comments on commit ade2129

Please sign in to comment.