Skip to content

Commit

Permalink
use fw length. radius from cli file
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Jun 9, 2024
1 parent ed14c1e commit a5747bf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('flightlog2kml', version : '1.0.21')
project('flightlog2kml', version : '1.0.22')
meson.add_install_script('meson/post_install.py')
version = get_option('version')
commit = get_option('commit')
Expand Down
6 changes: 4 additions & 2 deletions pkg/cli/fwapproach.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ func add_approach(dref string, dirn int, lpath []kml.Coordinate) []kml.Coordinat
}

fwax := Fwapproach_length / 2.0
if 4.0*Fwloiter_radius > fwax {
fwax = 4.0 * Fwloiter_radius
fwlr := Fwloiter_radius * 4.0

if fwax < fwlr {
fwax = fwlr
}

lax, lox := geo.Posit(lpath[iap].Lat, lpath[iap].Lon, float64(xdir), fwax)
Expand Down
8 changes: 6 additions & 2 deletions pkg/kmlgen/kmlbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,18 @@ func GenerateCliOnly(outfn string, gv func() string) {
}

func GenerateMissionOnly(outfn string, gv func() string) {
var sfx []kml.Element

fb := geo.Getfrobnication()
if len(options.Config.Cli) > 0 {
sfx = Generate_cli_kml(options.Config.Cli, fb)
}
kname := filepath.Base(options.Config.Mission)
desc := fmt.Sprintf("Generator: %s", gv())
d := kml.Folder(kml.Name(kname)).Add(kml.Description(desc)).Add(kml.Open(true))
_, mm, err := mission.Read_Mission_File(options.Config.Mission)
if err == nil {
isviz := true
fb := geo.Getfrobnication()
for nm, _ := range mm.Segment {
nmx := nm + 1
if options.Config.MissionIndex == 0 || nmx == options.Config.MissionIndex {
Expand Down Expand Up @@ -541,7 +546,6 @@ func GenerateMissionOnly(outfn string, gv func() string) {
}
}
if len(options.Config.Cli) > 0 {
sfx := Generate_cli_kml(options.Config.Cli, fb)
for _, s := range sfx {
d.Add(s)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/mission/to_kml.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ func (m *Mission) To_kml(hpos types.HomeRec, dms bool, fake bool, mmidx int, isv
kelem := kml.Folder(kml.Name(fldnam)).Add(kml.Description(desc)).
Add(kml.Visibility(isvis)).Add(styles.Get_mission_styles()...).Add(track).Add(wps...)

if landid != -1 && m.FWApproach.No == int8(mmidx+7) && m.FWApproach.Dirn1 != 0 && m.FWApproach.Dirn2 != 0 {
if landid != -1 && m.FWApproach.No == int8(mmidx+7) &&
(m.FWApproach.Dirn1 != 0 || m.FWApproach.Dirn2 != 0) {
f := kml.Folder(kml.Name("Approaches")).Add(kml.Open(true))
f.Add(styles.Get_approach_styles()...)
for _, ll := range cli.AddLaylines(m.MissionItems[landid].Lat, m.MissionItems[landid].Lon, addAlt, m.FWApproach, isvis) {
Expand Down

0 comments on commit a5747bf

Please sign in to comment.