Please enable JavaScript to view this site.

 

This topic covers the implementation details of TSunDataSource.

 

Scope: cpSunDataSource.pas; class derived from TBtnEditProperty. Prepared from the curated implementation supplied for this review on 2 October 2026.

 

Sources/SunSource id=0 is the primary database ID; additional slots start at 1 and terminate at the first gap. CalcOptions includes rise/set/refraction settings and dawn/dusk angles split into degrees/minutes.

 

The assignment gate is needsSaving, which is set by reading Sources. Preserve Sources when editing calculation settings.

 

Notation and shared helper rules: Reading this reference.

 

XML identity and composition

 

Literal rec_type values emitted within these routines: TSunCalcOptions, TSunSourceIDs. 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/SunSource[@id=0]

 

XML representation: The text of the SunSource[@id=0] element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a number and assigns it to aPropValue.SunDataSet.Source.Id when the record node exists.

 

Writing: Stores the text representation of DataValue.SunDataSet.Source.Id whenever the writer reaches this field.

 

CalcOptions/IgnoreSummerTimeRegardless

 

XML representation: The text of the IgnoreSummerTimeRegardless element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a boolean and assigns it to aPropValue.SunDataSet.CalcOptions.IgnoreSummerTimeRegardless when the record node exists; node2 exists.

 

Writing: Stores true or false according to DataValue.SunDataSet.CalcOptions.IgnoreSummerTimeRegardless whenever the writer reaches this field.

 

CalcOptions/IgnoreRefraction

 

XML representation: The text of the IgnoreRefraction element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a boolean and assigns it to aPropValue.SunDataSet.CalcOptions.IgnoreRefraction when the record node exists; node2 exists.

 

Writing: Stores true or false according to DataValue.SunDataSet.CalcOptions.IgnoreRefraction whenever the writer reaches this field.

 

CalcOptions/RiseSetPosition

 

XML representation: The text of the RiseSetPosition element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a number and assigns it to aPropValue.SunDataSet.CalcOptions.RiseSetPosition when the record node exists; node2 exists.

 

Writing: Stores the numeric value of DataValue.SunDataSet.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 (TSunDataSource.Create).

 

Reading: Converts the stored text to a boolean and assigns it to aPropValue.SunDataSet.CalcOptions.UseFixedDiskSize when the record node exists; node2 exists.

 

Writing: Stores true or false according to DataValue.SunDataSet.CalcOptions.UseFixedDiskSize whenever the writer reaches this field.

 

CalcOptions/DawnAngleDeg

 

XML representation: The text of the DawnAngleDeg element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a number and assigns it to aPropValue.SunDataSet.CalcOptions.DawnDepression.Degrees when the record node exists; node2 exists.

 

Writing: Stores the numeric value of DataValue.SunDataSet.CalcOptions.DawnDepression.Degrees whenever the writer reaches this field.

 

CalcOptions/DawnAngleMin

 

XML representation: The text of the DawnAngleMin element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a number and assigns it to aPropValue.SunDataSet.CalcOptions.DawnDepression.Minutes when the record node exists; node2 exists.

 

Writing: Stores the numeric value of DataValue.SunDataSet.CalcOptions.DawnDepression.Minutes whenever the writer reaches this field.

 

CalcOptions/DuskAngleDeg

 

XML representation: The text of the DuskAngleDeg element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a number and assigns it to aPropValue.SunDataSet.CalcOptions.DuskDepression.Degrees when the record node exists; node2 exists.

 

Writing: Stores the numeric value of DataValue.SunDataSet.CalcOptions.DuskDepression.Degrees whenever the writer reaches this field.

 

CalcOptions/DuskAngleMin

 

XML representation: The text of the DuskAngleMin element.

 

Initial value: PropValue (TSunDataSource.Create).

 

Reading: Converts the stored text to a number and assigns it to aPropValue.SunDataSet.CalcOptions.DuskDepression.Minutes when the record node exists; node2 exists.

 

Writing: Stores the numeric value of DataValue.SunDataSet.CalcOptions.DuskDepression.Minutes whenever the writer reaches this field.

 

Sources/@rec_type

 

XML representation: The rec_type attribute.

 

Writing: Stores the literal text “TSunSourceIDs” whenever the writer reaches this field.

 

Sources/SunSource/@id

 

XML representation: The id attribute.

 

Writing: Stores the literal text “0” whenever the writer reaches this field.

 

Sources/AdditionalSources/SunSource/@id

 

XML representation: The id attribute.

 

Writing: Stores the text representation of i when DataValue.SunDataSet.Source.Id is greater than 0; AdditionalSources.Count is greater than 0; for each i from 1 through AdditionalSources.Count.

 

Sources/AdditionalSources/SunSource[@id={i.toString}]

 

XML representation: The text of the SunSource[@id={i.toString}] element.

 

Writing: Stores the numeric value of Integer (AdditionalSources.Objects[i - 1]) when DataValue.SunDataSet.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 “TSunCalcOptions” whenever the writer reaches this field.

 

Initialization and reset values

 

TSunDataSource.Create

 

Setting or temporary variable

Initial value

When it is assigned

PropName

“Sun Data Source”

Always

Required

2

Always

AdditionalSources

TStringList.Create

Always

PropValue

Default (TSL_PropValue)

Always

PropValue.SunDataSet.Source.Id

0

Always

PropValue.SunDataSet.Source.Name

“None”

Always

PropValue.SunDataSet.CalcOptions.IgnoreSummerTimeRegardless

false

Always

PropValue.SunDataSet.CalcOptions.DawnDepression.Degrees

12

Always

PropValue.SunDataSet.CalcOptions.DawnDepression.Minutes

0

Always

PropValue.SunDataSet.CalcOptions.DuskDepression.Degrees

12

Always

PropValue.SunDataSet.CalcOptions.DuskDepression.Minutes

0

Always

PropValue.SunDataSet.CalcOptions.IgnoreRefraction

false

Always

PropValue.SunDataSet.CalcOptions.RiseSetPosition

rspdTop (0)

Always

PropValue.SunDataSet.CalcOptions.UseFixedDiskSize

false

Always

PropValue.SunDataSet

IniSettings.SunDefaults.DataValue.SunDataSet

UseIniSettingsInPropertyConstructor is true

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

 

Implementation details

 

The Implementation toggle contains only TSunDataSource methods. Initializers and helpers belonging to other types are identified separately below. Shared XML-helper limitations are explained in Reading this reference.

 

Implementation