zplCore.comzplCore.com

ZplPrinterFaults

public sealed class ZplPrinterFaults

Scriptable faults and printer conditions of a ZplVirtualPrinter: set conditions now (ZplPrinterFaults.Raise), schedule them deterministically (ZplPrinterFaults.Schedule: after n labels, bytes or cuts, on a command, after a time, or randomly with ZplPrinterFaults.Seed) and clear them like an operator (ZplPrinterFaults.Clear). Thread-safe.

Properties

PropertyTypeDescription
Active { get; }IReadOnlyCollection<ZplFaultKind>Active conditions.
Scheduled { get; }IReadOnlyList<ZplFaultRule>Scheduled rules that have not fired yet (and repeating rules).
Seed { get; set; }intSeed of the random triggers (default 0): the same seed and job give the same faults.
StopsPrinting { get; }boolPrinting is stopped (paper/ribbon out, head open, over temperature, cutter fault, pause, power off).

Methods

Method SignatureReturnsDescription
# ActiveRule(ZplFaultKind kind)ZplFaultRuleThe rule that activated kind (null when raised without rule or inactive).
# Clear(ZplFaultKind kind)voidClears a condition (paper loaded, head closed, cooled down, ~PS for Pause ...).
# ClearAll()voidClears all conditions and removes all scheduled rules.
# IsActive(ZplFaultKind kind)bool
# Load(ZplChaosScript script)voidLoads a chaos script (see ZplChaosScript) and schedules its faults.
# Raise(ZplFaultKind kind)voidActivates a condition now (like a sensor or the operator).
# Schedule(ZplFaultRule rule)ZplFaultRuleSchedules a rule; ZplFaultTriggerKind.Immediately activates it at once.
# Schedule(ZplFaultKind kind, ZplFaultTrigger trigger)ZplFaultRule

Events

EventHandler TypeDescription
FaultClearedEventHandler<ZplFaultEventArgs>
FaultRaisedEventHandler<ZplFaultEventArgs>