1
zhang
1 天以前 818fdd469e2ed47c9e02e06fcb4c7dc791977a0b
1
7个文件已修改
67 ■■■■ 已修改文件
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/webapp/views/pipeline.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java
@@ -69,10 +69,10 @@
            vo.setLoading(staProtocol.isLoading() ? "Y" : "N");     // 有物
            vo.setInEnable(staProtocol.isInEnable() ? "Y" : "N");   // 可入
            vo.setOutEnable(staProtocol.isOutEnable() ? "Y" : "N"); // 可出
            vo.setEmptyMk(staProtocol.isEmptyMk() !=staProtocol.isFullPlt() ? (staProtocol.isEmptyMk()?"空" : "满"): "-");     // 空板信号
            vo.setEmptyMk(staProtocol.isEmptyMk() != staProtocol.isFullPlt() ? (staProtocol.isEmptyMk() ? "空" : "满") : "-");     // 空板信号
            vo.setStaNo(staProtocol.getStaNo());                // 目标站
            vo.setWeight(staProtocol.getWeight() == null ? 0D : staProtocol.getWeight());
            vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow()? ( staProtocol.isLow() ? "低" : "高"): "-");     //高低库位
            vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() ? (staProtocol.isLow() ? "低" : "高") : "-");     //高低库位
        }
@@ -111,10 +111,10 @@
                    vo.setLoading(staProtocol.isLoading() ? "Y" : "N");     // 有物
                    vo.setInEnable(staProtocol.isInEnable() ? "Y" : "N");   // 可入
                    vo.setOutEnable(staProtocol.isOutEnable() ? "Y" : "N"); // 可出
                    vo.setEmptyMk(staProtocol.isEmptyMk() !=staProtocol.isFullPlt() ? (staProtocol.isEmptyMk()?"空" : "满"): "-");     // 空板信号
                    vo.setEmptyMk(staProtocol.isEmptyMk() != staProtocol.isFullPlt() ? (staProtocol.isEmptyMk() ? "空" : "满") : "-");     // 空板信号
                    vo.setStaNo(staProtocol.getStaNo());                // 目标站
                    vo.setWeight(staProtocol.getWeight() ==null ? 0D : staProtocol.getWeight());
                    vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow()? ( staProtocol.isLow() ? "低" : "高"): "-");     //高低库位
                    vo.setWeight(staProtocol.getWeight() == null ? 0D : staProtocol.getWeight());
                    vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() ? (staProtocol.isLow() ? "低" : "高") : "-");     //高低库位
                    return R.ok().add(vo);
                }
            }
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
@@ -6,13 +6,13 @@
 */
public enum DeviceField {
    // 扫码器:每站点16字节,String[14]
    BARCODE("DB103", 254, 18,new int[]{0,2},21),
    BARCODE("DB103", 254, 18, new int[]{0, 2}, 21),
    // 出入库模式
    IO_MODE("DB103", 170, 4,new int[]{0,2},21),
    IO_MODE("DB103", 170, 4, new int[]{0, 2}, 21),
    // 称重:每站点4字节,Float
    WEIGHT("DB103", 634, 6,new int[]{0,2},21),
    WEIGHT("DB103", 634, 6, new int[]{0, 2}, 21),
    // 尺寸异常:每站点2字节,Bit数组
    DIMENSION_WORD("DB103", 2, 8,new int[]{0,2,4,6},21);
    DIMENSION_WORD("DB103", 2, 8, new int[]{0, 2, 4, 6}, 21);
    private final String addressPattern;
    private final int offset;
@@ -20,7 +20,7 @@
    private final int[] seg;
    private final int arrLength;
    DeviceField(String addressPattern, int offset, int byteLength,int[] seg, int arrLength) {
    DeviceField(String addressPattern, int offset, int byteLength, int[] seg, int arrLength) {
        this.addressPattern = addressPattern;
        this.offset = offset;
        this.byteLength = byteLength;
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java
@@ -26,7 +26,7 @@
@Slf4j
@Component
public class OutOperationHandler implements OperationHandler  {
public class OutOperationHandler implements OperationHandler {
    @Autowired
    private SlaveProperties slaveProperties;
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java
@@ -20,9 +20,9 @@
    private Boolean weight;
    private Boolean barcode ;
    private Boolean barcode;
    private Boolean staNosError ;
    private Boolean staNosError;
    private List<Sta> releaseSta = new ArrayList<>();
@@ -31,7 +31,6 @@
    private List<Sta> inSta = new ArrayList<>();
    private List<Integer> staNos = new ArrayList<>();
    @Data
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java
@@ -62,7 +62,7 @@
            return;
        }
        int baseOffset =  TaskField.ALL.getOffset() + index * TaskField.ALL.getByteLength();
        int baseOffset = TaskField.ALL.getOffset() + index * TaskField.ALL.getByteLength();
        String workNoAddr = TaskField.TASK_NUMBER.getAddressPattern() + PlcConstant.ADDRESS_CONCATENATION
                + (baseOffset + TaskField.TASK_NUMBER.getOffset());
        String destStaAddr = TaskField.DEST_STATION.getAddressPattern() + PlcConstant.ADDRESS_CONCATENATION
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
@@ -164,7 +164,7 @@
        OperateResultExOne<byte[]> result = siemensS7Net.Read(
                DeviceField.BARCODE.buildAddress(),
                (short) ( DeviceField.BARCODE.getByteLength() * DeviceField.BARCODE.getArrLength()));
                (short) (DeviceField.BARCODE.getByteLength() * DeviceField.BARCODE.getArrLength()));
        if (!result.IsSuccess) {
            log.warn("读取条码失败 [id:{}]", slave.getId());
@@ -175,12 +175,12 @@
        for (int i = 0; i < DeviceField.BARCODE.getArrLength(); i++) {
            int[] seg = DeviceField.BARCODE.getSeg();
            Short staNo = siemensS7Net.getByteTransform().TransInt16(
                    content, seg[0]+i * DeviceField.BARCODE.getByteLength());
                    content, seg[0] + i * DeviceField.BARCODE.getByteLength());
            String barcode = siemensS7Net.getByteTransform().TransString(
                    content, seg[1]+i * DeviceField.BARCODE.getByteLength(),
                    DeviceField.BARCODE.getByteLength()-seg[1], "UTF-8");
                    content, seg[1] + i * DeviceField.BARCODE.getByteLength(),
                    DeviceField.BARCODE.getByteLength() - seg[1], "UTF-8");
            if (!Cools.isEmpty(barcode)&& staNo !=null) {
            if (!Cools.isEmpty(barcode) && staNo != null) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("扫码站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
@@ -196,7 +196,7 @@
     * 读取重量信息
     */
    private void readWeight() {
        if ( slave.getWeight() == null || ! slave.getWeight()) {
        if (slave.getWeight() == null || !slave.getWeight()) {
            return;
        }
@@ -209,13 +209,13 @@
            return;
        }
        byte[] content = result.Content;
        for (int i = 0; i < DeviceField.WEIGHT.getArrLength() ; i++) {
        for (int i = 0; i < DeviceField.WEIGHT.getArrLength(); i++) {
            int[] seg = DeviceField.WEIGHT.getSeg();
            Short staNo = siemensS7Net.getByteTransform().TransInt16(
                    content, seg[0]+i * DeviceField.WEIGHT.getByteLength());
                    content, seg[0] + i * DeviceField.WEIGHT.getByteLength());
            Double weight = (double) siemensS7Net.getByteTransform().TransSingle(
                    content, seg[1] + i * DeviceField.WEIGHT.getByteLength());
            if (!Cools.isEmpty(weight)&& staNo !=null) {
            if (!Cools.isEmpty(weight) && staNo != null) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("称重站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
@@ -223,14 +223,14 @@
                }
                staProtocol.setWeight(BigDecimal.valueOf(weight).setScale(4, RoundingMode.HALF_UP).doubleValue());
            }
           }
        }
    }
    /**
     * 读取外形检测错误
     */
    private void readDimensionErrors() {
        if ( slave.getStaNosError() == null ||  !slave.getStaNosError()) {
        if (slave.getStaNosError() == null || !slave.getStaNosError()) {
            return;
        }
@@ -248,14 +248,14 @@
            int[] seg = DeviceField.DIMENSION_WORD.getSeg();
            Short staNo = siemensS7Net.getByteTransform().TransInt16(
                    content, seg[0]);
            if ( staNo !=null) {
            if (staNo != null) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null){
                if (staProtocol == null) {
                    log.warn("异常站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
                    continue;
                }
                boolean[] status = siemensS7Net.getByteTransform().TransBool(
                        content, seg[1]+i * DeviceField.DIMENSION_WORD.getByteLength(),
                        content, seg[1] + i * DeviceField.DIMENSION_WORD.getByteLength(),
                        1);
//未使用,预留
//                boolean[] status1 = siemensS7Net.getByteTransform().TransBool(
zy-asc-conveyor/src/main/webapp/views/pipeline.html
@@ -832,11 +832,11 @@
                            <input id="staNo" name="staNo" type="number" min="0" class="form-input"
                                   autocomplete="off">
                        </div>
<!--                        <div class="form-group">-->
<!--                            <label class="form-label" for="pakMk">入库标记:</label>-->
<!--                            <input id="pakMk" name="pakMk" type="text" class="form-input"-->
<!--                                   autocomplete="off">-->
<!--                        </div>-->
                        <!--                        <div class="form-group">-->
                        <!--                            <label class="form-label" for="pakMk">入库标记:</label>-->
                        <!--                            <input id="pakMk" name="pakMk" type="text" class="form-input"-->
                        <!--                                   autocomplete="off">-->
                        <!--                        </div>-->
                    </form>
                </div>
                <div class="modal-footer">