#include "themisdatadownloader.h" #include "ui_themisdatadownloader.h" #include #include #include #include ThemisDataDownloader::ThemisDataDownloader(QWidget *parent) : QWidget(parent), ui(new Ui::ThemisDataDownloader) { ui->setupUi(this); m_xmlLoader = new ExpXmlDownLoader(); connect(this->ui->calendar,SIGNAL(activated(QDate)),this,SLOT(downloadData(QDate))); connect(this->ui->LoadXmlFileQpb,SIGNAL(clicked()),this,SLOT(loadXmlFile())); } ThemisDataDownloader::~ThemisDataDownloader() { delete ui; delete m_xmlLoader; } void ThemisDataDownloader::changeEvent(QEvent *e) { QWidget::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); break; default: break; } } void ThemisDataDownloader::downloadData(const QDate &date) { QDate tmpDate; QStringList months=QStringList()<< "JAN" << "FEB" << "MAR" << "APR" << "MAY" << "JUN" << "JUI" << "AUG" << "SEP" << "OCT" << "NOV" << "DEC"; tmpDate.setDate(date.year(),date.month(),1); int firstDayOfMonth=tmpDate.dayOfYear(); tmpDate.setDate(tmpDate.year(),tmpDate.month(),tmpDate.daysInMonth()); int lastDayOfMonth=tmpDate.dayOfYear(); QString link="http://ppi.pds.nasa.gov/ditdos/download?id=pds://PPI/CO-E_SW_J_S-MAG-3-RDR-FULL-RES-V1.0/DATA/" \ + QString("%1").arg(date.year()) +"/" + QString("%1_%2_").arg(firstDayOfMonth,3).arg(lastDayOfMonth,3).replace(' ','0') \ + months.at(date.month()-1) + "/" ; qDebug()<parseXml(file)) { QList daysToDl = m_xmlLoader->daysToDownload(); for(int i=0;i