Exemplo n.º 1
0
        public static SupportProfile CreateDefault()
        {
            var defaultSupportProfile = new SupportProfile();

            defaultSupportProfile.DisplayName = "Default";
            defaultSupportProfile.SupportAmountOfSibblingLayers = 40;
            defaultSupportProfile.SupportInfillDistance         = 3;
            defaultSupportProfile.SupportOverhangDistance       = 3;
            defaultSupportProfile.SupportLowestPointsDistance   = 2.1f;
            defaultSupportProfile.ASegmentHeight = 0.2f;
            defaultSupportProfile.ASegmentRadius = 0.35f;
            defaultSupportProfile.BSegmentHeight = 1.0f;
            defaultSupportProfile.BSegmentRadius = 0.5f;
            defaultSupportProfile.CSegmentRadius = 0.5f;
            defaultSupportProfile.DSegmentHeight = 1.4f;
            defaultSupportProfile.DSegmentRadius = 0.5f;

            defaultSupportProfile.SupportTopRadius    = 0.2f;
            defaultSupportProfile.SupportTopHeight    = 4f;
            defaultSupportProfile.SupportMiddleRadius = 0.4f;
            defaultSupportProfile.SupportBottomHeight = 1f;
            defaultSupportProfile.SupportBottomRadius = 2f;

            defaultSupportProfile.SupportLowestPointsOffset = new List <float>()
            {
                0.3f, 0.5f, 0.7f, 1f
            };
            defaultSupportProfile.SupportLowestPointsDistanceOffset = new List <float>()
            {
                1f, 2f, 3f, 4f
            };

            defaultSupportProfile.SurfaceAngles = new List <float>();
            defaultSupportProfile.SurfaceAngles.Add(30);
            defaultSupportProfile.SurfaceAngles.Add(45);

            defaultSupportProfile.SurfaceAngleDistanceFactors = new List <float>();
            defaultSupportProfile.SurfaceAngleDistanceFactors.Add(1.1f);
            defaultSupportProfile.SurfaceAngleDistanceFactors.Add(1.4f);
            defaultSupportProfile.Selected = true;
            defaultSupportProfile.Default  = true;

            defaultSupportProfile.SupportIntermittedConnectionHeight = 1f;

            return(defaultSupportProfile);
        }
Exemplo n.º 2
0
        public BindingList <MaterialsBySupplier> GetMaterialsByResolution(AtumPrinter selectedPrinter)
        {
            var materialsByResolution = new BindingList <MaterialsBySupplier>();

            foreach (var material in this.Materials)
            {
                if (material.XYResolution == selectedPrinter.PrinterXYResolutionAsInt && selectedPrinter is AtumDLPStation5 && !string.IsNullOrEmpty(material.PrinterHardwareType))
                {
                    var materialBySupplier = new MaterialsBySupplier();
                    materialBySupplier.Supplier = this.Supplier;
                    materialBySupplier.Materials.Add(material);
                    materialsByResolution.Add(materialBySupplier);
                }
                else if (material.XYResolution == selectedPrinter.PrinterXYResolutionAsInt && ((selectedPrinter is AtumV15Printer) || (selectedPrinter is AtumV20Printer)) && string.IsNullOrEmpty(material.PrinterHardwareType))
                {
                    var materialBySupplier = new MaterialsBySupplier();
                    materialBySupplier.Supplier = this.Supplier;

                    if (material.SupportProfiles == null)
                    {
                        material.SupportProfiles = new List <SupportProfile>();
                    }

                    if (material.SupportProfiles.Count == 0)
                    {
                        material.SupportProfiles.Add(SupportProfile.CreateDefault());
                    }
                    materialBySupplier.Materials.Add(material);
                    materialsByResolution.Add(materialBySupplier);
                }
                else if (material.XYResolution == selectedPrinter.PrinterXYResolutionAsInt && selectedPrinter is LoctiteV10 && !string.IsNullOrEmpty(material.PrinterHardwareType))
                {
                    var materialBySupplier = new MaterialsBySupplier();
                    materialBySupplier.Supplier = this.Supplier;

                    if (material.SupportProfiles == null)
                    {
                        material.SupportProfiles = new List <SupportProfile>();
                    }

                    if (material.SupportProfiles.Count == 0)
                    {
                        material.SupportProfiles.Add(SupportProfile.CreateDefault());
                    }
                    materialBySupplier.Materials.Add(material);
                    materialsByResolution.Add(materialBySupplier);
                }
            }

            var orderedBindingList = new BindingList <MaterialsBySupplier>();

            if (materialsByResolution.Count > 0)
            {
                var orderedList = materialsByResolution.OrderBy(s => s.Materials[0].Name).ToList();
                foreach (var orderedMaterial in orderedList)
                {
                    orderedBindingList.Add(orderedMaterial);
                }
            }



            return(orderedBindingList);
        }