gengby
2 years ago
10 changed files with 132 additions and 66 deletions
@ -0,0 +1,47 @@ |
|||
package org.nl.acs.common.deviceInfo; |
|||
|
|||
import net.sf.json.JSONObject; |
|||
import org.nl.acs.common.AbstractDriverService; |
|||
import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; |
|||
import org.nl.acs.opc.Device; |
|||
import org.nl.acs.task.service.dto.TaskDto; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author geng by |
|||
* 缓存架 |
|||
*/ |
|||
@Component("standard_conveyor_control") |
|||
public class StandardCoveyorControlDevice extends AbstractDriverService { |
|||
StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver; |
|||
|
|||
@Override |
|||
public JSONObject getDeviceInfo(Device device) { |
|||
standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|||
JSONObject jo = this.getCommonDeviceInfo(standardCoveyorControlDeviceDriver); |
|||
jo.put("is_click", true); |
|||
jo.put("hasGoods", standardCoveyorControlDeviceDriver.getBySignal()); |
|||
jo.put("device_type", "conveyor"); |
|||
return jo; |
|||
} |
|||
|
|||
@Override |
|||
public Boolean createInstCheckStartPoint(Device device, TaskDto taskDto) throws Exception { |
|||
standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public Boolean createInstCheckNextPoint(Device device, TaskDto taskDto) throws Exception { |
|||
standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public void changeDeviceStatus(Device device, JSONObject form) { |
|||
int hasGoodStatus = form.getInt("hasGoodStatus"); |
|||
standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|||
standardCoveyorControlDeviceDriver.setBySignal(hasGoodStatus); |
|||
// this.changeDeviceStatus(standardCoveyorControlDeviceDriver, form, false);
|
|||
} |
|||
} |
@ -1,42 +0,0 @@ |
|||
package org.nl.acs.common.deviceInfo; |
|||
|
|||
import net.sf.json.JSONObject; |
|||
import org.nl.acs.common.AbstractDriverService; |
|||
import org.nl.acs.common.enums.InstEnum; |
|||
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; |
|||
import org.nl.acs.opc.Device; |
|||
import org.nl.acs.task.service.dto.TaskDto; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author geng by |
|||
* 缓存架 |
|||
*/ |
|||
@Component("standard_inspect_site") |
|||
public class StandardInspectSiteDevice extends AbstractDriverService { |
|||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|||
@Override |
|||
public JSONObject getDeviceInfo(Device device) { |
|||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|||
JSONObject jo = this.getCommonDeviceInfo(standardInspectSiteDeviceDriver); |
|||
return jo; |
|||
} |
|||
|
|||
@Override |
|||
public Boolean createInstCheckStartPoint(Device device, TaskDto taskDto) throws Exception { |
|||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|||
return this.checkStartPoint(standardInspectSiteDeviceDriver, taskDto, InstEnum.standard_inspect_site_start.getMode(), InstEnum.standard_inspect_site_start.getMove()); |
|||
} |
|||
|
|||
@Override |
|||
public Boolean createInstCheckNextPoint(Device device, TaskDto taskDto) throws Exception { |
|||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|||
return this.checkNextPoint(standardInspectSiteDeviceDriver, taskDto,InstEnum.standard_inspect_site_next.getMode(), InstEnum.standard_conveyor_line_next.getMove()); |
|||
} |
|||
|
|||
@Override |
|||
public void changeDeviceStatus(Device device, JSONObject form) { |
|||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); |
|||
this.changeDeviceStatus(standardInspectSiteDeviceDriver, form, false); |
|||
} |
|||
} |
Loading…
Reference in new issue