| | |
| | | |
| | | public RgvModeType modeType; |
| | | |
| | | private transient Long loadingStartTime; |
| | | |
| | | /** |
| | | * 执行优先级 |
| | | * 0:不判断 |
| | | * 1:工位1先执行 |
| | | * 2:工位2先执行 |
| | | */ |
| | | public Short wrkTaskPri; |
| | | |
| | | public Short wrkTaskMove1; |
| | | |
| | | public Short wrkTaskMove2; |
| | | |
| | | |
| | | /** |
| | | * RGV当前状态工位1 |
| | | * 0:空闲,无任务 |
| | |
| | | * 工位1任务号 |
| | | */ |
| | | public Integer taskNo1 = 0; |
| | | /** |
| | | * 工位1目标站 |
| | | */ |
| | | public Integer staNo1 = 0; |
| | | |
| | | /** |
| | | * RGV工位1当前状态 |
| | |
| | | public Short walkPos; |
| | | |
| | | /** |
| | | * 急停 |
| | | * 急停触发 |
| | | */ |
| | | public Boolean err1; |
| | | |
| | | /** |
| | | * 有物无资料 |
| | | * |
| | | */ |
| | | public Boolean err2; |
| | | |
| | |
| | | */ |
| | | public Boolean err7; |
| | | |
| | | public Boolean err8; |
| | | public Boolean err9; |
| | | public Boolean err10; |
| | | public Boolean err11; |
| | | public Boolean err12; |
| | | |
| | | ////////////////////// 工位2定义 ////////////////////////////////////////////////// |
| | | /** |
| | | * 工位2任务号 |
| | | */ |
| | | public Integer taskNo2 = 0; |
| | | /** |
| | | * 工位1目标站 |
| | | */ |
| | | public Integer staNo2 = 0; |
| | | |
| | | /** |
| | | * RGV工位2当前状态 |
| | |
| | | public Integer getRgvPosI(){ |
| | | //需要根据现场改造 根据读到的值获取对应站点位置 |
| | | Map<Short,Integer> map = new HashMap<>(); |
| | | map.put((short) 1,100);map.put((short) 2,101); |
| | | map.put((short) 3,106);map.put((short) 4,107); |
| | | map.put((short) 5,112);map.put((short) 6,113); |
| | | map.put((short) 7,124); map.put((short) 8,119); |
| | | map.put((short) 9,149);map.put((short) 10,153); |
| | | map.put((short) 11,157);map.put((short) 12,161); |
| | | map.put((short) 1,1004);map.put((short) 2,1007); |
| | | map.put((short) 3,1010);map.put((short) 4,1014); |
| | | map.put((short) 5,1018);map.put((short) 6,1021); |
| | | map.put((short) 7,1024); map.put((short) 8,1028); |
| | | map.put((short) 9,1031);map.put((short) 10,1035); |
| | | map.put((short) 11,2003);map.put((short) 12,2006); |
| | | map.put((short) 13,2009);map.put((short) 14,2012); |
| | | map.put((short) 15,2015);map.put((short) 16,2018); |
| | | map.put((short) 17,2021);map.put((short) 18,2024); |
| | | map.put((short) 19,2027);map.put((short) 20,2030); |
| | | if (RgvPos==null) return 0; |
| | | |
| | | return map.get(RgvPos); |
| | | } |
| | | |
| | | public Integer getRgvPosI2() { |
| | | // key: 站点号 value: 基准物理位置 |
| | | Map<Integer, Integer> posMap = new HashMap<>(); |
| | | posMap.put(1004, 6534); |
| | | posMap.put(1007, 33634); |
| | | posMap.put(1010, 75174); |
| | | posMap.put(1014, 102124); |
| | | posMap.put(1018, 138224); |
| | | posMap.put(1021, 178034); |
| | | posMap.put(1024, 219684); |
| | | posMap.put(1028, 246724); |
| | | posMap.put(1031, 288194); |
| | | posMap.put(1035, 315204); |
| | | int tolerance = 200; // 允许误差范围 |
| | | |
| | | for (Map.Entry<Integer, Integer> entry : posMap.entrySet()) { |
| | | int site = entry.getKey(); |
| | | int basePos = entry.getValue(); |
| | | if (Math.abs(RgvPos - basePos) <= tolerance) { |
| | | return site; |
| | | } |
| | | } |
| | | |
| | | return 0; // 没匹配到站点 |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public RgvProtocol clone() { |
| | | try { |