|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Short wrkTaskPri; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Short wrkTaskMove1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Short wrkTaskMove2; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * RGV当前状态工位1 | 
|---|
|  |  |  | 
|---|
|  |  |  | * 工位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当前状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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(2003, 314954); | 
|---|
|  |  |  | posMap.put(2006, 288094); | 
|---|
|  |  |  | posMap.put(2009, 246574); | 
|---|
|  |  |  | posMap.put(2012, 219584); | 
|---|
|  |  |  | posMap.put(2015, 177934); | 
|---|
|  |  |  | posMap.put(2018, 138126); | 
|---|
|  |  |  | posMap.put(2021, 102124); | 
|---|
|  |  |  | posMap.put(2024, 75174); | 
|---|
|  |  |  | posMap.put(2027, 33748); | 
|---|
|  |  |  | posMap.put(2030, 6449); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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 { | 
|---|