3 changed files with 92 additions and 11 deletions
-
2src/main/java/a8k/appbean/HardwareException.java
-
70src/main/java/a8k/base_hardware/A8kCanBusService.java
-
31src/main/java/a8k/controller/TmpTestController.java
@ -0,0 +1,31 @@ |
|||
package a8k.controller; |
|||
import a8k.a8k_can_protocol.CmdId; |
|||
import a8k.a8k_can_protocol.ModuleId; |
|||
import a8k.appbean.HardwareException; |
|||
import a8k.base_hardware.A8kCanBusService; |
|||
import jakarta.annotation.Resource; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
@Controller |
|||
public class TmpTestController { |
|||
@Resource |
|||
private A8kCanBusService a8kCanBusService; |
|||
|
|||
@GetMapping("/tmp-test/a8k-can-bus-service-call") |
|||
@ResponseBody |
|||
public String a8kCanBusServiceCall() throws HardwareException { |
|||
this.a8kCanBusService.callcmd( |
|||
ModuleId.ServoTubeRackTubeRotateId, |
|||
CmdId.kmini_servo_enable, |
|||
new Integer[]{1} |
|||
); |
|||
this.a8kCanBusService.callblockcmd( |
|||
ModuleId.MotorTubeRackFeedId, |
|||
CmdId.kstep_motor_easy_move_by, |
|||
new Integer[]{5000}, |
|||
20000 |
|||
); |
|||
return "OK"; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue