Communicating with Other Plugins
NINA provides the ability for one plugin to publish messages that can then be received and acted on by other plugins. This section provides details for other plugin authors wishing to integrate with TS.
This is an experimental feature available with the 4.8.0.0 release and later. The timing and format of messages is likely to change. Any changes will be made in coordination with collaborating plugin authors.
TS Sender Details
TS messages will be identified by the following:
- MessageSenderId: B4541BA9-7B07-4D71-B8E1-6C73D4933EA0
- MessageSender: “Target Scheduler”
- SentAt: UTC Now (when message is composed/sent)
- TS is not currently using the CorrelationId message property
All messages sent from TS will be logged in the TS log at compose/send time.
Starting a Wait
When the TS planner returns a ‘wait’ period (wait some amount of time for the next target to become available), it will publish a wait start message.
- Topic: TargetScheduler-WaitStart
- Version: 1
- Content: (DateTime) wait end time
- Expiration: wait end time
- Headers: none
Starting a New Target
When the TS planner returns a target plan and the target is ‘new’ (see below), it will publish a new target start message.
- Topic: TargetScheduler-NewTargetStart
- Version: 1
- Content: (string) target name
- Expiration: target end time (see below)
- Headers:
- ProjectName: (string) TS project name for the target
- Coordinates: (NINA.Astrometry.Coordinates) coordinates of the target
- Rotation: (double) target rotation angle (as entered into the TS UI)
See below for details on when this message is sent.
Starting a Target
When the TS planner returns a target plan, it will publish a target start message. This is sent regardless of whether the target is new or not.
- Topic: TargetScheduler-TargetStart
- Version: 1
- Content: (string) target name
- Expiration: target end time (see below)
- Headers:
- ProjectName: (string) TS project name for the target
- Coordinates: (NINA.Astrometry.Coordinates) coordinates of the target
- Rotation: (double) target rotation angle (as entered into the TS UI)
See below for details on when this message is sent.
Notes on Target Start Messages
Order of Operations
TS will send the two types of target start messages in the following order:
- If the target is new, send the New Target Start message
- Send the Target Start message (always sent, regardless of whether new or not)
- Slew/center to the target (only if needed, e.g. target is new or TS was interrupted)
- Any instructions in the ‘Before New Target’ custom event container
- The regular plan instructions
A target plan is new when:
- It is the first target of the night or
- It is different from the previous target or
- It is the first target after an interruption (e.g. safety interrupt)
Target End Time
The target end time (in the message expiration field) should be used with caution. The value used is the time at which the target loses visibility. However, plans are designed to run within the project minimum time constraint and will contain only enough exposures to fill that time. Most plans will continue running past the project minimum since plans may contain time consuming operations like slew/center, or be interrupted by auto focus triggers. However, a plan is guaranteed to be stopped at the target end time since the target would no longer be visible after that time.