public void CopyFrom(InkConfig otherInk)
 {
     ZThick            = otherInk.ZThick;
     layertime_ms      = otherInk.layertime_ms;
     firstlayertime_ms = otherInk.firstlayertime_ms;
     numfirstlayers    = otherInk.numfirstlayers;
     resinprice        = otherInk.resinprice; // per liter
 }
 public void CopyFrom(InkConfig otherInk)
 {
     ZThick = otherInk.ZThick;
     layertime_ms = otherInk.layertime_ms;
     firstlayertime_ms = otherInk.firstlayertime_ms;
     numfirstlayers = otherInk.numfirstlayers;
     resinprice = otherInk.resinprice; // per liter
 }
Exemple #3
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);
        }
Exemple #4
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();
 }
Exemple #5
0
 public string AddNewResin(string resinName)
 {
     if (inks.ContainsKey(resinName))
         return "Resin profile name already exists";
     InkConfig ic = new InkConfig(resinName);
     if ((selectedInk != null) && inks.ContainsKey(selectedInk))
         ic.CopyFrom(inks[selectedInk]);
     inks[resinName] = ic;
     SetCurrentInk(resinName);
     return "OK";
 }