Skip to content

Commit

Permalink
Cleanup buttons geostaionary panel
Browse files Browse the repository at this point in the history
  • Loading branch information
hvanruys committed Jan 17, 2018
1 parent 129e61f commit 81ab35e
Show file tree
Hide file tree
Showing 24 changed files with 868 additions and 785 deletions.
2 changes: 1 addition & 1 deletion core/avhrrsatellite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ void AVHRRSatellite::ReadXMLfiles()
QFile xmlfile(QCoreApplication::applicationDirPath() + "/Segments.xml");
if(!xmlfile.open(QIODevice::ReadOnly | QIODevice::Text))
{
qDebug() << "Failed to open file";
qDebug() << "Failed to open /Segments.xml";
return;
}
else
Expand Down
49 changes: 40 additions & 9 deletions core/formephem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ void FormEphem::NewSegmentOverviewItem()
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsNoaa(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsHRP(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsGAC(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsMetopAhrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsMetopBhrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsNoaa19hrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsM01hrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsM02hrpt(), 0 );


newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsVIIRSM(), 0 );
Expand All @@ -270,14 +265,21 @@ void FormEphem::NewSegmentOverviewItem()
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsOLCIerr(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsSLSTR(), 0 );

newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsDatahubOLCIefr(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsDatahubOLCIerr(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsDatahubSLSTR(), 0 );

for(int i = 0; i < opts.geosatellites.count(); i++)
{
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsGeo(i), 0 );
}

newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsDatahubOLCIefr(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsDatahubOLCIerr(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsDatahubSLSTR(), 0 );

newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsMetopAhrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsMetopBhrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsNoaa19hrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsM01hrpt(), 0 );
newitem = new QTreeWidgetItem( ui->segmentoverview, segs->GetOverviewSegmentsM02hrpt(), 0 );

}

void FormEphem::showSegmentsAdded()
Expand Down Expand Up @@ -408,6 +410,32 @@ void FormEphem::itemSelectedsegmentdirectory( QTreeWidgetItem *item)
opts.Save();
}

void FormEphem::on_chkSelectAllDir_toggled(bool checked)
{
qDebug() << "FormEphem::on_chkSelectAllDir_toggled checked = " << checked;

QTreeWidgetItemIterator it1( ui->segmentdirectorywidget );

opts.segmentdirectorylistinc.clear();

while (*it1)
{
if ( checked )
{
opts.segmentdirectorylistinc << "1";
(*it1)->setCheckState(0, Qt::Checked);
}
else
{
opts.segmentdirectorylistinc << "0";
(*it1)->setCheckState(0, Qt::Unchecked);
}
++it1;
}

opts.Save();
}

void FormEphem::showActiveSatellites(void)
{

Expand Down Expand Up @@ -964,3 +992,6 @@ void FormEphem::on_btnDownloadFromDatahub_clicked()
segs->setXMLDate(ui->calendar->selectedDate());
segs->LoadXMLfromDatahub();
}



2 changes: 2 additions & 0 deletions core/formephem.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ private slots:

void on_btnDownloadFromDatahub_clicked();

void on_chkSelectAllDir_toggled(bool checked);

public slots:
void showSegmentsAdded();

Expand Down
39 changes: 31 additions & 8 deletions core/formephem.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>1235</width>
<height>760</height>
<width>1147</width>
<height>688</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QSplitter" name="splitter">
<property name="frameShadow">
Expand Down Expand Up @@ -184,6 +184,12 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTreeWidget" name="satlisttreewidget">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>300</height>
</size>
</property>
<column>
<property name="text">
<string notr="true">1</string>
Expand Down Expand Up @@ -253,11 +259,28 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>List of segment directories</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QCheckBox" name="chkSelectAllDir">
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>List of segment directories</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="segmentdirectorywidget">
Expand Down
22 changes: 0 additions & 22 deletions core/formgeostationary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,28 +1143,6 @@ void FormGeostationary::CreateGeoImageHDF(SegmentListGeostationary *sl, QString
filepattern = QString("Z_SATE_C_BABJ_") + filetiming + QString("_O_FY2G_FDI_VIS1KM") + QString("_001_NOM.HDF.gz");


// if(type == "VIS_IR" || type == "VIS_IR Color" || type == "HRV Color")
// {
// for (int j = 0; j < llVIS_IR.size(); ++j)
// {
// QFile file(sl->getImagePath() + "/" + llVIS_IR.at(j));
// QFileInfo fileinfo(file);
// //IMG_DK01B04_201510090000_001.bz2
// //0123456789012345678901234567890
// filesequence = fileinfo.fileName().mid(opts.geosatellites.at(geoindex).indexfilenbr, opts.geosatellites.at(geoindex).lengthfilenbr).toInt()-1;
// filespectrum = fileinfo.fileName().mid(opts.geosatellites.at(geoindex).indexspectrum, opts.geosatellites.at(geoindex).spectrumlist.at(0).length());
// filedate = fileinfo.fileName().mid(opts.geosatellites.at(geoindex).indexdate, opts.geosatellites.at(geoindex).lengthdate);
// filedate.resize(12, '0');

// sl->InsertPresent( spectrumvector, filespectrum, filesequence);

// sl->ComposeImageXRIT(fileinfo.filePath(), spectrumvector, inversevector);

// qDebug() << QString("CreateGeoImageXRIT VIS_IR || VIS_IR Color || HRV Color ----> %1 filesequence = %2").arg(fileinfo.filePath()).arg(filesequence);
// }
// }


if(type == "VIS_IR" || type == "VIS_IR Color")
{
llVIS_IR = this->getGeostationarySegments(geoindex, "VIS_IR", sl->getImagePath(), spectrumvector, filepattern);
Expand Down
12 changes: 6 additions & 6 deletions core/formimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ void FormImage::displayAVHRRImageInfo()
"</body></html>").arg(segtype).arg(nbrselected).arg(imageptrs->ptrimagecomp_col->width()).arg(imageptrs->ptrimagecomp_col->height());


formtoolbox->writeInfoToAVHRR(txtInfo);
formtoolbox->writeInfoToTextEdit(txtInfo);

}

Expand Down Expand Up @@ -1224,7 +1224,7 @@ void FormImage::displayVIIRSImageInfo(eSegmentType type)
"Nbr of segments = %2<br>"
"Image width = %3 height = %4<br>"
"</body></html>").arg(segtype).arg(nbrselected).arg(imageptrs->ptrimageViirsM->width()).arg(imageptrs->ptrimageViirsM->height());
formtoolbox->writeInfoToVIIRSM(txtInfo);
formtoolbox->writeInfoToTextEdit(txtInfo);

} else
if(type == SEG_VIIRSDNB)
Expand All @@ -1239,7 +1239,7 @@ void FormImage::displayVIIRSImageInfo(eSegmentType type)
"Moon illumination = %5 %</p>"
"</body></html>").arg(segtype).arg(nbrselected).arg(imageptrs->ptrimageViirsDNB->width())
.arg(imageptrs->ptrimageViirsDNB->height()).arg(moonillum, 4, 'f', 2);
formtoolbox->writeInfoToVIIRSDNB(txtInfo);
formtoolbox->writeInfoToTextEdit(txtInfo);

}

Expand Down Expand Up @@ -1292,7 +1292,7 @@ void FormImage::displayGeoImageInformation(QString satname)
"</body></html>").arg(satname).arg(imageptrs->ptrimageGeostationary->width()).arg(imageptrs->ptrimageGeostationary->height());


formtoolbox->writeInfoToGeo(txtInfo);
formtoolbox->writeInfoToTextEdit(txtInfo);
}

void FormImage::displaySentinelImageInfo(eSegmentType type)
Expand Down Expand Up @@ -1337,7 +1337,7 @@ void FormImage::displaySentinelImageInfo(eSegmentType type)
"Image width = %3 height = %4<br>"
"Nbr of saturated pixels = %5<br>"
"</body></html>").arg(segtype).arg(nbrselected).arg(imageptrs->ptrimageOLCI->width()).arg(imageptrs->ptrimageOLCI->height()).arg(nbrofsaturatedpixels);
formtoolbox->writeInfoToSentinel(txtInfo);
formtoolbox->writeInfoToTextEdit(txtInfo);
}
else if(type == SEG_SLSTR)
{
Expand All @@ -1349,7 +1349,7 @@ void FormImage::displaySentinelImageInfo(eSegmentType type)
"Nbr of segments = %2<br>"
"Image width = %3 height = %4<br>"
"</body></html>").arg(segtype).arg(nbrselected).arg(imageptrs->ptrimageSLSTR->width()).arg(imageptrs->ptrimageSLSTR->height());
formtoolbox->writeInfoToSentinel(txtInfo);
formtoolbox->writeInfoToTextEdit(txtInfo);
}

}
Expand Down
35 changes: 5 additions & 30 deletions core/formtoolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ FormToolbox::FormToolbox(QWidget *parent, FormImage *p_formimage, FormGeostation
ui->rbtnAColor->setChecked(true);
opts.channelontexture = 6; // color channel

ui->teAVHRR->setReadOnly(true);
ui->teAVHRR->append(formimage->txtInfo);
// ui->teAVHRR->setReadOnly(true);
// ui->teAVHRR->append(formimage->txtInfo);

ui->lblCLAHE->setText(QString("%1").arg(double(opts.clahecliplimit), 0, 'f', 1));
ui->sliCLAHE->setSliderPosition(opts.clahecliplimit * 10);
Expand Down Expand Up @@ -476,37 +476,12 @@ void FormToolbox::setSLSTRConfigsettings()
ui->comboSLSTRConfig->blockSignals(false);
}

void FormToolbox::writeInfoToAVHRR(QString info)
void FormToolbox::writeInfoToTextEdit(QString info)
{
ui->teAVHRR->clear();
ui->teAVHRR->append(info);
ui->te->clear();
ui->te->append(info);
}

void FormToolbox::writeInfoToVIIRSM(QString info)
{
ui->teVIIRSM->clear();
ui->teVIIRSM->append(info);
}

void FormToolbox::writeInfoToVIIRSDNB(QString info)
{
ui->teVIIRSDNB->clear();
ui->teVIIRSDNB->append(info);
}

void FormToolbox::writeInfoToGeo(QString info)
{
ui->teGeo->clear();
ui->teGeo->append(info);
}

void FormToolbox::writeInfoToSentinel(QString info)
{
ui->teSentinel->clear();
ui->teSentinel->append(info);
}


bool FormToolbox::eventFilter(QObject *target, QEvent *event)
{
if (target == ui->btnLCCMapNorth || target == ui->btnLCCMapSouth || target == ui->btnLCCMapEast || target == ui->btnLCCMapWest)
Expand Down
6 changes: 1 addition & 5 deletions core/formtoolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ class FormToolbox : public QWidget
void setTabWidgetIndex(int index);
void setTabWidgetVIIRSIndex(int index);
void setTabWidgetSentinelIndex(int index);
void writeInfoToAVHRR(QString info);
void writeInfoToVIIRSM(QString info);
void writeInfoToVIIRSDNB(QString info);
void writeInfoToGeo(QString info);
void writeInfoToSentinel(QString info);
void writeInfoToTextEdit(QString info);
void createFilenamestring(QString sat, QString d, QVector<QString> spectrum);
QString returnFilenamestring() { return filenamecreated; }
bool comboColVIIRSOK();
Expand Down
Loading

0 comments on commit 81ab35e

Please sign in to comment.