Skip to main content

Action

Enum Action 

Source
pub enum Action {
Show 33 variants ReadSignal { signal: Signal, wait_for_newest: bool, }, ReadSignals { signals: Vec<Signal>, wait_for_newest: bool, }, ReadSignalNames, ReadBias, SetBias { voltage: f32, }, ReadOsci { signal: Signal, trigger: Option<TriggerConfig>, data_to_get: DataToGet, is_stable: Option<fn(&[f64]) -> bool>, }, ReadPiezoPosition { wait_for_newest_data: bool, }, SetPiezoPosition { position: Position, wait_until_finished: bool, }, MovePiezoRelative { delta: Position, }, MoveMotorAxis { direction: MotorDirection, steps: u16, blocking: bool, }, MoveMotor3D { displacement: MotorDisplacement, blocking: bool, }, MoveMotorClosedLoop { target: Position3D, mode: MovementMode, }, StopMotor, AutoApproach { wait_until_finished: bool, timeout: Duration, center_freq_shift: bool, }, Withdraw { wait_until_finished: bool, timeout: Duration, }, SafeReposition { x_steps: i16, y_steps: i16, }, SetZSetpoint { setpoint: f32, }, ScanControl { action: ScanAction, }, ReadScanStatus, BiasPulse { wait_until_done: bool, pulse_width: Duration, bias_value_v: f32, z_controller_hold: u16, pulse_mode: u16, }, TipShaper { config: TipShaperConfig, wait_until_finished: bool, timeout: Duration, }, PulseRetract { pulse_width: Duration, pulse_height_v: f32, }, Wait { duration: Duration, }, Store { key: String, action: Box<Action>, }, Retrieve { key: String, }, StartTCPLogger, StopTCPLogger, GetTCPLoggerStatus, ConfigureTCPLogger { channels: Vec<i32>, oversampling: i32, }, CheckTipState { method: TipCheckMethod, }, CheckTipStability { method: TipStabilityMethod, max_duration: Duration, }, ReadStableSignal { signal: Signal, data_points: Option<usize>, use_new_data: bool, stability_method: SignalStabilityMethod, timeout: Duration, retry_count: Option<u32>, }, ReachedTargedAmplitude,
}
Expand description

Enhanced Action enum representing all possible SPM operations Properly separates motor (step-based) and piezo (continuous) movements

Variants§

§

ReadSignal

Read single signal value

Fields

§signal: Signal
§wait_for_newest: bool
§

ReadSignals

Read multiple signal values

Fields

§signals: Vec<Signal>
§wait_for_newest: bool
§

ReadSignalNames

Read all available signal names

§

ReadBias

Read current bias voltage

§

SetBias

Set bias voltage to specific value

Fields

§voltage: f32
§

ReadOsci

Fields

§signal: Signal
§data_to_get: DataToGet
§is_stable: Option<fn(&[f64]) -> bool>
§

ReadPiezoPosition

Read current piezo position (continuous coordinates)

Fields

§wait_for_newest_data: bool
§

SetPiezoPosition

Set piezo position (absolute)

Fields

§position: Position
§wait_until_finished: bool
§

MovePiezoRelative

Move piezo position (relative to current)

Fields

§delta: Position
§

MoveMotorAxis

Move motor along a single axis (discrete positioning)

Fields

§direction: MotorDirection
§steps: u16
§blocking: bool
§

MoveMotor3D

Move motor in 3D space with single displacement vector

Fields

§displacement: MotorDisplacement
§blocking: bool
§

MoveMotorClosedLoop

Move motor using closed-loop to target position

Fields

§target: Position3D
§

StopMotor

Stop all motor movement

§

AutoApproach

Perform auto-approach with timeout

Fields

§wait_until_finished: bool
§timeout: Duration
§center_freq_shift: bool

If true, center the frequency shift before starting auto-approach

§

Withdraw

Withdraw tip with timeout

Fields

§wait_until_finished: bool
§timeout: Duration
§

SafeReposition

Safely reposition tip: withdraw → move → approach → stabilize

Fields

§x_steps: i16
§y_steps: i16
§

SetZSetpoint

Set Z-controller setpoint

Fields

§setpoint: f32
§

ScanControl

Control scan operations

Fields

§action: ScanAction
§

ReadScanStatus

Read scan status

§

BiasPulse

Execute bias pulse with parameters

Fields

§wait_until_done: bool
§pulse_width: Duration
§bias_value_v: f32
§z_controller_hold: u16
§pulse_mode: u16
§

TipShaper

Full tip shaper control with all parameters

Fields

§wait_until_finished: bool
§timeout: Duration
§

PulseRetract

Simple pulse-retract with predefined safe values

Fields

§pulse_width: Duration
§pulse_height_v: f32
§

Wait

Wait for a specific duration

Fields

§duration: Duration
§

Store

Store result value with key for later retrieval

Fields

§action: Box<Action>
§

Retrieve

Retrieve previously stored value

Fields

§

StartTCPLogger

Start TCP logger (must be configured first)

§

StopTCPLogger

Stop TCP logger

§

GetTCPLoggerStatus

Get TCP logger status and configuration

§

ConfigureTCPLogger

Configure TCP logger channels and oversampling

Fields

§channels: Vec<i32>
§oversampling: i32
§

CheckTipState

Check tip state using specified method (non-invasive)

Fields

§

CheckTipStability

Check tip stability using potentially invasive methods WARNING: This action may damage the tip through bias sweeps or extended testing

Fields

§max_duration: Duration
§

ReadStableSignal

Get a stable signal value using TCP logger data and stability analysis

Fields

§signal: Signal
§data_points: Option<usize>
§use_new_data: bool
§stability_method: SignalStabilityMethod
§timeout: Duration
§retry_count: Option<u32>
§

ReachedTargedAmplitude

Check if oscillation amplitude is reached

Implementations§

Source§

impl Action

Source

pub fn is_positioning_action(&self) -> bool

Check if this is a positioning action

Source

pub fn is_read_action(&self) -> bool

Check if this is a read-only action

Source

pub fn is_control_action(&self) -> bool

Check if this is a control action

Source

pub fn modifies_bias(&self) -> bool

Check if this action modifies bias voltage

Source

pub fn involves_motor(&self) -> bool

Check if this action involves motor movement

Source

pub fn involves_piezo(&self) -> bool

Check if this action involves piezo movement

Source

pub fn description(&self) -> String

Get a human-readable description of the action

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Action

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Action> for ActionRequest

Source§

fn from(action: Action) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<Action> for ActionChain

Source§

fn from_iter<T: IntoIterator<Item = Action>>(iter: T) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl Freeze for Action

§

impl RefUnwindSafe for Action

§

impl Send for Action

§

impl Sync for Action

§

impl Unpin for Action

§

impl UnwindSafe for Action

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.