This commit is contained in:
psh
2024-02-23 17:53:24 +08:00
parent 5553983559
commit ad55cf9f6a
6 changed files with 1063 additions and 20 deletions

View File

@@ -29,7 +29,9 @@ public enum DriverTypeEnum {
AUTODOOR(10, "standard_autodoor", "标准版-自动门", "autodoor"),
SSX_SITE(11, "ssx_site", "输送线", "conveyor");
SSX_SITE(11, "ssx_site", "输送线", "conveyor"),
FOLD_DISC_SITE(12, "fold_disc_site", "叠盘机", "station");

View File

@@ -1,10 +1,11 @@
package org.nl.acs.device_driver.basedriver.fold_disc_site;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.DeviceType;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceType;
import org.nl.acs.device_driver.basedriver.ssx_site.ItemProtocol;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
@@ -14,7 +15,7 @@ import java.util.List;
* 晟华叠盘机
*/
@Service
public class FoldDiscSiteDefinition implements OpcDeviceDriverDefinition {
public class FoldDiscSiteDefinition implements OpcDeviceDriverDefination {
@Override
public String getDriverCode() {
return "fold_disc_site";
@@ -32,7 +33,7 @@ public class FoldDiscSiteDefinition implements OpcDeviceDriverDefinition {
@Override
public DeviceDriver getDriverInstance(Device device) {
return (new FoldDiscSiteDeviceDriver()).setDevice(device).setDriverDefinition(this);
return (new FoldDiscSiteDeviceDriver()).setDevice(device).setDriverDefination(this);
}
@Override
@@ -48,16 +49,12 @@ public class FoldDiscSiteDefinition implements OpcDeviceDriverDefinition {
}
@Override
public List<ItemDto> getReadableItemDTOs() {
return getReadableItemDtos2();
}
public static List<ItemDto> getReadableItemDtos2() {
return ItemProtocol.getReadableItemDtos();
public List<ItemDto> getReadableItemDtos() {
return org.nl.acs.device_driver.basedriver.ssx_site.ItemProtocol.getReadableItemDtos();
}
@Override
public List<ItemDto> getWriteableItemDTOs() {
public List<ItemDto> getWriteableItemDtos() {
return ItemProtocol.getWriteableItemDtos();
}

View File

@@ -16,8 +16,13 @@ public class ItemProtocol {
public static String item_move = "move";
public static String item_action = "action";
public static String item_error = "error";
public static String item_tier = "tier";
public static String item_task = "task";
public static String item_weight = "weight";
public static String item_material_type = "material_type";
public static String item_barcode = "barcode";
public static String item_to_command = "to_command";
public static String item_to_target = "to_target";
public static String item_to_task = "to_task";
private SsxSiteDeviceDriver driver;
@@ -45,14 +50,31 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_error);
}
public int getTier() {
return this.getOpcIntegerValue(item_tier);
public int getTask() {
return this.getOpcIntegerValue(item_task);
}
public int getWeight() {
return this.getOpcIntegerValue(item_weight);
}
public int getMaterialType() {
return this.getOpcIntegerValue(item_material_type);
}
public int getBarcode() {
return this.getOpcIntegerValue(item_barcode);
}
public int getToCommand() {
return this.getOpcIntegerValue(item_to_command);
}
public int getToTarget() {
return this.getOpcIntegerValue(item_to_target);
}
public int getToTask() {
return this.getOpcIntegerValue(item_to_task);
}
//是否有货
public int hasGoods(int move) {
@@ -80,14 +102,19 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB600.B3"));
list.add(new ItemDto(item_tier, "层数", "DB600.D4"));
list.add(new ItemDto(item_task, "任务号", "DB600.D4"));
list.add(new ItemDto(item_weight, "重量", "DB600.D4"));
list.add(new ItemDto(item_material_type, "物料类型", "DB600.D4"));
list.add(new ItemDto(item_barcode, "条码", "DB600.D4"));
list.add(new ItemDto(item_error, "报警信号", "DB600.B5"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "作业命", "DB601.W2", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_command, "下发指", "DB2.W0", Boolean.TRUE));
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W2"));
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D4"));
return list;
}