pub struct ProcessContext {
pub udf: bool,
pub udfs: AlarmSeverity,
pub nsev: AlarmSeverity,
pub phas: i16,
pub tse: i16,
pub time: SystemTime,
pub tsel: String,
pub dtyp: String,
pub callback_priority: CallbackPriority,
}Expand description
Read-only snapshot of framework-owned CommonFields state that a
record’s process() or device support’s read() needs to see
during the processing cycle.
The framework owns RecordInstance.common; a record process()
receives only &mut self (the concrete record) and device support
read() receives only &mut dyn Record. Neither can reach
CommonFields. C records, by contrast, see dbCommon directly —
e.g. epidRecord.c:195 reads pepid->udf, timestampRecord.c:90
reads ptimestamp->tse, devTimeOfDay.c:122 reads psi->phas.
The framework builds a ProcessContext from common and pushes it
onto the record (via Record::set_process_context) and onto the
device support (via
crate::server::device_support::DeviceSupport::set_process_context)
immediately before the respective call. This mirrors the existing
set_device_did_compute framework-set-hook pattern: additive,
no process() / read() signature change.
Fields§
§udf: booldbCommon.udf — value is undefined. C records check this at the
top of process() (e.g. epidRecord.c:195).
udfs: AlarmSeveritydbCommon.udfs — alarm severity raised for a UDF record.
nsev: AlarmSeveritydbCommon.nsev — the pending (new) alarm severity this cycle has
accumulated so far, BEFORE the record body runs. C dbGetLink folds an
MS-class input link’s severity into nsev at fetch time, so a record
body that branches on the input severity reads it here — e.g.
transformRecord.c:554 if ((ptran->nsev >= INVALID_ALARM) && (ptran->ivla == transformIVLA_DO_NOTHING)). The framework folds every input-link alarm
into common.nsev before building this snapshot, so nsev is the single
source of truth; the record never re-derives it from the links.
phas: i16dbCommon.phas — phase. Used by device support for format
selection (devTimeOfDay.c:122).
tse: i16dbCommon.tse — time-stamp event. timestampRecord.c:90
branches on tse == epicsTimeEventDeviceTime.
time: SystemTimedbCommon.time — the record’s current resolved time stamp at the
start of this cycle (the previous cycle’s stamp, or UNIX_EPOCH
before the first process). Device support that has to format the
record’s time during read() — the std module’s devTimeOfDay.c
recGblGetTimeStamp(psi) call, which runs before the framework’s
per-cycle timestamp application — resolves the stamp with
crate::server::recgbl::get_time_stamp(tse, time). The time
member is the device-provided value that helper returns verbatim on
the TSE == epicsTimeEventDeviceTime (-2) branch.
tsel: StringdbCommon.tsel — time-stamp event link string.
dtyp: StringdbCommon.dtyp — device-support type name. A record’s
process() / pre-process hooks can branch on the DTYP to mirror
C device support that lives in a separate DSET (e.g. the epid
record’s devEpidSoftCallback callback DSET drives the TRIG
readback link, whereas devEpidSoft does not).
callback_priority: CallbackPriorityThe callback band dbCommon.prio selects for work this cycle defers —
C seqRecord.c:145-146, which re-runs
callbackSetPriority(prec->prio, &pcb->callback) at the top of every
process() so a PRIO written between cycles takes effect on the next
one. Already converted: a record stashes this and hands it to
crate::runtime::task::spawn_background rather than re-deriving a
band from a raw menu index.
Trait Implementations§
Source§impl Clone for ProcessContext
impl Clone for ProcessContext
Source§fn clone(&self) -> ProcessContext
fn clone(&self) -> ProcessContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more