自动化立体仓库 - WCS系统
Junjie
2023-11-29 35fac40cfc0d636479bde094391e6f237b3116d4
src/main/java/com/zy/asrs/utils/Utils.java
@@ -2,6 +2,8 @@
import com.core.common.Arith;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.core.model.CrnSlave;
import com.zy.core.properties.SlaveProperties;
import java.text.DecimalFormat;
@@ -23,14 +25,14 @@
        int[] wcsRow = getWcsRow(split[0]);
        int[] ints = null;
        if (split[3].equals("01")){
            ints = Arrays.copyOfRange(wcsRow, 0, wcsRow.length / 2);
            ints = Arrays.copyOfRange(wcsRow, 0, (wcsRow.length+2-1) / 2);
            if (split[4].equals("01")){
                ints = Arrays.copyOfRange(ints, wcsRow.length / 2,wcsRow.length-1);
            }else {
                ints = Arrays.copyOfRange(ints, 0, wcsRow.length / 2);
            }
        }else {
            ints = Arrays.copyOfRange(wcsRow, wcsRow.length / 2,wcsRow.length-1 );
            ints = Arrays.copyOfRange(wcsRow, (wcsRow.length+2-1) / 2,wcsRow.length-1 );
            if (split[4].equals("01")){
                ints = Arrays.copyOfRange(ints, 0, wcsRow.length / 2);
@@ -275,6 +277,26 @@
    }
    public static CrnSlave.CrnStn getCrnStnByStaNo(Integer staNo, Boolean pakIn) {
        SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class);
        for (CrnSlave crn : slaveProperties.getCrn()) {
            List<CrnSlave.CrnStn> crnInStn = null;
            if (pakIn) {
                crnInStn = crn.getCrnInStn();
            }else {
                crnInStn = crn.getCrnOutStn();
            }
            for (CrnSlave.CrnStn crnStn : crnInStn) {
                if (crnStn.getStaNo().equals(staNo)) {
                    return crnStn;
                }
            }
        }
        return null;
    }
    public static void main(String[] args) {
//        SlaveProperties slaveProperties = new SlaveProperties();
//        slaveProperties.setDoubleDeep(true);
@@ -284,7 +306,7 @@
//        slaveProperties.setGroupCount(4);
//        Integer deepRow = getDeepRow(slaveProperties, 6);
//        System.out.println(deepRow);
        String wcsLocNo = getWcsLocNo("03-52-01-01-02");
        String wcsLocNo = getWcsLocNo("06-52-01-01-01");
        System.out.println(wcsLocNo);
    }
}