fgmapping 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
- v1.1.1 Bug fix: corrected altitude handlinh and HUD display
1
+ v1.1.2 Bug fix: path handling fixed while pressing button repeatedly
2
+
3
+ v1.1.1 Bug fix: corrected altitude handling and HUD display
2
4
 
3
5
  v1.1.0 included permanent storage of settings and selection between metric <-> imperial units
4
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{fgmapping}
5
- s.version = "1.1.1"
5
+ s.version = "1.1.2"
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"]
@@ -615,23 +615,27 @@ class MainDlg < Qt::Widget
615
615
  @linepen.setColor(Qt::Color.new(track.color))
616
616
  tck=nil
617
617
  prev_node=false
618
- track.nodes.each{|n|
619
- if !prev_node then
620
- tck=Qt::PainterPath.new(Qt::PointF.new((n.toxtile - mainnode_x) * 256, (n.toytile - mainnode_y) * 256))
621
- else
622
- tck.lineTo((n.toxtile - mainnode_x) * 256, (n.toytile - mainnode_y) * 256)
623
- end
624
- prev_node = true
625
- }
626
- track.path=TrackGraphicsPathItem.new(track)
627
- track.path.setPath(tck)
628
- track.path.setZValue(Z_VALUE_TRACK)
629
- track.path.setPen(@linepen)
630
- @scene.addItem(track.path)
618
+ if !track.nodes.empty? then
619
+ track.nodes.each{|n|
620
+ if !prev_node then
621
+ tck=Qt::PainterPath.new(Qt::PointF.new((n.toxtile - mainnode_x) * 256, (n.toytile - mainnode_y) * 256))
622
+ else
623
+ tck.lineTo((n.toxtile - mainnode_x) * 256, (n.toytile - mainnode_y) * 256)
624
+ end
625
+ prev_node = true
626
+ }
627
+ track.path=TrackGraphicsPathItem.new(track)
628
+ track.path.setPath(tck)
629
+ track.path.setZValue(Z_VALUE_TRACK)
630
+ track.path.setPen(@linepen)
631
+ @scene.addItem(track.path)
632
+ end
631
633
  end
632
634
  }
633
635
  if @w.pBrecordTrack.isChecked then
634
- @tckpath=@mytracks[@mytrack_current].path.path
636
+ if !@mytracks[@mytrack_current].path.nil?
637
+ @tckpath=@mytracks[@mytrack_current].path.path
638
+ end
635
639
  end
636
640
  end
637
641
 
@@ -730,10 +734,6 @@ class MainDlg < Qt::Widget
730
734
  @offset_x = @posnode.toxtile - mainnode_x
731
735
  @offset_y = @posnode.toytile - mainnode_y
732
736
  movemap(@node)
733
- # @w.gVmap.centerOn(@offset_x*256,@offset_y*256)
734
- # if !@hud.nil? then
735
- # @hud.setPos(@w.gVmap.mapToScene(0,0))
736
- # end
737
737
  end
738
738
  if @mytrack_current >= 0 and @w.pBrecordTrack.isChecked then
739
739
  if @mytracks[@mytrack_current].nil? then
@@ -774,6 +774,11 @@ class MainDlg < Qt::Widget
774
774
  if state
775
775
  @mytrack_current += 1
776
776
  @w.pBrecordTrack.text = "Recording Track #{@mytrack_current + 1}"
777
+ if @mytracks[@mytrack_current].nil? then
778
+ @mytracks[@mytrack_current] = Way.new(1, 'user', Time.now, nextcolor)
779
+ @linepen.setColor(Qt::Color.new(@mytracks[@mytrack_current].color))
780
+ @prev_track_node = false
781
+ end
777
782
  else
778
783
  @w.pBrecordTrack.text = "Record Track #{@mytrack_current + 2}"
779
784
  end
@@ -981,8 +986,8 @@ class TrackGraphicsPathItem < Qt::GraphicsPathItem
981
986
 
982
987
  if !hit.nil? and !@parent.nil? then
983
988
  n=@parent.nodes[hit]
984
- @nodeinfo_widget.w.lBlon.text="%.3f" % n.lon
985
- @nodeinfo_widget.w.lBlat.text="%.3f" % n.lat
989
+ @nodeinfo_widget.w.lBlon.text="%.3f°" % n.lon
990
+ @nodeinfo_widget.w.lBlat.text="%.3f°" % n.lat
986
991
  @nodeinfo_widget.w.lBalt.text="%.1fm" % n.elevation
987
992
  @nodeinfo_widget.w.lBspeed.text="%.1fkm/h" % n.speed
988
993
  pos = mapToScene(hoverEvent.pos)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
8
+ - 2
9
+ version: 1.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Meltner