sige 1 year ago
parent
commit
b6cbb8591b
  1. 24
      src/main/java/a8k/base_hardware/A8kCanBusService.java
  2. 27
      src/main/java/a8k/controller/SamplesPreProcessModuleCtrlController.java
  3. 4
      src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java

24
src/main/java/a8k/base_hardware/A8kCanBusService.java

@ -149,49 +149,45 @@ public class A8kCanBusService {
}
//TODO
public A8kPacket callcmd(Integer moduleId, Integer cmdId) throws HardwareException {
return null;
return this.callcmd(moduleId, cmdId, new Integer[]{});
}
//TODO
public A8kPacket callcmd(Integer moduleId, Integer cmdId, Integer p0) throws HardwareException {
return null;
return this.callcmd(moduleId, cmdId, new Integer[]{p0});
}
//TODO
public A8kPacket callcmd(Integer moduleId, Integer cmdId, Integer p0, Integer p1) throws HardwareException {
return null;
return this.callcmd(moduleId, cmdId, new Integer[]{p0, p1});
}
//TODO
public A8kPacket callcmd(Integer moduleId, Integer cmdId, Integer p0, Integer p1, Integer p2) throws HardwareException {
return null;
return this.callcmd(moduleId, cmdId, new Integer[]{p0, p1, p2});
}
//TODO
public A8kPacket callcmd(Integer moduleId, Integer cmdId, Integer p0, Integer p1, Integer p2, Integer p3) throws HardwareException {
return null;
return this.callcmd(moduleId, cmdId, new Integer[]{p0, p1, p2, p3});
}
//TODO
public void callblockcmd(Integer moduleId, Integer cmdId, Integer p0, Integer p1, Integer p2, Integer p3, Integer acitionOvertime) throws HardwareException, InterruptedException {
this.callblockcmd(moduleId, cmdId, new Integer[]{p0,p1,p2,p3}, acitionOvertime);
}
//TODO
public void callblockcmd(Integer moduleId, Integer cmdId, Integer p0, Integer p1, Integer p2, Integer acitionOvertime) throws HardwareException, InterruptedException {
this.callblockcmd(moduleId, cmdId, new Integer[]{p0,p1,p2}, acitionOvertime);
}
//TODO
public void callblockcmd(Integer moduleId, Integer cmdId, Integer p0, Integer p1, Integer acitionOvertime) throws HardwareException, InterruptedException {
this.callblockcmd(moduleId, cmdId, new Integer[]{p0,p1}, acitionOvertime);
}
//TODO
public void callblockcmd(Integer moduleId, Integer cmdId, Integer p0, Integer acitionOvertime) throws HardwareException, InterruptedException {
this.callblockcmd(moduleId, cmdId, new Integer[]{p0}, acitionOvertime);
}
//TODO
public void callblockcmd(Integer moduleId, Integer cmdId, Integer acitionOvertime) throws HardwareException, InterruptedException {
this.callblockcmd(moduleId, cmdId, new Integer[]{}, acitionOvertime);
}
//TODO

27
src/main/java/a8k/controller/SamplesPreProcessModuleCtrlController.java

@ -0,0 +1,27 @@
package a8k.controller;
import a8k.service.hardware.SamplesPreProcessModuleCtrlService;
import com.iflytop.uf.controller.UfApiControllerBase;
import com.iflytop.uf.controller.UfApiResponse;
import com.iflytop.uf.util.UfClassHelper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
@Controller
public class SamplesPreProcessModuleCtrlController extends UfApiControllerBase {
@Resource
private SamplesPreProcessModuleCtrlService samplesPreProcessModuleCtrlService;
@PostMapping("/api/sample-pre-process-module-ctrl/execute-service-method")
@ResponseBody
public UfApiResponse executeServiceMethod( @RequestBody Map<String,Object> params ) throws NoSuchMethodException {
Object service = this.samplesPreProcessModuleCtrlService;
String methodName = (String)params.get("method");
List<Object> methodArgs = (List<Object>)params.get("params");
Object result = UfClassHelper.invokeMethod(service, methodName, methodArgs);
return this.success(result);
}
}

4
src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java

@ -362,14 +362,14 @@ public class SamplesPreProcessModuleCtrlService {
*/
public void openAerosolFan() throws HardwareException {
var params = this.samplesPreProcessModuleCtrlParamsService;
this.a8kCanBusService.callcmd(ModuleId.MotorTubeRackMoveModule, CmdId.kstep_motor_easy_move_to_zero, params.getAerosolFanLevel());
this.a8kCanBusService.callcmd(ModuleId.WbTubeFanModule, CmdId.kfan_controler_set_speed, params.getAerosolFanLevel());
}
/**
* 关闭气溶胶风扇
*/
public void closeAerosolFan() throws HardwareException {
this.a8kCanBusService.callcmd(ModuleId.MotorTubeRackMoveModule, CmdId.kstep_motor_easy_move_to_zero, 0);
this.a8kCanBusService.callcmd(ModuleId.WbTubeFanModule, CmdId.kfan_controler_set_speed, 0);
}
/**

Loading…
Cancel
Save