This commit is contained in:
张江玮
2023-02-08 19:30:11 +08:00
parent 5f8de1a5a3
commit 9ff71aa996
7 changed files with 62 additions and 35 deletions

View File

@@ -96,9 +96,9 @@ public class ItemProtocol {
public static List<ItemDto> getWriteableItemDtos() { public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "作业命令", "DB601.W2", Boolean.valueOf(true))); list.add(new ItemDto(item_to_command, "作业命令", "DB.W0", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_target, "目标站", "DB601.W4")); list.add(new ItemDto(item_to_target, "目标站", "DB.W2"));
list.add(new ItemDto(item_to_task, "任务号", "DB601.D8")); list.add(new ItemDto(item_to_task, "任务号", "DB.D4"));
return list; return list;
} }

View File

@@ -57,11 +57,11 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination
public static List<ItemDto> getReadableItemDtos2() { public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList(); List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", true)); list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB.B1", true));
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B2")); list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB.B2"));
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B6")); list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB.B3"));
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D8")); list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB.D4"));
return list; return list;
} }

View File

@@ -111,10 +111,10 @@ public class ItemProtocol {
public static List<ItemDto> getWriteableItemDtos() { public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "作业命令", "DB33.W2", Boolean.valueOf(true))); list.add(new ItemDto(item_to_command, "作业命令", "DB.W0", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_target, "目标站", "DB33.W4")); list.add(new ItemDto(item_to_target, "目标站", "DB.W2"));
list.add(new ItemDto(item_to_task, "任务号", "DB33.D8")); list.add(new ItemDto(item_to_task, "任务号", "DB.D4"));
list.add(new ItemDto(item_to_barcode, "条码", "DB33.S12")); list.add(new ItemDto(item_to_barcode, "条码", "DB.W8"));
return list; return list;
} }

View File

@@ -57,12 +57,12 @@ public class LnshLaminatingMachineDefination implements OpcDeviceDriverDefinatio
public static List<ItemDto> getReadableItemDtos2() { public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList(); List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB32.B0")); list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB32.B1", true)); list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB.B1", true));
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB32.B2")); list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB.B2"));
list.add(new ItemDto(ItemProtocol.item_container_type, "托盘类型", "DB32.B6")); list.add(new ItemDto(ItemProtocol.item_container_type, "托盘类型", "DB.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB32.B7")); list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB.B4"));
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB32.D8")); list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB.D5"));
return list; return list;
} }

View File

@@ -360,17 +360,20 @@ export default {
return return
} }
for (const val in this.data1) { for (const val in this.data1) {
if (this.data1[val].code.indexOf('heartbeat') !== -1) {
this.data1[val].db = beforeStr + '.B0'
}
if (this.data1[val].code.indexOf('move') !== -1) { if (this.data1[val].code.indexOf('move') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1) this.data1[val].db = beforeStr + '.B2'
} }
if (this.data1[val].code.indexOf('container_type') !== -1) { if (this.data1[val].code.indexOf('container_type') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) this.data1[val].db = beforeStr + '.B3'
} }
if (this.data1[val].code.indexOf('error') !== -1) { if (this.data1[val].code.indexOf('error') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 3) this.data1[val].db = beforeStr + '.B4'
} }
if (this.data1[val].code.indexOf('task') !== -1) { if (this.data1[val].code.indexOf('task') !== -1) {
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 4) this.data1[val].db = beforeStr + '.D5'
} }
} }
} }
@@ -391,13 +394,13 @@ export default {
} }
for (const val in this.data2) { for (const val in this.data2) {
if (this.data2[val].code.indexOf('to_target') !== -1) { if (this.data2[val].code.indexOf('to_target') !== -1) {
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) this.data2[val].db = beforeStr + '.W2'
} }
if (this.data2[val].code.indexOf('to_task') !== -1) { if (this.data2[val].code.indexOf('to_task') !== -1) {
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 4) this.data2[val].db = beforeStr + '.D4'
} }
if (this.data2[val].code.indexOf('to_barcode') !== -1) { if (this.data2[val].code.indexOf('to_barcode') !== -1) {
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 8) this.data2[val].db = beforeStr + '.W8'
} }
} }
} }

View File

@@ -360,6 +360,9 @@ export default {
return return
} }
for (const val in this.data1) { for (const val in this.data1) {
if (this.data1[val].code.indexOf('heartbeat') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) - 1)
}
if (this.data1[val].code.indexOf('status') !== -1) { if (this.data1[val].code.indexOf('status') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1) this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1)
} }
@@ -414,17 +417,35 @@ export default {
return return
} }
for (const val in this.data2) { for (const val in this.data2) {
if (this.data2[val].code.indexOf('to_command') !== -1) {
this.data2[val].db = beforeStr + '.W0'
}
if (this.data2[val].code.indexOf('to_error') !== -1) { if (this.data2[val].code.indexOf('to_error') !== -1) {
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) this.data2[val].db = beforeStr + '.W2'
} }
if (this.data2[val].code.indexOf('to_order_No') !== -1) { if (this.data2[val].code.indexOf('to_order_No') !== -1) {
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 4) + '.50' this.data2[val].db = beforeStr + '.STRING4.50'
} }
if (this.data2[val].code.indexOf('to_weight') !== -1) { if (this.data2[val].code.indexOf('to_qty') !== -1) {
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 54) this.data2[val].db = beforeStr + '.D54'
} }
if (this.data2[val].code.indexOf('to_material_code') !== -1) { if (this.data2[val].code.indexOf('to_material_code') !== -1) {
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 58) + '.50' this.data2[val].db = beforeStr + '.STRING58.50'
}
if (this.data2[val].code.indexOf('to_product_code') !== -1) {
this.data2[val].db = beforeStr + '.W108'
}
if (this.data2[val].code.indexOf('to_AlongSide') !== -1) {
this.data2[val].db = beforeStr + '.W110'
}
if (this.data2[val].code.indexOf('to_BshortSide') !== -1) {
this.data2[val].db = beforeStr + '.W112'
}
if (this.data2[val].code.indexOf('to_Htrapezoidal') !== -1) {
this.data2[val].db = beforeStr + '.W114'
}
if (this.data2[val].code.indexOf('to_Wthickness') !== -1) {
this.data2[val].db = beforeStr + '.W116'
} }
} }
} }

View File

@@ -359,14 +359,17 @@ export default {
return return
} }
for (const val in this.data1) { for (const val in this.data1) {
if (this.data1[val].code.indexOf('heartbeat') !== -1) {
this.data1[val].db = beforeStr + '.B0'
}
if (this.data1[val].code.indexOf('move') !== -1) { if (this.data1[val].code.indexOf('move') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1) this.data1[val].db = beforeStr + '.B2'
} }
if (this.data1[val].code.indexOf('error') !== -1) { if (this.data1[val].code.indexOf('error') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5) this.data1[val].db = beforeStr + '.B3'
} }
if (this.data1[val].code.indexOf('task') !== -1) { if (this.data1[val].code.indexOf('task') !== -1) {
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7) this.data1[val].db = beforeStr + '.D4'
} }
} }
} }
@@ -387,10 +390,10 @@ export default {
} }
for (const val in this.data2) { for (const val in this.data2) {
if (this.data2[val].code.indexOf('to_target') !== -1) { if (this.data2[val].code.indexOf('to_target') !== -1) {
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) this.data2[val].db = beforeStr + '.W2'
} }
if (this.data2[val].code.indexOf('to_task') !== -1) { if (this.data2[val].code.indexOf('to_task') !== -1) {
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6) this.data2[val].db = beforeStr + '.D4'
} }
} }
} }