Beispiel #1
0
        public static EuroPallet FeedEuroPallet(ITransportSection transportSection, float distance, BasePalletData palletData, PalletStatus palletStatus)
        {
            EuroPallet           PalletLoad;
            IEmulationController controller = Core.Assemblies.Assembly.Items.Values.ToList().FirstOrDefault(x => x is IEmulationController) as IEmulationController;

            if (controller != null)
            {
                PalletLoad = controller.GetEuroPallet(transportSection.Route, 0, palletStatus);
                if (PalletLoad != null) //It is not necesary to implement this just return null Pallet load from the controller and a standard load will be created
                {
                    return(PalletLoad);
                }
            }
            try
            {
                EuroPalletInfo palletInfo = new EuroPalletInfo();
                palletInfo.color    = Color.Peru;
                palletInfo.Status   = palletStatus;
                palletInfo.filename = EuroPallet.Mesh;

                //LoadHeight includes the height of the pallet (145mm)
                palletInfo.LoadHeight = 2.2f;
                palletInfo.LoadWidth  = 0.9f;
                palletInfo.LoadLength = 1.3f;

                //Set the dimensions of a EuroPallet (This is the standard size)
                palletInfo.length = 1.2f;
                palletInfo.width  = 0.8f;
                palletInfo.height = 0.14f; // Actual size is 0.144f but reduced so visible space can be added in stack (0.005f space)

                EuroPallet palletLoad = new EuroPallet(palletInfo);

                //palletLoad.Part = (RigidLoadPart)new PalletPart(0.008f, palletInfo.color, palletInfo.length, palletInfo.height, palletInfo.width, true, palletInfo.density, Pallet_Load.Size(PalletType.EuroPallet), palletInfo.rigid);
                palletLoad.Pallet_Data        = palletData;
                palletLoad.Pallet_Data.Weight = 60.0f;
                transportSection.Route.Add(palletLoad, distance);
                Load.Items.Add(palletLoad);

                string SSCCBarcode = GetSSCCBarcode();
                if (SSCCBarcode != "")
                {
                    palletLoad.SSCCBarcode    = SSCCBarcode;
                    palletLoad.Identification = SSCCBarcode;
                }
                return(palletLoad);
            }
            catch (Exception se)
            {
                Core.Environment.Log.Write(se);
                Core.Environment.Scene.Pause();
                return(null);
            }
        }
Beispiel #2
0
        private void StackPallet()
        {
            var createdloads = 1;
            var loadYaw      = Trigonometry.PI(Trigonometry.Angle2Rad(Angle));

            IEmulationController controller = Core.Assemblies.Assembly.Items.Values.ToList().FirstOrDefault(x => x is IEmulationController) as IEmulationController;
            EuroPallet           load;

            while (createdloads < palletStacks)
            {
                if (controller != null)
                {
                    load = controller.GetEuroPallet(null, 0, PalletStatus.Empty);
                }
                else
                {
                    EuroPalletInfo info = new EuroPalletInfo
                    {
                        length   = Length,
                        height   = Height,
                        width    = Width,
                        color    = Color.Peru,
                        InStack  = true,
                        Status   = PalletStatus.Empty,
                        filename = Mesh,
                    };
                    load = new EuroPallet(info);
                }
                //EuroPallet load = new EuroPallet(info);
                load.UserDeletable = false;
                load.Yaw           = loadYaw;
                load.OnSelecting  += palletLoad_OnSelecting;
                var stackY = (Height + 0.005f) * createdloads; // create empty space between loads
                Group(load, new Vector3(0, stackY, 0));
                createdloads++;
                stackedPallets.Add(load);
            }
        }