public void LinearAxis_Linear_builtOK() { uint offset = 155; uint countsPerRev = 3200; LinearAxis la = new LinearAxis(1, "test1", "plcX", countsPerRev, offset); double positionInch = la.PositionInch(3200); Assert.AreEqual(offset, la.EncoderOffset); Assert.AreEqual(countsPerRev, la.EncoderCtsPerRev); Assert.AreEqual(AxisTypeEnum.Linear, la.Type); }
public void LinearAxis_Linear_ReturnsPosition() { uint offset = 155; uint countsPerRev = 3200; LinearAxis la = new LinearAxis(1, "test1", "plcX", countsPerRev, offset); double Poscounts = 3200; double positionInch = la.PositionInch(Poscounts); double positionChk = (Poscounts - offset) / countsPerRev; double positionCts = la.PositionCounts(positionInch); Assert.AreEqual(positionChk, positionInch, " inch pos"); Assert.AreEqual(3200, positionCts); }