• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX BGL2XML feature request

Messages
1,268
Country
us-hawaii
Currently BGL2XML does not decode timezone records. It would be nice (for me anyway) to have this capability. I have done some preliminary work.

The section type is 0x002F
Each record is a timezone lat/long box and is 24 bytes

What I found is

0x00 DWord Long Min
0x04 DWord Lat Max
0x08 DWord Long Max
0x0C DWord Lat Min
0x10 SInt16 timedeviation minutes
0x12 byte priority
0x13 Sint8 daylightSavingsTimeShift
0x14 byte SavingsStartDayOfYearBase (ls 8 bits)
0x15 byte SavingsEndDayOfYearBase (ls 4 bits) SavingsStartDayOfWeek (3 bits) SavingsStartDayOfYearBase (ms 1 bit)
0x16 byte daylightSavingsEndDayOfWeek (3 bits) SavingsEndDayOfYearBase (ms 5 bits)
0x17 byte unk (00?)

scott s.
.
 
Hi Scott

I will certainly look at it. What is the best test file to work with?
 
Probably the default timezone.bgl. I have done some simple files like this:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Created by Scenery Design Engine (SDE) on 12/22/10 -->
<FSData
   version="9.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="bglcomp.xsd">
<TimeZone
      latitudeMinimum = "N89"
      latitudeMaximum = "N90"
      longitudeMinimum = "W180"
      longitudeMaximum = "W178"
      timedeviation = "300"
      priority = "255"
      daylightSavings = "NONE"
      daylightSavingsTimeShift = "60"
      daylightSavingsStartDayOfYearBase = "60"
      daylightSavingsStartDayOfWeek = "SUNDAY"
      daylightSavingsEndDayOfYearBase = "310"
      daylightSavingsEndDayOfWeek = "SUNDAY"
/> 
</FSData>

scott s.
.
 
I cannot find any support in the FS9 SDK for Time Zones. Am I correct in assuming this applies only to FSX?
 
Hi Scott

This is probably all me but I am a bit confused on your findings for these bytes:

0x14 byte SavingsStartDayOfYearBase (ls 8 bits)
0x15 byte SavingsEndDayOfYearBase (ls 4 bits) SavingsStartDayOfWeek (3 bits) SavingsStartDayOfYearBase (ms 1 bit)
0x16 byte daylightSavingsEndDayOfWeek (3 bits) SavingsEndDayOfYearBase (ms 5 bits)

StartDayOfYearBase works on 0x14 so I am unclear where the ms bit of 0x15 comes in.

EndDayOfYearBase appears twice.

Also you have not mentioned 'daylightSavings' Is that because you did not find it?
 
I probably did a poor job of writing it. Basically, day-of-week is encoded in 3 bits. 001 = Sunday and 111 = Saturday. The start and end day-of-year are encoded in 8+1 bits, treated as unsigned integer. So a total of 3 bytes for the 4 variables.

Reading the 3 bytes in order from start of record (offset) to end of record

0x14 bits 7-0 are bits 7-0 of the start day of year
0x15 bit 0 is bit 8 of the start day of year
........ bits 1-3 are start day of week
........ bits 4-7 are bits 0-3 of end day of year
0x16 bit 0 is bit 8 of end day of year
........ bits 1-3 are end day of week
........ bits 4-7 are bits 4-7 of end day of year

example
0x14 3C
0x15 6 001 0
0x16 3 111 1

gives
start day of year 0 3C (60 dec)
start day of week 001 (sunday)
end day of year 1 3 6 (310 dec)
end day of week 111 (saturday)

Note that FSX doesn't seem to have any problem with DST in the southern hemisphere (start day of year can be greater than end day of year).

As near as I can tell, the way it works is it takes the start day of year and computes the day of week, and then advances the start day of year until the computed day of week equals the given day of week, so the given start day of year is the earliest date it will change, and the latest that day of year +6.

scott s.
.
 
Back
Top