Table of Contents

Class TimeShift

Namespace
Hi.Numerical.StepSelectionUtils
Assembly
HiMech.dll

Represents a time-based shift operation for machining steps. This class provides functionality to shift step indices based on time offsets.

public class TimeShift : IStepShift, IMakeXmlSource
Inheritance
TimeShift
Implements
Inherited Members
Extension Methods

Constructors

TimeShift(TimeSpan, bool)

Initializes a new instance of the TimeShift class with the specified parameters.

public TimeShift(TimeSpan timeShift, bool isBackward)

Parameters

timeShift TimeSpan

The amount of time to shift.

isBackward bool

True to shift backward in time, false to shift forward.

TimeShift(XElement)

Initializes a new instance of the TimeShift class from XML.

public TimeShift(XElement src)

Parameters

src XElement

The XML element containing the time shift configuration.

Properties

IsBackward

Gets or sets a value indicating whether the shift is backward in time. When true, shifts steps earlier in time; when false, shifts steps later in time.

public bool IsBackward { get; set; }

Property Value

bool

ShiftTimeSpan

Gets or sets the amount of time to shift.

public TimeSpan ShiftTimeSpan { get; set; }

Property Value

TimeSpan

XName

Gets the XML element name used for serialization.

public static string XName { get; }

Property Value

string

Remarks

This name is used as the XML tag when serializing/deserializing TimeShift instances. The value is the unqualified name of the class (TimeShift).

Methods

GetShiftedStepIndex(ClStrip, int)

Gets the shifted step index based on the original index and the time shift configuration.

public int GetShiftedStepIndex(ClStrip host, int originalStepIndex)

Parameters

host ClStrip

The cutter location strip containing the steps.

originalStepIndex int

The original step index to shift.

Returns

int

The shifted step index, or -1 if the shift results in an invalid index.

MakeXmlSource(string, string)

Creates an XML representation of this time shift configuration.

public XElement MakeXmlSource(string baseDirectory, string relFile)

Parameters

baseDirectory string

The base directory for resolving relative paths (not used).

relFile string

The relative file path (not used).

Returns

XElement

An XML element containing the time shift configuration.