Name

condition sun, conditionsun, kPMConditionConditionSun — Conditional on the Sun's position being between two events.

Synopsis

condition sun structure { invert, type, not before, not after, geolocation, date };
invert : boolean, default, optional
type : string, choice
not before : string, choice, default, optional
not after : string, choice, default, optional
geolocation : geolocation structure
date : date, optional

Description

Conditional on the Sun's position being between two events.

sun position tests if the Sun's position, observed from given location on Earth, is between two astronomic events. Typically this condition is used to test if the date and time is during the day or night.

Fields

invert. Invert the condition's conclusion.

Conditions are designed to positively identify specific states. Many events will want a condition to confirm that a specific state is not occuring. To reverse the role of a positive condition, use the invert field.

If a condition is true, and the invert field is set, the condition will invert the true and return false.

If a condition is false, and the invert field is set, the condition will invert the false and return true.

invert is a boolean. If invert is omitted, the default false is used. invert is optional.

type. Type of condition to test.

type is a string. type must be sun, kPMConditionType_Sun.

not before. The date is not before this Sun event.

not before is a string. If not before is omitted, the default sunrise is used. not before is optional. not before must be one of the following ten constants:

  • night end, kPMConditionNotBefore_NightEnd.
  • nautical dawn, kPMConditionNotBefore_NauticalDawn.
  • dawn, kPMConditionNotBefore_Dawn.
  • sunrise, kPMConditionNotBefore_Sunrise.
  • sunrise limit, kPMConditionNotBefore_SunriseLimit.
  • sunset limit, kPMConditionNotBefore_SunsetLimit.
  • sunset, kPMConditionNotBefore_Sunset.
  • dusk, kPMConditionNotBefore_Dusk.
  • nautical dusk, kPMConditionNotBefore_NauticalDusk.
  • night begin, kPMConditionNotBefore_NightBegin.

not after. The date is not after this Sun event.

not after is a string. If not after is omitted, the default sunrise is used. not after is optional. not after must be one of the following ten constants:

  • night end, kPMConditionNotAfter_NightEnd.
  • nautical dawn, kPMConditionNotAfter_NauticalDawn.
  • dawn, kPMConditionNotAfter_Dawn.
  • sunrise, kPMConditionNotAfter_Sunrise.
  • sunrise limit, kPMConditionNotAfter_SunriseLimit.
  • sunset limit, kPMConditionNotAfter_SunsetLimit.
  • sunset, kPMConditionNotAfter_Sunset.
  • dusk, kPMConditionNotAfter_Dusk.
  • nautical dusk, kPMConditionNotAfter_NauticalDusk.
  • night begin, kPMConditionNotAfter_NightBegin.

geolocation. Location to calculate Sun position from.

geolocation is a geolocation structure.

date. Date to calculate Sun position on.

date is a date. date is optional.