Select Git revision
Inheritance.relast
Test.connect 1.24 KiB
/* Version 2020-07-15 */
// --- update definitions ---
receive Link.CurrentPosition using ParseRobotState, RobotStateToIntPosition ;
send RobotArm.AppropriateSpeed using CreateSpeedMessage, SerializeRobotConfig ;
// --- dependency definitions ---
RobotArm.AppropriateSpeed canDependOn Link.CurrentPosition as dependency1 ;
// --- mapping definitions ---
ParseRobotState maps byte[] bytes to robot.RobotStateOuterClass.RobotState {:
TestCounter.INSTANCE.numberParseLinkState += 1;
return robot.RobotStateOuterClass.RobotState.parseFrom(bytes);
:}
SerializeRobotConfig maps config.Config.RobotConfig rc to byte[] {:
TestCounter.INSTANCE.numberSerializeRobotConfig += 1;
return rc.toByteArray();
:}
RobotStateToIntPosition maps robot.RobotStateOuterClass.RobotState rs to IntPosition {:
TestCounter.INSTANCE.numberLinkStateToIntPosition += 1;
robot.RobotStateOuterClass.RobotState.Position p = rs.getPosition();
return IntPosition.of((int) (Math.round(p.getX() * 10)), (int) (Math.round(p.getY() * 10)), (int) (Math.round(p.getZ() * 10)));
:}
CreateSpeedMessage maps double speed to config.Config.RobotConfig {:
TestCounter.INSTANCE.numberCreateSpeedMessage += 1;
return config.Config.RobotConfig.newBuilder()
.setSpeed(speed)
.build();
:}