public void Setup(UserParameterList parms)
        {
            try
            {
                m_parms = parms;
                lvParams.Items.Clear();
                //parms.paramDict.
                foreach (KeyValuePair<string, CWParameter> parm in parms.paramDict)
                {
                    CWParameter cwp = parm.Value;
                    ListViewItem lvi = lvParams.Items.Add(parm.Key);
                    if(cwp.ParamType == typeof(string))
                    {
                        GuiParam<string> dat = (GuiParam<string>)cwp;
                        lvi.SubItems.Add(dat.GetVal());
                    }
                    //GuiParam prm

                }
                lvParams.Refresh();
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogError(ex);
            }
        }
 public void SaveUserParamList(XmlNode parentNode, UserParameterList parList)
 {
     foreach (KeyValuePair <string, CWParameter> pair in parList.paramDict)
     {
         SetParameter(parentNode, pair.Value);
     }
     parList.ConfigChanged = false;
 }
        public void LoadUserParamList(UserParameterList parList)
        {
            XmlNode nd = FindChildElement(m_toplevel, "UserParameters");

            if (nd == null)
            {
                return;
            }
            LoadUserParamList(nd, parList);
        }
 public void LoadUserParamList(XmlNode parentNode, UserParameterList parList)
 {
     foreach (XmlNode xnode in parentNode.ChildNodes)
     {
         CWParameter par = CWParameter.LoadUser(xnode);
         if (par != null)
         {
             parList.paramDict[par.paramName] = par;
         }
     }
 }
        public void SaveUserParamList(UserParameterList parList)
        {
            XmlNode nd = FindChildElement(m_toplevel, "UserParameters");

            if (nd == null)
            {
                nd = m_xdoc.CreateElement("UserParameters");
                m_toplevel.AppendChild(nd);
            }
            SaveUserParamList(nd, parList);
        }
        private double m_ZMaxFeedrate; // in mm/min

        #endregion Fields

        #region Constructors

        public MachineConfig()
        {
            m_PlatXSize = 102.0;
            m_PlatYSize = 77.0;
            m_PlatZSize = 100; // 100 mm default, we have to load this
            m_XMaxFeedrate = 100;
            m_YMaxFeedrate = 100;
            m_ZMaxFeedrate = 100;
            XRenderSize = 1024;
            YRenderSize = 768;
            m_driverconfig = new DeviceDriverConfig();
            //m_monitorconfig = new MonitorConfig();
            m_lstMonitorconfigs = new List<MonitorConfig>(); // create a list of monitors attached to the system
            m_machinetype = eMachineType.UV_DLP;
            m_multimontype = eMultiMonType.eVertical;
            MachineControls = "";
            userParams = new UserParameterList();
            CalcPixPerMM();
        }
Example #7
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();
 }
Example #8
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;
        }
        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;
        }
Example #10
0
 public void SaveUserParamList(UserParameterList parList)
 {
     XmlNode nd = FindChildElement(m_toplevel, "UserParameters");
     if (nd == null)
     {
         nd = m_xdoc.CreateElement("UserParameters");
         m_toplevel.AppendChild(nd);
     }
     SaveUserParamList(nd, parList);
 }
Example #11
0
 public void SaveUserParamList(XmlNode parentNode, UserParameterList parList)
 {
     foreach (KeyValuePair<string, CWParameter> pair in parList.paramDict)
     {
         SetParameter(parentNode, pair.Value);
     }
     parList.ConfigChanged = false;
 }
Example #12
0
 public void LoadUserParamList(UserParameterList parList)
 {
     XmlNode nd = FindChildElement(m_toplevel, "UserParameters");
     if (nd == null)
         return;
     LoadUserParamList(nd, parList);
 }
Example #13
0
 public void LoadUserParamList(XmlNode parentNode, UserParameterList parList)
 {
     foreach (XmlNode xnode in parentNode.ChildNodes)
     {
         CWParameter par = CWParameter.LoadUser(m_xdoc, xnode);
         if (par != null)
             parList.paramDict[par.paramName] = par;
     }
 }