|
@ -19,20 +19,9 @@ import org.springframework.stereotype.Component; |
|
|
@Component |
|
|
@Component |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
|
@CommandMapping("debug_cover_elevator_lift_down") |
|
|
@CommandMapping("debug_cover_elevator_lift_down") |
|
|
public class CoverElevatorLiftDownCommandHandler implements CommandHandler { |
|
|
|
|
|
private final WebSocketService webSocketService; |
|
|
|
|
|
private final StepMotor stepMotor; |
|
|
|
|
|
|
|
|
public class CoverElevatorLiftDownCommandHandler extends BaseCommandHandler { |
|
|
@Override |
|
|
@Override |
|
|
public void handle(CmdDTO cmdDTO) { |
|
|
public void handle(CmdDTO cmdDTO) { |
|
|
webSocketService.pushNotification(Notification.infoHandleStartNotification(cmdDTO)); |
|
|
|
|
|
try { |
|
|
|
|
|
Integer velocity = cmdDTO.getIntegerParam("velocity"); |
|
|
|
|
|
String velocityUnitStr = cmdDTO.getStringParam("velocityUnit"); |
|
|
|
|
|
VelocityUnit velocityUnit = VelocityUnit.toVelocityUnit(velocityUnitStr); |
|
|
|
|
|
stepMotor.setDefaultVelocity(velocityUnit.toMM_PER_SEC(velocity)); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
webSocketService.pushNotification(Notification.errorNotification(cmdDTO, e)); |
|
|
|
|
|
} |
|
|
|
|
|
webSocketService.pushNotification(Notification.infoHandleEndNotification(cmdDTO)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |