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
timeShiftTimeSpanThe amount of time to shift.
isBackwardboolTrue 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
srcXElementThe 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
ShiftTimeSpan
Gets or sets the amount of time to shift.
public TimeSpan ShiftTimeSpan { get; set; }
Property Value
XName
Gets the XML element name used for serialization.
public static string XName { get; }
Property Value
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
hostClStripThe cutter location strip containing the steps.
originalStepIndexintThe 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
baseDirectorystringThe base directory for resolving relative paths (not used).
relFilestringThe relative file path (not used).
Returns
- XElement
An XML element containing the time shift configuration.