3 changed files with 61 additions and 7 deletions
-
39src/main/java/com/iflytop/colortitration/app/command/control/StopAllMotorCommand.java
-
6src/main/java/com/iflytop/colortitration/app/controller/PositionController.java
-
23src/main/java/com/iflytop/colortitration/app/service/module/TransferModuleService.java
@ -0,0 +1,39 @@ |
|||||
|
package com.iflytop.colortitration.app.command.control; |
||||
|
|
||||
|
import com.iflytop.colortitration.app.common.annotation.CommandMapping; |
||||
|
import com.iflytop.colortitration.app.common.enums.MultipleModuleCode; |
||||
|
import com.iflytop.colortitration.app.core.command.BaseCommandHandler; |
||||
|
import com.iflytop.colortitration.app.model.dto.CommandDTO; |
||||
|
import com.iflytop.colortitration.app.service.module.TitrationModuleService; |
||||
|
import com.iflytop.colortitration.app.service.module.TransferModuleService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 停止所有电机 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("stop_all_motor") |
||||
|
public class StopAllMotorCommand extends BaseCommandHandler { |
||||
|
private final TitrationModuleService titrationModuleService; |
||||
|
private final TransferModuleService transferModuleService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(CommandDTO commandDTO) { |
||||
|
|
||||
|
return runAsync(() -> { |
||||
|
//停止转运电机 |
||||
|
transferModuleService.stopAllMotor(); |
||||
|
//停止摇匀电机 |
||||
|
titrationModuleService.shakeStop(MultipleModuleCode.MODULE_1); |
||||
|
titrationModuleService.shakeStop(MultipleModuleCode.MODULE_2); |
||||
|
//停止所有的泵 todo |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue