Subversion Repositories Projects

Rev

Rev 395 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 395 Rev 481
Line 15... Line 15...
15
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
18
 ***************************************************************************/
19
#include "dlg_Map.h"
19
#include "dlg_Map.h"
-
 
20
#include "dlg_MapPos.h"
-
 
21
 
-
 
22
 
20
#include <QDomDocument>
23
#include <QDomDocument>
21
#include <QFile>
24
#include <QFile>
Line 22... Line 25...
22
 
25
 
23
dlg_Map::dlg_Map(QWidget *parent) : QDialog(parent)
26
dlg_Map::dlg_Map(QWidget *parent) : QDialog(parent)
Line 69... Line 72...
69
    o_Map->addLayer(o_Layer);
72
    o_Map->addLayer(o_Layer);
70
    o_Map->addLayer(o_Click);
73
    o_Map->addLayer(o_Click);
71
    o_Map->addLayer(o_Route);
74
    o_Map->addLayer(o_Route);
Line 72... Line 75...
72
 
75
 
73
    o_Map->setZoom(17);
76
    o_Map->setZoom(17);
-
 
77
//    o_Map->setView(QPointF(13.5,52.5));
Line 74... Line 78...
74
    o_Map->setView(QPointF(13.5,52.5));
78
    o_Map->setView(QPointF(o_Settings->Map.LastLongitude,o_Settings->Map.LastLatitude));
Line 75... Line 79...
75
 
79
 
Line 289... Line 293...
289
// Position zum Flug-Track hinzufügen
293
// Position zum Flug-Track hinzufügen
290
void dlg_Map::add_Position(double x, double y)
294
void dlg_Map::add_Position(double x, double y)
291
{
295
{
292
    sWayPoint WayPoint;
296
    sWayPoint WayPoint;
Line -... Line 297...
-
 
297
 
-
 
298
    o_Settings->Map.LastLongitude = x;
-
 
299
    o_Settings->Map.LastLatitude = y;
293
 
300
 
294
    WayPoint.Longitude = x;
301
    WayPoint.Longitude = x;
295
    WayPoint.Latitude = y;
302
    WayPoint.Latitude = y;
Line 296... Line 303...
296
//    WayPoint.Time = sb_Time->value();
303
//    WayPoint.Time = sb_Time->value();
Line 433... Line 440...
433
{
440
{
434
    QString Filename = QFileDialog::getOpenFileName(this, "Bild als Karte",  o_Settings->DIR.Logging, "Bilddatei(*.jpg *.png *.gif);;Alle Dateien (*)");
441
    QString Filename = QFileDialog::getOpenFileName(this, "Bild als Karte",  o_Settings->DIR.Logging, "Bilddatei(*.jpg *.png *.gif);;Alle Dateien (*)");
Line 435... Line 442...
435
 
442
 
436
    if (!Filename.isEmpty())
443
    if (!Filename.isEmpty())
437
    {
444
    {
Line 438... Line 445...
438
        QFile f_Points(Filename + ".pos");
445
        QFile *f_Points = new QFile(Filename + ".pos");
439
 
446
 
440
        if (f_Points.exists())
447
        if (f_Points->exists())
Line 441... Line 448...
441
        {
448
        {
Line 442... Line 449...
442
            f_Points.open(QIODevice::ReadOnly | QIODevice::Text);
449
            f_Points->open(QIODevice::ReadOnly | QIODevice::Text);
443
 
450
 
444
            QString s_Points;
451
            QString s_Points;
445
 
452
 
Line 446... Line 453...
446
            while (!f_Points.atEnd())
453
            while (!f_Points->atEnd())
Line 447... Line 454...
447
            {
454
            {
Line 448... Line 455...
448
                s_Points.append(f_Points.readLine());
455
                s_Points.append(f_Points->readLine());
Line 449... Line 456...
449
            }
456
            }
450
 
457
 
451
            f_Points.close();
458
            f_Points->close();
-
 
459
 
-
 
460
            QStringList s_Pos = s_Points.split(",");
-
 
461
 
-
 
462
            FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
-
 
463
 
-
 
464
            o_Layer->addGeometry(fip);
-
 
465
            o_Map->updateRequestNew();
-
 
466
        }
-
 
467
        else
-
 
468
        {
-
 
469
            dlg_MapPos *f_MapPos = new dlg_MapPos(this);
-
 
470
 
-
 
471
            if (f_MapPos->exec()==QDialog::Accepted)
-
 
472
            {
-
 
473
                QString Data = f_MapPos->get_Data();
-
 
474
 
-
 
475
                f_Points->open(QIODevice::ReadWrite | QIODevice::Text);
-
 
476
 
-
 
477
                QTextStream out(f_Points);
-
 
478
 
-
 
479
                out.setRealNumberPrecision(9);
-
 
480
 
-
 
481
                out << Data << "\n";
-
 
482
 
-
 
483
                f_Points->close();
-
 
484
 
-
 
485
                QStringList s_Pos = Data.split(",");
452
 
486
 
453
            QStringList s_Pos = s_Points.split(",");
487
                FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
Line 454... Line 488...
454
 
488
 
455
            FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
489
                o_Layer->addGeometry(fip);