As the internal format of ChView is object based, the data file is comprised of serialised objects. Each fundamental data type has its own representation on disk.
Longs: are saved as 4 byte bitfields.
Strings: are saved a a 1 byte length determinator followed
by that many bytes of data. This does not include the null
terminator. If the string is longer that 254 then a byte
containing FF is stored with two bytes following containing
the actual length.
Floats: are unusual. They are stored as string representations.
This is done because most of the floating point numbers we
wish to store are nice rounded numbers. It is more efficient
to store them as strings than 8-byte floating point values.
Colorref: this is a Windows RGB value. It is promoted to a long
and saved as that.
LogFont: a binary representation of the Windows structure.
Preamble:
This area stores overall information for the data file.
First is stored a long value containing the version number
of the data representation. The current representation is
version 00000101 (hex value). Future versions will increment
this number.
Next are the view preferences:
Grid |int |Display grid or not
GridSize |double |Granularity of grid
Link |int |Display Links or not
LinkNumbers |int |Display Link Numbers or not
LinkSize x 4 |double |Size of each link gradation
StarName |int |Display Star Names or not
Radius |double |View Radius
Scale |int |Display Scope or note
GridStyle |int |Style of grid lines
LinkStyle x 3 |int |Style of link lines
StemStyle |int |Style of stems
StarOutline |int |Display star outline or not
RouteDisp |int |Display routes or not
Dummy x 8 |long |Reserved
OColour |Colorref |Colour of spectral type O stars
BColour |Colorref |
AColour |Colorref |
FColour |Colorref |
GColour |Colorref |
KColour |Colorref |
MColour |Colorref |
XColour |Colorref |
BackColour |Colorref |Colour of background
TextColour |Colorref |Colour of text
LinkNumColour |Colorref |Colour of link numbers
LinkColour x 3 |Colorref |Colour of link gradations
GridColour |Colorref |Colour of grid
StemColour |Colorref |Colour of stems
ORad |int |Radius of spectral class O stars
BRad |int |
ARad |int |
FRad |int |
GRad |int |
KRad |int |
MRad |int |
XRad |int |
DwarfRad |int |
GiantRad |int |
SuperGiantRad |int |
CentreOrds x 3 |double |Galactic coordinates of centre
theta |double |Rotational position
phi |double |
rho |double |
tscale |double |Angular scales
pscale |double |
rscale |double |
xscale |double |Display scales
yscale |double |
GroupLabel x 4 |string |Names of groups
DisplayGroup x 4 |int |Display each group or not
RouteLabel \ |string |Name of Route label
RouteColour x 4 |colorref |Colour of Route
RouteStyle / |int |Style of Route lines
LinkF |logfont |Link Number font
NameF |logfont |StarName font
UNameF |logfont |Unused font
Data:
First here is a long containing the number of star objects that
follow. Each object consists of:
cjcName |string |Proper Name of Place
starName |string |Official name of star
dToEarth |double |Distance to earth
Spectra |string |Spectra
Mass |double |Collapsed mass
ActualMass |double |Uncollapsed mass
ords[0] |double |Galactic coordinates
ords[1] |double |
ords[2] |double |
Constellation |string |Constellation
Comment |string |Comment
Selected |int |Selected or not
index |int |Index in file
Group |int |Group of star
There is a single byte indicating if there is a subsidiary star
orbiting this one. If so this entire data structure repeats
(recursively).
Lastly we record the links. First is a integer value indicating
the number of following links. Each link is then represented by
a integer containing the type of link and a string containing the
starName of the destination.
Postamble:
This contains only a string giving general comments on the entire
file.
Integers: are saved as 2 byte bitfields.