Class ForceAccelShot
- Namespace
- Hi.Vibrations
- Assembly
- HiMech.dll
Represents a data point containing force, acceleration, and moment measurements at a specific time.
public class ForceAccelShot : IForceShot, IMomentShot, IAccelerationShot, ITimeShot, ITimeGetter
- Inheritance
-
ForceAccelShot
- Implements
- Inherited Members
- Extension Methods
Constructors
ForceAccelShot()
Initializes a new instance of the ForceAccelShot class.
public ForceAccelShot()
ForceAccelShot(TimeSpan, Vec3d, Vec3d, Vec3d)
Initializes a new instance of the ForceAccelShot class with the specified values.
public ForceAccelShot(TimeSpan time, Vec3d force_N, Vec3d acceleration_g, Vec3d moment_Nm)
Parameters
time
TimeSpanThe time point of the measurement.
force_N
Vec3dThe force vector in Newtons.
acceleration_g
Vec3dThe acceleration vector in g-force units.
moment_Nm
Vec3dThe moment vector in Newton-meters.
Properties
Acceleration_g
Gets or sets the acceleration vector in g-force units (g). This property automatically converts between mm/s² and g, where 1g = 9.81 m/s².
public Vec3d Acceleration_g { get; set; }
Property Value
Remarks
Conversion factors:
- From m/s² to g: divide by 9.81
- From g to m/s²: multiply by 9.81
Common reference values:
- 1g: Earth's gravitational acceleration
- 0g: Free fall
Acceleration_mds2
Gets or sets the acceleration vector in meters per second squared (m/s²). This property automatically converts between mm/s² and m/s².
public Vec3d Acceleration_mds2 { get; set; }
Property Value
Remarks
Conversion factors:
- From mm/s² to m/s²: divide by 1000
- From m/s² to mm/s²: multiply by 1000
Acceleration_mmds2
Gets or sets the acceleration vector in millimeters per second squared (mm/s²). This is the base unit for acceleration storage in the system.
public Vec3d Acceleration_mmds2 { get; set; }
Property Value
Remarks
The acceleration vector components represent:
- X: Acceleration in the X direction (mm/s²)
- Y: Acceleration in the Y direction (mm/s²)
- Z: Acceleration in the Z direction (mm/s²)
AxTag
Gets the column name for X-axis acceleration data in CSV files.
public static string AxTag { get; }
Property Value
AyTag
Gets the column name for Y-axis acceleration data in CSV files.
public static string AyTag { get; }
Property Value
AzTag
Gets the column name for Z-axis acceleration data in CSV files.
public static string AzTag { get; }
Property Value
Force_N
Gets or sets the force vector applied to the workpiece, measured in Newtons (N).
public Vec3d Force_N { get; set; }
Property Value
Remarks
The force vector components represent:
- X: Force in the X direction (N)
- Y: Force in the Y direction (N)
- Z: Force in the Z direction (N)
Positive values typically indicate:
- Forces acting in the positive direction of each axis
- Forces applied to the workpiece (rather than the tool)
FxTags
Gets the possible column names for X-axis force data in CSV files.
public static string[] FxTags { get; }
Property Value
- string[]
FyTags
Gets the possible column names for Y-axis force data in CSV files.
public static string[] FyTags { get; }
Property Value
- string[]
FzTags
Gets the possible column names for Z-axis force data in CSV files.
public static string[] FzTags { get; }
Property Value
- string[]
Moment_Nm
Gets or sets the moment (torque) vector, measured in Newton-meters (N⋅m).
public Vec3d Moment_Nm { get; set; }
Property Value
Remarks
The moment vector components represent:
- X: Moment around the X axis (N⋅m)
- Y: Moment around the Y axis (N⋅m)
- Z: Moment around the Z axis (N⋅m)
Positive values indicate:
- Clockwise moments when looking along the positive axis direction
- Following the right-hand rule convention
MxTags
Gets the possible column names for X-axis moment data in CSV files.
public static string[] MxTags { get; }
Property Value
- string[]
MyTags
Gets the possible column names for Y-axis moment data in CSV files.
public static string[] MyTags { get; }
Property Value
- string[]
MzTags
Gets the possible column names for Z-axis moment data in CSV files.
public static string[] MzTags { get; }
Property Value
- string[]
Time
Gets or sets the time value in seconds.
public TimeSpan Time { get; set; }
Property Value
TimeTags
Gets the possible column names for time data in CSV files.
public static string[] TimeTags { get; }
Property Value
- string[]
Methods
GetAdd(ITimeShot)
Adds another time shot to this one.
public ITimeShot GetAdd(ITimeShot shot)
Parameters
shot
ITimeShotThe time shot to add.
Returns
- ITimeShot
A new time shot representing the sum of the two shots.
Remarks
The addition should:
- Combine vector components appropriately
- Handle null or missing data gracefully
- Preserve the time value according to implementation rules
GetScaled(double)
Scales the values in this time shot by the specified factor.
public ITimeShot GetScaled(double scale)
Parameters
scale
doubleThe scaling factor to apply to all vector components.
Returns
- ITimeShot
A new time shot with all values scaled by the given factor.
Remarks
The scaling should:
- Apply to all vector components
- Handle null or missing data gracefully
- Scale the time value if appropriate for the implementation
ReadRows(string, Action<int>, CancellationToken?)
Reads force and acceleration data from a CSV file.
public static List<ForceAccelShot> ReadRows(string file, Action<int> lineReaded = null, CancellationToken? cancellationToken = null)
Parameters
file
stringThe path to the CSV file to read.
lineReaded
Action<int>Optional callback function to report progress.
cancellationToken
CancellationToken?Optional cancellation token to cancel the operation.
Returns
- List<ForceAccelShot>
A list of ForceAccelShot objects containing the data from the file.
Exceptions
- InvalidDataException
Thrown when the file format is invalid.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(string)
Returns a string representation of the ForceAccelShot instance with the specified format.
public string ToString(string format)
Parameters
format
stringThe format string to use for numeric values.
Returns
- string
A string containing the formatted values.
Operators
operator +(ForceAccelShot, ForceAccelShot)
Adds two ForceAccelShot instances together.
public static ForceAccelShot operator +(ForceAccelShot a, ForceAccelShot b)
Parameters
a
ForceAccelShotThe first ForceAccelShot instance.
b
ForceAccelShotThe second ForceAccelShot instance.
Returns
- ForceAccelShot
A new ForceAccelShot instance containing the sum of the two inputs.
operator *(ForceAccelShot, double)
Multiplies a ForceAccelShot instance by a scalar value.
public static ForceAccelShot operator *(ForceAccelShot a, double s)
Parameters
a
ForceAccelShotThe ForceAccelShot instance to multiply.
s
doubleThe scalar value to multiply by.
Returns
- ForceAccelShot
A new ForceAccelShot instance containing the scaled values.