using RSI.RapidCode.dotNET;
using NUnit.Framework;
using System;
using System.Linq;
#if DOXYGEN
#endif
[TestFixture]
[Category("Software")]
public class motionStreaming : SampleAppTestBase
{
[Test]
public void PTmotion()
{
int points = 3;
int emptyCount = 2;
double[] positions = { 1.0, 0.5, 0.75 };
double[] times = { 0.2, 0.3, 0.1 };
positions,
times,
points,
emptyCount,
false,
true);
Assert.That(axis.
CommandPositionGet(), Is.EqualTo(positions.Last()),
"The command position should be equal to last position in the array");
}
[Test, Timeout(Constants.MAX_TEST_TIME)]
public void PVTmotion()
{
int points = 3;
int emptyCount = 2;
double[] positions = { 1.0, 0.5, 0.75 };
double[] velocities = { 12.0, 10.0, 6.0 };
double[] times = { 0.1, 0.2, 0.1 };
velocities,
times,
points,
emptyCount,
false,
true);
Assert.That(axis.
CommandPositionGet(), Is.EqualTo(positions.Last()),
"The command position should be equal to last position in the array");
}
[Test, Timeout(Constants.MAX_TEST_TIME)]
public void PVAJTmotion()
{
int points = 3;
int emptyCount = 2;
double[] positions = { 1.0, 0.5, 0.75 };
double[] velocities = { 10.0, 20.0, 40.0 };
double[] accelerations = { 4, 4, 4 };
double[] jerks = { 50, 50, 50 };
double[] times = { 0.4, 0.2, 0.1 };
velocities,
accelerations,
jerks,
times,
points,
emptyCount,
false,
true);
Assert.That(axis.
CommandPositionGet(), Is.EqualTo(positions.Last()),
"The command position should be equal to last position in the array");
}
[Test, Timeout(Constants.MAX_TEST_TIME)]
public void PTmotionWhileStopping()
{
const int points = 3;
const int emptyCount = 2;
double[] first = { 0.1, 0.2, 0.3 };
double[] second = { 0.4, 0.5, 0.6 };
double[] third = { 0.7, 0.8, 0.9 };
double[] time1 = { 0.3, 0.3, 0.3 };
double[] time2 = { 0.2, 0.2, 0.2 };
double[] time3 = { 0.25, 0.25, 0.25 };
}
}
double CommandPositionGet()
Get the current command position.
int32_t MotionDoneWait()
Waits for a move to complete.
void Resume()
Resume an axis.
void MovePVT(const double *const position, const double *const velocity, const double *const time, int32_t pointCount, int32_t emptyCount, bool retain, bool final)
Move commanded by list of positions, velocities, and times.
void MovePT(RSIMotionType type, const double *const position, const double *const time, int32_t pointCount, int32_t emptyCount, bool retain, bool final)
A move commanded by a list of position and time points.
void MovePVAJT(const double *const position, const double *const velocity, const double *const acceleration, const double *const jerk, const double *const time, int32_t pointCount, int32_t emptyCount, bool retain, bool final)
RSIMotionType
PT and PVT streaming motion types.