Skip to content
Snippets Groups Projects
Select Git revision
  • f20554307992e2e69f78ac812e16a03cdcb53b11
  • dev default protected
  • main protected
  • feature/better-placeholders
  • 0.3.0
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.1
  • 0.2
  • 0.1
11 results

Inheritance.relast

Blame
  • 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();
    :}