Skip to main content

ThrottleRecord

Struct ThrottleRecord 

Source
pub struct ThrottleRecord {
Show 21 fields pub val: f64, pub oval: f64, pub sent: f64, pub osent: f64, pub wait: i16, pub hopr: f64, pub lopr: f64, pub drvlh: f64, pub drvll: f64, pub drvls: i16, pub drvlc: i16, pub ver: String, pub sts: i16, pub prec: i16, pub dprec: i16, pub dly: f64, pub out: String, pub ov: i16, pub sinp: String, pub siv: i16, pub sync: i16, /* private fields */
}
Expand description

Throttle record — rate-limits value changes to prevent device damage.

Ported from EPICS std module throttleRecord.c.

When VAL is written, the record checks drive limits, optionally clips the value, sets WAIT=True, then writes SENT to the OUT link only after the minimum delay (DLY) has elapsed since the last output. If a new value arrives during the delay, it queues the latest value and sends it when the delay expires.

Fields§

§val: f64

Set value (VAL)

§oval: f64

Previous set value (OVAL), read-only

§sent: f64

Last sent value (SENT), read-only

§osent: f64

Previous sent value (OSENT), read-only

§wait: i16

Busy flag (WAIT): 0=False, 1=True, read-only

§hopr: f64

High operating range (HOPR)

§lopr: f64

Low operating range (LOPR)

§drvlh: f64

High drive limit (DRVLH)

§drvll: f64

Low drive limit (DRVLL)

§drvls: i16

Limit status: 0=Normal, 1=Low, 2=High (DRVLS), read-only

§drvlc: i16

Limit clipping: 0=Off, 1=On (DRVLC)

§ver: String

Code version string (VER), read-only

§sts: i16

Record status: 0=Unknown, 1=Error, 2=Success (STS), read-only

§prec: i16

Display precision (PREC)

§dprec: i16

Delay display precision (DPREC)

§dly: f64

Delay between outputs in seconds (DLY)

§out: String

Output link (OUT)

§ov: i16

Output link valid: 0=ExtNC, 1=Ext, 2=Local, 3=Constant (OV), read-only

§sinp: String

Sync input link (SINP)

§siv: i16

Sync input link valid (SIV), read-only

§sync: i16

Sync trigger: 0=Idle, 1=Process (SYNC)

Trait Implementations§

Source§

impl Default for ThrottleRecord

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Record for ThrottleRecord

Source§

fn menu_field_choices(&self, field: &str) -> Option<&'static [&'static str]>

Record-specific DBF_MENU fields, served as DBR_ENUM with the menu’s choice labels in .dbd index order (C throttleRecord.dbd): WAIT=throttleWAIT, DRVLC=throttleDRVLC, DRVLS=throttleDRVLS, STS=throttleSTS, OV/SIV=throttleOV, SYNC=throttleSYNC.

C throttleRecord.c:308 keeps recGblFwdLink(prec) commented out in process() — the forward link is fired ONLY from valuePut’s non-CONSTANT branch (throttleRecord.c:580), i.e. only on a cycle where a real OUT write actually occurred. The framework default fires FLNK every process(), which would also fire it on a queuing-during-delay cycle, a rejected out-of-range cycle, a drain with nothing queued, and a CONSTANT-OUT cycle — none of which write OUT in C. process() maintains out_written (reset to false each cycle, set true only by send_value on a real OUT write); this hook returns it.

Source§

fn record_type(&self) -> &'static str

Return the record type name (e.g., “ai”, “ao”, “bi”).
Source§

fn process(&mut self) -> CaResult<ProcessOutcome>

Process the record (scan/compute cycle). Read more
Source§

fn can_device_write(&self) -> bool

Whether this record type supports device write (output records only). aao is included here even though it’s served by the same concrete struct as waveform/aai/subArray — the WaveformRecord’s can_device_write override picks the right answer per [ArrayKind], but this default matters for code that only has the record-type string.
Source§

fn special(&mut self, field: &str, after: bool) -> CaResult<()>

Called before/after a field put for side-effect processing.
Source§

fn get_field(&self, name: &str) -> Option<EpicsValue>

Get a field value by name.
Source§

fn put_field(&mut self, name: &str, value: EpicsValue) -> CaResult<()>

Set a field value by name.
Source§

fn field_list(&self) -> &'static [FieldDesc]

Return the list of field descriptors.
Source§

fn init_record(&mut self, pass: u8) -> CaResult<()>

Initialize record (pass 0: field defaults; pass 1: dependent init).
Source§

fn set_async_context(&mut self, name: String, db: AsyncDbHandle)

Called once by the framework when the record is registered (add_record), delivering the record its own canonical name plus a cycle-free crate::server::database::AsyncDbHandle for driving async-side updates from OUTSIDE a process() cycle. Read more
Source§

fn put_field_internal(&mut self, name: &str, value: EpicsValue) -> CaResult<()>

Internal field write that bypasses read-only checks. Used by the framework to write values from ReadDbLink actions into fields that are normally read-only (e.g., epid.CVAL). Default implementation delegates to put_field(). Read more
Source§

fn took_metadata_change(&mut self) -> bool

Optional: report whether this record’s last process() call mutated a metadata-class field (EGU/PREC/HOPR/LOPR/HLM/LLM/ alarm limits / DRVH/DRVL / state strings). Read more
Source§

fn field_metadata_override(&self, _field: &str) -> Option<FieldMetadataOverride>

Per-field override of the record-level display/control metadata for a GET / monitor snapshot of field. Read more
Source§

fn long_string_fields(&self) -> &'static [&'static str]

Field names this record serves as a long string: a DBF_CHAR array field that semantically holds a NUL-terminated string. Read more
Source§

fn process_passive_fields(&self) -> &'static [&'static str]

Field names declared pp(TRUE) in this record type’s DBD (empty if none, e.g. event/histogram, or if the type is unmodeled). Read more
Source§

fn processes_after_put(&self, field: &str) -> bool

Whether a put to field should reprocess this Passive record. Read more
Source§

fn validate_put(&self, _field: &str, _value: &EpicsValue) -> Result<(), CaError>

Validate a put before it is applied. Return Err to reject.
Source§

fn on_put(&mut self, _field: &str)

Hook called after a successful put_field.
Source§

fn primary_field(&self) -> &'static str

Primary field name (default “VAL”). Override for waveform etc.
Source§

fn val(&self) -> Option<EpicsValue>

Get the primary value.
Source§

fn set_val(&mut self, value: EpicsValue) -> Result<(), CaError>

Set the primary value. Read more
Source§

fn accepts_raw_soft_input(&self) -> bool

Whether this record implements the DTYP="Raw Soft Channel" read path via Record::apply_raw_input. Records that return true opt into framework routing of the INP link value through apply_raw_input (RVAL + MASK) instead of the default soft-channel VAL direct write. Read more
Source§

fn apply_raw_input(&mut self, value: EpicsValue) -> Result<(), CaError>

Apply a value read from a DTYP="Raw Soft Channel" INP link. Read more
Source§

fn apply_raw_readback(&mut self, _raw: i32) -> bool

Apply a raw device value read back from an output record’s device support (the asyn init seed and driver readback callback), the output analogue of Record::apply_raw_input. An output record whose convert() is forward (engineering → raw) must invert it here — store the raw value into RVAL and compute the engineering VAL — because the framework’s forward convert would otherwise recompute RVAL from the stale VAL and discard the readback (C processAo/initAo set rval/val directly, devAsynInt32.c:955-957/:973-994). Read more
Source§

fn apply_float64_readback(&mut self, _raw: f64) -> bool

Apply a float64 device value read back from an output record’s asyn device support — the asynFloat64 analogue of Record::apply_raw_readback. A float64 output (ao) whose device value carries an ASLO/AOFF linear scaling must seed the engineering VAL here (VAL = value * ASLO + AOFF), because the asyn store path would otherwise write the raw device value straight into VAL and drop the scaling. Sets VAL only (a float64 ao carries no RVAL); the reverse scaling (OVAL - AOFF) / ASLO is applied on the device-write side. Mirrors C initAo/processAo (devAsynFloat64.c:627-629/:646-649). Read more
Source§

fn install_breaktable_registry(&mut self, _registry: Arc<BreakTableRegistry>)

Hand the record the database’s breakpoint-table registry so an ai/ao with LINR >= 3 can resolve and cache the table its LINR selects. Called once at iocInit, before the first process/convert. The record resolves the table lazily on the first conversion (and re-resolves when LINR changes at runtime), mirroring C cvtRawToEngBpt’s init || *ppbrk == NULL cache. The default is a no-op: only ai/ao carry LINR.
Source§

fn apply_invalid_output_value( &mut self, ivov: EpicsValue, ) -> Result<(), CaError>

Apply IVOA=2 (“set outputs to IVOV”) semantics: copy the IVOV value into whatever output staging field the OUT writeback consumes for this record type. Mirrors the per-record C recXxx.c behaviour: Read more
Source§

fn is_put_complete(&self) -> bool

Whether async processing has completed and put_notify can respond. Records that return AsyncPendingNotify should return false while async work is in progress, and true when done. Default: true (synchronous records are always complete).
Source§

fn should_output(&self) -> bool

Whether this record’s OUT link should be written after processing. Defaults to true. Override in calcout / longout to implement OOPT conditional output (epics-base 7.0.8).
Source§

fn on_output_complete(&mut self)

Notify the record that the OUT-link / device write completed successfully on this cycle. The framework calls this right after the actual write so transition-detection state (e.g. longout.pval) can update for the next cycle’s Self::should_output check. Default: no-op.
Source§

fn uses_monitor_deadband(&self) -> bool

Whether this record uses MDEL/ADEL deadband for monitor posting. Binary records (bi, bo, busy, mbbi, mbbo) return false because C EPICS always posts monitors for these record types regardless of whether the value changed.
Source§

fn monitor_value_changed(&self) -> Option<bool>

Per-record VALUE/LOG monitor gate for record types that post a monitor only when the value actually changed — and have no MDEL/ADEL deadband to express that. Read more
Source§

fn monitor_always_post(&self) -> (bool, bool)

menuPost “Always” override for the VALUE / LOG monitor masks. Read more
Source§

fn monitor_deadband_value(&self) -> Option<EpicsValue>

The value the MDEL/ADEL deadband is evaluated against. Read more
Source§

fn monitor_deadband_field(&self) -> &'static str

The FIELD whose VALUE/LOG monitor delivery the MDEL/ADEL deadband gates — the field Self::monitor_deadband_value reads. A record overriding one must override both consistently. Read more
Source§

fn alarm_cycle_monitored_fields(&self) -> &'static [&'static str]

Fields the record’s C monitor() posts on every cycle whose alarm transition fired, even when their value did not change. Read more
Source§

fn force_posted_fields(&self) -> &'static [&'static str]

Fields the record’s C monitor() re-posts with DBE_VAL_LOG on every cycle that recomputed them, even when the value did not change — the analogue of an unconditional MARK(field) in C. Read more
Source§

fn log_swept_fields(&self) -> &'static [&'static str]

Fields the record’s C monitor() re-posts with DBE_LOG ONLY on every cycle it names them, regardless of change — the analogue of an unconditional db_post_events(field, DBE_LOG) sweep. Read more
Source§

fn value_only_change_fields(&self) -> &'static [&'static str]

Fields whose change-detected monitor post must carry DBE_VALUE only — the LOG bit is stripped — instead of the framework default DBE_VALUE | DBE_LOG. Read more
Source§

fn fields_posted_with_value_mask(&self) -> &'static [&'static str]

Secondary value fields a record posts with the primary VAL monitor mask, gated INSIDE C’s if (monitor_mask) guard — i.e. only on a cycle where VAL itself is posted (an alarm change or an MDEL/ADEL crossing) AND the field actually changed, NOT a forced DBE_VALUE | DBE_LOG on every change. Read more
Source§

fn array_monitor_post(&mut self) -> Option<ArrayMonitorPost>

The array-style monitor decision (C waveform/aai/aao monitor(), waveformRecord.c:291-326). None (the default) means the record has no MPST/APST/HASH mechanism and the generic MDEL/ADEL deadband decision applies. Some(_) lets the record replace that with its “Always vs On Change” rule: it hashes the array content, compares to the stored HASH, updates it, and reports whether DBE_VALUE / DBE_LOG should be on the VAL post this cycle and whether the hash changed (so the owner posts HASH with DBE_VALUE). Called by check_deadband_ext (the single owner of the VAL-mask decision).
Source§

fn event_posted_fields(&self) -> &'static [&'static str]

Fields the record posts itself via an event-driven, individually masked path rather than the generic change-detection loop. The framework excludes these from that loop so they are neither double-posted nor spuriously posted on a cycle the event did not fire. C waveform/aai/aao monitor() posts HASH this way — db_post_events(prec, &prec->hash, DBE_VALUE) only when the content hash changed (waveformRecord.c:317-319), never via VAL’s change. Read more
Source§

fn post_init_finalize_undef(&mut self, _udf: &mut bool) -> Result<(), CaError>

Post-init finalisation hook with mutable access to the framework’s UDF flag. Called once after both init_record passes complete. Default implementation is a no-op. Read more
Source§

fn seed_deadband_tracking(&mut self)

Seed the monitor/archive/alarm deadband trackers (MLST/ALST/LALM) from the initial value at iocInit, called once by the builder after both init_record passes and post_init_finalize_undef. Read more
Called by the framework immediately after applying this cycle’s Record::multi_input_links fetches, before process(). Read more
Source§

fn set_fetch_gate_failed(&mut self, _failed: bool)

Report that a record which gates its value update on a selected input read (currently sel in Specified mode) had that gating fetch fail this cycle. C selRecord.c::process (line 114) runs do_sel only when fetch_values succeeds; on failure VAL/UDF freeze. failed == true ⇒ the configured selected input or NVL link did not resolve, so process() must hold the previous output. Default: ignore (records with no fetch gate). Same framework-set hook pattern as Record::set_resolved_input_links.
Source§

fn monitor_side_effect_fields( &self, _put_field: &str, ) -> &'static [&'static str]

Other fields whose monitors must be posted because a put to put_field changed them as a side effect, without driving a full process cycle. Read more
Source§

fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>

Downcast to concrete type for device support init injection. Override in record types that need device support to inject state (e.g., MotorRecord).
Source§

fn clears_udf(&self) -> bool

Whether processing this record should clear UDF. Override to return false for record types that don’t produce a valid value every cycle.
Source§

fn value_is_undefined(&self) -> bool

Whether the record’s current VAL is undefined (UDF must stay set). Read more
Source§

fn check_alarms(&mut self, _common: &mut CommonFields)

Per-record alarm hook — evaluate record-type-specific alarms (STATE / COS / analog limit / SOFT) and accumulate them into nsta/nsev via recGblSetSevr. Read more
Return multi-input link field pairs: (link_field, value_field). Override in calc, calcout, sel, sub to return INPA..INPL → A..L mappings.
The subset of Self::multi_input_links the framework should actually fetch this cycle, given an optional externally-resolved selector index (sel’s NVL→SELN value, or None when no NVL link drove it). Default None = fetch every input link. Read more
Return multi-output link field pairs: (link_field, value_field). Override in transform to return OUTA..OUTP → A..P mappings.
Source§

fn output_event(&self) -> Option<String>

Return the name of the output event (OEVT) to post this cycle, or None. The event-subsystem twin of the OUT write: a downstream SCAN="Event" / EVNT="<name>" record is woken each time the record drives output. Mirrors C calcout/sCalcout/aCalcout execOutput, which calls postEvent(epvt) / post_event(oevt) immediately after writeValue in every OUT-driving branch. Read more
Source§

fn pre_process_actions(&mut self) -> Vec<ProcessAction>

Return pre-process actions (ReadDbLink) that the framework should execute BEFORE calling process(). This is called once per cycle. Default returns empty. Override in records that need link reads to be available during process().
Return actions the framework must execute BEFORE the input-link (multi_input_links, INP -> value-field) fetch for this cycle. Read more
Source§

fn set_process_context(&mut self, _ctx: &ProcessContext)

Called by the framework immediately before process() to push a read-only snapshot of framework-owned [CommonFields] state (ProcessContext) that the record’s process() needs to see. Read more
Framework init hook: called once at record load after the common link fields (INP/OUT/FLNK/…) have been resolved and the init_record passes have run, with the record’s resolved CommonFields. Read more
Source§

fn set_device_did_compute(&mut self, _did_compute: bool)

Called by the framework before process() to indicate whether device support’s read() already performed the record’s compute step. Override in records that have a built-in compute (e.g., epid PID) to skip it when device support already ran it. Default: ignore.
Source§

fn soft_channel_skips_convert(&self) -> bool

Whether this record has a raw-to-engineering (RVAL → VAL) convert() step that must be skipped on a Soft Channel input. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more