This commit is contained in:
USER-20220102CG\noblelift
2022-10-12 21:24:24 +08:00
parent 3fee17cbe7
commit 5fbe677065
2 changed files with 7 additions and 29 deletions

View File

@@ -52,35 +52,9 @@ public class WhxrWeighingDefination implements OpcDeviceDriverDefination {
@Override
public List<ItemDto> getReadableItemDtos() {
return getReadableItemDtos2();
return ItemProtocol.getReadableItemDtos();
}
public static List<ItemDto> getReadableItemDtos2() {
List<ItemDto> list = new ArrayList();
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true)));
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B4"));
list.add(new ItemDto(ItemProtocol.item_status, "状态", "DB600.B5"));
list.add(new ItemDto(ItemProtocol.item_isstop, "是否暂停", "DB600.B6"));
list.add(new ItemDto(ItemProtocol.item_all_weight, "当前总重量", "DB600.REAL8"));
list.add(new ItemDto(ItemProtocol.item_abarrel_weighing, "单桶称重重量", "DB600.REAL12"));
list.add(new ItemDto(ItemProtocol.item_amaterial_weight, "单次物料重量", "DB600.REAL16"));
list.add(new ItemDto(ItemProtocol.item_last_abarrel_weighing, "上次单桶称重量", "DB600.REAL20"));
list.add(new ItemDto(ItemProtocol.item_last_amaterial_weight, "上次物料重量", "DB600.REAL24"));
list.add(new ItemDto(ItemProtocol.item_formula_code, "配方编码", "DB600.S28"));
list.add(new ItemDto(ItemProtocol.item_material_code, "当前配粉物料编码", "DB600.S284"));
list.add(new ItemDto(ItemProtocol.item_bucketunique, "桶号", "DB600.S540"));
list.add(new ItemDto(ItemProtocol.item_needout_qty, "当前桶需出重量", "DB600.REAL796"));
list.add(new ItemDto(ItemProtocol.item_formula_qty, "当前配粉物料所需重量", "DB600.REAL800"));
list.add(new ItemDto(ItemProtocol.item_masterbucket_qty, "当前配方总重量", "DB600.REAL804"));
list.add(new ItemDto(ItemProtocol.item_small_scale_error, "小秤误差值", "DB600.REAL808"));
list.add(new ItemDto(ItemProtocol.item_middle_scale_error, "中秤误差值", "DB600.REAL812"));
list.add(new ItemDto(ItemProtocol.item_big_scale_error, "大秤误差值", "DB600.REAL816"));
list.add(new ItemDto(ItemProtocol.item_formuladtl_id, "配方明细标识", "DB600.S820"));
list.add(new ItemDto(ItemProtocol.item_small_scale_weight, "小称当前重量", "DB600.REAL1076"));
return list;
}
@Override
public List<ItemDto> getWriteableItemDtos() {

View File

@@ -126,6 +126,7 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
masterbucket_qty = this.itemProtocol.getMasterbucket_qty();
needout_qty = this.itemProtocol.getNeedout_qty();
formula_qty = this.itemProtocol.getFormula_qty();
small_scale_weight = this.itemProtocol.getSmall_scale_weight();
last_abarrel_weighing = this.itemProtocol.getLast_abarrel_weighing();
last_amaterial_weight = this.itemProtocol.getLast_amaterial_weight();
@@ -286,7 +287,8 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
json.put("formuladtl_id", formuladtl_id);
json.put("bucketunique", bucketunique);
json.put("masterbucket_qty", masterbucket_qty);
json.put("all_weight", all_weight);
json.put("all_weight", all_weight+small_scale_weight);
json.put("small_scale_weight", small_scale_weight);
json.put("error", String.valueOf(error));
enter(json);
}
@@ -305,7 +307,8 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
json.put("formuladtl_id", formuladtl_id);
json.put("bucketunique", bucketunique);
json.put("masterbucket_qty", masterbucket_qty);
json.put("all_weight", all_weight);
json.put("all_weight", all_weight+small_scale_weight);
json.put("small_scale_weight", small_scale_weight);
json.put("error", "0");
enter(json);
}
@@ -397,4 +400,5 @@ public class WhxrWeighingDeviceDriver extends AbstractOpcDeviceDriver implements
}
return flag;
}
}