| | |
| | | private static final Logger log = LoggerFactory.getLogger(DeviceStatusDataHandler.class); |
| | | @Autowired |
| | | private WorkstationCache workstationCache; |
| | | //@Autowired |
| | | //private IotDBSessionConfig iotdbCfg; |
| | | //@Autowired |
| | | //private IotDBCommonService iotDBCommonService; |
| | | |
| | | @Autowired |
| | | private DeviceStateService deviceStateService; |
| | | @Override |
| | |
| | | state.setShiftTimeType(data.getShiftTimeType()); |
| | | fillWorkStationCondition(data, state); |
| | | |
| | | //insertState(state); |
| | | deviceStateService.saveDeviceStates(Arrays.asList(state)); |
| | | |
| | | log.info("设备状态保存完成"); |
| | |
| | | } |
| | | |
| | | int translateStatus(String statusVal) { |
| | | |
| | | int oriStatus = Integer.valueOf(statusVal); |
| | | |
| | | int result = oriStatus; |
| | | /* |
| | | //西门子828d, cnc_run_status: 运行状态(0:RESET,1:STOP,2:HOLD,3:START,4:SPENDLE_CW_CCW,5:OTHER) |
| | | switch(oriStatus) { |
| | | case 3://START |
| | |
| | | log.info("statusconvert,ori={},result={}",oriStatus,result); |
| | | if(result == 0) { |
| | | result = 2;// |
| | | } |
| | | }*/ |
| | | return result; |
| | | } |
| | | } |