Пример #1
0
        //  public static List<ICaseControllerCommon> CaseControllers = new List<ICaseControllerCommon>();

        //Feed case load should actually be part of the basic code for BK10 (perhaps common)
        //Then we want to add default and selectable types of loads that can be configured within a project
        //These types will then be used to generate loads and add them to the model at the correct place
        //For now we just have a default type which cannot be changed on a project specific basis
        public static Case_Load FeedCaseLoad(ITransportSection transportSection, float distance, BaseCaseData caseData)
        {
            Case_Load            caseLoad;
            IEmulationController controller = Core.Assemblies.Assembly.Items.Values.ToList().FirstOrDefault(x => x is IEmulationController) as IEmulationController;

            if (controller != null)
            {
                caseLoad = controller.GetCaseLoad(transportSection.Route, 0);
                if (caseLoad != null) //It is not necesary to implement this just return null case load from the controller and a standard load will be created
                {
                    return(caseLoad);
                }
            }

            try
            {
                string SSCCBarcode = "";

                MeshInfo boxInfo = new MeshInfo();
                boxInfo.color    = System.Drawing.Color.Peru;
                boxInfo.filename = Case_Load.GraphicsMesh;

                SSCCBarcode    = GetSSCCBarcode();
                boxInfo.length = 0.6f;
                boxInfo.width  = 0.4f;
                boxInfo.height = 0.28f;

                Case_Load boxLoad = new Case_Load(boxInfo);
                boxLoad.Case_Data        = caseData;
                boxLoad.Case_Data.Weight = 2.3f;
                transportSection.Route.Add(boxLoad, distance);
                Experior.Core.Loads.Load.Items.Add(boxLoad);

                if (SSCCBarcode != "")
                {
                    boxLoad.SSCCBarcode    = SSCCBarcode;
                    boxLoad.Identification = SSCCBarcode;
                }
                return(boxLoad);
            }
            catch (Exception se)
            {
                Core.Environment.Log.Write(se);
                Core.Environment.Scene.Pause();
                return(null);
            }
        }
Пример #2
0
        public static Case_Load FeedCaseLoad(ITransportSection transportSection, float distance, float length, float width, float height, float weight, Color color, int barcodeLength, BaseCaseData caseData)
        {
            try
            {
                string SSCCBarcode = "";

                MeshInfo boxInfo = new MeshInfo();
                boxInfo.color    = color;
                boxInfo.filename = Case_Load.GraphicsMesh;

                SSCCBarcode    = GetSSCCBarcode();// GetSSCCBarcode(barcodeLength);
                boxInfo.length = length;
                boxInfo.width  = width;
                boxInfo.height = height;

                Case_Load boxLoad = new Case_Load(boxInfo);
                boxLoad.Case_Data        = caseData;
                boxLoad.Case_Data.Weight = weight;
                transportSection.Route.Add(boxLoad, distance);
                Experior.Core.Loads.Load.Items.Add(boxLoad);

                if (SSCCBarcode != "")
                {
                    boxLoad.SSCCBarcode = SSCCBarcode;
                }
                return(boxLoad);
            }
            catch (Exception se)
            {
                Core.Environment.Log.Write(se);
                Core.Environment.Scene.Pause();
                return(null);
            }
        }
Пример #3
0
        /// <summary>
        /// Method to return a Tray load
        /// </summary>
        /// <param name="transportSection">The transport section to add the load too</param>
        /// <param name="distance">The position distance along the transport section</param>
        /// <param name="trayData">Base tray data</param>
        /// <param name="trayStatus">Tray status (Empty, Loaded or Stacked)</param>
        /// <returns>Load of type Tray</returns>
        public static Tray FeedTrayLoad(ITransportSection transportSection, float distance, BaseCaseData trayData, TrayStatus trayStatus)
        {
            Tray trayLoad;
            IEmulationController controller = Core.Assemblies.Assembly.Items.Values.ToList().FirstOrDefault(x => x is IEmulationController) as IEmulationController;

            if (controller != null)
            {
                trayLoad = controller.GetTray(transportSection.Route, 0, trayStatus);
                if (trayLoad != null) //It is not necesary to implement this just return null case load from the controller and a standard load will be created
                {
                    return(trayLoad);
                }
            }
            try
            {
                TrayInfo trayInfo = new TrayInfo();
                trayInfo.color      = Color.Peru;
                trayInfo.filename   = Tray.Mesh;
                trayInfo.Status     = trayStatus;
                trayInfo.TrayStacks = 6;

                //LoadHeight includes the height of the tray (280mm)
                trayInfo.LoadHeight = 0.410f;
                trayInfo.LoadWidth  = 0.4f;
                trayInfo.LoadLength = 0.6f;

                //Set the dimensions of a tray (This is the standard size)
                trayInfo.length = 0.65f;
                trayInfo.width  = 0.45f;
                trayInfo.height = 0.058f; // Actual size is 0.063f but reduced so visible space can be added in stack (0.005f space)

                trayLoad = new Tray(trayInfo);

                trayLoad.Case_Data = trayData;
                transportSection.Route.Add(trayLoad, distance);
                Load.Items.Add(trayLoad);

                string SSCCBarcode = GetSSCCBarcode();
                if (SSCCBarcode != "")
                {
                    trayLoad.SSCCBarcode    = SSCCBarcode;
                    trayLoad.Identification = SSCCBarcode;
                }
                return(trayLoad);
            }
            catch (Exception se)
            {
                Core.Environment.Log.Write(se);
                Core.Environment.Scene.Pause();
                return(null);
            }
        }