public bool Load(XmlHelper xh, XmlNode xnode)
 {
     Name = xh.GetString(xnode, "Name", "Default");
     ZThick = xh.GetDouble(xnode, "SliceHeight", 0.05);
     layertime_ms = xh.GetInt(xnode, "LayerTime", 1000);
     firstlayertime_ms = xh.GetInt(xnode, "FirstLayerTime", 5000);
     numfirstlayers = xh.GetInt(xnode, "NumberofBottomLayers", 3);
     resinprice = xh.GetDouble(xnode, "ResinPriceL", 0.0);
     return true;
 }
Exemplo n.º 2
0
 public bool Load(XmlHelper xh, XmlNode xnode)
 {
     Name              = xh.GetString(xnode, "Name", "Default");
     ZThick            = xh.GetDouble(xnode, "SliceHeight", 0.05);
     layertime_ms      = xh.GetInt(xnode, "LayerTime", 1000);
     firstlayertime_ms = xh.GetInt(xnode, "FirstLayerTime", 5000);
     numfirstlayers    = xh.GetInt(xnode, "NumberofBottomLayers", 3);
     resinprice        = xh.GetDouble(xnode, "ResinPriceL", 0.0);
     return(true);
 }
Exemplo n.º 3
0
        public bool Load(XmlHelper xh, XmlNode parent)
        {
            XmlNode mdc = xh.FindSection(parent, "MonitorDriverConfig");

            m_XDLPRes = xh.GetDouble(mdc, "DLP_X_Res", 1024.0);
            m_YDLPRes = xh.GetDouble(mdc, "DLP_Y_Res", 768.0);
            // m_Xpixpermm and m_Ypixpermm are calculated dinamically, no need to save/load
            //m_Xpixpermm = xh.GetDouble(mdc, "PixPermmX", 10.0);
            //m_Ypixpermm = xh.GetDouble(mdc, "PixPermmY", 10.0);
            m_monitorid = xh.GetString(mdc, "MonitorID", "");
            m_displayconnectionenabled = xh.GetBool(mdc, "DisplayCommEnabled", false);
            m_displayconnection.Load(xh, mdc);
            return(true);
        }
Exemplo n.º 4
0
        public void Load(String filename)
        {
            XmlHelper xh        = new XmlHelper();
            bool      fileExist = xh.Start(filename, "SupportConfig");
            XmlNode   sc        = xh.m_toplevel;

            xspace         = xh.GetDouble(sc, "XSpace", 5.0);
            yspace         = xh.GetDouble(sc, "YSpace", 5.0);
            mingap         = xh.GetDouble(sc, "MinAdaptiveGap", 5.0);
            htrad          = xh.GetDouble(sc, "HeadTopRadiusMM", 0.2);
            hbrad          = xh.GetDouble(sc, "HeadBottomRadiusMM", 0.5);
            ftrad          = xh.GetDouble(sc, "FootTopRadiusMM", 0.5);
            fbrad          = xh.GetDouble(sc, "FootBottomRadiusMM", 2.0);
            fbrad2         = xh.GetDouble(sc, "FootBottomIntraRadiusMM", 0.2);
            downwardAngle  = xh.GetDouble(sc, "DownwardAngle", 45.0);
            m_onlydownward = xh.GetBool(sc, "GenerateOnDownward", false);
            ZAnalyze       = (float)xh.GetDouble(sc, "ZAnalyze", .25);

            if (!fileExist)
            {
                xh.Save(FILE_VERSION);
            }
        }
        public void Load(String filename)
        {
            XmlHelper xh        = new XmlHelper();
            bool      fileExist = xh.Start(filename, "SupportConfig");
            XmlNode   sc        = xh.m_toplevel;

            xspace = xh.GetDouble(sc, "XSpace", 5.0);
            yspace = xh.GetDouble(sc, "YSpace", 5.0);
            mingap = xh.GetDouble(sc, "MinAdaptiveGap", 5.0);
            htrad  = xh.GetDouble(sc, "HeadTopRadiusMM", 0.2);
            hbrad  = xh.GetDouble(sc, "HeadBottomRadiusMM", 0.5);
            ftrad  = xh.GetDouble(sc, "FootTopRadiusMM", 0.5);
            fbrad  = xh.GetDouble(sc, "FootBottomRadiusMM", 2.0);
            fbrad2 = xh.GetDouble(sc, "FootBottomIntraRadiusMM", 0.2);

            if (!fileExist)
            {
                xh.Save(FILE_VERSION);
            }
        }
        public void Load(String filename)
        {
            XmlHelper xh = new XmlHelper();
            bool fileExist = xh.Start(filename, "SupportConfig");
            XmlNode sc = xh.m_toplevel;

            xspace = xh.GetDouble(sc, "XSpace", 5.0);
            yspace = xh.GetDouble(sc, "YSpace", 5.0);
            mingap = xh.GetDouble(sc, "MinAdaptiveGap", 5.0);
            htrad = xh.GetDouble(sc, "HeadTopRadiusMM", 0.2);
            hbrad = xh.GetDouble(sc, "HeadBottomRadiusMM", 0.5);
            ftrad = xh.GetDouble(sc, "FootTopRadiusMM", 0.5);
            fbrad = xh.GetDouble(sc, "FootBottomRadiusMM", 2.0);
            fbrad2 = xh.GetDouble(sc, "FootBottomIntraRadiusMM", 0.2);

            if (!fileExist)
            {
                xh.Save(FILE_VERSION);
            }
        }
 public bool Load(XmlHelper xh, XmlNode thisnode)
 {
     XmlNode mdc = thisnode;// xh.FindSection(parent, "MonitorDriverConfig");
     m_XDLPRes = xh.GetDouble(mdc, "DLP_X_Res", 1024.0);
     m_YDLPRes = xh.GetDouble(mdc, "DLP_Y_Res", 768.0);
     m_monitorid = xh.GetString(mdc, "MonitorID", "");
     m_displayconnectionenabled = xh.GetBool(mdc, "DisplayCommEnabled", false);
     m_displayconnection.Load(xh, mdc);
     m_monitorrect.top = (float)xh.GetDouble(mdc, "MonitorTop", 0.0);
     m_monitorrect.left = (float)xh.GetDouble(mdc, "MonitorLeft", 0.0);
     m_monitorrect.right = (float)xh.GetDouble(mdc, "MonitorRight", 1.0);
     m_monitorrect.bottom = (float)xh.GetDouble(mdc, "MonitorBottom", 1.0);
     return true;
 }        
        public bool Load(XmlHelper xh, XmlNode thisnode)
        {
            XmlNode mdc = thisnode;// xh.FindSection(parent, "MonitorDriverConfig");

            m_XDLPRes   = xh.GetDouble(mdc, "DLP_X_Res", 1024.0);
            m_YDLPRes   = xh.GetDouble(mdc, "DLP_Y_Res", 768.0);
            m_monitorid = xh.GetString(mdc, "MonitorID", "");
            m_displayconnectionenabled = xh.GetBool(mdc, "DisplayCommEnabled", false);
            m_displayconnection.Load(xh, mdc);
            m_monitorrect.top    = (float)xh.GetDouble(mdc, "MonitorTop", 0.0);
            m_monitorrect.left   = (float)xh.GetDouble(mdc, "MonitorLeft", 0.0);
            m_monitorrect.right  = (float)xh.GetDouble(mdc, "MonitorRight", 1.0);
            m_monitorrect.bottom = (float)xh.GetDouble(mdc, "MonitorBottom", 1.0);
            return(true);
        }
        public bool Load(XmlHelper xh, XmlNode thisnode)
        {
            XmlNode mdc = thisnode;// xh.FindSection(parent, "MonitorDriverConfig");

            m_XDLPRes   = xh.GetDouble(mdc, "DLP_X_Res", 1024.0);
            m_YDLPRes   = xh.GetDouble(mdc, "DLP_Y_Res", 768.0);
            m_monitorid = xh.GetString(mdc, "MonitorID", "");
            m_displayconnectionenabled = xh.GetBool(mdc, "DisplayCommEnabled", false);
            m_displayconnection.Load(xh, mdc);
            m_monitorrect.top     = (float)xh.GetDouble(mdc, "MonitorTop", 0.0);
            m_monitorrect.left    = (float)xh.GetDouble(mdc, "MonitorLeft", 0.0);
            m_monitorrect.right   = (float)xh.GetDouble(mdc, "MonitorRight", 1.0);
            m_monitorrect.bottom  = (float)xh.GetDouble(mdc, "MonitorBottom", 1.0);
            m_brightmask_filename = xh.GetString(mdc, "CorrectionMask", "");
            m_usemask             = xh.GetBool(mdc, "UseMask", false);
            if (m_usemask == true)
            {
                try
                {
                    if (File.Exists(m_brightmask_filename))
                    {
                        m_mask = new Bitmap(m_brightmask_filename);
                    }
                    else
                    {
                        DebugLogger.Instance().LogWarning("Mask Image " + m_brightmask_filename + " not found, disabling");
                        m_usemask = false;
                    }
                }
                catch (Exception ex)
                {
                    DebugLogger.Instance().LogError(ex);
                }
            }
            return(true);
        }
Exemplo n.º 10
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.º 11
0
 public bool Load(XmlHelper xh, XmlNode xnode)
 {
     name  = xh.GetString(xnode, "Name", "Default");
     price = xh.GetDouble(xnode, "PriceL", 0.0);
     return(true);
 }
        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;
        }
        bool Load(XmlHelper xh)
        {
            bool retval = false;

            XmlNode mc = xh.m_toplevel;

            m_PlatXSize = xh.GetDouble(mc, "PlatformXSize", 102.0);
            m_PlatYSize = xh.GetDouble(mc, "PlatformYSize", 77.0);
            m_PlatZSize = xh.GetDouble(mc, "PlatformZSize", 100.0);
            m_XMaxFeedrate = xh.GetDouble(mc, "MaxXFeedRate", 100.0);
            m_YMaxFeedrate = xh.GetDouble(mc, "MaxYFeedRate", 100.0);
            m_ZMaxFeedrate = xh.GetDouble(mc, "MaxZFeedRate", 100.0);
            XRenderSize = xh.GetInt(mc, "XRenderSize", 1024);
            YRenderSize = xh.GetInt(mc, "YRenderSize", 768);
            MachineControls = xh.GetString(mc, "DisplayedControls", "XYZPG");
            m_machinetype = (eMachineType)xh.GetEnum(mc, "MachineType", typeof(eMachineType), eMachineType.UV_DLP);
            m_multimontype = (eMultiMonType)xh.GetEnum(mc, "MultiMonType", typeof(eMultiMonType), eMultiMonType.eHorizontal);

            if (m_driverconfig.Load(xh, mc))
            {
                retval = true;
            }

            //m_monitorconfig.Load(xh, mc);
            List<XmlNode> monitornodes = xh.FindAllChildElement(mc, "MonitorDriverConfig");
            m_lstMonitorconfigs = new List<MonitorConfig>();
            foreach (XmlNode node in monitornodes)
            {
                MonitorConfig monc = new MonitorConfig();
                monc.Load(xh, node);
                m_lstMonitorconfigs.Add(monc);
            }
            if (m_lstMonitorconfigs.Count > 0)
            {
                // we need at least 1 monitor
                //m_monitorconfig = m_lstMonitorconfigs[0];
            }
            else
            {
                DebugLogger.Instance().LogError("No monitor configurations found!");
            }

            CalcPixPerMM();

            CorrectMonitorConfig();
            userParams = new UserParameterList();
            xh.LoadUserParamList(userParams);
            return retval;
        }
        public bool Load(string filename)
        {
            m_filename = filename;
            m_name = Path.GetFileNameWithoutExtension(filename);
            bool retval = false;
            XmlHelper xh = new XmlHelper();
            bool fileExist = xh.Start(m_filename, "MachineConfig");
            XmlNode mc = xh.m_toplevel;

            m_PlatXSize = xh.GetDouble(mc, "PlatformXSize", 102.0);
            m_PlatYSize = xh.GetDouble(mc, "PlatformYSize", 77.0);
            m_PlatZSize = xh.GetDouble(mc, "PlatformZSize", 100.0);
            m_XMaxFeedrate = xh.GetDouble(mc, "MaxXFeedRate", 100.0);
            m_YMaxFeedrate = xh.GetDouble(mc, "MaxYFeedRate", 100.0);
            m_ZMaxFeedrate = xh.GetDouble(mc, "MaxZFeedRate", 100.0);
            m_machinetype = (eMachineType)xh.GetEnum(mc, "MachineType", typeof(eMachineType), eMachineType.UV_DLP);

            if (m_driverconfig.Load(xh, mc))
            {
                retval = true;
            }

            m_monitorconfig.Load(xh, mc);
            CalcPixPerMM();

            if (!fileExist)
            {
                xh.Save(FILE_VERSION);
            }
            return retval;
        }
 public bool Load(XmlHelper xh, XmlNode parent)
 {
     XmlNode mdc = xh.FindSection(parent, "MonitorDriverConfig");
     m_XDLPRes = xh.GetDouble(mdc, "DLP_X_Res", 1024.0);
     m_YDLPRes = xh.GetDouble(mdc, "DLP_Y_Res", 768.0);
     // m_Xpixpermm and m_Ypixpermm are calculated dinamically, no need to save/load
     //m_Xpixpermm = xh.GetDouble(mdc, "PixPermmX", 10.0);
     //m_Ypixpermm = xh.GetDouble(mdc, "PixPermmY", 10.0);
     m_monitorid = xh.GetString(mdc, "MonitorID", "");
     m_displayconnectionenabled = xh.GetBool(mdc, "DisplayCommEnabled", false);
     m_displayconnection.Load(xh, mdc);
     return true;
 }
Exemplo n.º 16
0
        public bool Load(string filename)
        {
            m_filename = filename;
            m_lstMonitorconfigs.Clear(); // clear any previously loaded monitors
            m_name = Path.GetFileNameWithoutExtension(filename);
            bool retval = false;
            XmlHelper xh = new XmlHelper();
            bool fileExist = xh.Start(m_filename, "MachineConfig");
            XmlNode mc = xh.m_toplevel;

            m_PlatXSize = xh.GetDouble(mc, "PlatformXSize", 102.0);
            m_PlatYSize = xh.GetDouble(mc, "PlatformYSize", 77.0);
            m_PlatZSize = xh.GetDouble(mc, "PlatformZSize", 100.0);
            m_XMaxFeedrate = xh.GetDouble(mc, "MaxXFeedRate", 100.0);
            m_YMaxFeedrate = xh.GetDouble(mc, "MaxYFeedRate", 100.0);
            m_ZMaxFeedrate = xh.GetDouble(mc, "MaxZFeedRate", 100.0);
            XRenderSize = xh.GetInt(mc, "XRenderSize", 1024);
            YRenderSize = xh.GetInt(mc, "YRenderSize", 768);
            MachineControls = xh.GetString(mc, "DisplayedControls", "XYZPG");
            m_machinetype = (eMachineType)xh.GetEnum(mc, "MachineType", typeof(eMachineType), eMachineType.UV_DLP);
            m_multimontype = (eMultiMonType)xh.GetEnum(mc, "MultiMonType", typeof(eMultiMonType), eMultiMonType.eHorizontal);
            
            if (m_driverconfig.Load(xh, mc))
            {
                retval = true;
            }

            //m_monitorconfig.Load(xh, mc);
            List<XmlNode> monitornodes = xh.FindAllChildElement(mc, "MonitorDriverConfig");
            m_lstMonitorconfigs = new List<MonitorConfig>();
            foreach (XmlNode node in monitornodes) 
            {
                MonitorConfig monc = new MonitorConfig();
                monc.Load(xh, node);
                m_lstMonitorconfigs.Add(monc);
            }
            if (m_lstMonitorconfigs.Count > 0)
            {
                // we need at least 1 monitor
                //m_monitorconfig = m_lstMonitorconfigs[0];
            }
            else 
            {
                DebugLogger.Instance().LogError("No monitor configurations found!");
            }

            CalcPixPerMM();

            if (!fileExist)
            {
                xh.Save(FILE_VERSION);
            }
            CorrectMonitorConfig();
            return retval;
        }
 public bool Load(XmlHelper xh, XmlNode thisnode)
 {
     XmlNode mdc = thisnode;// xh.FindSection(parent, "MonitorDriverConfig");
     m_XDLPRes = xh.GetDouble(mdc, "DLP_X_Res", 1024.0);
     m_YDLPRes = xh.GetDouble(mdc, "DLP_Y_Res", 768.0);
     m_monitorid = xh.GetString(mdc, "MonitorID", "");
     m_displayconnectionenabled = xh.GetBool(mdc, "DisplayCommEnabled", false);
     m_displayconnection.Load(xh, mdc);
     m_monitorrect.top = (float)xh.GetDouble(mdc, "MonitorTop", 0.0);
     m_monitorrect.left = (float)xh.GetDouble(mdc, "MonitorLeft", 0.0);
     m_monitorrect.right = (float)xh.GetDouble(mdc, "MonitorRight", 1.0);
     m_monitorrect.bottom = (float)xh.GetDouble(mdc, "MonitorBottom", 1.0);
     m_brightmask_filename = xh.GetString(mdc, "CorrectionMask", "");
     m_usemask = xh.GetBool(mdc, "UseMask", false);
     if (m_usemask == true)
     {
         try
         {
             m_mask = new Bitmap(m_brightmask_filename);
         }
         catch (Exception ex)
         {
             DebugLogger.Instance().LogError(ex);
         }
     }
     return true;
 }