/*
         * Copy constructor
         */
        public SliceBuildConfig(SliceBuildConfig source)
        {
            dpmmX             = source.dpmmX;        // dots per mm x
            dpmmY             = source.dpmmY;        // dots per mm y
            xres              = source.xres;
            yres              = source.yres;         // the resolution of the output image
            ZThick            = source.ZThick;       // thickness of the z layer - slicing height
            layertime_ms      = source.layertime_ms; // time to project image per layer in milliseconds
            firstlayertime_ms = source.firstlayertime_ms;
            blanktime_ms      = source.blanktime_ms;
            plat_temp         = source.plat_temp;      // desired platform temperature in celsius
            exportgcode       = source.exportgcode;    // export the gcode file when slicing
            exportsvg         = source.exportsvg;      // export the svg slices when building
            exportimages      = source.exportimages;   // export image slices when building
            m_headercode      = source.m_headercode;   // inserted at beginning of file
            m_footercode      = source.m_footercode;   // inserted at end of file
            m_preliftcode     = source.m_preliftcode;  // inserted between each slice
            m_postliftcode    = source.m_postliftcode; // inserted between each slice
            m_preslicecode    = source.m_preslicecode; // inserted before each slice
            m_mainliftcode    = source.m_mainliftcode; // inserted before postlift and after prelift. its the main lift code

            liftdistance     = source.liftdistance;
            direction        = source.direction;
            numfirstlayers   = source.numfirstlayers;
            XOffset          = source.XOffset;
            YOffset          = source.YOffset;
            slidetiltval     = source.slidetiltval;
            antialiasing     = source.antialiasing;
            usemainliftgcode = source.usemainliftgcode;
            autocalcdelay    = source.autocalcdelay;
            liftfeedrate     = source.liftfeedrate;
            liftretractrate  = source.liftretractrate;
            aaval            = source.aaval;//
            //raise_time_ms = source.raise_time_ms;
        }
 public void CreateDefault()
 {
     numfirstlayers    = 3;
     layertime_ms      = 1000; // 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms      = 2000; // 2 seconds blank
     xres           = 1024;
     yres           = 768;
     ZThick         = .05;
     plat_temp      = 75;
     dpmmX          = 102.4;
     dpmmY          = 76.8;
     XOffset        = 0;
     YOffset        = 0;
     numfirstlayers = 3;
     exportgcode    = true;
     exportsvg      = false;
     exportimages   = false;
     direction      = eBuildDirection.Bottom_Up;
     liftdistance   = 5.0;
     //raise_time_ms = 750;
     slidetiltval     = 0.0;
     antialiasing     = false;
     usemainliftgcode = false;
     autocalcdelay    = false;
     aaval            = 1.5;
     liftfeedrate     = 50.0;  // 50mm/s
     liftretractrate  = 100.0; // 100mm/s
     SetDefaultCodes();        // set up default gcodes
 }
        /*This is used to serialize to the GCode post-header info*/
        public bool Load(String filename)
        {
            try
            {
                LoadGCodes();
                XmlReader xr = (XmlReader)XmlReader.Create(filename);
                xr.ReadStartElement("SliceBuildConfig");
                dpmmX             = double.Parse(xr.ReadElementString("DotsPermmX"));
                dpmmY             = double.Parse(xr.ReadElementString("DotsPermmY"));
                xres              = int.Parse(xr.ReadElementString("XResolution"));
                yres              = int.Parse(xr.ReadElementString("YResolution"));
                ZThick            = double.Parse(xr.ReadElementString("SliceHeight"));
                layertime_ms      = int.Parse(xr.ReadElementString("LayerTime"));
                firstlayertime_ms = int.Parse(xr.ReadElementString("FirstLayerTime"));
                blanktime_ms      = int.Parse(xr.ReadElementString("BlankTime"));
                plat_temp         = int.Parse(xr.ReadElementString("PlatformTemp"));
                exportgcode       = bool.Parse(xr.ReadElementString("ExportGCode"));
                exportsvg         = bool.Parse(xr.ReadElementString("ExportSVG"));
                exportimages      = bool.Parse(xr.ReadElementString("ExportImages"));;
                XOffset           = int.Parse(xr.ReadElementString("XOffset"));
                YOffset           = int.Parse(xr.ReadElementString("YOffset"));
                direction         = (eBuildDirection)Enum.Parse(typeof(eBuildDirection), xr.ReadElementString("Direction"));
                liftdistance      = double.Parse(xr.ReadElementString("LiftDistance"));
                xr.ReadEndElement();
                xr.Close();

                return(true);
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogRecord(ex.Message);
                return(false);
            }
        }
Exemplo n.º 4
0
        private void LoadInternal(ref XmlHelper xh)
        {
            XmlNode sbc = xh.m_toplevel;

            dpmmX = xh.GetDouble(sbc, "DotsPermmX", 102.4);
            dpmmY = xh.GetDouble(sbc, "DotsPermmY", 76.8);
            xres  = xh.GetInt(sbc, "XResolution", 1024);
            yres  = xh.GetInt(sbc, "YResolution", 768);
            //ZThick = xh.GetDouble(sbc, "SliceHeight", 0.05);
            //layertime_ms = xh.GetInt(sbc, "LayerTime", 1000); // 1 second default
            //firstlayertime_ms = xh.GetInt(sbc, "FirstLayerTime", 5000);
            blanktime_ms = xh.GetInt(sbc, "BlankTime", 2000); // 2 seconds blank
            plat_temp    = xh.GetInt(sbc, "PlatformTemp", 75);
            //exportgcode = xh.GetBool(sbc, "ExportGCode"));
            exportsvg = xh.GetBool(sbc, "ExportSVG", false);
            export    = xh.GetBool(sbc, "Export", false);;
            XOffset   = xh.GetInt(sbc, "XOffset", 0);
            YOffset   = xh.GetInt(sbc, "YOffset", 0);
            //numfirstlayers = xh.GetInt(sbc, "NumberofBottomLayers", 3);
            direction        = (eBuildDirection)xh.GetEnum(sbc, "Direction", typeof(eBuildDirection), eBuildDirection.Bottom_Up);
            liftdistance     = xh.GetDouble(sbc, "LiftDistance", 5.0);
            slidetiltval     = xh.GetDouble(sbc, "SlideTiltValue", 0.0);
            antialiasing     = xh.GetBool(sbc, "AntiAliasing", false);
            usemainliftgcode = xh.GetBool(sbc, "UseMainLiftGCode", false);
            aaval            = xh.GetDouble(sbc, "AntiAliasingValue", 1.5);
            liftfeedrate     = xh.GetDouble(sbc, "LiftFeedRate", 50.0);     // 50mm/s
            liftretractrate  = xh.GetDouble(sbc, "LiftRetractRate", 100.0); // 100mm/s
            m_exportopt      = xh.GetString(sbc, "ExportOption", "SUBDIR"); // default to saving in subdirectory
            m_flipX          = xh.GetBool(sbc, "FlipX", false);
            m_flipY          = xh.GetBool(sbc, "FlipY", false);
            m_notes          = xh.GetString(sbc, "Notes", "");
            //m_resinprice = xh.GetDouble(sbc, "ResinPriceL", 0.0);

            m_headercode   = xh.GetString(sbc, "GCodeHeader", DefGCodeHeader());
            m_footercode   = xh.GetString(sbc, "GCodeFooter", DefGCodeFooter());
            m_preslicecode = xh.GetString(sbc, "GCodePreslice", DefGCodePreslice());
            m_liftcode     = xh.GetString(sbc, "GCodeLift", DefGCodeLift());
            selectedInk    = xh.GetString(sbc, "SelectedInk", "Default");
            inks           = new Dictionary <string, InkConfig>();
            List <XmlNode> inkNodes = xh.FindAllChildElement(sbc, "InkConfig");

            foreach (XmlNode xnode in inkNodes)
            {
                string    name = xh.GetString(xnode, "Name", "Default");
                InkConfig ic   = new InkConfig(name);
                ic.Load(xh, xnode);
                inks[name] = ic;
            }
            if (!inks.ContainsKey(selectedInk))
            {
                InkConfig ic = new InkConfig(selectedInk);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                inks[selectedInk] = ic;
            }
            SetCurrentInk(selectedInk);
            minExposure  = xh.GetInt(sbc, "MinTestExposure", 500);
            exposureStep = xh.GetInt(sbc, "TestExposureStep", 200);
        }
        public void CopyFrom(SliceBuildConfig source)
        {
            dpmmX             = source.dpmmX;        // dots per mm x
            dpmmY             = source.dpmmY;        // dots per mm y
            xres              = source.xres;
            yres              = source.yres;         // the resolution of the output image
            ZThick            = source.ZThick;       // thickness of the z layer - slicing height
            layertime_ms      = source.layertime_ms; // time to project image per layer in milliseconds
            firstlayertime_ms = source.firstlayertime_ms;
            blanktime_ms      = source.blanktime_ms;
            plat_temp         = source.plat_temp;       // desired platform temperature in celsius
            // exportgcode = source.exportgcode; // export the gcode file when slicing
            exportsvg          = source.exportsvg;      // export the svg slices when building
            export             = source.export;         // export image slices when building
            exportpng          = source.exportpng;
            m_headercode       = source.m_headercode;   // inserted at beginning of file
            m_footercode       = source.m_footercode;   // inserted at end of file
            m_preslicecode     = source.m_preslicecode; // inserted before each slice
            m_liftcode         = source.m_liftcode;     // its the main lift code
            m_shutterclosecode = source.m_shutterclosecode;
            m_shutteropencode  = source.m_shutteropencode;

            liftdistance       = source.liftdistance;
            direction          = source.direction;
            numfirstlayers     = source.numfirstlayers;
            XOffset            = source.XOffset;
            YOffset            = source.YOffset;
            slidetiltval       = source.slidetiltval;
            antialiasing       = source.antialiasing;
            usemainliftgcode   = source.usemainliftgcode;
            liftfeedrate       = source.liftfeedrate;
            bottomliftfeedrate = source.bottomliftfeedrate;
            liftretractrate    = source.liftretractrate;
            aaval = source.aaval;//
            //m_generateautosupports = source.m_generateautosupports;
            m_exportopt           = source.m_exportopt;
            m_flipX               = source.m_flipX;
            m_flipY               = source.m_flipY;
            m_notes               = source.m_notes;
            m_resinprice          = source.m_resinprice;
            selectedInk           = source.selectedInk;
            m_createoutlines      = source.m_createoutlines;
            m_outlinewidth_inset  = source.m_outlinewidth_inset;
            m_outlinewidth_outset = source.m_outlinewidth_outset;
            if (source.inks != null)
            {
                inks = new Dictionary <string, InkConfig>();
                foreach (KeyValuePair <string, InkConfig> entry in source.inks)
                {
                    inks[entry.Key] = entry.Value;
                }
            }
            minExposure   = source.minExposure;
            exposureStep  = source.exposureStep;
            exportpreview = source.exportpreview;

            userParams = source.userParams;
        }
 public void CreateDefault()
 {
     numfirstlayers    = 3;
     layertime_ms      = 1000; // 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms      = 2000; // 2 seconds blank
     xres           = 1024;
     yres           = 768;
     ZThick         = .05;
     plat_temp      = 75;
     dpmmX          = 102.4;
     dpmmY          = 76.8;
     XOffset        = 0;
     YOffset        = 0;
     numfirstlayers = 3;
     //exportgcode = true;
     exportsvg    = 0;
     export       = false;
     exportpng    = false;
     direction    = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval       = 0.0;
     antialiasing       = false;
     usemainliftgcode   = false;
     aaval              = 1.5;
     liftfeedrate       = 50.0;     // 50mm/s
     bottomliftfeedrate = 25.0;
     liftretractrate    = 100.0;    // 100mm/s
     m_exportopt        = "SUBDIR"; // default to saving in subdirectory
     m_flipX            = false;
     m_flipY            = false;
     m_notes            = "";
     m_resinprice       = 0.0;//
     //set the default gcode segments
     m_headercode       = DefGCodeHeader();
     m_footercode       = DefGCodeFooter();
     m_liftcode         = DefGCodeLift();
     m_preslicecode     = DefGCodePreslice();
     m_shutteropencode  = DefGCodeOpenShutter();
     m_shutterclosecode = DefGCodeCloseShutter();
     inks                  = new Dictionary <string, InkConfig>();
     selectedInk           = "Default";
     inks[selectedInk]     = new InkConfig(selectedInk);
     minExposure           = 500;
     m_createoutlines      = false;
     m_outlinewidth_inset  = 2.0;
     m_outlinewidth_outset = 0.0;
     exposureStep          = 200;
     exportpreview         = PreviewGenerator.ePreview.None;
     userParams            = new UserParameterList();
 }
        public bool Load(String filename)
        {
            m_filename = filename;

            XmlHelper xh        = new XmlHelper();
            bool      fileExist = xh.Start(filename, "SliceBuildConfig");
            XmlNode   sbc       = xh.m_toplevel;

            dpmmX             = xh.GetDouble(sbc, "DotsPermmX", 102.4);
            dpmmY             = xh.GetDouble(sbc, "DotsPermmY", 76.8);
            xres              = xh.GetInt(sbc, "XResolution", 1024);
            yres              = xh.GetInt(sbc, "YResolution", 768);
            ZThick            = xh.GetDouble(sbc, "SliceHeight", 0.05);
            layertime_ms      = xh.GetInt(sbc, "LayerTime", 1000); // 1 second default
            firstlayertime_ms = xh.GetInt(sbc, "FirstLayerTime", 5000);
            blanktime_ms      = xh.GetInt(sbc, "BlankTime", 2000); // 2 seconds blank
            plat_temp         = xh.GetInt(sbc, "PlatformTemp", 75);
            //exportgcode = xh.GetBool(sbc, "ExportGCode"));
            exportsvg        = xh.GetBool(sbc, "ExportSVG", false);
            export           = xh.GetBool(sbc, "Export", false);;
            XOffset          = xh.GetInt(sbc, "XOffset", 0);
            YOffset          = xh.GetInt(sbc, "YOffset", 0);
            numfirstlayers   = xh.GetInt(sbc, "NumberofBottomLayers", 3);
            direction        = (eBuildDirection)xh.GetEnum(sbc, "Direction", typeof(eBuildDirection), eBuildDirection.Bottom_Up);
            liftdistance     = xh.GetDouble(sbc, "LiftDistance", 5.0);
            slidetiltval     = xh.GetDouble(sbc, "SlideTiltValue", 0.0);
            antialiasing     = xh.GetBool(sbc, "AntiAliasing", false);
            usemainliftgcode = xh.GetBool(sbc, "UseMainLiftGCode", false);
            aaval            = xh.GetDouble(sbc, "AntiAliasingValue", 1.5);
            liftfeedrate     = xh.GetDouble(sbc, "LiftFeedRate", 50.0);     // 50mm/s
            liftretractrate  = xh.GetDouble(sbc, "LiftRetractRate", 100.0); // 100mm/s
            m_exportopt      = xh.GetString(sbc, "ExportOption", "SUBDIR"); // default to saving in subdirectory
            m_flipX          = xh.GetBool(sbc, "FlipX", false);
            m_flipY          = xh.GetBool(sbc, "FlipY", false);
            m_notes          = xh.GetString(sbc, "Notes", "");
            m_resinprice     = xh.GetDouble(sbc, "ResinPriceL", 0.0);

            m_headercode   = xh.GetString(sbc, "GCodeHeader", DefGCodeHeader());
            m_footercode   = xh.GetString(sbc, "GCodeFooter", DefGCodeFooter());
            m_preslicecode = xh.GetString(sbc, "GCodePreslice", DefGCodePreslice());
            m_liftcode     = xh.GetString(sbc, "GCodeLift", DefGCodeLift());

            if (!fileExist)
            {
                return(xh.Save(FILE_VERSION));
            }

            return(true);
        }
        /*This is used to serialize to the GCode post-header info*/
        public bool Load(String filename)
        {
            try
            {
                m_filename = filename;
                LoadGCodes();
                XmlReader xr = (XmlReader)XmlReader.Create(filename);
                xr.ReadStartElement("SliceBuildConfig");
                int ver = int.Parse(xr.ReadElementString("FileVersion"));
                if (ver != FILE_VERSION)
                {
                    return(false); // I may try to implement some backward compatibility here...
                }
                dpmmX             = double.Parse(xr.ReadElementString("DotsPermmX"));
                dpmmY             = double.Parse(xr.ReadElementString("DotsPermmY"));
                xres              = int.Parse(xr.ReadElementString("XResolution"));
                yres              = int.Parse(xr.ReadElementString("YResolution"));
                ZThick            = double.Parse(xr.ReadElementString("SliceHeight"));
                layertime_ms      = int.Parse(xr.ReadElementString("LayerTime"));
                firstlayertime_ms = int.Parse(xr.ReadElementString("FirstLayerTime"));
                blanktime_ms      = int.Parse(xr.ReadElementString("BlankTime"));
                plat_temp         = int.Parse(xr.ReadElementString("PlatformTemp"));
                exportgcode       = bool.Parse(xr.ReadElementString("ExportGCode"));
                exportsvg         = bool.Parse(xr.ReadElementString("ExportSVG"));
                exportimages      = bool.Parse(xr.ReadElementString("ExportImages"));;
                XOffset           = int.Parse(xr.ReadElementString("XOffset"));
                YOffset           = int.Parse(xr.ReadElementString("YOffset"));
                numfirstlayers    = int.Parse(xr.ReadElementString("NumberofBottomLayers"));
                direction         = (eBuildDirection)Enum.Parse(typeof(eBuildDirection), xr.ReadElementString("Direction"));
                liftdistance      = double.Parse(xr.ReadElementString("LiftDistance"));
                slidetiltval      = double.Parse(xr.ReadElementString("SlideTiltValue"));
                antialiasing      = bool.Parse(xr.ReadElementString("AntiAliasing"));
                autocalcdelay     = bool.Parse(xr.ReadElementString("AutoCalcDelay"));
                usemainliftgcode  = bool.Parse(xr.ReadElementString("UseMainLiftGCode"));
                aaval             = double.Parse(xr.ReadElementString("AntiAliasingValue"));
                liftfeedrate      = double.Parse(xr.ReadElementString("LiftFeedRate"));
                liftretractrate   = double.Parse(xr.ReadElementString("LiftRetractRate"));

                xr.ReadEndElement();
                xr.Close();

                return(true);
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogRecord(ex.Message);
                return(false);
            }
        }
 public void CreateDefault()
 {
     layertime_ms      = 1000; // 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms      = 2000; // 2 seconds blank
     xres         = 1024;
     yres         = 768;
     ZThick       = .025;
     plat_temp    = 75;
     dpmmX        = 102.4;
     dpmmY        = 76.8;
     XOffset      = 0;
     YOffset      = 0;
     exportgcode  = true;
     exportsvg    = false;
     exportimages = false;
     direction    = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     SetDefaultCodes(); // set up default gcodes
 }
 public void CreateDefault()
 {
     numfirstlayers    = 3;
     layertime_ms      = 1000; // 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms      = 2000; // 2 seconds blank
     xres           = 1024;
     yres           = 768;
     ZThick         = .05;
     plat_temp      = 75;
     dpmmX          = 102.4;
     dpmmY          = 76.8;
     XOffset        = 0;
     YOffset        = 0;
     numfirstlayers = 3;
     //exportgcode = true;
     exportsvg    = false;
     export       = false;
     direction    = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval     = 0.0;
     antialiasing     = false;
     usemainliftgcode = false;
     aaval            = 1.5;
     liftfeedrate     = 50.0;     // 50mm/s
     liftretractrate  = 100.0;    // 100mm/s
     m_exportopt      = "SUBDIR"; // default to saving in subdirectory
     m_flipX          = false;
     m_flipY          = false;
     m_notes          = "";
     m_resinprice     = 0.0;//
     //set the default gcode segments
     m_headercode   = DefGCodeHeader();
     m_footercode   = DefGCodeFooter();
     m_liftcode     = DefGCodeLift();
     m_preslicecode = DefGCodePreslice();
 }
Exemplo n.º 11
0
 /*
  * Copy constructor
  */
 public SliceBuildConfig(SliceBuildConfig source)
 {
     dpmmX             = source.dpmmX;        // dots per mm x
     dpmmY             = source.dpmmY;        // dots per mm y
     xres              = source.xres;
     yres              = source.yres;         // the resolution of the output image
     ZThick            = source.ZThick;       // thickness of the z layer - slicing height
     layertime_ms      = source.layertime_ms; // time to project image per layer in milliseconds
     firstlayertime_ms = source.firstlayertime_ms;
     blanktime_ms      = source.blanktime_ms;
     plat_temp         = source.plat_temp;      // desired platform temperature in celsius
     exportgcode       = source.exportgcode;    // export the gcode file when slicing
     exportsvg         = source.exportsvg;      // export the svg slices when building
     exportimages      = source.exportimages;   // export image slices when building
     m_headercode      = source.m_headercode;   // inserted at beginning of file
     m_footercode      = source.m_footercode;   // inserted at end of file
     m_preliftcode     = source.m_preliftcode;  // inserted between each slice
     m_postliftcode    = source.m_postliftcode; // inserted between each slice
     liftdistance      = source.liftdistance;
     direction         = source.direction;
     XOffset           = source.XOffset;
     YOffset           = source.YOffset;
 }
        public void CopyFrom(SliceBuildConfig source)
        {
            dpmmX             = source.dpmmX;        // dots per mm x
            dpmmY             = source.dpmmY;        // dots per mm y
            xres              = source.xres;
            yres              = source.yres;         // the resolution of the output image
            ZThick            = source.ZThick;       // thickness of the z layer - slicing height
            layertime_ms      = source.layertime_ms; // time to project image per layer in milliseconds
            firstlayertime_ms = source.firstlayertime_ms;
            blanktime_ms      = source.blanktime_ms;
            plat_temp         = source.plat_temp;   // desired platform temperature in celsius
            // exportgcode = source.exportgcode; // export the gcode file when slicing
            exportsvg      = source.exportsvg;      // export the svg slices when building
            export         = source.export;         // export image slices when building
            m_headercode   = source.m_headercode;   // inserted at beginning of file
            m_footercode   = source.m_footercode;   // inserted at end of file
            m_preslicecode = source.m_preslicecode; // inserted before each slice
            m_liftcode     = source.m_liftcode;     // its the main lift code

            liftdistance     = source.liftdistance;
            direction        = source.direction;
            numfirstlayers   = source.numfirstlayers;
            XOffset          = source.XOffset;
            YOffset          = source.YOffset;
            slidetiltval     = source.slidetiltval;
            antialiasing     = source.antialiasing;
            usemainliftgcode = source.usemainliftgcode;
            liftfeedrate     = source.liftfeedrate;
            liftretractrate  = source.liftretractrate;
            aaval            = source.aaval;//
            //m_generateautosupports = source.m_generateautosupports;
            m_exportopt  = source.m_exportopt;
            m_flipX      = source.m_flipX;
            m_flipY      = source.m_flipY;
            m_notes      = source.m_notes;
            m_resinprice = source.m_resinprice;
        }
 public void CreateDefault()
 {
     numfirstlayers    = 3;
     layertime_ms      = 1000; // 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms      = 2000; // 2 seconds blank
     xres           = 1024;
     yres           = 768;
     ZThick         = .05;
     plat_temp      = 75;
     dpmmX          = 102.4;
     dpmmY          = 76.8;
     XOffset        = 0;
     YOffset        = 0;
     numfirstlayers = 3;
     //exportgcode = true;
     exportsvg    = false;
     export       = false;
     direction    = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval     = 0.0;
     antialiasing     = false;
     usemainliftgcode = false;
     aaval            = 1.5;
     liftfeedrate     = 50.0;  // 50mm/s
     liftretractrate  = 100.0; // 100mm/s
     //m_generateautosupports = false; // for testing
     m_exportopt  = "SUBDIR";  // default to saving in subdirectory
     m_flipX      = false;
     m_flipY      = false;
     m_notes      = "";
     m_resinprice = 0.0; //
     //m_sliceimmediate = false;
     SetDefaultCodes();  // set up default gcodes
 }
 public void CreateDefault()
 {
     numfirstlayers = 3;
     layertime_ms = 1000;// 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms = 2000; // 2 seconds blank
     xres = 1024;
     yres = 768;
     ZThick = .05;
     plat_temp = 75;
     dpmmX = 102.4;
     dpmmY = 76.8;
     XOffset = 0;
     YOffset = 0;
     numfirstlayers = 3;
     exportgcode = true;
     exportsvg = false;
     exportimages = false;
     direction = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval = 0.0;
     antialiasing = false;
     usemainliftgcode = false;
     autocalcdelay = false;
     aaval = 1.5;
     liftfeedrate = 50.0;// 50mm/s
     liftretractrate = 100.0;// 100mm/s
     SetDefaultCodes(); // set up default gcodes
 }
        private String m_preliftcode; // inserted before each slice

        #endregion Fields

        #region Constructors

        /*
         Copy constructor
         */
        public SliceBuildConfig(SliceBuildConfig source)
        {
            dpmmX = source.dpmmX; // dots per mm x
            dpmmY = source.dpmmY; // dots per mm y
            xres = source.xres;
            yres = source.yres; // the resolution of the output image
            ZThick = source.ZThick; // thickness of the z layer - slicing height
            layertime_ms = source.layertime_ms; // time to project image per layer in milliseconds
            firstlayertime_ms = source.firstlayertime_ms;
            blanktime_ms = source.blanktime_ms;
            plat_temp = source.plat_temp; // desired platform temperature in celsius
            exportgcode = source.exportgcode; // export the gcode file when slicing
            exportsvg = source.exportsvg; // export the svg slices when building
            exportimages = source.exportimages; // export image slices when building
            m_headercode = source.m_headercode; // inserted at beginning of file
            m_footercode = source.m_footercode; // inserted at end of file
            m_preliftcode = source.m_preliftcode; // inserted between each slice
            m_postliftcode = source.m_postliftcode; // inserted between each slice
            liftdistance = source.liftdistance;
            direction = source.direction;
            numfirstlayers = source.numfirstlayers;
            XOffset = source.XOffset;
            YOffset = source.YOffset;
        }
        /*This is used to serialize to the GCode post-header info*/
        public bool Load(String filename)
        {
            try
            {
                LoadGCodes();
                XmlReader xr = (XmlReader)XmlReader.Create(filename);
                xr.ReadStartElement("SliceBuildConfig");
                int ver = int.Parse(xr.ReadElementString("FileVersion"));
                if (ver != FILE_VERSION)
                {
                    return false; // I may try to implement some backward compatibility here...
                }
                dpmmX = double.Parse(xr.ReadElementString("DotsPermmX"));
                dpmmY = double.Parse(xr.ReadElementString("DotsPermmY"));
                xres = int.Parse(xr.ReadElementString("XResolution"));
                yres = int.Parse(xr.ReadElementString("YResolution"));
                ZThick = double.Parse(xr.ReadElementString("SliceHeight"));
                layertime_ms = int.Parse(xr.ReadElementString("LayerTime"));
                firstlayertime_ms = int.Parse(xr.ReadElementString("FirstLayerTime"));
                blanktime_ms = int.Parse(xr.ReadElementString("BlankTime"));
                plat_temp = int.Parse(xr.ReadElementString("PlatformTemp"));
                exportgcode = bool.Parse(xr.ReadElementString("ExportGCode"));
                exportsvg = bool.Parse(xr.ReadElementString("ExportSVG"));
                exportimages = bool.Parse(xr.ReadElementString("ExportImages")); ;
                XOffset = int.Parse(xr.ReadElementString("XOffset"));
                YOffset = int.Parse(xr.ReadElementString("YOffset"));
                numfirstlayers = int.Parse(xr.ReadElementString("NumberofBottomLayers"));
                direction = (eBuildDirection)Enum.Parse(typeof(eBuildDirection), xr.ReadElementString("Direction"));
                liftdistance = double.Parse(xr.ReadElementString("LiftDistance"));
                xr.ReadEndElement();
                xr.Close();

                return true;
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogRecord(ex.Message);
                return false;
            }
        }
 public void CreateDefault()
 {
     layertime_ms = 1000;// 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms = 2000; // 2 seconds blank
     xres = 1024;
     yres = 768;
     ZThick = .025;
     plat_temp = 75;
     dpmmX = 102.4;
     dpmmY = 76.8;
     XOffset = 0;
     YOffset = 0;
     numfirstlayers = 3;
     exportgcode = true;
     exportsvg = false;
     exportimages = false;
     direction = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     SetDefaultCodes(); // set up default gcodes
 }
Exemplo n.º 18
0
        private void LoadInternal(ref XmlHelper xh)
        {
            XmlNode sbc = xh.m_toplevel;
            dpmmX = xh.GetDouble(sbc, "DotsPermmX", 102.4);
            dpmmY = xh.GetDouble(sbc, "DotsPermmY", 76.8);
            xres = xh.GetInt(sbc, "XResolution", 1024);
            yres = xh.GetInt(sbc, "YResolution", 768);
            //ZThick = xh.GetDouble(sbc, "SliceHeight", 0.05);
            //layertime_ms = xh.GetInt(sbc, "LayerTime", 1000); // 1 second default
            //firstlayertime_ms = xh.GetInt(sbc, "FirstLayerTime", 5000);
            blanktime_ms = xh.GetInt(sbc, "BlankTime", 2000); // 2 seconds blank
            plat_temp = xh.GetInt(sbc, "PlatformTemp", 75);
            //exportgcode = xh.GetBool(sbc, "ExportGCode"));

            exportsvg = xh.GetInt(sbc, "ExportSVG", 0); // the problem is this was previously a boolean variable

            if ((exportsvg < 0) || (exportsvg > 4))
                exportsvg = 0;
            export = xh.GetBool(sbc, "Export", false); ;
            exportpng = xh.GetBool(sbc, "ExportPNG", false); ;

            XOffset = xh.GetInt(sbc, "XOffset", 0);
            YOffset = xh.GetInt(sbc, "YOffset", 0);
            //numfirstlayers = xh.GetInt(sbc, "NumberofBottomLayers", 3);
            direction = (eBuildDirection)xh.GetEnum(sbc, "Direction", typeof(eBuildDirection), eBuildDirection.Bottom_Up);
            liftdistance = xh.GetDouble(sbc, "LiftDistance", 5.0);
            slidetiltval = xh.GetDouble(sbc, "SlideTiltValue", 0.0);
            antialiasing = xh.GetBool(sbc, "AntiAliasing", false);
            usemainliftgcode = xh.GetBool(sbc, "UseMainLiftGCode", false);
            aaval = xh.GetDouble(sbc, "AntiAliasingValue", 1.5);
            liftfeedrate = xh.GetDouble(sbc, "LiftFeedRate", 50.0); // 50mm/s
            bottomliftfeedrate = xh.GetDouble(sbc, "BottomLiftFeedRate", 25.0); // 50mm/s
            liftretractrate = xh.GetDouble(sbc, "LiftRetractRate", 100.0); // 100mm/s
            m_exportopt = xh.GetString(sbc, "ExportOption", "SUBDIR"); // default to saving in subdirectory
            m_flipX = xh.GetBool(sbc, "FlipX", false);
            m_flipY = xh.GetBool(sbc, "FlipY", false);
            m_notes = xh.GetString(sbc, "Notes", "");
            m_createoutlines = xh.GetBool(sbc, "RenderOutlines", false);
            m_outlinewidth_inset = xh.GetDouble(sbc, "OutlineWidth_Inset", 2.0);
            m_outlinewidth_outset = xh.GetDouble(sbc, "OutlineWidth_Outset", 0.0);

            //m_resinprice = xh.GetDouble(sbc, "ResinPriceL", 0.0);

            m_headercode = xh.GetString(sbc, "GCodeHeader", DefGCodeHeader());
            m_footercode = xh.GetString(sbc, "GCodeFooter", DefGCodeFooter());
            m_preslicecode = xh.GetString(sbc, "GCodePreslice", DefGCodePreslice());
            m_liftcode = xh.GetString(sbc, "GCodeLift", DefGCodeLift());
            selectedInk = xh.GetString(sbc, "SelectedInk", "Default");
            inks = new Dictionary<string, InkConfig>();
            List<XmlNode> inkNodes = xh.FindAllChildElement(sbc, "InkConfig");
            foreach (XmlNode xnode in inkNodes)
            {
                string name = xh.GetString(xnode, "Name", "Default");
                InkConfig ic = new InkConfig(name);
                ic.Load(xh, xnode);
                inks[name] = ic;
            }
            if (!inks.ContainsKey(selectedInk))
            {
                InkConfig ic = new InkConfig(selectedInk);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                inks[selectedInk] = ic;
            }
            SetCurrentInk(selectedInk);
            minExposure = xh.GetInt(sbc, "MinTestExposure", 500);
            exposureStep = xh.GetInt(sbc, "TestExposureStep", 200);
            exportpreview = (PreviewGenerator.ePreview)xh.GetEnum(sbc, "ExportPreview", typeof(PreviewGenerator.ePreview), PreviewGenerator.ePreview.None);
            xh.LoadUserParamList(userParams);
        }
Exemplo n.º 19
0
 public void CreateDefault()
 {
     numfirstlayers = 3;
     layertime_ms = 1000;// 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms = 2000; // 2 seconds blank
     xres = 1024;
     yres = 768;
     ZThick = .05;
     plat_temp = 75;
     dpmmX = 102.4;
     dpmmY = 76.8;
     XOffset = 0;
     YOffset = 0;
     numfirstlayers = 3;
     //exportgcode = true;
     exportsvg = 0;
     export = false;
     exportpng = false;
     direction = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval = 0.0;
     antialiasing = false;
     usemainliftgcode = false;
     aaval = 1.5;
     liftfeedrate = 50.0;// 50mm/s
     bottomliftfeedrate = 25.0;
     liftretractrate = 100.0;// 100mm/s
     m_exportopt = "SUBDIR"; // default to saving in subdirectory
     m_flipX = false;
     m_flipY = false;
     m_notes = "";
     m_resinprice = 0.0;//
     //set the default gcode segments
     m_headercode = DefGCodeHeader();
     m_footercode = DefGCodeFooter();
     m_liftcode = DefGCodeLift();
     m_preslicecode = DefGCodePreslice();
     inks = new Dictionary<string, InkConfig>();
     selectedInk = "Default";
     inks[selectedInk] = new InkConfig(selectedInk);
     minExposure = 500;
     m_createoutlines = false;
     m_outlinewidth_inset = 2.0;
     m_outlinewidth_outset = 0.0;
     exposureStep = 200;
     exportpreview = PreviewGenerator.ePreview.None;
     userParams = new UserParameterList();
 }
 public void CreateDefault()
 {
     numfirstlayers = 3;
     layertime_ms = 1000;// 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms = 2000; // 2 seconds blank
     xres = 1024;
     yres = 768;
     ZThick = .05;
     plat_temp = 75;
     dpmmX = 102.4;
     dpmmY = 76.8;
     XOffset = 0;
     YOffset = 0;
     numfirstlayers = 3;
     //exportgcode = true;
     exportsvg = false;
     export = false;
     direction = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval = 0.0;
     antialiasing = false;
     usemainliftgcode = false;
     aaval = 1.5;
     liftfeedrate = 50.0;// 50mm/s
     liftretractrate = 100.0;// 100mm/s
     m_exportopt = "SUBDIR"; // default to saving in subdirectory
     m_flipX = false;
     m_flipY = false;
     m_notes = "";
     m_resinprice = 0.0;//
     //set the default gcode segments
     m_headercode = DefGCodeHeader();
     m_footercode = DefGCodeFooter();
     m_liftcode = DefGCodeLift();
     m_preslicecode = DefGCodePreslice();
 }
        public bool Load(String filename)
        {
            m_filename = filename;

            LoadGCodes();
            XmlHelper xh = new XmlHelper();
            bool fileExist = xh.Start(filename, "SliceBuildConfig");
            XmlNode sbc = xh.m_toplevel;

            dpmmX = xh.GetDouble(sbc, "DotsPermmX", 102.4);
            dpmmY = xh.GetDouble(sbc, "DotsPermmY", 76.8);
            xres = xh.GetInt(sbc, "XResolution", 1024);
            yres = xh.GetInt(sbc, "YResolution", 768);
            ZThick = xh.GetDouble(sbc, "SliceHeight", 0.05);
            layertime_ms = xh.GetInt(sbc, "LayerTime", 1000); // 1 second default
            firstlayertime_ms = xh.GetInt(sbc, "FirstLayerTime", 5000);
            blanktime_ms = xh.GetInt(sbc, "BlankTime", 2000); // 2 seconds blank
            plat_temp = xh.GetInt(sbc, "PlatformTemp", 75);
            //exportgcode = xh.GetBool(sbc, "ExportGCode"));
            exportsvg = xh.GetBool(sbc, "ExportSVG", false);
            export = xh.GetBool(sbc, "Export", false); ;
            XOffset = xh.GetInt(sbc, "XOffset", 0);
            YOffset = xh.GetInt(sbc, "YOffset", 0);
            numfirstlayers = xh.GetInt(sbc, "NumberofBottomLayers", 3);
            direction = (eBuildDirection)xh.GetEnum(sbc, "Direction", typeof(eBuildDirection), eBuildDirection.Bottom_Up);
            liftdistance = xh.GetDouble(sbc, "LiftDistance", 5.0);
            slidetiltval = xh.GetDouble(sbc, "SlideTiltValue", 0.0);
            antialiasing = xh.GetBool(sbc, "AntiAliasing", false);
            usemainliftgcode = xh.GetBool(sbc, "UseMainLiftGCode", false);
            aaval = xh.GetDouble(sbc, "AntiAliasingValue", 1.5);
            liftfeedrate = xh.GetDouble(sbc, "LiftFeedRate", 50.0); // 50mm/s
            liftretractrate = xh.GetDouble(sbc, "LiftRetractRate", 100.0); // 100mm/s
            m_exportopt = xh.GetString(sbc, "ExportOption", "SUBDIR"); // default to saving in subdirectory
            m_flipX = xh.GetBool(sbc, "FlipX", false);
            m_flipY = xh.GetBool(sbc, "FlipY", false);
            m_notes = xh.GetString(sbc, "Notes", "");
            m_resinprice = xh.GetDouble(sbc, "ResinPriceL", 0.0);

            if (!fileExist)
            {
                return xh.Save(FILE_VERSION);
            }

            return true;
        }
 public void CreateDefault()
 {
     numfirstlayers = 3;
     layertime_ms = 1000;// 1 second default
     firstlayertime_ms = 5000;
     blanktime_ms = 2000; // 2 seconds blank
     xres = 1024;
     yres = 768;
     ZThick = .05;
     plat_temp = 75;
     dpmmX = 102.4;
     dpmmY = 76.8;
     XOffset = 0;
     YOffset = 0;
     numfirstlayers = 3;
     //exportgcode = true;
     exportsvg = false;
     export = false;
     direction = eBuildDirection.Bottom_Up;
     liftdistance = 5.0;
     //raise_time_ms = 750;
     slidetiltval = 0.0;
     antialiasing = false;
     usemainliftgcode = false;
     aaval = 1.5;
     liftfeedrate = 50.0;// 50mm/s
     liftretractrate = 100.0;// 100mm/s
     //m_generateautosupports = false; // for testing
     m_exportopt = "SUBDIR"; // default to saving in subdirectory
     m_flipX = false;
     m_flipY = false;
     m_notes = "";
     m_resinprice = 0.0;//
     //m_sliceimmediate = false;
     SetDefaultCodes(); // set up default gcodes
 }
        public void CopyFrom(SliceBuildConfig source)
        {
            dpmmX = source.dpmmX; // dots per mm x
            dpmmY = source.dpmmY; // dots per mm y
            xres = source.xres;
            yres = source.yres; // the resolution of the output image
            ZThick = source.ZThick; // thickness of the z layer - slicing height
            layertime_ms = source.layertime_ms; // time to project image per layer in milliseconds
            firstlayertime_ms = source.firstlayertime_ms;
            blanktime_ms = source.blanktime_ms;
            plat_temp = source.plat_temp; // desired platform temperature in celsius
            // exportgcode = source.exportgcode; // export the gcode file when slicing
            exportsvg = source.exportsvg; // export the svg slices when building
            export = source.export; // export image slices when building
            m_headercode = source.m_headercode; // inserted at beginning of file
            m_footercode = source.m_footercode; // inserted at end of file
            m_preliftcode = source.m_preliftcode; // inserted between each slice
            m_postliftcode = source.m_postliftcode; // inserted between each slice
            m_preslicecode = source.m_preslicecode; // inserted before each slice
            m_mainliftcode = source.m_mainliftcode; // inserted before postlift and after prelift. its the main lift code

            liftdistance = source.liftdistance;
            direction = source.direction;
            numfirstlayers = source.numfirstlayers;
            XOffset = source.XOffset;
            YOffset = source.YOffset;
            slidetiltval = source.slidetiltval;
            antialiasing = source.antialiasing;
            usemainliftgcode = source.usemainliftgcode;
            liftfeedrate = source.liftfeedrate;
            liftretractrate = source.liftretractrate;
            aaval = source.aaval;//
            //m_generateautosupports = source.m_generateautosupports;
            m_exportopt = source.m_exportopt;
            m_flipX = source.m_flipX;
            m_flipY = source.m_flipY;
            m_notes = source.m_notes;
            m_resinprice = source.m_resinprice;
        }
Exemplo n.º 24
0
        private void LoadInternal(ref XmlHelper xh)
        {
            XmlNode sbc = xh.m_toplevel;

            dpmmX = xh.GetDouble(sbc, "DotsPermmX", 102.4);
            dpmmY = xh.GetDouble(sbc, "DotsPermmY", 76.8);
            xres  = xh.GetInt(sbc, "XResolution", 1024);
            yres  = xh.GetInt(sbc, "YResolution", 768);
            //ZThick = xh.GetDouble(sbc, "SliceHeight", 0.05);
            //layertime_ms = xh.GetInt(sbc, "LayerTime", 1000); // 1 second default
            //firstlayertime_ms = xh.GetInt(sbc, "FirstLayerTime", 5000);
            blanktime_ms = xh.GetInt(sbc, "BlankTime", 2000); // 2 seconds blank
            plat_temp    = xh.GetInt(sbc, "PlatformTemp", 75);
            //exportgcode = xh.GetBool(sbc, "ExportGCode"));

            exportsvg = xh.GetInt(sbc, "ExportSVG", 0); // the problem is this was previously a boolean variable

            if ((exportsvg < 0) || (exportsvg > 4))
            {
                exportsvg = 0;
            }
            export    = xh.GetBool(sbc, "Export", false);;
            exportpng = xh.GetBool(sbc, "ExportPNG", false);;

            XOffset = xh.GetInt(sbc, "XOffset", 0);
            YOffset = xh.GetInt(sbc, "YOffset", 0);
            //numfirstlayers = xh.GetInt(sbc, "NumberofBottomLayers", 3);
            direction             = (eBuildDirection)xh.GetEnum(sbc, "Direction", typeof(eBuildDirection), eBuildDirection.Bottom_Up);
            liftdistance          = xh.GetDouble(sbc, "LiftDistance", 5.0);
            slidetiltval          = xh.GetDouble(sbc, "SlideTiltValue", 0.0);
            antialiasing          = xh.GetBool(sbc, "AntiAliasing", false);
            usemainliftgcode      = xh.GetBool(sbc, "UseMainLiftGCode", false);
            aaval                 = xh.GetDouble(sbc, "AntiAliasingValue", 1.5);
            liftfeedrate          = xh.GetDouble(sbc, "LiftFeedRate", 50.0);       // 50mm/s
            bottomliftfeedrate    = xh.GetDouble(sbc, "BottomLiftFeedRate", 25.0); // 50mm/s
            liftretractrate       = xh.GetDouble(sbc, "LiftRetractRate", 100.0);   // 100mm/s
            m_exportopt           = xh.GetString(sbc, "ExportOption", "SUBDIR");   // default to saving in subdirectory
            m_flipX               = xh.GetBool(sbc, "FlipX", false);
            m_flipY               = xh.GetBool(sbc, "FlipY", false);
            m_notes               = xh.GetString(sbc, "Notes", "");
            m_createoutlines      = xh.GetBool(sbc, "RenderOutlines", false);
            m_outlinewidth_inset  = xh.GetDouble(sbc, "OutlineWidth_Inset", 2.0);
            m_outlinewidth_outset = xh.GetDouble(sbc, "OutlineWidth_Outset", 0.0);


            m_feed_thickness   = xh.GetDouble(sbc, "FeedThickness", 1);
            m_wall_thickness   = xh.GetDouble(sbc, "WallThickness", 1);
            m_speed_spareading = xh.GetDouble(sbc, "SpeedSpareading", 1);
            m_speed_printing   = xh.GetDouble(sbc, "SpeedPrinting", 1);
            m_roller_speed     = xh.GetDouble(sbc, "Speed_printing", 1);
            m_bottom_layers    = xh.GetDouble(sbc, "BottomLayers", 1);


            //m_resinprice = xh.GetDouble(sbc, "ResinPriceL", 0.0);

            m_headercode   = xh.GetString(sbc, "GCodeHeader", DefGCodeHeader());
            m_footercode   = xh.GetString(sbc, "GCodeFooter", DefGCodeFooter());
            m_preslicecode = xh.GetString(sbc, "GCodePreslice", DefGCodePreslice());
            m_liftcode     = xh.GetString(sbc, "GCodeLift", DefGCodeLift());
            m_layercode    = xh.GetString(sbc, "GCodeLayer", DefGCodeLayer());
            selectedInk    = xh.GetString(sbc, "SelectedInk", "Default");

            selectedpowder = xh.GetString(sbc, "SelectedPowder", "Default");

            selectedfluid = xh.GetString(sbc, "SelectedFluid", "Default");


            inks = new Dictionary <string, InkConfig>();
            List <XmlNode> inkNodes = xh.FindAllChildElement(sbc, "InkConfig");

            foreach (XmlNode xnode in inkNodes)
            {
                string    name = xh.GetString(xnode, "Name", "Default");
                InkConfig ic   = new InkConfig(name);
                ic.Load(xh, xnode);
                inks[name] = ic;
            }
            if (!inks.ContainsKey(selectedInk))
            {
                InkConfig ic = new InkConfig(selectedInk);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                inks[selectedInk] = ic;
            }

            fluids = new Dictionary <string, FluidConfig>();
            List <XmlNode> fluidNodes = xh.FindAllChildElement(sbc, "FluidConfig");

            foreach (XmlNode xnode in fluidNodes)
            {
                string name = xh.GetString(xnode, "Name", "Default");
                var    ic   = new FluidConfig(name);
                ic.Load(xh, xnode);
                fluids[name] = ic;
            }
            if (!fluids.ContainsKey(selectedfluid))
            {
                FluidConfig ic = new FluidConfig(selectedfluid);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                fluids[selectedfluid] = ic;
            }


            powders = new Dictionary <string, PowderConfig>();
            List <XmlNode> powderNodes = xh.FindAllChildElement(sbc, "PowderConfig");

            foreach (XmlNode xnode in powderNodes)
            {
                string name = xh.GetString(xnode, "Name", "Default");
                var    ic   = new PowderConfig(name);
                ic.Load(xh, xnode);
                powders[name] = ic;
            }
            if (!powders.ContainsKey(selectedpowder))
            {
                PowderConfig ic = new PowderConfig(selectedpowder);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                powders[selectedpowder] = ic;
            }

            SetCurrentInk(selectedInk);

            SetCurrentPowder(selectedpowder);
            SetCurrentFluid(selectedfluid);

            minExposure   = xh.GetInt(sbc, "MinTestExposure", 500);
            exposureStep  = xh.GetInt(sbc, "TestExposureStep", 200);
            exportpreview = (PreviewGenerator.ePreview)xh.GetEnum(sbc, "ExportPreview", typeof(PreviewGenerator.ePreview), PreviewGenerator.ePreview.None);



            xh.LoadUserParamList(userParams);
        }
Exemplo n.º 25
0
        public void CopyFrom(SliceBuildConfig source)
        {
            dpmmX = source.dpmmX; // dots per mm x
            dpmmY = source.dpmmY; // dots per mm y
            xres = source.xres;
            yres = source.yres; // the resolution of the output image
            ZThick = source.ZThick; // thickness of the z layer - slicing height
            layertime_ms = source.layertime_ms; // time to project image per layer in milliseconds
            firstlayertime_ms = source.firstlayertime_ms;
            blanktime_ms = source.blanktime_ms;
            plat_temp = source.plat_temp; // desired platform temperature in celsius
            // exportgcode = source.exportgcode; // export the gcode file when slicing
            exportsvg = source.exportsvg; // export the svg slices when building
            export = source.export; // export image slices when building
            exportpng = source.exportpng;
            m_headercode = source.m_headercode; // inserted at beginning of file
            m_footercode = source.m_footercode; // inserted at end of file
            m_preslicecode = source.m_preslicecode; // inserted before each slice
            m_liftcode = source.m_liftcode; // its the main lift code

            liftdistance = source.liftdistance;
            direction = source.direction;
            numfirstlayers = source.numfirstlayers;
            XOffset = source.XOffset;
            YOffset = source.YOffset;
            slidetiltval = source.slidetiltval;
            antialiasing = source.antialiasing;
            usemainliftgcode = source.usemainliftgcode;
            liftfeedrate = source.liftfeedrate;
            bottomliftfeedrate = source.bottomliftfeedrate;
            liftretractrate = source.liftretractrate;
            aaval = source.aaval;//
            //m_generateautosupports = source.m_generateautosupports;
            m_exportopt = source.m_exportopt;
            m_flipX = source.m_flipX;
            m_flipY = source.m_flipY;
            m_notes = source.m_notes;
            m_resinprice = source.m_resinprice;
            selectedInk = source.selectedInk;
            m_createoutlines = source.m_createoutlines;
            m_outlinewidth_inset = source.m_outlinewidth_inset;
            m_outlinewidth_outset = source.m_outlinewidth_outset;
            if (source.inks != null)
            {
                inks = new Dictionary<string, InkConfig>();
                foreach (KeyValuePair<string, InkConfig> entry in source.inks)
                {
                    inks[entry.Key] = entry.Value;
                }
            }
            minExposure = source.minExposure;
            exposureStep = source.exposureStep;
            exportpreview = source.exportpreview;

            userParams = source.userParams;
        }