This topic covers the implementation details of TMoonDataSource.
Scope: cpMoonDataSource.pas; class derived from TBtnEditProperty. Prepared from the curated implementation supplied for this review on 2 October 2026.
Sources/MoonSource id=0 is the primary database ID; additional source slots start at 1 and terminate at the first gap. CalcOptions contains calculation settings; RiseSetPosition is an enum.
In this reader, needsSaving becomes true when Sources is present. Changing only CalcOptions in an otherwise absent Sources structure does not by itself cause the copied DataValue to be assigned.
Notation and shared helper rules: Reading this reference.
Literal rec_type values emitted within these routines: TMoonCalcOptions, TMoonSourceIDs. Nested values may belong to child wrappers rather than this owner itself; the attribute entries below give their exact locations.
Inherited implementation: TBtnEditProperty. Follow it when the ordered behavior invokes inherited methods; inherited fields are not repeated as locally owned fields.
Exact XML fields and attributes
The paths below start at this record or property node. A slash identifies a child element; @ identifies an attribute. Curly braces mark a variable index or expression, not literal XML text. Initial values describe initialization; they do not establish what an omitted individual element does. The Implementation toggle below contains the supplied routines for exact branch order and conversions.
Sources/MoonSource[@id=0]
XML representation: The text of the MoonSource[@id=0] element.
Initial value: PropValue (TMoonDataSource.Create).
Reading: Converts the stored text to a number and assigns it to aPropValue.MoonDataSet.Source.Id when the record node exists.
Writing: Stores the text representation of DataValue.MoonDataSet.Source.Id whenever the writer reaches this field.
CalcOptions/IgnoreSummerTimeRegardless
XML representation: The text of the IgnoreSummerTimeRegardless element.
Initial value: PropValue (TMoonDataSource.Create).
Reading: Converts the stored text to a boolean and assigns it to aPropValue.MoonDataSet.CalcOptions.IgnoreSummerTimeRegardless when the record node exists; node2 exists.
Writing: Stores true or false according to DataValue.MoonDataSet.CalcOptions.IgnoreSummerTimeRegardless whenever the writer reaches this field.
CalcOptions/IgnoreRefraction
XML representation: The text of the IgnoreRefraction element.
Initial value: PropValue (TMoonDataSource.Create).
Reading: Converts the stored text to a boolean and assigns it to aPropValue.MoonDataSet.CalcOptions.IgnoreRefraction when the record node exists; node2 exists.
Writing: Stores true or false according to DataValue.MoonDataSet.CalcOptions.IgnoreRefraction whenever the writer reaches this field.
CalcOptions/RiseSetPosition
XML representation: The text of the RiseSetPosition element.
Initial value: PropValue (TMoonDataSource.Create).
Reading: Converts the stored text to a number and assigns it to aPropValue.MoonDataSet.CalcOptions.RiseSetPosition when the record node exists; node2 exists.
Writing: Stores the numeric value of DataValue.MoonDataSet.CalcOptions.RiseSetPosition (see the value table below) whenever the writer reaches this field.
CalcOptions/UseFixedDiskSize
XML representation: The text of the UseFixedDiskSize element.
Initial value: PropValue (TMoonDataSource.Create).
Reading: Converts the stored text to a boolean and assigns it to aPropValue.MoonDataSet.CalcOptions.UseFixedDiskSize when the record node exists; node2 exists.
Writing: Stores true or false according to DataValue.MoonDataSet.CalcOptions.UseFixedDiskSize whenever the writer reaches this field.
Sources/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMoonSourceIDs” whenever the writer reaches this field.
Sources/MoonSource/@id
XML representation: The id attribute.
Writing: Stores the literal text “0” whenever the writer reaches this field.
Sources/AdditionalSources/MoonSource/@id
XML representation: The id attribute.
Writing: Stores the text representation of i when DataValue.MoonDataSet.Source.Id is greater than 0; AdditionalSources.Count is greater than 0; for each i from 1 through AdditionalSources.Count.
Sources/AdditionalSources/MoonSource[@id={i.toString}]
XML representation: The text of the MoonSource[@id={i.toString}] element.
Writing: Stores the numeric value of Integer (AdditionalSources.Objects[i - 1]) when DataValue.MoonDataSet.Source.Id is greater than 0; AdditionalSources.Count is greater than 0; for each i from 1 through AdditionalSources.Count.
Import: This routine does not read this field. See the inherited or enclosing implementation where applicable.
CalcOptions/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMoonCalcOptions” whenever the writer reaches this field.
Initialization and reset values
TMoonDataSource.Create
Setting or temporary variable |
Initial value |
When it is assigned |
PropName |
“Moon Data Source” |
Always |
Required |
2 |
Always |
AdditionalSources |
TStringList.Create |
Always |
PropValue |
Default (TSL_PropValue) |
Always |
PropValue.MoonDataSet.Source.Id |
IniSettings.MoonDataSourceID |
UseIniSettingsInPropertyConstructor is true |
PropValue.MoonDataSet.Source.Name |
IniSettings.MoonDataSourceName |
UseIniSettingsInPropertyConstructor is true |
PropValue.MoonDataSet.CalcOptions.IgnoreSummerTimeRegardless |
false |
UseIniSettingsInPropertyConstructor is true |
PropValue.MoonDataSet.CalcOptions.IgnoreRefraction |
false |
UseIniSettingsInPropertyConstructor is true |
PropValue.MoonDataSet.CalcOptions.RiseSetPosition |
rspdTop (0) |
UseIniSettingsInPropertyConstructor is true |
PropValue.MoonDataSet.CalcOptions.UseFixedDiskSize |
false |
UseIniSettingsInPropertyConstructor is true |
PropValue.MoonDataSet.Source.Id |
0 |
UseIniSettingsInPropertyConstructor is false |
PropValue.MoonDataSet.Source.Name |
“None” |
UseIniSettingsInPropertyConstructor is false |
PropValue.MoonDataSet.CalcOptions.IgnoreSummerTimeRegardless |
false |
UseIniSettingsInPropertyConstructor is false |
PropValue.MoonDataSet.CalcOptions.IgnoreRefraction |
false |
UseIniSettingsInPropertyConstructor is false |
PropValue.MoonDataSet.CalcOptions.RiseSetPosition |
rspdTop (0) |
UseIniSettingsInPropertyConstructor is false |
PropValue.MoonDataSet.CalcOptions.UseFixedDiskSize |
false |
UseIniSettingsInPropertyConstructor is false |
DataValue |
PropValue |
Always |
This routine also calls inherited Create; self.FillDisplayValue. See Implementation for their order and any conditional calls.
Value namespaces used by this implementation
These are declared Pascal ordinal values. Use the ordinal only where the field serializer actually writes ord(...), an integer cast or an equivalent value. Set-marker strings and local option lists have their own representation; sentinel members in an enum are not automatically legal XML choices.
TRiseSetPositionDefinition
Ordinal |
Declared member |
0 |
rspdTop |
1 |
rspdCenter |
2 |
rspdBottom |
Storage declarations relevant to interpretation
These are in-memory member and property types, not a list of mandatory XML children. They retain array bounds, fixed buffers and selector types. The field reference above defines what is actually serialized.
Name |
Declared type / bounds |
Kind |
AdditionalSources |
TStringList |
member |
The Implementation toggle contains only TMoonDataSource methods. Initializers and helpers belonging to other types are identified separately below. Shared XML-helper limitations are explained in Reading this reference.