石墨消解仪后端服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

3 months ago
  1. package com.iflytop.gd.hardware.constants;
  2. import com.iflytop.gd.hardware.type.Servo.MiniServoMId;
  3. import org.springframework.util.Assert;
  4. import java.util.Map;
  5. public class MiniServoConstant {
  6. static public final Integer actionOvertime = 20000;
  7. static class MiniServoFixPosConfig {
  8. public Integer zeroPos;
  9. public Integer refPos;
  10. }
  11. static Map<MiniServoMId, MiniServoFixPosConfig> map = Map.of(
  12. // //摇匀模组Y轴
  13. // MiniServoMId.ShakeModGripperYSV, new MiniServoFixPosConfig() {{
  14. // zeroPos = 110;
  15. // refPos = 100;//Y轴最外侧的位置
  16. // }},
  17. // //摇匀模组夹爪
  18. // MiniServoMId.ShakeModGripperSV, new MiniServoFixPosConfig() {{
  19. // zeroPos = 1600;
  20. // refPos = 1800;//完全张开的位置
  21. // }},
  22. // //试管架夹紧
  23. // MiniServoMId.ShakeModTubeScanerClampingSV, new MiniServoFixPosConfig() {{
  24. // zeroPos = 1800;
  25. // refPos = 1800;//水平位置
  26. // }},
  27. // //试管顶升舵机
  28. // MiniServoMId.ShakeModLiftingSV, new MiniServoFixPosConfig() {{
  29. // zeroPos = 644;//底部 644/3000 = 220/1024
  30. // refPos = 644;//底部
  31. // }}
  32. );
  33. static public Integer getZeroPos(MiniServoMId mid) {
  34. var config = map.get(mid);
  35. Assert.notNull(config, "getZeroPos fail");
  36. return config.zeroPos;
  37. }
  38. static public Integer getRefPos(MiniServoMId mid) {
  39. var config = map.get(mid);
  40. Assert.notNull(config, "getRefPos fail");
  41. return config.refPos;
  42. }
  43. }