pub struct ColorTemperatureObject { /* private fields */ }Expand description
BACnet Color Temperature object (type 64).
Holds a correlated colour temperature in kelvin, 1000 to 30000 and within Min_Pres_Value and Max_Pres_Value. It isn’t commandable: Present_Value takes a write with no priority array, clamping a value between 1000 and Min_Pres_Value up to the minimum, and one between Max_Pres_Value and 30000 down to the maximum (Clause 12.Y.4).
Color_Command takes a BACnetColorCommand whose operation is
FADE_TO_CCT, RAMP_TO_CCT, STEP_UP_CCT, STEP_DOWN_CCT or STOP (see
set_color_command) and carries it out
(#1474). FADE_TO_CCT and RAMP_TO_CCT set Present_Value to the target,
clamped to the limits, and move Tracking_Value to it from where it
stands, over the command’s fade time or at its ramp rate (the defaults
when it carries none), with In_Progress FADE_ACTIVE or RAMP_ACTIVE until
it arrives. The step operations set Present_Value at once to
Tracking_Value plus or minus the step increment, clamped to the limits.
STOP ends a fade or ramp there, and Present_Value takes the temperature it
reached. A Present_Value write halts a fade or ramp too, then moves to the
new temperature as Transition says: at once for NONE, a fade over
Default_Fade_Time for FADE, or a ramp at Default_Ramp_Rate for RAMP.
Fades and ramps run on the monotonic clock the database binds, as a Color object’s fades do.
Cloning copies served state into an in-memory object. Tags persistence and pending saves remain solely with the original; cloning or dropping the copy never saves, corrects, settles, or waits on the original writer.
Implementations§
Source§impl ColorTemperatureObject
impl ColorTemperatureObject
Sourcepub fn new(instance: u32, name: impl Into<String>) -> Result<Self, Error>
pub fn new(instance: u32, name: impl Into<String>) -> Result<Self, Error>
Create a Color Temperature object at 4000 K (neutral white), which is also its Default_Color_Temperature.
Min_Pres_Value and Max_Pres_Value start at the full 1000 to 30000 K range, Default_Fade_Time at 100 ms (as a Color object’s does), Default_Ramp_Rate at 100 K/s, Default_Step_Increment at 50 K and Transition at NONE.
Sourcepub fn set_value_source_tracking(&mut self, enabled: bool)
pub fn set_value_source_tracking(&mut self, enabled: bool)
Track Value_Source (Clause 19.5, #1552), as a Color object’s
set_value_source_tracking
does. A set_min_max that moves Present_Value leaves no source
either.
Build with application-owned Tags storage. Saved Tags override configured
Tags only while set_profile provisions the row. Loaded data must satisfy
the normal Tags rules and the opt-in 1 MiB snapshot limit.
Sourcepub fn wait_for_tag_saves(&self)
pub fn wait_for_tag_saves(&self)
Wait for queued save attempts to finish. This is not a success receipt; writes report their own save outcomes. Unstaged local writes block.
Sourcepub fn set_profile(&mut self, profile: ObjectProfile) -> Result<(), Error>
pub fn set_profile(&mut self, profile: ObjectProfile) -> Result<(), Error>
Provision the optional Tags, Profile_Location and Profile_Name rows
before registration (#1553; see ObjectProfile). Tags takes
writes; the profile rows are read-only over the network. A profile
that fails ObjectProfile::check is refused and changes nothing.
Sourcepub fn set_audit_policy(&mut self, policy: ObjectAuditPolicy)
pub fn set_audit_policy(&mut self, policy: ObjectAuditPolicy)
Provision the optional Audit_Level and Auditable_Operations rows
before registration, as a Color object’s are (#1525). Table 12-Y has
no Audit_Priority_Filter either, so a priority filter in policy is
left out.
Sourcepub fn set_present_value(&mut self, kelvin: u32) -> Result<(), Error>
pub fn set_present_value(&mut self, kelvin: u32) -> Result<(), Error>
Set Present_Value in kelvin, as a WriteProperty of it would.
A value outside 1000 to 30000 is refused with VALUE_OUT_OF_RANGE and changes nothing; one inside is clamped to Min_Pres_Value and Max_Pres_Value (Clause 12.Y.4). A fade or ramp in progress is then halted, and the output moves to the value as Transition says.
Sourcepub fn set_min_max(&mut self, min: u32, max: u32) -> Result<(), Error>
pub fn set_min_max(&mut self, min: u32, max: u32) -> Result<(), Error>
Set Min_Pres_Value and Max_Pres_Value, in kelvin.
Clauses 12.Y.13 and 12.Y.14 keep them within 1000 to 30000; a minimum below 1000, a maximum above 30000 or a minimum above the maximum is refused with VALUE_OUT_OF_RANGE and changes nothing. A Present_Value outside the new limits moves to the nearer one at once, halting any fade or ramp, and a non-zero Default_Color_Temperature is clamped the same way.
Sourcepub fn color_command(&self) -> BACnetColorCommand
pub fn color_command(&self) -> BACnetColorCommand
The last command written to Color_Command, or operation NONE with no other field before any write.
Sourcepub fn set_color_command(
&mut self,
command: BACnetColorCommand,
) -> Result<(), Error>
pub fn set_color_command( &mut self, command: BACnetColorCommand, ) -> Result<(), Error>
Set Color_Command and carry the command out, as a WriteProperty of the encoded command would.
The command is checked against the Color Temperature object’s table of colour commands (Addendum 135-2020ca, Table 12-Y2): FADE_TO_CCT, RAMP_TO_CCT, STEP_UP_CCT, STEP_DOWN_CCT and STOP are taken. FADE_TO_CCT and RAMP_TO_CCT need a target colour temperature of 1000 to 30000 K. A field the operation uses must be in range: fade time (FADE_TO_CCT) 100 to 86,400,000 ms, ramp rate (RAMP_TO_CCT) 1 to 30000 K/s, step increment (the step operations) 1 to 30000 K. Fields the operation doesn’t use are kept unchecked. A refusal is VALUE_OUT_OF_RANGE and leaves the object unchanged.
Trait Implementations§
Source§impl BACnetObject for ColorTemperatureObject
impl BACnetObject for ColorTemperatureObject
Source§fn object_identifier(&self) -> ObjectIdentifier
fn object_identifier(&self) -> ObjectIdentifier
Source§fn object_name(&self) -> &str
fn object_name(&self) -> &str
Source§fn read_property(
&self,
property: PropertyIdentifier,
array_index: Option<u32>,
) -> Result<PropertyValue, Error>
fn read_property( &self, property: PropertyIdentifier, array_index: Option<u32>, ) -> Result<PropertyValue, Error>
Source§fn write_property(
&mut self,
property: PropertyIdentifier,
array_index: Option<u32>,
value: PropertyValue,
priority: Option<u8>,
) -> Result<(), Error>
fn write_property( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, ) -> Result<(), Error>
Source§fn write_property_from(
&mut self,
property: PropertyIdentifier,
array_index: Option<u32>,
value: PropertyValue,
priority: Option<u8>,
origin: &CommandOrigin,
) -> Result<(), Error>
fn write_property_from( &mut self, property: PropertyIdentifier, array_index: Option<u32>, value: PropertyValue, priority: Option<u8>, origin: &CommandOrigin, ) -> Result<(), Error>
Source§fn property_metadata(&self) -> Cow<'_, [PropertyMetadata]>
fn property_metadata(&self) -> Cow<'_, [PropertyMetadata]>
Source§fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>
fn property_list(&self) -> Cow<'static, [PropertyIdentifier]>
Source§fn supports_cov(&self) -> bool
fn supports_cov(&self) -> bool
Source§fn is_writable_property(&self, property: PropertyIdentifier) -> bool
fn is_writable_property(&self, property: PropertyIdentifier) -> bool
property for this object. Read moreSource§fn is_array_property(&self, property: PropertyIdentifier) -> bool
fn is_array_property(&self, property: PropertyIdentifier) -> bool
property accepts an array index on this object. Read moreSource§fn is_list_property(&self, property: PropertyIdentifier) -> bool
fn is_list_property(&self, property: PropertyIdentifier) -> bool
property is a BACnetLIST on this object. Read moreSource§fn is_createable(&self) -> bool
fn is_createable(&self) -> bool
Source§fn creation_only_properties(&self) -> &'static [PropertyIdentifier]
fn creation_only_properties(&self) -> &'static [PropertyIdentifier]
Source§fn initialize_property(
&mut self,
_property: PropertyIdentifier,
_value: PropertyValue,
) -> Result<(), Error>
fn initialize_property( &mut self, _property: PropertyIdentifier, _value: PropertyValue, ) -> Result<(), Error>
Self::creation_only_properties, written whole. Read moreSource§fn is_deleteable(&self) -> bool
fn is_deleteable(&self) -> bool
Source§fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>
fn required_properties(&self) -> Cow<'static, [PropertyIdentifier]>
Source§fn supports_subscribe_cov_property(&self) -> bool
fn supports_subscribe_cov_property(&self) -> bool
Source§fn supports_cov_property(&self, property: PropertyIdentifier) -> bool
fn supports_cov_property(&self, property: PropertyIdentifier) -> bool
Source§fn cov_increment(&self) -> Option<f64>
fn cov_increment(&self) -> Option<f64>
Source§fn cov_reported_properties(&self) -> &'static [CovReportedProperty]
fn cov_reported_properties(&self) -> &'static [CovReportedProperty]
Source§fn set_overridden(&mut self, _overridden: bool)
fn set_overridden(&mut self, _overridden: bool)
Source§fn evaluate_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
fn evaluate_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
Source§fn tick_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
fn tick_intrinsic_reporting(&mut self) -> Option<TransitionOutcome>
Time_Delay countdown for a pending transition. Read moreSource§fn tick_schedule(
&mut self,
_today: SpecificDate,
_time: Time,
_calendar_active: &dyn Fn(ObjectIdentifier) -> bool,
) -> Option<ScheduleWrite>
fn tick_schedule( &mut self, _today: SpecificDate, _time: Time, _calendar_active: &dyn Fn(ObjectIdentifier) -> bool, ) -> Option<ScheduleWrite>
Source§fn take_owed_schedule_writes(&mut self) -> Vec<ScheduleWrite>
fn take_owed_schedule_writes(&mut self) -> Vec<ScheduleWrite>
Source§fn complete_schedule_write(
&mut self,
_write: &ScheduleWrite,
_outcomes: &[ScheduleTargetOutcome],
) -> bool
fn complete_schedule_write( &mut self, _write: &ScheduleWrite, _outcomes: &[ScheduleTargetOutcome], ) -> bool
write, one of this schedule’s writes:
outcomes holds one entry per member of write.references, in order. Read moreSource§fn retry_refusals_naming(
&self,
_target: ObjectIdentifier,
) -> Option<ScheduleWrite>
fn retry_refusals_naming( &self, _target: ObjectIdentifier, ) -> Option<ScheduleWrite>
retry of the current value to the
references whose last write was refused and that name target, an
object just added to the database (#1440), so the refusal can clear
without waiting for the next pass. None when no such refusal
stands, or when the pass itself would retry nothing: out of service,
outside Effective_Period, or with a NULL Present_Value. Only
meaningful for Schedule objects; default returns None.Source§fn acknowledge_alarm(
&mut self,
_transition_bit: EventTransitionBits,
) -> Result<(), Error>
fn acknowledge_alarm( &mut self, _transition_bit: EventTransitionBits, ) -> Result<(), Error>
transition_bit flags in acked_transitions.
Returns Ok(()) if the object supports event detection, Err otherwise.Source§fn apply_life_safety_operation(
&mut self,
_operation: LifeSafetyOperation,
) -> Result<LifeSafetyOperationOutcome, Error>
fn apply_life_safety_operation( &mut self, _operation: LifeSafetyOperation, ) -> Result<LifeSafetyOperationOutcome, Error>
Source§fn set_life_safety_operation_expected_internal(
&mut self,
_operation: LifeSafetyOperation,
) -> Result<(), Error>
fn set_life_safety_operation_expected_internal( &mut self, _operation: LifeSafetyOperation, ) -> Result<(), Error>
Source§fn set_event_state_internal(&mut self, _state: EventState) -> Result<(), Error>
fn set_event_state_internal(&mut self, _state: EventState) -> Result<(), Error>
Event_State transition. Read moreSource§fn enrollment_eval_state_internal(&self) -> Option<EventEnrollmentEvalState>
fn enrollment_eval_state_internal(&self) -> Option<EventEnrollmentEvalState>
Source§fn set_enrollment_eval_state_internal(
&mut self,
_state: EventEnrollmentEvalState,
) -> Result<(), Error>
fn set_enrollment_eval_state_internal( &mut self, _state: EventEnrollmentEvalState, ) -> Result<(), Error>
Source§fn enrollment_eval_source_internal(
&self,
) -> Option<Option<EventEnrollmentMonitoredSource>>
fn enrollment_eval_source_internal( &self, ) -> Option<Option<EventEnrollmentMonitoredSource>>
Source§fn set_enrollment_eval_source_internal(
&mut self,
_source: Option<EventEnrollmentMonitoredSource>,
) -> Result<(), Error>
fn set_enrollment_eval_source_internal( &mut self, _source: Option<EventEnrollmentMonitoredSource>, ) -> Result<(), Error>
Source§fn set_acked_transitions_internal(
&mut self,
_transition_bit: EventTransitionBits,
_acknowledged: bool,
) -> Result<(), Error>
fn set_acked_transitions_internal( &mut self, _transition_bit: EventTransitionBits, _acknowledged: bool, ) -> Result<(), Error>
Acked_Transitions bit on a received event-state
transition. Read moreSource§fn evaluate_reliability_internal(
&mut self,
) -> Result<ReliabilityEvaluation, Error>
fn evaluate_reliability_internal( &mut self, ) -> Result<ReliabilityEvaluation, Error>
Reliability. Read moreSource§fn set_reliability_internal(
&mut self,
_reliability: Reliability,
) -> Result<(), Error>
fn set_reliability_internal( &mut self, _reliability: Reliability, ) -> Result<(), Error>
Reliability value. Read moreSource§fn set_present_value_internal(
&mut self,
_value: PropertyValue,
) -> Result<(), Error>
fn set_present_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>
Present_Value supplied by the local application. Read moreSource§fn set_present_value_from_internal(
&mut self,
value: PropertyValue,
_origin: &CommandOrigin,
) -> Result<(), Error>
fn set_present_value_from_internal( &mut self, value: PropertyValue, _origin: &CommandOrigin, ) -> Result<(), Error>
Source§fn set_tracking_value_internal(
&mut self,
_value: PropertyValue,
) -> Result<(), Error>
fn set_tracking_value_internal( &mut self, _value: PropertyValue, ) -> Result<(), Error>
Tracking_Value the local application derived. Read moreSource§fn report_access_input_internal(
&mut self,
_input: AccessControlInput,
) -> Result<(), Error>
fn report_access_input_internal( &mut self, _input: AccessControlInput, ) -> Result<(), Error>
AccessControlInput. Read more