| | |
| | | import com.zy.asrs.domain.vo.SiteTableVo; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.DevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 输送设备接口 |
| | | * Created by vincent on 2020-06-01 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/site") |
| | | public class SiteController { |
| | |
| | | vo.setLoading(staProtocol.isLoading()?"Y":"N"); // 有物 |
| | | vo.setInEnable(staProtocol.isInEnable()?"Y":"N"); // 可入 |
| | | vo.setOutEnable(staProtocol.isOutEnable()?"Y":"N"); // 可出 |
| | | vo.setLiftArrival(staProtocol.isLiftArrival()?"Y":"N"); // 提升机到位信号 |
| | | vo.setShuttleTakeEnable(staProtocol.isShuttleTakeEnable()?"Y":"N"); // 穿梭车可取信号 |
| | | vo.setPakMk(staProtocol.isPakMk()?"Y":"N"); // 入库标记 |
| | | vo.setEmptyMk(staProtocol.isEmptyMk()?"Y":"N"); // 空板信号 |
| | | vo.setStaNo(staProtocol.getStaNo()); // 目标站 |
| | | vo.setStaNo(staProtocol.getStaNo() == null ? 0 : staProtocol.getStaNo()); // 目标站 |
| | | vo.setLocType1(staProtocol.getLocType1()==null?"-":staProtocol.getLocType1().toString()); // 高低信号 |
| | | |
| | | String outInModel = "-"; |
| | | if (staProtocol.getOutInModel() != null) { |
| | | switch (staProtocol.getOutInModel().intValue()) { |
| | | case 0: |
| | | outInModel = "default"; |
| | | break; |
| | | case 1: |
| | | outInModel = "in"; |
| | | break; |
| | | case 2: |
| | | outInModel = "out"; |
| | | break; |
| | | default: |
| | | outInModel = "-"; |
| | | } |
| | | } |
| | | vo.setOutInModel(outInModel); // 出入库模式 |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | |
| | | |
| | | for(Map.Entry<Integer, StaProtocol> entry : station.entrySet()) { |
| | | StaProtocol staProtocol = entry.getValue(); |
| | | // if (staProtocol) { |
| | | // PlcErrorTableVo vo = new PlcErrorTableVo(); |
| | | // vo.setNo(entry.getKey()); // 序号 |
| | | // |
| | | // vo.setPlcDesc(""); // todo:luxiaotao plc错误描述 |
| | | // vo.setError(""); // todo:luxiaotao 异常信息 |
| | | // list.add(vo); |
| | | // } |
| | | } |
| | | |
| | | } |
| | |
| | | }else{ |
| | | return -1; |
| | | } |
| | | |
| | | }); |
| | | return R.ok().add(list); |
| | | } |
| | |
| | | for (Map.Entry<Integer, StaProtocol> entry : station.entrySet()) { |
| | | if (siteId.equals(entry.getKey())) { |
| | | StaProtocol staProtocol = entry.getValue(); |
| | | staProtocol = staProtocol.clone(); |
| | | if (workNo != null) { |
| | | staProtocol.setWorkNo(workNo); |
| | | } |