Browse Source

update

tags/v0
zhaohe 10 months ago
parent
commit
8ce42d3b05
  1. 3
      src/main/java/a8k/hardware/A8kCanBusService.java
  2. 3
      src/main/java/a8k/service/appdevicectrl/scheduler/MainFlowCtrlScheduler.java
  3. 3
      src/main/java/a8k/type/exception/AppException.java

3
src/main/java/a8k/hardware/A8kCanBusService.java

@ -739,17 +739,14 @@ public class A8kCanBusService {
receipt = receiptQueue.poll(overtime, TimeUnit.MILLISECONDS); receipt = receiptQueue.poll(overtime, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) { } catch (InterruptedException e) {
isWaitingReceipt = false; isWaitingReceipt = false;
// throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId()))); throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId())));
} }
isWaitingReceipt = false; isWaitingReceipt = false;
if (receipt == null) { if (receipt == null) {
// throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId()))); throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId())));
} }
if (receipt.getPacketType() == A8kPacket.PACKET_TYPE_ERROR_ACK) { if (receipt.getPacketType() == A8kPacket.PACKET_TYPE_ERROR_ACK) {
// throw new AppException(MId.valueOf(pack.getModuleId()), (receipt.getContentI32(0)));
throw AppException.of(new HardwareError(A8kEcode.fromInt(receipt.getContentI32(0)), throw AppException.of(new HardwareError(A8kEcode.fromInt(receipt.getContentI32(0)),
MId.valueOf(pack.getModuleId()), MId.valueOf(pack.getModuleId()),
CmdId.valueOf(pack.getCmdId()))); CmdId.valueOf(pack.getCmdId())));

3
src/main/java/a8k/service/appdevicectrl/scheduler/MainFlowCtrlScheduler.java

@ -122,11 +122,10 @@ public class MainFlowCtrlScheduler {
dowhatList.add(action); dowhatList.add(action);
} }
} }
} }
return dowhatList; return dowhatList;
} catch (Exception e) { } catch (Exception e) {
logger.info("guessWhatToDo error:{}", e.getMessage());
logger.info("guessWhatToDo error:{}", e.toString());
appResourceMgrService.releaseAllResource(this); appResourceMgrService.releaseAllResource(this);
} }
return new ArrayList<>(); return new ArrayList<>();

3
src/main/java/a8k/type/exception/AppException.java

@ -12,9 +12,6 @@ public class AppException extends Exception {
// 构造函数 // 构造函数
public AppError error; public AppError error;
public AppException() {
super();
}
public AppException(A8kEcode ecodeType) { public AppException(A8kEcode ecodeType) {
super(String.format("Error code %s", ecodeType)); super(String.format("Error code %s", ecodeType));

Loading…
Cancel
Save