diff --git a/src/main/java/com/iflytop/sgs/app/service/device/module/TransferModuleService.java b/src/main/java/com/iflytop/sgs/app/service/device/module/TransferModuleService.java index 36ee781..b0ed1f8 100644 --- a/src/main/java/com/iflytop/sgs/app/service/device/module/TransferModuleService.java +++ b/src/main/java/com/iflytop/sgs/app/service/device/module/TransferModuleService.java @@ -1,6 +1,7 @@ package com.iflytop.sgs.app.service.device.module; import com.iflytop.sgs.app.model.bo.Point3D; +import com.iflytop.sgs.app.service.api.SystemConfigService; import com.iflytop.sgs.app.service.device.DeviceCommandService; import com.iflytop.sgs.app.service.device.DeviceStateService; import com.iflytop.sgs.app.ws.server.WebSocketSender; @@ -8,6 +9,7 @@ import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandGenerator; import com.iflytop.sgs.common.enums.CraftsTransferTypeCode; +import com.iflytop.sgs.common.enums.SystemConfigCode; import com.iflytop.sgs.common.utils.CommandUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -27,6 +29,7 @@ import java.util.concurrent.locks.ReentrantLock; public class TransferModuleService { private final DeviceCommandService deviceCommandService; private final DeviceStateService deviceStateService; + private final SystemConfigService systemConfigService; private final BlockingQueue solutionQueue = new ArrayBlockingQueue<>(10); private final BlockingQueue annealQueue = new ArrayBlockingQueue<>(10); private final BlockingQueue heatQueue = new ArrayBlockingQueue<>(10); @@ -254,9 +257,26 @@ public class TransferModuleService { * 转运机械臂X轴相对移动到指定点 */ public void transferXMoveBy(String cmdId, String cmdCode, double position) throws Exception { + Double lowSpeed = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.z_move_in_low_speed);//进入卡槽的速度 + Double normalSpeed = systemConfigService.getSystemConfigDoubleByCode(SystemConfigCode.z_move_in_normal_speed);//正常的速度 + if (lowSpeed == null) { + lowSpeed = 30.0; + } + if (normalSpeed == null) { + lowSpeed = 100.0; + } + DeviceCommandBundle deviceLowSpeedSetCommand = DeviceCommandGenerator.transferZSet(lowSpeed); + CommandFuture deviceSetLowSpeedCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceLowSpeedSetCommand); + CommandUtil.wait(deviceSetLowSpeedCommandFuture); + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferXMoveBy(position); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); CommandUtil.wait(deviceCommandFuture); + + DeviceCommandBundle deviceNormalSpeedSetCommand = DeviceCommandGenerator.transferZSet(normalSpeed); + CommandFuture deviceNormalSpeedSetCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceNormalSpeedSetCommand); + CommandUtil.wait(deviceNormalSpeedSetCommandFuture); + } /** diff --git a/src/main/java/com/iflytop/sgs/common/enums/SystemConfigCode.java b/src/main/java/com/iflytop/sgs/common/enums/SystemConfigCode.java index c61eae1..42d2efc 100644 --- a/src/main/java/com/iflytop/sgs/common/enums/SystemConfigCode.java +++ b/src/main/java/com/iflytop/sgs/common/enums/SystemConfigCode.java @@ -21,6 +21,8 @@ public enum SystemConfigCode { fan_stop_temperature("风扇关闭的温度设置"), pre_fill_when_open_service("开机是否预充 默认true"), pre_fill_distance_when_open_service("开机预充距离 最小3"), + z_move_in_low_speed("z轴进入卡槽的速度 标准30 最大100"), + z_move_in_normal_speed("z轴正常移动速度 标准100"), ; private final String description; diff --git a/src/main/resources/sql/init.sql b/src/main/resources/sql/init.sql index 1da3d76..5ebaf0e 100644 --- a/src/main/resources/sql/init.sql +++ b/src/main/resources/sql/init.sql @@ -46,20 +46,22 @@ CREATE TABLE IF NOT EXISTS system_config create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (1, '水加液系数', 'water', '2', '2025-06-07 10:58:06.000', '2025-06-07 10:58:07.000'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (2, '浓硝酸加液系数', 'thick', '2', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (3, '稀硝酸加液系数', 'thin', '2', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (4, '回吸放滴落距离', 'back_flow_distance', '0.2', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (5, '过量预充距离', 'pre_fill_distance', '20', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (6, '过量排空距离', 'drain_distance', '20', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (7, '过量抽液距离', 'number_reduce', '10', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (8, '允许的最大清洁次数', 'cycle_clean_max', '8', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (1, '水加液系数', 'water', '2.0', '2025-06-07 10:58:06.000', '2025-06-07 10:58:07.000'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (2, '浓硝酸加液系数', 'thick', '2.0', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (3, '稀硝酸加液系数', 'thin', '2.0', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (4, '回吸放滴落距离', 'back_flow_distance', '0.1', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (5, '过量预充距离', 'pre_fill_distance', '17.0', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (6, '过量排空距离', 'drain_distance', '17.0', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (7, '过量抽液距离', 'number_reduce', '7.0', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (8, '允许的最大清洁次数', 'cycle_clean_max', '5', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (9, '蠕动泵最大转速限制', 'liquid_max_speed', '150', '2025-05-28 13:30:45', '2025-05-28 13:30:45'); INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (10, '忽略门自检', 'door_origin_is_ignore', 'true', '2025-05-29T14:23:48', '2025-05-29T14:23:48'); INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (11, '工艺结束蜂鸣器次数', 'crafts_end_beep_times', '3', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000'); INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (12, '风扇关闭的温度设置', 'fan_stop_temperature', '110.0', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000'); INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (13, '开机是否预充', 'pre_fill_when_open_service', 'true', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000'); -INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (14, '开机预充距离', 'pre_fill_distance_when_open_service', '40.0', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (14, '开机预充距离', 'pre_fill_distance_when_open_service', '3.0', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (15, 'z轴进入卡槽的速度 标准50 最大100', 'z_move_in_low_speed', '30.0', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000'); +INSERT OR IGNORE INTO system_config ("id", "name", "code", "value", "create_time", "update_time") VALUES (16, 'z轴正常移动速度 标准100', 'z_move_in_normal_speed', '100.0', '2025-06-04 19:06:55.000', '2025-06-04 19:06:56.000');