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); } }
// 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); } }