public void UpdateFromSettings(PlanarAdditiveSettings settings)
        {
            if (settings == null)
            {
                return;
            }
            if (settings is SingleMaterialFFFSettings == false)
            {
                throw new Exception("PrintSettings.UpdateFromSettings: invalid settings type!");
            }

            SingleMaterialFFFSettings ss = settings as SingleMaterialFFFSettings;

            Active = ss;

            LayerHeightMM             = ss.LayerHeightMM;
            OuterShells               = ss.Shells;
            RoofLayers                = ss.RoofLayers;
            FloorLayers               = ss.FloorLayers;
            InfillStepX               = ss.SparseLinearInfillStepX;
            ClipSelfOverlaps          = ss.ClipSelfOverlaps;
            InteriorSolidRegionShells = ss.InteriorSolidRegionShells;
            StartLayers               = ss.StartLayers;
            StartLayerHeightMM        = ss.StartLayerHeightMM;

            GenerateSupport         = ss.GenerateSupport;
            OverhangAngleDeg        = ss.SupportOverhangAngleDeg;
            SupportMinZTips         = ss.SupportMinZTips;
            EnableSupportShell      = ss.EnableSupportShell;
            EnableSupportReleaseOpt = ss.EnableSupportReleaseOpt;
            SupportStepX            = ss.SupportSpacingStepX;
            SupportSolidSpace       = ss.SupportSolidSpace;

            EnableBridging      = ss.EnableBridging;
            MaxBridgeDistanceMM = ss.MaxBridgeWidthMM;

            LayerRangeMin = ss.LayerRangeFilter.a + 1;
            LayerRangeMax = ss.LayerRangeFilter.b + 1;

            NozzleDiameterMM   = ss.Machine.NozzleDiamMM;
            FilamentDiameterMM = ss.Machine.FilamentDiamMM;
            ExtruderTempC      = ss.ExtruderTempC;
            BedTempC           = ss.HeatedBedTempC;
            PrintSpeedMMS      = (int)Math.Round(ss.RapidExtrudeSpeed / 60, 0);
            TravelSpeedMMS     = (int)Math.Round(ss.RapidTravelSpeed / 60, 0);
            FanSpeedX          = (int)Math.Round(ss.FanSpeedX * 100, 0);
            BedSizeXMM         = (int)ss.Machine.BedSizeXMM;
            BedSizeYMM         = (int)ss.Machine.BedSizeYMM;
            BedSizeZMM         = (int)ss.Machine.MaxHeightMM;

            bValueModified = false;
            OnNewSettings?.Invoke(this);
        }
Exemple #2
0
        public void UpdateFromSettings(PrintMeshSO printSO)
        {
            if (printSO == null)
            {
                return;
            }

            ActiveSO = printSO;
            Active   = printSO.Settings;

            // Note!! have to use internal variables here, if we use accessors then we
            // will spawn toolpath invalidations when objects change
            object_type = Active.ObjectType;
            no_voids    = Active.NoVoids;
            shell_only  = Active.OuterShellOnly;
            open_mode   = Active.OpenMeshMode;
            clearance   = Active.Clearance;
            offset_xy   = Active.OffsetXY;

            bValueModified = false;
            OnNewSettings?.Invoke(this);
        }