Exemplo n.º 1
0
    public static void Odd2Even_Connect(HighStoreShelf_Parameter HP, MultiHighBay_Parameter MHP, GameObject OBJ)
    {
        //奇数高架库与偶数高架库之间的连接
        float      TunnelWidth = MHP.TunnelWidth;
        GameObject obj1        = (GameObject)Resources.Load("Scene/Elevated_Warehouse/Cube2");//加载侧面固定杆
        Vector3    size        = new Vector3();

        size.x = TunnelWidth;
        size.y = HP.HorizontalStanchionThick;
        size.z = HP.VerticalStanchionWidth;
        GameObject obj1_1 = Instantiate(obj1); obj1_1.transform.localScale = size;

        //GameObject OBJ1 = new GameObject();
        for (int i = 0; i <= HP.ColumnsNum; i++)
        {
            GameObject clone = Instantiate(obj1_1);
            clone.transform.parent        = OBJ.transform;
            clone.transform.localPosition = new Vector3(0, -size.y / 2, -size.z / 2 - i * (HP.ColumnWidth + HP.VerticalStanchionWidth));
        }
        //GameObject OBJ2 = new GameObject();
        GameObject obj1_2 = Instantiate(obj1); obj1_2.transform.localScale = new Vector3(size.x, size.y, size.z / 2);
        //obj1_2.transform.parent = OBJ.transform; obj1_2.transform.localPosition = new Vector3(size.x, size.y, size.z / 2);
        GameObject obj1_3 = Instantiate(obj1); obj1_3.transform.localScale = new Vector3(size.x, size.y, size.z / 2);

        //obj1_3.transform.parent = OBJ.transform; obj1_3.transform.localPosition = new Vector3(size.x, size.y, size.z / 2);

        //OBJ1.transform.parent = OBJ.transform;
        obj1_2.transform.parent        = OBJ.transform; obj1_3.transform.parent = OBJ.transform;
        obj1_2.transform.localPosition = new Vector3(0, -size.y / 2, HP.ColumnWidth + size.z / 4);
        //OBJ1.transform.localPosition = new Vector3(0, 0, -HP.ColumnWidth);
        obj1_3.transform.localPosition = new Vector3(0, -size.y / 2, -(HP.ColumnWidth + HP.VerticalStanchionWidth) * (HP.ColumnsNum + 1) - size.z / 4);
        //OBJ2.transform.parent = OBJ.transform;//重新调整坐标
        //OBJ2.transform.localPosition = new Vector3(0, 0, (HP.ColumnWidth * (HP.ColumnsNum + 2)) / 2);
        DestroyImmediate(obj1_1);
    }
Exemplo n.º 2
0
    public static void Even2Odd_Connect(HighStoreShelf_Parameter HP, MultiHighBay_Parameter MHP, GameObject OBJ)
    {
        //构件偶数高架库与奇数高架库之间的连接
        float      Width = HP.ColumnWidth + HP.VerticalStanchionWidth;
        GameObject obj   = (GameObject)Resources.Load("Scene/Elevated_Warehouse/Cube2");//加载侧面固定杆
        Vector3    size  = new Vector3();

        size.x = MHP.HookupDistance; size.y = HP.HorizontalStanchionThick; size.z = HP.VerticalStanchionWidth;
        int        Num1      = HP.FloorsNum / 2 + 1;             //纵向个数
        int        Num2      = HP.ColumnsNum + 1;                //横向个数
        float      High      = HP.Size.y - HP.Height2Ground / 2; //首层距地高度的一半出开始纵向固定
        float      Temp_High = High / Num1;                      //纵向两根之间的高度
        GameObject OBJ1      = new GameObject();

        for (int i = 0; i < Num2; i++)
        {
            for (int j = 0; j <= Num1; j++)
            {
                GameObject clone = Instantiate(obj); clone.transform.localScale = size; clone.transform.parent = OBJ1.transform;
                clone.transform.localPosition = new Vector3(0, HP.Height2Ground / 2 + Temp_High * j - size.y / 2, -i * Width - HP.VerticalStanchionWidth / 2);
            }
        }
        OBJ1.transform.parent = OBJ.transform; OBJ1.transform.localPosition = new Vector3(0, 0, 0);
        GameObject obj1 = Instantiate(obj); obj1.transform.localScale = new Vector3(size.x, size.y, size.z / 2);

        obj1.transform.parent        = OBJ.transform;
        obj1.transform.localPosition = new Vector3(0, HP.Size.y - size.y / 2, HP.ColumnWidth + size.z / 4);
        GameObject obj2 = Instantiate(obj); obj2.transform.localScale = new Vector3(size.x, size.y, size.z / 2);

        obj2.transform.parent        = OBJ.transform;
        obj2.transform.localPosition = new Vector3(0, HP.Size.y - size.y / 2, -(HP.ColumnWidth + HP.VerticalStanchionWidth) * (HP.ColumnsNum + 1) - size.z / 4);
    }
Exemplo n.º 3
0
    public static void ConnectComponent(HighStoreShelf_Parameter HP, MultiHighBay_Parameter MHP, GameObject OBJ)
    {
        //增加高架库之间的连)接
        int   Num1 = (MHP.Num - 1) / 2; //偶数-奇数连接
        int   Num2 = (MHP.Num + 1) / 2; //奇数-偶数连接
        float Depth = HP.Size.x; float TunnelWidth = MHP.TunnelWidth; float HookupDistance = MHP.HookupDistance;
        //进行奇偶高架库之间的连接
        GameObject obj1 = new GameObject(); //奇偶高架库之间的连接部分
        GameObject OBJ1 = new GameObject(); //所有奇偶高架库之间的连接部分

        Odd2Even_Connect(HP, MHP, obj1);
        for (int i = 1; i <= Num2; i++)
        {
            GameObject clone = Instantiate(obj1); clone.transform.parent = OBJ1.transform;
            clone.transform.localPosition = new Vector3(-((2 * i - 1) * Depth + TunnelWidth / 2 + (i - 1) * (TunnelWidth + HookupDistance)), 0, 0);
        }
        //进行偶奇高架库之间的连接
        GameObject obj2 = new GameObject(); //偶奇高架库之间的连接部分
        GameObject OBJ2 = new GameObject(); //所有偶奇高架库之间的连接部分

        Even2Odd_Connect(HP, MHP, obj2);
        for (int i = 1; i <= Num1; i++)
        {
            GameObject clone = Instantiate(obj2); clone.transform.parent = OBJ2.transform;
            clone.transform.localPosition = new Vector3(-(HookupDistance / 2 + 2 * i * Depth + i * TunnelWidth + (i - 1) * HookupDistance), 0, 0);
        }
        OBJ1.transform.parent        = OBJ.transform; OBJ2.transform.parent = OBJ.transform;
        OBJ1.transform.localPosition = new Vector3(0, HP.Size.y, 0);
        OBJ2.transform.localPosition = new Vector3(0, 0, 0);

        DestroyImmediate(obj1); DestroyImmediate(obj2);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(OBJ);
    }
Exemplo n.º 4
0
    //创建高架库
    #region Create_HighBays
    public static void Create_HighBays(HighStoreShelf_Parameter HP, MultiHighBay_Parameter MHP, GameObject OBJ)
    {
        //HP单个高架库设计尺寸参数
        //HSP高架库组合设计的参数
        //根据单个高架库设计参数生成高架库
        GameObject HighBay = new GameObject();
        string     name    = "HighBay";

        HighBay.name = name;
        //
        Subassembly.Create_HighStoreShelf(HP, HighBay);
        HighBay.transform.Rotate(0, 180, 0);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(HighBay); //Debug.Log(00);
        //根据高架库组合设计的参数生成高架库组合

        GameObject HighBayGroup = new GameObject(); HighBayGroup.name = "HighBayGroup";

        for (int i = 0; i < MHP.Num; i++)
        {
            GameObject clone     = Instantiate(HighBay); clone.transform.parent = HighBayGroup.transform; clone.name = name + (i + 1).ToString();
            float      TempValue = -(HP.Size.x / 2 + i * HP.Size.x + ((i + 1) / 2) * MHP.TunnelWidth + (i / 2) * MHP.HookupDistance);
            clone.transform.localPosition = new Vector3(TempValue, 0, 0);
        }
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(HighBayGroup);
        GameObject OBJ1 = new GameObject(); OBJ1.name = "ConnectPart";

        ConnectComponent(HP, MHP, OBJ1);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(OBJ1);
        HighBayGroup.transform.parent = OBJ.transform; HighBayGroup.transform.localPosition = new Vector3(0, 0, 0);
        OBJ1.transform.parent         = OBJ.transform; OBJ1.transform.localPosition = new Vector3(0, 0, 0);

        DestroyImmediate(HighBay);
    }
Exemplo n.º 5
0
    public static void Create_EndShelf(HighStoreShelf_Parameter HSSP, int i, GameObject EndShelf)
    {
        //水平支柱
        GameObject obj = (GameObject)Resources.Load("Scene/HighBay/Cube");
        //竖直支柱
        GameObject obj2      = Instantiate(obj); //竖直支柱
        Vector3    obj2_size = new Vector3(HSSP.VerticalStanchionWidth, HSSP.FloorsHigh[i], HSSP.VerticalStanchionWidth);

        obj2.transform.localScale = obj2_size;
        GameObject obj2_2      = Instantiate(obj2);
        float      temp_value1 = (HSSP.Size.x - HSSP.VerticalStanchionWidth) / 2;
        //侧面倾斜支柱
        float      TempValue1         = HSSP.Size.x - HSSP.VerticalStanchionWidth;
        float      TempValue2         = (HSSP.FloorsHigh[i] - HSSP.HorizontalStanchionThick) / 2;
        float      TempValue3         = Mathf.Sqrt(TempValue1 * TempValue1 + TempValue2 * TempValue2);//侧面倾斜支柱的长度
        Vector3    SideStanchion_size = new Vector3(HSSP.VerticalStanchionWidth / 2, TempValue3, HSSP.VerticalStanchionWidth / 2);
        float      angle  = Mathf.Atan(TempValue1 / TempValue2) * 180 / Mathf.PI;
        GameObject obj3_1 = Instantiate(obj); obj3_1.transform.localScale = SideStanchion_size;

        obj3_1.transform.Rotate(0, 0, angle);
        GameObject obj3_2 = Instantiate(obj); obj3_2.transform.localScale = SideStanchion_size;

        obj3_2.transform.Rotate(0, 0, -angle);
        //组合
        obj2.transform.parent          = EndShelf.transform; obj2_2.transform.parent = EndShelf.transform;
        obj2.transform.localPosition   = new Vector3(temp_value1, HSSP.FloorsHigh[i] / 2 - HSSP.HorizontalStanchionThick, 0);
        obj2_2.transform.localPosition = new Vector3(-temp_value1, HSSP.FloorsHigh[i] / 2 - HSSP.HorizontalStanchionThick, 0);
        obj3_1.transform.parent        = EndShelf.transform; obj3_2.transform.parent = EndShelf.transform;
        obj3_1.transform.localPosition = new Vector3(0, (obj2_size.y - HSSP.HorizontalStanchionThick) / 4, 0);
        obj3_2.transform.localPosition = new Vector3(0, 3 * (obj2_size.y - HSSP.HorizontalStanchionThick) / 4, 0);

        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(EndShelf);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(EndShelf);
    }
Exemplo n.º 6
0
    public static void Create_Foot(HighStoreShelf_Parameter HSSP, GameObject Foot)
    {
        GameObject obj       = (GameObject)Resources.Load("Scene/HighBay/Cube");
        GameObject obj1      = Instantiate(obj);
        Vector3    obj1_size = new Vector3(HSSP.VerticalStanchionWidth, HSSP.Height2Ground - HSSP.HorizontalStanchionThick, HSSP.VerticalStanchionWidth);

        obj1.transform.localScale = obj1_size;
        GameObject obj2      = Instantiate(obj);
        Vector3    obj2_size = new Vector3(3 * HSSP.VerticalStanchionWidth, 0.01f, 2 * HSSP.VerticalStanchionWidth);

        obj2.transform.localScale = obj2_size;
        GameObject OBJ = new GameObject();

        obj1.transform.parent        = OBJ.transform; obj2.transform.parent = OBJ.transform;
        obj1.transform.localPosition = new Vector3(0, obj1_size.y / 2, 0);
        obj2.transform.localPosition = new Vector3(0, obj2_size.y / 2, 0);

        GameObject obj3 = Instantiate(obj);

        obj3.transform.localScale = new Vector3(HSSP.Size.x, HSSP.VerticalStanchionWidth, HSSP.VerticalStanchionWidth);

        GameObject OBJ2 = Instantiate(OBJ);

        OBJ.transform.parent         = Foot.transform; OBJ2.transform.parent = Foot.transform; obj3.transform.parent = Foot.transform;
        OBJ.transform.localPosition  = new Vector3((HSSP.Size.x - HSSP.VerticalStanchionWidth) / 2, 0, 0);
        OBJ2.transform.localPosition = new Vector3(-(HSSP.Size.x - HSSP.VerticalStanchionWidth) / 2, 0, 0);
        obj3.transform.localPosition = new Vector3(0, HSSP.Height2Ground / 2, 0);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(Foot);
    }
Exemplo n.º 7
0
    public static void Create_TopShelf(HighStoreShelf_Parameter HSSP, GameObject TopShelf)
    {
        GameObject obj = (GameObject)Resources.Load("Scene/HighBay/Cube");
        //水平支柱
        GameObject obj1      = Instantiate(obj); //水平支柱
        Vector3    obj1_size = new Vector3(HSSP.VerticalStanchionWidth, HSSP.HorizontalStanchionThick, HSSP.ColumnWidth + 2 * HSSP.VerticalStanchionWidth);

        obj1.transform.localScale = obj1_size;
        GameObject obj1_2 = Instantiate(obj1);
        //水平交叉支柱
        float      TempValue1          = HSSP.Size.x - HSSP.VerticalStanchionWidth;
        float      TempValue4          = HSSP.ColumnWidth - HSSP.VerticalStanchionWidth;
        float      TempValue5          = Mathf.Sqrt(TempValue1 * TempValue1 + TempValue4 * TempValue4);//水平交叉支柱的长度
        float      angle1              = Mathf.Atan(TempValue1 / TempValue4) * 180 / Mathf.PI;
        Vector3    CrossStanchion_size = new Vector3(HSSP.VerticalStanchionWidth, HSSP.HorizontalStanchionThick / 2, TempValue5);
        GameObject obj2_1              = Instantiate(obj); obj2_1.transform.localScale = CrossStanchion_size;

        obj2_1.transform.Rotate(0, angle1, 0);
        GameObject obj2_2 = Instantiate(obj); obj2_2.transform.localScale = CrossStanchion_size;

        obj2_2.transform.Rotate(0, -angle1, 0);
        //组合
        obj1.transform.parent = TopShelf.transform; obj1_2.transform.parent = TopShelf.transform;
        float temp_value1 = HSSP.Size.x / 2 - HSSP.VerticalStanchionWidth / 2;
        float temp_value2 = -(HSSP.ColumnWidth + HSSP.VerticalStanchionWidth) / 2;

        obj1.transform.localPosition   = new Vector3(temp_value1, -HSSP.HorizontalStanchionThick / 2, 0);
        obj1_2.transform.localPosition = new Vector3(-temp_value1, -HSSP.HorizontalStanchionThick / 2, 0);
        obj2_1.transform.parent        = TopShelf.transform; obj2_2.transform.parent = TopShelf.transform;
        obj2_1.transform.localPosition = new Vector3(0, -obj1_size.y + CrossStanchion_size.y / 2, 0);
        obj2_2.transform.localPosition = new Vector3(0, -obj1_size.y + CrossStanchion_size.y / 2, 0);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(TopShelf);
    }
Exemplo n.º 8
0
    //场景关键点信息
    #region Create_SceneInfo
    public void Create_SceneInfo(ref ParametersList1 PL, out KeyPositionsData KPD)
    {
        RollerConveyor_Parameter RCP = PL.RCP;
        HighStoreShelf_Parameter HP  = PL.HP;
        MultiHighBay_Parameter   MHP = PL.MHP;
        KeyPositionsData         KP  = new KeyPositionsData();

        KP.HighBaysNum = MHP.Num;//高架库数目

        //Vector3[] LiftTransferPositions = new Vector3[]
        KP.HighValues      = new float[] { RCP.RCHigh, RCP.RCHigh - 0.1f };//两种输送线高度
        KP.ConveyorLengths = new float[2] {
            RCP.RCLength, HP.Size.x * 2 + MHP.HookupDistance + MHP.TunnelWidth - RCP.RCWidth
        };
        KP.EnterPosition = new Vector3((KP.ConveyorLengths[1] + RCP.RCWidth - HP.Size.x), RCP.RCHigh - 0.1f, -RCP.RCWidth / 2);//入口处坐标
        float[] ConveyorLinesValues = new float[(MHP.Num + 1) / 2];
        float[] PilerLinesValues    = new float[(MHP.Num + 1) / 2];

        for (int i = 0; i < (MHP.Num + 1) / 2; i++)
        {
            ConveyorLinesValues[i] = -(-RCP.RCWidth / 2 + (2 * i + 1) * HP.Size.x + i * MHP.TunnelWidth + i * MHP.HookupDistance);
            PilerLinesValues[i]    = -(MHP.TunnelWidth / 2 + i * (MHP.TunnelWidth + MHP.HookupDistance) + (2 * i + 1) * HP.Size.x);
        }
        KP.ConveyorLinesValues = ConveyorLinesValues; //每条入库输送线的X值
        //KP.ConveyorLinesLength = 3 * RCP.RCLength;//入库输送线的长度
        KP.ConveyorWidth    = RCP.RCWidth;            //输送线宽度
        KP.PilerLinesValues = PilerLinesValues;       //每条堆垛机线路的X值
        Vector3[] HighBaysPositions = new Vector3[MHP.Num];
        for (int i = 0; i < MHP.Num; i++)
        {
            float TempValue = HP.Size.x / 2 + i * HP.Size.x + ((i + 1) / 2) * MHP.TunnelWidth + (i / 2) * MHP.HookupDistance;
            HighBaysPositions[i] = new Vector3(-TempValue, 0, -(RCP.RCWidth + 2 * RCP.RCLength));
        }
        KP.HighBaysPositions = HighBaysPositions; //高架库的坐标
        KP.CargoSize         = PL.CargoSize;      //货物尺寸

        StorePositions StorePositions = new StorePositions();

        float[] StoreFloorPositions  = new float[HP.FloorsNum];
        float[] StoreColumnPositions = new float[HP.ColumnsNum];
        float   TempValue1           = 0;

        for (int i = 0; i < HP.FloorsNum; i++)
        {
            TempValue1            += HP.FloorsHigh[i];
            StoreFloorPositions[i] = TempValue1;
        }
        for (int j = 0; j < HP.ColumnsNum; j++)
        {
            StoreColumnPositions[j] = -(HP.ColumnWidth / 2 + (j + 1) * HP.ColumnWidth);
        }
        float[] StorePlacePosition = { HP.ColumnWidth / 4, -HP.ColumnWidth / 4 };
        StorePositions.StoreFloorPositions  = StoreFloorPositions;
        StorePositions.StoreColumnPositions = StoreColumnPositions;
        StorePositions.StorePlacePosition   = StorePlacePosition;
        KP.StorePositions = StorePositions;//高架库仓位坐标信息
        //货物入口坐标(相对于设备)
        KP.CargoEnterPosition = new Vector3(0, KP.HighValues[0], KP.ConveyorLengths[0]);
        KPD = KP;
    }
Exemplo n.º 9
0
    //多线路输送机(平行于高架库方向)
    #region Create_BeltConveyorGroup
    public void Create_BeltConveyorGroup(ParametersList1 PL, GameObject ConveyorGroup)
    {
        HighStoreShelf_Parameter HP  = PL.HP;
        MultiHighBay_Parameter   MHP = PL.MHP;
        //先创建一条输送线,再clone
        GameObject BeltConveyors = new GameObject(); BeltConveyors.name = "BeltConveyors";
        GameObject BeltConveyor  = new GameObject(); BeltConveyor.name = "BeltConveyor";

        RollerConveyor.Create_BeltConveyor(PL.RCP, BeltConveyor);
        BeltConveyor.transform.Rotate(0, 180, 0);
        for (int i = 0; i < (PL.MHP.Num + 1) / 2; i++)
        {
            GameObject clone1 = Instantiate(BeltConveyors); clone1.name = BeltConveyors.name + (i + 1).ToString();
            for (int j = 0; j < 3; j++)
            {
                GameObject clone = Instantiate(BeltConveyor);
                clone.name             = BeltConveyor.name + (i + 1) + "_" + (j + 1);
                clone.transform.parent = clone1.transform;
                float tempZ = PL.RCP.RCLength * j;
                clone.transform.localPosition = new Vector3(0, 0, -tempZ);
            }
            clone1.transform.parent = ConveyorGroup.transform;
            float TempValue1 = PL.RCP.RCWidth / 2 - ((2 * i + 1) * HP.Size.x + i * MHP.TunnelWidth + i * MHP.HookupDistance);
            clone1.transform.localPosition = new Vector3(TempValue1, 0, 0);
        }
        DestroyImmediate(BeltConveyor);
        DestroyImmediate(BeltConveyors);
    }
Exemplo n.º 10
0
    public static void Create_HighStoreShelf(HighStoreShelf_Parameter HSSP, GameObject HighStoreShelf)
    {
        float TempValue1 = HSSP.ColumnWidth + HSSP.VerticalStanchionWidth;
        float TempValue2 = HSSP.ColumnWidth / 2 + HSSP.VerticalStanchionWidth;
        float TempValue3 = HSSP.Height2Ground;

        for (int i = 0; i < HSSP.FloorsNum; i++)
        {
            GameObject MainShelf = new GameObject(); MainShelf.name = "MainShelf";
            Create_MainShelf(HSSP, i, MainShelf);
            for (int j = 0; j < HSSP.ColumnsNum; j++)
            {
                GameObject clone = Instantiate(MainShelf); clone.name = MainShelf.name + "_" + (i + 1).ToString() + "_" + (j + 1).ToString();
                clone.transform.parent        = HighStoreShelf.transform;
                clone.transform.localPosition = new Vector3(0, TempValue3, TempValue2 + j * TempValue1);
            }
            GameObject EndShelf = new GameObject(); EndShelf.name = "EndShelf" + (i + 1).ToString();
            Create_EndShelf(HSSP, i, EndShelf);
            MyClass.Create2(EndShelf);
            EndShelf.transform.parent        = HighStoreShelf.transform;
            EndShelf.transform.localPosition = new Vector3(0, TempValue3, HSSP.ColumnsNum * TempValue1 + HSSP.VerticalStanchionWidth / 2);
            TempValue3 = TempValue3 + HSSP.FloorsHigh[i];
            DestroyImmediate(MainShelf);
        }
        GameObject Foot     = new GameObject(); Foot.name = "Foot"; Create_Foot(HSSP, Foot);
        GameObject TopShelf = new GameObject(); TopShelf.name = "TopShelf"; Create_TopShelf(HSSP, TopShelf);

        MyClass.Create2(TopShelf);
        for (int i = 0; i < HSSP.ColumnsNum; i++)
        {
            GameObject clone1 = Instantiate(Foot); clone1.name = Foot.name + (i + 1).ToString();
            clone1.transform.parent        = HighStoreShelf.transform;
            clone1.transform.localPosition = new Vector3(0, 0, HSSP.VerticalStanchionWidth / 2 + i * TempValue1);

            GameObject clone2 = Instantiate(TopShelf); clone2.name = TopShelf.name + (i + 1).ToString();
            clone2.transform.parent        = HighStoreShelf.transform;
            clone2.transform.localPosition = new Vector3(0, TempValue3, TempValue2 + i * TempValue1);
        }
        Foot.name = Foot.name + (HSSP.ColumnsNum + 1).ToString(); Foot.transform.parent = HighStoreShelf.transform;
        Foot.transform.localPosition = new Vector3(0, 0, HSSP.ColumnsNum * TempValue1 + HSSP.VerticalStanchionWidth / 2);
        GameObject TopShelf0 = new GameObject(); TopShelf0.name = TopShelf.name + 0.ToString();

        Create_TopShelf1(HSSP, TopShelf0);
        GameObject TopShelf1 = Instantiate(TopShelf0); TopShelf1.name = TopShelf.name + (HSSP.ColumnsNum + 1).ToString();

        TopShelf1.transform.Rotate(0, 180, 0);
        TopShelf0.transform.parent        = HighStoreShelf.transform; TopShelf1.transform.parent = HighStoreShelf.transform;
        TopShelf0.transform.localPosition = new Vector3(0, TempValue3, HSSP.ColumnsNum * TempValue1 + HSSP.VerticalStanchionWidth);
        TopShelf1.transform.localPosition = new Vector3(0, TempValue3, 0);
        DestroyImmediate(TopShelf);
    }
Exemplo n.º 11
0
    public static void Create_MainShelf(HighStoreShelf_Parameter HSSP, int i, GameObject MainShelf)
    {
        GameObject TopShelf = new GameObject();

        Create_TopShelf(HSSP, TopShelf);
        GameObject EndShelf = new GameObject();

        Create_EndShelf(HSSP, i, EndShelf);
        TopShelf.transform.parent        = MainShelf.transform;
        TopShelf.transform.localPosition = new Vector3(0, 0, 0);
        EndShelf.transform.parent        = MainShelf.transform;
        EndShelf.transform.localPosition = new Vector3(0, 0, -(HSSP.ColumnWidth + HSSP.VerticalStanchionWidth) / 2);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().Create2(MainShelf);
    }
Exemplo n.º 12
0
    public static void HighBay_ReadTxt(ref string path, out HighStoreShelf_Parameter HP)
    {
        string[] strs1 = System.IO.File.ReadAllLines(path);
        //读取高架库列数
        int i1 = strs1[1].IndexOf("= ") + 1; string str1 = strs1[1].Remove(0, i1);
        int columns_num = int.Parse(str1); //Debug.Log(columns_num);
        //读取高架库列宽
        int   i2 = strs1[2].IndexOf("= ") + 1; string str2 = strs1[2].Remove(0, i2);
        float column_width = float.Parse(str2); //Debug.Log(column_width);
        //读取高架库层数
        int i3 = strs1[3].IndexOf("= ") + 1; string str3 = strs1[3].Remove(0, i3);
        int floors_num = int.Parse(str3); //Debug.Log(floors_num);
        //读取高架库首层距地高度
        int   i4 = strs1[4].IndexOf("= ") + 1; string str4 = strs1[4].Remove(0, i4);
        float AltitudeAgl = float.Parse(str4); //Debug.Log(AltitudeAgl);
        //读取高架库每层高度
        int    i5 = strs1[5].IndexOf("【") + 1; int j5 = strs1[5].IndexOf("】");
        string str5 = strs1[5].Substring(i5, j5 - i5); string[] str5_1 = str5.Split(' ');

        float[] FloorsHigh = new float[floors_num + 1];
        //FloorsHigh[0] = AltitudeAgl;
        float High = 0;

        for (int i = 0; i < floors_num; i++)
        {
            FloorsHigh[i] = float.Parse(str5_1[i]);
            High          = High + FloorsHigh[i];
        } //Debug.Log(High);
        //读取高架库仓位深度
        int   i6 = strs1[6].IndexOf("= ") + 1; string str6 = strs1[6].Remove(0, i6);
        float HighBay_Depth = float.Parse(str6); //Debug.Log(HighBay_Depth);
        //读取正面水平支柱尺寸
        int    i7 = strs1[7].IndexOf("【") + 1; int j7 = strs1[7].IndexOf("】");
        string str7 = strs1[7].Substring(i7, j7 - i7); string[] str7_1 = str7.Split(' ');

        float[] HorizontalStanchion_size = { float.Parse(str7_1[0]), float.Parse(str7_1[1]), float.Parse(str7_1[2]) };//高架库尺寸,【0】、【1】、【2】分别是x,z,y方向尺寸
        //读取侧面支柱倾斜角度
        int   i8 = strs1[8].IndexOf("= ") + 1; string str8 = strs1[8].Remove(0, i8);
        float slope_angle = float.Parse(str8); //Debug.Log(slope_angle);

        HP.ColumnsNum               = columns_num;
        HP.FloorsNum                = floors_num;
        HP.FloorsHigh               = FloorsHigh;
        HP.Height2Ground            = AltitudeAgl;
        HP.HorizontalStanchionThick = HorizontalStanchion_size[2];
        HP.ColumnWidth              = HorizontalStanchion_size[0];
        HP.VerticalStanchionWidth   = column_width - HP.ColumnWidth;
        float[] size = { (columns_num + 2) * column_width, HighBay_Depth, High };
        HP.Size = new Vector3(HighBay_Depth, High + AltitudeAgl, column_width * columns_num);
    }
Exemplo n.º 13
0
    //计算产生参数
    #region CreateSize
    public void CreateSize(ref HighStoreShelf_Parameter HP, ref MultiHighBay_Parameter MHP, out ParametersList1 PAL)
    {
        //Size1是货物的尺寸;RCP是输送机尺寸
        //ParametersList PL = new ParametersList();
        float Distance0 = HP.ColumnWidth * 2;//坐标点到场景起点的Z距离

        float tempsize = HP.VerticalStanchionWidth;


        Vector3 CargoSize;

        CargoSize.x = HP.Size.x;
        CargoSize.y = HP.Size.x;
        CargoSize.z = HP.Size.x;


        RollerConveyor_Parameter RCP;

        RCP.RCLength     = HP.ColumnWidth;                     //输送机的长度设为高架库单列宽度
        RCP.RollerRadius = 0.05f;                              //滚筒半径
        RCP.RCWidth      = CargoSize.x + 4 * RCP.RollerRadius; //货物的X尺寸+2*滚筒半径+tempsize
        RCP.RCHigh       = 1.1f;                               //输送机高度设为1.2m

        PilerParameter PP;

        PP.PilerHigh   = HP.Size.y;
        PP.PilerLength = HP.Size.z + 2 * HP.ColumnWidth;

        Vector3 PlatFormSize;

        PlatFormSize.x = CargoSize.x + 2 * RCP.RollerRadius + tempsize;; //平台X尺寸与输送机宽度一致
        PlatFormSize.y = RCP.RCHigh - RCP.RollerRadius / 8;              //平台高度与输送线高度一致,低于输送机高度为滚筒半径的1/8
        PlatFormSize.z = CargoSize.z + CargoSize.z / 10;

        ParametersList1 PL;

        PL.Distance  = Distance0; PL.HP = HP; PL.MHP = MHP; PL.RCP = RCP; PL.PP = PP;
        PL.CargoSize = CargoSize; PL.PlatFormSize = PlatFormSize;
        PAL          = PL;
        //Debug.Log(PL.HP.HighBaySize[1]);
    }
Exemplo n.º 14
0
    //创建仓库场景
    #region Create_Scene
    public void Create_Scene(ParametersList1 PL, PositionsList POL, string Path)
    {
        HighStoreShelf_Parameter HP  = PL.HP;
        MultiHighBay_Parameter   MHP = PL.MHP;
        RollerConveyor_Parameter RCP = PL.RCP;
        float      TempValue1        = RCP.RCLength;
        float      TempValue2        = RCP.RCWidth;
        float      TempValue3        = TempValue2 - HP.Size.x;
        GameObject WarehouseScene    = new GameObject(); WarehouseScene.name = Name;//创建场景
        //存放货物
        GameObject Cargos = new GameObject();

        Cargos.name = "Cargos"; Cargos.transform.parent = WarehouseScene.transform;
        Cargos.transform.localPosition = new Vector3(0, 0, 0);
        //添加地面
        GameObject obj    = (GameObject)Resources.Load("Scene/Dimian");
        GameObject dimian = Instantiate(obj);
        float      Width  = HP.Size.z + 8 * RCP.RCLength;

        dimian.transform.localScale    = new Vector3(Width, 0.1f, Width);
        dimian.transform.parent        = WarehouseScene.transform;
        dimian.transform.localPosition = new Vector3(-(Width / 2 - RCP.RCLength * 4), -0.05f, -(Width / 2 - 2 * RCP.RCLength));
        //添加入口滚筒输送机
        GameObject               EnterRollerConveyor = new GameObject();
        RollerConveyorType       type = RollerConveyorType.Intact;
        RollerConveyor_Parameter RCP2 = new RollerConveyor_Parameter();

        RCP2          = PL.RCP; RCP2.RCHigh = RCP2.RCHigh - 0.1f;
        RCP2.RCLength = enterRollerLength;//长度自定义
        //RCP2.RCLength = PL.HP.Size.x * 2 + PL.MHP.HookupDistance + PL.MHP.TunnelWidth - RCP2.RCWidth;
        RollerConveyor.Create_RollerConveyor(RCP2, EnterRollerConveyor, type);
        EnterRollerConveyor.name             = "EnterRollerConveyor";
        EnterRollerConveyor.transform.parent = WarehouseScene.transform;
        EnterRollerConveyor.transform.Rotate(0, -90, 0);
        EnterRollerConveyor.transform.localPosition = new Vector3((RCP2.RCLength + TempValue3), 0, -TempValue2 / 2);
        //添加入口顶升移栽机
        LiftTransferParameter LTP = new LiftTransferParameter();

        LTP.High         = PL.RCP.RCHigh - 0.1f;
        LTP.Width        = PL.RCP.RCWidth;
        LTP.RollerRadius = PL.RCP.RollerRadius;
        LTP.GearDiameter = PL.RCP.RollerRadius * 2;
        GameObject enterLiftTransfer = new GameObject();

        LiftTransfer1.CreateLiftTransfer(enterLiftTransfer, ref LTP);
        enterLiftTransfer.name             = "EnterLiftTransfer";
        enterLiftTransfer.transform.parent = WarehouseScene.transform;
        float tempEnterX = RCP2.RCLength - (PL.HP.Size.x - LTP.Width) + LTP.Width / 2;//入口顶升的X坐标

        enterLiftTransfer.transform.localPosition = new Vector3(tempEnterX, 0, -TempValue2 / 2);
        //添加入口皮带输送机
        GameObject EnterBeltConveyors = new GameObject(); EnterBeltConveyors.name = "EnterBeltConveyors";

        Create_EnterBeltConveyors(PL, EnterBeltConveyors);
        EnterBeltConveyors.transform.parent        = WarehouseScene.transform;
        EnterBeltConveyors.transform.localPosition = new Vector3(tempEnterX, 0, 0);
        //添加顶升移载机设备
        GameObject LiftTransferGroup = new GameObject(); LiftTransferGroup.name = "LiftTransferGroup";

        Create_LiftTransferGroup(PL, LiftTransferGroup);
        LiftTransferGroup.transform.parent        = WarehouseScene.transform;
        LiftTransferGroup.transform.localPosition = new Vector3(0, 0, -TempValue2 / 2);
        //添加滚筒输送机(垂直于高架库方向)
        GameObject RollerConveyorGroup = new GameObject(); RollerConveyorGroup.name = "RollerConveyorGroup";

        Create_RollerConveyorGroup(PL, RollerConveyorGroup);
        RollerConveyorGroup.transform.parent        = WarehouseScene.transform;
        RollerConveyorGroup.transform.localPosition = new Vector3(0, 0, -TempValue2 / 2);
        //添加皮带输送机(平行于高架库方向)
        GameObject BeltConveyorGroup = new GameObject(); BeltConveyorGroup.name = "BeltConveyorGroup";

        Create_BeltConveyorGroup(PL, BeltConveyorGroup);
        BeltConveyorGroup.transform.parent        = WarehouseScene.transform;
        BeltConveyorGroup.transform.localPosition = new Vector3(0, 0, -TempValue2);
        //为场景添加高架库设备
        GameObject HighBays1 = new GameObject(); HighBays1.name = "HighBayGroup";

        HighBay2.Create_HighBays(HP, MHP, HighBays1);
        HighBays1.transform.parent        = WarehouseScene.transform;
        HighBays1.transform.localPosition = new Vector3(0, 0, -(3 * TempValue1 + TempValue2));
        //为场景添加堆垛机设备
        GameObject PilerGroup = new GameObject(); PilerGroup.name = "PilerGroup";

        Create_Pilers(PL, PilerGroup);
        PilerGroup.transform.parent        = WarehouseScene.transform;
        PilerGroup.transform.localPosition = new Vector3(0, 0, -(TempValue1 + TempValue2));
        //添加出口滚筒输送机
        GameObject ExitRollerConveyor    = new GameObject();
        RollerConveyor_Parameter exitRCP = PL.RCP;

        exitRCP.RCLength = exitRollerLength; exitRCP.RCHigh = PL.RCP.RCHigh - 0.1f;
        RollerConveyor.Create_RollerConveyor(exitRCP, ExitRollerConveyor, RollerConveyorType.Intact);
        ExitRollerConveyor.name             = "ExitRollerConveyor";
        ExitRollerConveyor.transform.parent = WarehouseScene.transform;
        int   j         = (PL.MHP.Num + 1) / 2 - 1;
        float tempExitX = -PL.HP.Size.x - j * (PL.HP.Size.x * 2 + PL.MHP.HookupDistance + PL.MHP.TunnelWidth);

        ExitRollerConveyor.transform.Rotate(0, -90, 0);
        ExitRollerConveyor.transform.localPosition = new Vector3(tempExitX, 0, -TempValue2 / 2);
        //添加出口顶升移栽机
        GameObject ExitLiftTransfer = new GameObject();

        ExitLiftTransfer.name = "ExitLiftTransfer";
        LiftTransfer1.CreateLiftTransfer(ExitLiftTransfer, ref LTP);
        ExitLiftTransfer.transform.parent = WarehouseScene.transform;
        tempExitX = tempExitX - exitRollerLength - LTP.Width / 2;
        ExitLiftTransfer.transform.localPosition = new Vector3(tempExitX, 0, -TempValue2 / 2);
        //添加出口皮带输送线
        GameObject ExitBeltConveyors = new GameObject();

        ExitBeltConveyors.name = "ExitBeltConveyors";
        Create_ExitBeltConveyors(PL, ExitBeltConveyors);
        ExitBeltConveyors.transform.parent        = WarehouseScene.transform;
        ExitBeltConveyors.transform.localPosition = new Vector3(tempExitX, 0, 0);
        //给场景添加Message
        WarehouseScene.AddComponent <ShowKeyPositionData>();
        ShowKeyPositionData ShowKeyData = WarehouseScene.GetComponent <ShowKeyPositionData>();
        KeyPositionsData    KPD         = new KeyPositionsData();

        //float[] HighValues = { 1.2f, 1.1f };
        //SI.HighValues = HighValues;
        Create_SceneInfo(ref PL, out KPD);
        ShowKeyData.KeyPositionsData = KPD;
        //Debug.Log(KPD.ConveyorLengths);
        //WarehouseScene.AddComponent<SceneData>();
        //SceneData SD = WarehouseScene.GetComponent<SceneData>();
        //Information sd = new Information(); sd.Name = "Name"; sd.Num = 2;
        ////WarehouseScene.GetComponent<SceneData>().
        //SD.IN = sd;
        GameObject Cargo = new GameObject(); Cargo.name = "Cargo";

        Cargo1.Create_Cargo(KPD.CargoSize, Cargo);
        //SD.IN.Num = 2; SD.IN.Name = "A";
        //输出场景
        MyClass.CreatePrefab(WarehouseScene, Path);
        MyClass.CreatePrefab(Cargo, path2 + Cargo.name);

        //根据参数预创建一个存储状态面板
        //GameObject StorageStateInterface = new GameObject();
        //StorageStateInterface.name = "StorageStateInterface";
        BinsPanel.Ajustment(MHP.Num, HP.FloorsNum, HP.ColumnsNum);
        BinsPanel.Ajustment2(MHP.Num, HP.FloorsNum, HP.ColumnsNum);
        //GameObject.Find("ScriptsContainer").GetComponent<MyClass>().CreatePrefab(StorageStateInterface, path2 +"Simulation/" +StorageStateInterface.name);
    }
Exemplo n.º 15
0
    //输出多线路运动数据
    #region Create_PositionsList
    public void Create_PositionsList(ref ParametersList1 PL, out PositionsList PositonsList)
    {
        HighStoreShelf_Parameter HP  = PL.HP;
        MultiHighBay_Parameter   MHP = PL.MHP;
        RollerConveyor_Parameter RCP = PL.RCP;
        float ConveryorsLength       = 2 * HP.ColumnWidth;

        //高架库位置信息
        //HighBayPositions[i,0]记录第i个高架库坐标的X值,[i,1]记录第i个高架库坐标的Y值,[i,2]记录第i个高架库坐标的Z值;
        float[,] HighBayPositions = new float[MHP.Num, 3];
        for (int i = 0; i < MHP.Num; i++)
        {
            HighBayPositions[i, 0] = -(HP.Size.x / 2 + i * HP.Size.x + ((i + 1) / 2) * MHP.TunnelWidth + (i / 2) * MHP.HookupDistance);
            HighBayPositions[i, 1] = 0; HighBayPositions[i, 2] = -PL.Distance - ConveryorsLength + HP.ColumnWidth;
        }
        //输送线的数据
        //ConveyorPositions[i,0]记录第i个高架库坐标的X值,[i,1]记录第i个高架库坐标的Y值,[i,2]记录第i个高架库坐标的Z值;
        //[i,4]记录输送线的长度,
        float[,] ConveyorPositions = new float[MHP.Num, 4];
        for (int i = 0; i < MHP.Num; i++)
        {
            ConveyorPositions[i, 1] = 0; ConveyorPositions[i, 2] = -PL.Distance;
            ConveyorPositions[i, 3] = 2 * HP.ColumnWidth;
            switch (i % 2)
            {
            case 0:
                ConveyorPositions[i, 0] = -((i + 1) * HP.Size.x + (i / 2) * MHP.TunnelWidth + (i / 2) * MHP.HookupDistance);
                ConveyorPositions[i, 0] = ConveyorPositions[i, 0] + RCP.RCWidth / 2;
                break;

            case 1:
                ConveyorPositions[i, 0] = -(i * HP.Size.x + ((i + 1) / 2) * MHP.TunnelWidth + (i / 2) * MHP.HookupDistance);
                ConveyorPositions[i, 0] = ConveyorPositions[i, 0] - RCP.RCWidth / 2;
                break;
            }
        }
        //堆垛机的坐标数据
        //PilerPositions[i,0]记录第i个高架库坐标的X值,[i,1]记录第i个高架库坐标的Y值,[i,2]记录第i个高架库坐标的Z值;
        float[,] PilerPositions = new float[(MHP.Num + 1) / 2, 3];
        for (int i = 0; i < (MHP.Num + 1) / 2; i++)
        {
            PilerPositions[i, 0] = -(MHP.TunnelWidth / 2 + i * (MHP.TunnelWidth + MHP.HookupDistance) + (2 * i + 1) * HP.Size.x);
            PilerPositions[i, 1] = 0; PilerPositions[i, 2] = -PL.Distance - ConveryorsLength + 2 * HP.ColumnWidth;
        }
        //高架库仓位数据
        float[,,,] StorageBinPositions = new float[HP.FloorsNum, HP.ColumnsNum, 2, 3];
        float temphigh = HP.FloorsHigh[0];

        for (int i = 0; i < HP.FloorsNum; i++)
        {
            for (int j = 0; j < HP.ColumnsNum; j++)
            {
                StorageBinPositions[i, j, 0, 0] = 0; StorageBinPositions[i, j, 0, 1] = temphigh;
                StorageBinPositions[i, j, 0, 2] = -(HP.ColumnWidth * (j + 1) + HP.ColumnWidth / 4);
                StorageBinPositions[i, j, 1, 0] = 0; StorageBinPositions[i, j, 1, 1] = temphigh;
                StorageBinPositions[i, j, 1, 2] = -(HP.ColumnWidth * (j + 1) + 3 * HP.ColumnWidth / 4);
            }
            temphigh = temphigh + HP.FloorsHigh[i + 1];
        }
        //
        PositionsList POL;

        POL.HighBayPositions    = HighBayPositions; POL.PilerPositons = PilerPositions; POL.ConveyorPositons = ConveyorPositions;
        POL.StorageBinPositions = StorageBinPositions;
        PositonsList            = POL;
    }