.. default-domain:: cpp .. highlight:: cpp .. namespace:: krpc::services::KerbalAlarmClock Alarm ===== .. class:: Alarm Represents an alarm. Obtained by calling :func:`alarms`, :func:`alarm_with_name` or :func:`alarms_with_type`. .. function:: AlarmAction action() .. function:: void set_action(AlarmAction value) The action that the alarm triggers. .. function:: double margin() .. function:: void set_margin(double value) The number of seconds before the event that the alarm will fire. .. function:: double time() .. function:: void set_time(double value) The time at which the alarm will fire. .. function:: AlarmType type() The type of the alarm. .. function:: std::string id() The unique identifier for the alarm. .. function:: std::string name() .. function:: void set_name(std::string value) The short name of the alarm. .. function:: std::string notes() .. function:: void set_notes(std::string value) The long description of the alarm. .. function:: double remaining() The number of seconds until the alarm will fire. .. function:: bool enabled() .. function:: void set_enabled(bool value) Whether the alarm is enabled. A disabled alarm does not fire. .. function:: bool play_sound() .. function:: void set_play_sound(bool value) Whether the alarm plays a sound when it fires. .. function:: bool triggered() Whether the alarm has fired. Remains true once the alarm has fired; stream this or use it in an event expression to react to the alarm firing. .. function:: bool repeat() .. function:: void set_repeat(bool value) Whether the alarm will be repeated after it has fired. Only has an effect for alarm types that support repeating (see :func:`Alarm::supports_repeat`). .. function:: bool supports_repeat() Whether this alarm's type supports repeating (see :func:`Alarm::repeat`). .. function:: double repeat_period() .. function:: void set_repeat_period(double value) The time delay to automatically create an alarm after it has fired. Only has an effect for alarm types that support a repeat period (see :func:`Alarm::supports_repeat_period`). .. function:: bool supports_repeat_period() Whether this alarm's type supports a repeat period (see :func:`Alarm::repeat_period`). .. function:: SpaceCenter::Vessel vessel() .. function:: void set_vessel(SpaceCenter::Vessel value) The vessel that the alarm is attached to. .. function:: SpaceCenter::CelestialBody xfer_origin_body() .. function:: void set_xfer_origin_body(SpaceCenter::CelestialBody value) The celestial body the vessel is departing from. .. function:: SpaceCenter::CelestialBody xfer_target_body() .. function:: void set_xfer_target_body(SpaceCenter::CelestialBody value) The celestial body the vessel is arriving at. .. function:: void remove() Removes the alarm. Any further use of this object throws an exception.