fgmapping 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Manifest +1 -0
- data/Rakefile +1 -1
- data/fgmapping.gemspec +4 -4
- data/lib/hud-widget.rb +1 -1
- data/lib/main-dlg-impl.rb +191 -74
- data/lib/main-dlg.rb +48 -6
- data/lib/nodeinfo-widget.rb +1 -1
- data/lib/resources.marshal +0 -0
- data/lib/resources.rb +7 -5220
- metadata +6 -4
data/CHANGELOG
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
v1.3.0 added elevation layer, restructured threaded tile reading, added compressed resource file handling
|
2
|
+
|
1
3
|
v1.2.1 corrected alt display in popup of tracks - restructured reading of flightgear data to make is more responsive - added application icon
|
2
4
|
|
3
5
|
v1.2.0 Added setting of Radio Manager Waypoints in Flightgear
|
data/Manifest
CHANGED
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ Echoe.new('fgmapping', version) do |p|
|
|
17
17
|
p.url = "http://rubyforge.org/projects/fgmap"
|
18
18
|
p.author = "Michael Meltner"
|
19
19
|
p.email = "mmeltner @nospamplease@ gmail.com"
|
20
|
-
p.ignore_pattern = ["tmp/*", "script/*", "develop/*", "README.build_gem"]
|
20
|
+
p.ignore_pattern = ["tmp/*", "script/*", "develop/*", "README.build_gem", "*.gz"]
|
21
21
|
p.development_dependencies = []
|
22
22
|
end
|
23
23
|
|
data/fgmapping.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{fgmapping}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.3.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Michael Meltner"]
|
9
|
-
s.date = %q{2010-06-
|
9
|
+
s.date = %q{2010-06-23}
|
10
10
|
s.default_executable = %q{flightgear-mapping}
|
11
11
|
s.description = %q{Flightgear live mapping}
|
12
12
|
s.email = %q{mmeltner @nospamplease@ gmail.com}
|
13
13
|
s.executables = ["flightgear-mapping"]
|
14
|
-
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "bin/flightgear-mapping", "lib/LICENSE", "lib/README", "lib/bsearch.rb", "lib/hud-impl.rb", "lib/hud-widget.rb", "lib/init.rb", "lib/main-dlg-impl.rb", "lib/main-dlg.rb", "lib/navaid.rb", "lib/nodeinfo-impl.rb", "lib/nodeinfo-widget.rb", "lib/resources.rb", "lib/tile.rb", "lib/waypoint.rb"]
|
15
|
-
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "bin/flightgear-mapping", "fgmapping.gemspec", "lib/LICENSE", "lib/README", "lib/bsearch.rb", "lib/hud-impl.rb", "lib/hud-widget.rb", "lib/init.rb", "lib/main-dlg-impl.rb", "lib/main-dlg.rb", "lib/navaid.rb", "lib/nodeinfo-impl.rb", "lib/nodeinfo-widget.rb", "lib/resources.rb", "lib/tile.rb", "lib/waypoint.rb"]
|
14
|
+
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "bin/flightgear-mapping", "lib/LICENSE", "lib/README", "lib/bsearch.rb", "lib/hud-impl.rb", "lib/hud-widget.rb", "lib/init.rb", "lib/main-dlg-impl.rb", "lib/main-dlg.rb", "lib/navaid.rb", "lib/nodeinfo-impl.rb", "lib/nodeinfo-widget.rb", "lib/resources.marshal", "lib/resources.rb", "lib/tile.rb", "lib/waypoint.rb"]
|
15
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "bin/flightgear-mapping", "fgmapping.gemspec", "lib/LICENSE", "lib/README", "lib/bsearch.rb", "lib/hud-impl.rb", "lib/hud-widget.rb", "lib/init.rb", "lib/main-dlg-impl.rb", "lib/main-dlg.rb", "lib/navaid.rb", "lib/nodeinfo-impl.rb", "lib/nodeinfo-widget.rb", "lib/resources.marshal", "lib/resources.rb", "lib/tile.rb", "lib/waypoint.rb"]
|
16
16
|
s.homepage = %q{http://rubyforge.org/projects/fgmap}
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Fgmapping", "--main", "README.build_gem"]
|
18
18
|
s.require_paths = ["lib"]
|
data/lib/hud-widget.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'hud-widget.ui'
|
3
3
|
**
|
4
|
-
** Created:
|
4
|
+
** Created: Mi. Jun 23 14:44:44 2010
|
5
5
|
** by: Qt User Interface Compiler version 4.6.2
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
data/lib/main-dlg-impl.rb
CHANGED
@@ -39,17 +39,22 @@ ILSCONEANGLE = 10 # in degree
|
|
39
39
|
ILSTEXTOFFSET = 10 # in pixel
|
40
40
|
|
41
41
|
Z_VALUE_TILES = 0
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
42
|
+
Z_VALUE_TILES_ELEVATION = 1
|
43
|
+
Z_VALUE_TRACK = 2
|
44
|
+
Z_VALUE_TRACK_COLORED = 3
|
45
|
+
Z_VALUE_WAYPOINT = 4
|
46
|
+
Z_VALUE_NAV = 5
|
47
|
+
Z_VALUE_ORIGIN = 6
|
48
|
+
Z_VALUE_ROSE = 7
|
49
|
+
Z_VALUE_POINTERTOORIGIN = 8
|
50
|
+
Z_VALUE_POINTER = 9
|
50
51
|
Z_VALUE_HUD = 10
|
52
|
+
Z_VALUE_WARNING = 20
|
51
53
|
SCALE_SVG = 0.3
|
52
54
|
|
55
|
+
OPENSTREETMAP_TILE = 0
|
56
|
+
ELEVATION_TILE = 1
|
57
|
+
|
53
58
|
COLORRANGE_DEG = 120.0
|
54
59
|
COLOROFFSET_DEG = 240.0
|
55
60
|
|
@@ -58,6 +63,7 @@ FS_READ_INTERVAL = 100 # enter GUI refresh loop every 100ms
|
|
58
63
|
LOOPSLEEPINTERVAL = (0.95 * FS_READ_INTERVAL / 1000) # spend 95% of time sleeping to prevent
|
59
64
|
# threads from starving. Time is in seconds!
|
60
65
|
TICKSTOSKIP = 20
|
66
|
+
|
61
67
|
AUTOSAVE_INTERVAL = 10 * 60 * 1000 # autosave interval for tracks
|
62
68
|
HOVER_TIMER = 2000 # time until HUD widget disappears
|
63
69
|
MAXVORSTODISPLAY = 500 # maximum number of nav-aids to display on map
|
@@ -65,14 +71,12 @@ MAXILSTODISPLAY = 200
|
|
65
71
|
|
66
72
|
FS_PORT = 2948
|
67
73
|
|
68
|
-
|
69
|
-
#LATSTARTUP = 49.462126667
|
70
|
-
#LONSTARTUP = 11.121691667
|
71
74
|
LATSTARTUP = 50.0368400387281
|
72
75
|
LONSTARTUP = 8.55965957641601
|
73
76
|
|
74
77
|
MAPSDIR = ENV['HOME'] + "/.OpenstreetmapTiles"
|
75
78
|
|
79
|
+
#Thread.abort_on_exception = true
|
76
80
|
#GC.disable
|
77
81
|
|
78
82
|
# Class MainDlg ############################################
|
@@ -84,7 +88,7 @@ class MainDlg < Qt::Widget
|
|
84
88
|
|
85
89
|
slots "pBexit_clicked()", "pBdo_clicked()", "pBplus_clicked()", "pBminus_clicked()", \
|
86
90
|
"cBpointorigin_clicked()", "pBrecordTrack_toggled(bool)", "wakeupTimer()", "autosaveTimer()", \
|
87
|
-
'cBvor_clicked()', 'cBndb_clicked()', 'cBrw_clicked()'
|
91
|
+
'cBvor_clicked()', 'cBndb_clicked()', 'cBrw_clicked()', 'cBshadows_clicked()', 'hSopacity_changed(int)'
|
88
92
|
|
89
93
|
def initialize(parent, arg)
|
90
94
|
super(parent)
|
@@ -100,6 +104,7 @@ class MainDlg < Qt::Widget
|
|
100
104
|
@w.cBrw.setChecked(@cfg.value("rwChecked",Qt::Variant.new(false)).toBool)
|
101
105
|
@w.cBndb.setChecked(@cfg.value("nbdChecked",Qt::Variant.new(false)).toBool)
|
102
106
|
@w.cBvor.setChecked(@cfg.value("vorChecked",Qt::Variant.new(true)).toBool)
|
107
|
+
@opacity = @cfg.value("opacity",Qt::Variant.new(1.0)).toFloat
|
103
108
|
|
104
109
|
@flag=Qt::Pixmap.new(":/icons/flag-blue.png")
|
105
110
|
@pin=Qt::Pixmap.new(":/icons/wpttemp-red.png")
|
@@ -136,14 +141,21 @@ class MainDlg < Qt::Widget
|
|
136
141
|
@rot = 0
|
137
142
|
@remainingTiles = 0
|
138
143
|
@httpThreads = Array.new
|
144
|
+
@currentlyDownloading = Array.new
|
145
|
+
@currentlyDownloadingElevation = Array.new
|
146
|
+
@tilesToAdd = Array.new
|
139
147
|
|
140
148
|
@navs = Navaid.new(arg)
|
141
149
|
|
142
150
|
@httpMutex = Mutex.new
|
151
|
+
@httpElevationMutex = Mutex.new
|
143
152
|
@queryMutex = Mutex.new
|
144
|
-
|
153
|
+
@tilesToAddMutex = Mutex.new
|
154
|
+
|
145
155
|
@scene=Qt::GraphicsScene.new()
|
146
156
|
@w.gVmap.setScene(@scene)
|
157
|
+
resetScene()
|
158
|
+
|
147
159
|
@w.lBzoom.setText(@zoom.to_s)
|
148
160
|
vorGraphic=Qt::GraphicsSvgItem.new(":/icons/vor.svg")
|
149
161
|
vorGraphic.setElementId("VOR")
|
@@ -174,6 +186,19 @@ class MainDlg < Qt::Widget
|
|
174
186
|
readFlightgear()
|
175
187
|
end
|
176
188
|
|
189
|
+
def resetScene
|
190
|
+
@scene.clear
|
191
|
+
@openstreetmapLayer = TileGraphicsItemGroup.new
|
192
|
+
@openstreetmapLayer.setZValue(Z_VALUE_TILES)
|
193
|
+
@openstreetmapLayer.setOpacity(@opacity)
|
194
|
+
@scene.addItem(@openstreetmapLayer)
|
195
|
+
@elevationLayer = Qt::GraphicsItemGroup.new
|
196
|
+
@elevationLayer.setZValue(Z_VALUE_TILES_ELEVATION)
|
197
|
+
@scene.addItem(@elevationLayer)
|
198
|
+
|
199
|
+
@w.hSopacity.setValue((@opacity * 100).to_i)
|
200
|
+
end
|
201
|
+
|
177
202
|
def get_data(path)
|
178
203
|
# check from end to get most recent position
|
179
204
|
r=@fs_ans.reverse.detect do |f|
|
@@ -357,6 +382,8 @@ class MainDlg < Qt::Widget
|
|
357
382
|
th.kill
|
358
383
|
end
|
359
384
|
@httpThreads = Array.new
|
385
|
+
@currentlyDownloading = Array.new
|
386
|
+
@currentlyDownloadingElevation = Array.new
|
360
387
|
@remainingTiles = 0
|
361
388
|
@scene.removeItem(@warningText)
|
362
389
|
|
@@ -376,6 +403,8 @@ class MainDlg < Qt::Widget
|
|
376
403
|
end
|
377
404
|
@remainingTiles = 0
|
378
405
|
@httpThreads = Array.new
|
406
|
+
@currentlyDownloading = Array.new
|
407
|
+
@currentlyDownloadingElevation = Array.new
|
379
408
|
@scene.removeItem(@warningText)
|
380
409
|
|
381
410
|
@zoom -= 1
|
@@ -388,16 +417,71 @@ class MainDlg < Qt::Widget
|
|
388
417
|
movemap(@node, true)
|
389
418
|
end
|
390
419
|
|
391
|
-
def addTileToScene(f, origin_x, origin_y)
|
392
|
-
pmi=TileGraphicsPixmapItem.new(Qt::Pixmap.new(f))
|
420
|
+
def addTileToScene(f, origin_x, origin_y, thread=false)
|
393
421
|
@scene_tiles << f
|
394
422
|
f =~ /\/(\d*)\/(\d*)\/(\d*)/
|
395
423
|
x = $2.to_i
|
396
424
|
y = $3.to_i
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
425
|
+
|
426
|
+
if thread then
|
427
|
+
# we can not add the tiles to the scene within this thread directly. It crosses thread
|
428
|
+
# bounderies which crashes QT badly
|
429
|
+
@tilesToAddMutex.synchronize {
|
430
|
+
@tilesToAdd << [f, (x - origin_x)*256, (y - origin_y)*256, OPENSTREETMAP_TILE]
|
431
|
+
}
|
432
|
+
else # add immediately, we are not in a different thread
|
433
|
+
pmi=Qt::GraphicsPixmapItem.new(Qt::Pixmap.new(f), @openstreetmapLayer)
|
434
|
+
pmi.setOffset((x - origin_x)*256, (y - origin_y)*256)
|
435
|
+
end
|
436
|
+
|
437
|
+
if @w.cBshadows.isChecked then
|
438
|
+
if FileTest.exist?(f + "-elevation.png") then
|
439
|
+
if thread then
|
440
|
+
# we can not add the tiles to the scene within this thread directly. It crosses thread
|
441
|
+
# bounderies which crashes QT badly
|
442
|
+
@tilesToAddMutex.synchronize {
|
443
|
+
@tilesToAdd << [f, (x - origin_x)*256, (y - origin_y)*256, ELEVATION_TILE]
|
444
|
+
}
|
445
|
+
else
|
446
|
+
pmi = Qt::GraphicsPixmapItem.new(Qt::Pixmap.new(f + "-elevation.png"), @elevationLayer)
|
447
|
+
pmi.setOffset((x - origin_x)*256, (y - origin_y)*256)
|
448
|
+
pmi.setZValue(Z_VALUE_TILES_ELEVATION)
|
449
|
+
end
|
450
|
+
else
|
451
|
+
@httpThreads << Thread.new(f) {|filename|
|
452
|
+
if !@currentlyDownloadingElevation.include?(filename) then
|
453
|
+
@currentlyDownloadingElevation << filename
|
454
|
+
# try to download elevation profile
|
455
|
+
@httpElevationMutex.synchronize {
|
456
|
+
h = Net::HTTP.new('toolserver.org')
|
457
|
+
h.open_timeout = 10
|
458
|
+
filename =~ /\/\d+\/\d+\/\d+$/
|
459
|
+
fn = $&
|
460
|
+
begin
|
461
|
+
resp, data = h.get("/~cmarqu/hill" + fn + ".png", nil)
|
462
|
+
if resp.kind_of?(Net::HTTPOK) then
|
463
|
+
# check here again as in the meantime another thread might already have added the tile
|
464
|
+
if !FileTest.exist?($MAPSHOME + fn + "-elevation.png") then
|
465
|
+
File.open($MAPSHOME + fn + "-elevation.png", "w") do |file|
|
466
|
+
file.write(data)
|
467
|
+
end
|
468
|
+
@tilesToAddMutex.synchronize {
|
469
|
+
@tilesToAdd << [$MAPSHOME + fn + "-elevation.png", (x - origin_x)*256, (y - origin_y)*256, ELEVATION_TILE]
|
470
|
+
}
|
471
|
+
end
|
472
|
+
else
|
473
|
+
puts "No elevation profile found for this tile."
|
474
|
+
end
|
475
|
+
# NoMethodError because of bug, see http://redmine.ruby-lang.org/issues/show/2708
|
476
|
+
rescue NoMethodError, Errno::ECONNREFUSED, SocketError, Timeout::Error
|
477
|
+
puts "No connection to elevation profile server."
|
478
|
+
end
|
479
|
+
} # sync
|
480
|
+
@currentlyDownloadingElevation.delete(filename)
|
481
|
+
end # if downloading
|
482
|
+
} # Thread
|
483
|
+
end
|
484
|
+
end
|
401
485
|
end
|
402
486
|
|
403
487
|
def addNavToScene(vor, origin_x, origin_y)
|
@@ -463,8 +547,8 @@ class MainDlg < Qt::Widget
|
|
463
547
|
@scene_tiles = []
|
464
548
|
@scene_navs = []
|
465
549
|
@scene_rws = []
|
466
|
-
|
467
|
-
# 8
|
550
|
+
resetScene()
|
551
|
+
# 8 => 256 = 2**8
|
468
552
|
size = 2**(@zoom + 8)
|
469
553
|
sceneRect = Qt::RectF.new(0,0,size,size)
|
470
554
|
sceneRect.moveCenter(Qt::PointF.new(@node.xtile, @node.ytile))
|
@@ -487,7 +571,7 @@ class MainDlg < Qt::Widget
|
|
487
571
|
@scene_tiles = []
|
488
572
|
@scene_navs = []
|
489
573
|
@scene_rws = []
|
490
|
-
|
574
|
+
resetScene()
|
491
575
|
end
|
492
576
|
|
493
577
|
if @w.cBrw.isChecked then
|
@@ -505,63 +589,60 @@ class MainDlg < Qt::Widget
|
|
505
589
|
@scene_tiles = []
|
506
590
|
@scene_navs = []
|
507
591
|
@scene_rws = []
|
508
|
-
|
592
|
+
resetScene()
|
509
593
|
end
|
510
594
|
|
511
595
|
fn = node.getfilenames(@w.gVmap.size, @offset_x, @offset_y)
|
512
596
|
|
513
597
|
fn.each{|f|
|
514
|
-
if !@scene_tiles.include?(f)
|
598
|
+
if !@scene_tiles.include?(f) then
|
515
599
|
if FileTest.exist?(f+".png") then
|
516
600
|
addTileToScene(f, origin_x, origin_y)
|
517
601
|
elsif downloadTiles and (@timeNoInternet.nil? or (Time.now - @timeNoInternet) > 60) then
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
Dir.mkdir(dir)
|
542
|
-
rescue Errno::EEXIST
|
543
|
-
# just swallow error
|
602
|
+
@httpThreads << Thread.new(f) {|filename|
|
603
|
+
# check if we already download this tile
|
604
|
+
if !@currentlyDownloading.include?(filename) then
|
605
|
+
@currentlyDownloading << filename
|
606
|
+
@remainingTiles += 1
|
607
|
+
@httpMutex.synchronize {
|
608
|
+
h = Net::HTTP.new('tile.openstreetmap.org')
|
609
|
+
h.open_timeout = 10
|
610
|
+
filename =~ /\/\d+\/\d+\/\d+$/
|
611
|
+
fn = $&
|
612
|
+
begin
|
613
|
+
resp, data = h.get(fn + ".png", nil)
|
614
|
+
if resp.kind_of?(Net::HTTPOK) then
|
615
|
+
maindir = Dir.pwd
|
616
|
+
Dir.chdir($MAPSHOME)
|
617
|
+
fn.split("/")[0..-2].each do |dir|
|
618
|
+
if !dir.empty? then
|
619
|
+
begin
|
620
|
+
Dir.mkdir(dir)
|
621
|
+
rescue Errno::EEXIST
|
622
|
+
# just swallow error
|
623
|
+
end
|
624
|
+
Dir.chdir(dir)
|
544
625
|
end
|
545
|
-
Dir.chdir(dir)
|
546
626
|
end
|
627
|
+
Dir.chdir(maindir)
|
628
|
+
File.open($MAPSHOME + fn + ".png", "w") do |file|
|
629
|
+
file.write(data)
|
630
|
+
end
|
631
|
+
# we call from within a thread, signal this to the subroutine
|
632
|
+
addTileToScene($MAPSHOME + fn, origin_x, origin_y, true)
|
633
|
+
else
|
634
|
+
puts "Could not download tile. Internet connection alive?"
|
635
|
+
@timeNoInternet=Time.now
|
547
636
|
end
|
548
|
-
|
549
|
-
|
550
|
-
file.write(data)
|
551
|
-
end
|
552
|
-
addTileToScene($MAPSHOME + f, origin_x, origin_y)
|
553
|
-
else
|
637
|
+
# NoMethodError because of bug, see http://redmine.ruby-lang.org/issues/show/2708
|
638
|
+
rescue NoMethodError, Errno::ECONNREFUSED, SocketError, Timeout::Error
|
554
639
|
puts "Could not download tile. Internet connection alive?"
|
555
640
|
@timeNoInternet=Time.now
|
556
641
|
end
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
end
|
562
|
-
@scene.removeItem(@warningText)
|
563
|
-
}
|
564
|
-
@remainingTiles -= 1
|
642
|
+
}
|
643
|
+
@remainingTiles -= 1
|
644
|
+
@currentlyDownloading.delete(filename)
|
645
|
+
end # if
|
565
646
|
}
|
566
647
|
else
|
567
648
|
puts "Internet timeout still running"
|
@@ -717,9 +798,34 @@ class MainDlg < Qt::Widget
|
|
717
798
|
sleep LOOPSLEEPINTERVAL
|
718
799
|
return
|
719
800
|
end
|
720
|
-
|
721
801
|
@wakeupCounter = 0
|
722
802
|
|
803
|
+
# add tiles which are awaiting addition
|
804
|
+
@tilesToAddMutex.synchronize {
|
805
|
+
@tilesToAdd.each do |tile|
|
806
|
+
parent = (tile[3] == OPENSTREETMAP_TILE) ? @openstreetmapLayer : @elevationLayer
|
807
|
+
pmi = Qt::GraphicsPixmapItem.new(Qt::Pixmap.new(tile[0]), parent)
|
808
|
+
pmi.setOffset(tile[1], tile[2])
|
809
|
+
end
|
810
|
+
@tilesToAdd.clear
|
811
|
+
}
|
812
|
+
|
813
|
+
if @remainingTiles > 0 then
|
814
|
+
if @warningText.nil? then
|
815
|
+
@warningText = Qt::GraphicsSimpleTextItem.new()
|
816
|
+
@warningText.setBrush(Qt::Brush.new(Qt::Color.new("red")))
|
817
|
+
@warningText.setZValue(Z_VALUE_WARNING)
|
818
|
+
@scene.addItem(@warningText)
|
819
|
+
end
|
820
|
+
fontInfo = Qt::FontInfo.new(@warningText.font)
|
821
|
+
@warningText.setText("#{@remainingTiles} remaining tiles")
|
822
|
+
@warningText.setPos(@w.gVmap.mapToScene((@w.gVmap.size.width - @warningText.boundingRect.width)/2,
|
823
|
+
@w.gVmap.size.height - fontInfo.pixelSize - 10))
|
824
|
+
elsif !@warningText.nil? then
|
825
|
+
@scene.removeItem(@warningText)
|
826
|
+
@warningText = nil
|
827
|
+
end
|
828
|
+
|
723
829
|
if @fs_socket.nil? then
|
724
830
|
begin
|
725
831
|
@fs_socket = TCPSocket.open('localhost', FS_PORT)
|
@@ -811,6 +917,7 @@ class MainDlg < Qt::Widget
|
|
811
917
|
end # if @fs_ans.length>0
|
812
918
|
@fs_ans=[]
|
813
919
|
end # socket nil
|
920
|
+
# p "wakeupTimer out"
|
814
921
|
end
|
815
922
|
|
816
923
|
|
@@ -866,6 +973,7 @@ class MainDlg < Qt::Widget
|
|
866
973
|
@cfg.setValue("rwChecked", Qt::Variant.new(@w.cBrw.isChecked))
|
867
974
|
@cfg.setValue("nbdChecked", Qt::Variant.new(@w.cBndb.isChecked))
|
868
975
|
@cfg.setValue("vorChecked", Qt::Variant.new(@w.cBvor.isChecked))
|
976
|
+
@cfg.setValue("opacity", Qt::Variant.new(@opacity))
|
869
977
|
@cfg.sync
|
870
978
|
@parent.close
|
871
979
|
end
|
@@ -881,10 +989,14 @@ class MainDlg < Qt::Widget
|
|
881
989
|
def cBrw_clicked()
|
882
990
|
movemap(@node, true)
|
883
991
|
end
|
884
|
-
|
885
|
-
def
|
992
|
+
|
993
|
+
def cBshadows_clicked()
|
994
|
+
movemap(@node, true)
|
995
|
+
end
|
996
|
+
|
997
|
+
def resizeEvent(e)
|
886
998
|
super
|
887
|
-
|
999
|
+
movemap(@node, true)
|
888
1000
|
end
|
889
1001
|
|
890
1002
|
def keyPressEvent(keyevent)
|
@@ -899,9 +1011,15 @@ class MainDlg < Qt::Widget
|
|
899
1011
|
super
|
900
1012
|
end # case
|
901
1013
|
end
|
1014
|
+
|
1015
|
+
def hSopacity_changed(opacity)
|
1016
|
+
@opacity = opacity / 100.0
|
1017
|
+
@openstreetmapLayer.setOpacity(@opacity)
|
1018
|
+
end
|
902
1019
|
end
|
903
1020
|
|
904
1021
|
|
1022
|
+
|
905
1023
|
class FlagGraphicsPixmapItem < Qt::GraphicsPixmapItem
|
906
1024
|
def initialize(*k)
|
907
1025
|
super
|
@@ -944,8 +1062,8 @@ class TrackGraphicsPathItem < Qt::GraphicsPathItem
|
|
944
1062
|
setAcceptHoverEvents(true)
|
945
1063
|
setHandlesChildEvents(true)
|
946
1064
|
|
947
|
-
# store these elements in permanent
|
948
|
-
# otherwise GC will remove them and then causes core-
|
1065
|
+
# store these elements in permanent array
|
1066
|
+
# otherwise GC will remove them and then causes core-dumps in QT
|
949
1067
|
@@nodeinfo_array << [@nodeinfow, @nodeinfo_widget]
|
950
1068
|
end
|
951
1069
|
|
@@ -1082,7 +1200,7 @@ class TrackGraphicsPathItem < Qt::GraphicsPathItem
|
|
1082
1200
|
end
|
1083
1201
|
|
1084
1202
|
|
1085
|
-
class
|
1203
|
+
class TileGraphicsItemGroup < Qt::GraphicsItemGroup
|
1086
1204
|
def mousePressEvent(mouseEvent)
|
1087
1205
|
pos = mouseEvent.scenePos
|
1088
1206
|
dlg=mouseEvent.widget.parent.parent
|
@@ -1091,7 +1209,7 @@ class TileGraphicsPixmapItem < Qt::GraphicsPixmapItem
|
|
1091
1209
|
dlg.offset_x = pos.x / 256.0
|
1092
1210
|
dlg.offset_y = pos.y / 256.0
|
1093
1211
|
dlg.movemap(dlg.node)
|
1094
|
-
when Qt::RightButton
|
1212
|
+
# when Qt::RightButton
|
1095
1213
|
|
1096
1214
|
end # case
|
1097
1215
|
end
|
@@ -1222,6 +1340,5 @@ class Qt::GraphicsSvgItem
|
|
1222
1340
|
}
|
1223
1341
|
end
|
1224
1342
|
end
|
1225
|
-
|
1226
1343
|
end
|
1227
1344
|
|