public bool Save(XmlHelper xh, XmlNode parent) { XmlNode xnode = xh.AddSection(parent, "PowderConfig"); xh.SetParameter(xnode, "Name", name); xh.SetParameter(xnode, "PriceL", price); return(true); }
// save to xml file -SHS public bool Save(String filename) { XmlHelper xh = new XmlHelper(); xh.StartNew(filename, "ProjectorCmdList"); foreach (ProjectorCommand pc in m_commands) { XmlNode nd = xh.AddSection(null, "Command"); xh.SetParameter(nd, "Name", pc.name); xh.SetParameter(nd, "IsHex", pc.hex); xh.SetParameter(nd, "Cmd", pc.command); } return xh.Save(FILE_VERSION); }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { XmlNode mdc = xh.FindSection(parent, "MonitorDriverConfig"); xh.SetParameter(mdc, "DLP_X_Res", m_XDLPRes); xh.SetParameter(mdc, "DLP_Y_Res", m_YDLPRes); // m_Xpixpermm and m_Ypixpermm are calculated dinamically, no need to save/load //xh.SetParameter(mdc, "PixPermmX", m_Xpixpermm); //xh.SetParameter(mdc, "PixPermmY", m_Ypixpermm); xh.SetParameter(mdc, "MonitorID", m_monitorid); xh.SetParameter(mdc, "DisplayCommEnabled", m_displayconnectionenabled); m_displayconnection.Save(xh, mdc); return(true); }
public void Save(String filename) { XmlHelper xh = new XmlHelper(); xh.Start(filename, "SupportConfig"); XmlNode sc = xh.m_toplevel; xh.SetParameter(sc, "XSpace", xspace); xh.SetParameter(sc, "YSpace", yspace); xh.SetParameter(sc, "MinAdaptiveGap", mingap); xh.SetParameter(sc, "HeadTopRadiusMM", htrad); xh.SetParameter(sc, "HeadBottomRadiusMM", hbrad); xh.SetParameter(sc, "FootTopRadiusMM", ftrad); xh.SetParameter(sc, "FootBottomRadiusMM", fbrad); xh.SetParameter(sc, "FootBottomIntraRadiusMM", fbrad2); xh.SetParameter(sc, "DownwardAngle", downwardAngle); xh.SetParameter(sc, "GenerateOnDownward", m_onlydownward); xh.Save(FILE_VERSION); }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { // XmlNode mdc = xh.FindSection(parent, "MonitorDriverConfig"); XmlNode mdc = xh.AddSection(parent, "MonitorDriverConfig"); xh.SetParameter(mdc, "DLP_X_Res", m_XDLPRes); // gotta make this auto.. xh.SetParameter(mdc, "DLP_Y_Res", m_YDLPRes); xh.SetParameter(mdc, "MonitorID", m_monitorid); xh.SetParameter(mdc, "DisplayCommEnabled", m_displayconnectionenabled); m_displayconnection.Save(xh, mdc); xh.SetParameter(mdc, "MonitorTop", m_monitorrect.top); xh.SetParameter(mdc, "MonitorLeft", m_monitorrect.left); xh.SetParameter(mdc, "MonitorRight", m_monitorrect.right); xh.SetParameter(mdc, "MonitorBottom", m_monitorrect.bottom); xh.SetParameter(mdc, "CorrectionMask", m_brightmask_filename); xh.SetParameter(mdc, "UseMask", m_usemask); return(true); }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { bool retval = false; XmlNode mdc = xh.FindSection(parent, "MotorsDriverConfig"); xh.SetParameter(mdc, "DriverType", m_drivertype); if (m_connection.Save(xh, mdc)) { retval = true; } return retval; }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { bool retval = false; XmlNode mdc = xh.FindSection(parent, "MotorsDriverConfig"); xh.SetParameter(mdc, "DriverType", m_drivertype); if (m_connection.Save(xh, mdc)) { retval = true; } return(retval); }
public void Save(String filename) { XmlHelper xh = new XmlHelper(); xh.Start(filename, "SupportConfig"); XmlNode sc = xh.m_toplevel; xh.SetParameter(sc, "XSpace", xspace); xh.SetParameter(sc, "YSpace", yspace); xh.SetParameter(sc, "MinAdaptiveGap", mingap); xh.SetParameter(sc, "HeadTopRadiusMM", htrad); xh.SetParameter(sc, "HeadBottomRadiusMM", hbrad); xh.SetParameter(sc, "FootTopRadiusMM", ftrad); xh.SetParameter(sc, "FootBottomRadiusMM", fbrad); xh.SetParameter(sc, "FootBottomIntraRadiusMM", fbrad2); xh.Save(FILE_VERSION); }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { XmlNode cps = xh.FindSection(parent, "ComPortSettings"); xh.SetParameter(cps, "PortName", comname); xh.SetParameter(cps, "Speed", speed); xh.SetParameter(cps, "Databits", databits); xh.SetParameter(cps, "Parity", parity); xh.SetParameter(cps, "Stopbits", stopbits); xh.SetParameter(cps, "Handshake", handshake); return true; }
public bool Save(XmlHelper xh, XmlNode parent) { XmlNode xnode = xh.AddSection(parent, "InkConfig"); xh.SetParameter(xnode, "Name", Name); xh.SetParameter(xnode, "SliceHeight", ZThick); xh.SetParameter(xnode, "LayerTime", layertime_ms); xh.SetParameter(xnode, "FirstLayerTime", firstlayertime_ms); xh.SetParameter(xnode, "NumberofBottomLayers", numfirstlayers); xh.SetParameter(xnode, "ResinPriceL", resinprice); return true; }
public bool Save(XmlHelper xh, XmlNode parent) { XmlNode xnode = xh.AddSection(parent, "InkConfig"); xh.SetParameter(xnode, "Name", Name); xh.SetParameter(xnode, "SliceHeight", ZThick); xh.SetParameter(xnode, "LayerTime", layertime_ms); xh.SetParameter(xnode, "FirstLayerTime", firstlayertime_ms); xh.SetParameter(xnode, "NumberofBottomLayers", numfirstlayers); xh.SetParameter(xnode, "ResinPriceL", resinprice); return(true); }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { XmlNode cps = xh.FindSection(parent, "ComPortSettings"); xh.SetParameter(cps, "PortName", comname); xh.SetParameter(cps, "Speed", speed); xh.SetParameter(cps, "Databits", databits); xh.SetParameter(cps, "Parity", parity); xh.SetParameter(cps, "Stopbits", stopbits); xh.SetParameter(cps, "Handshake", handshake); return(true); }
public void Save(String filename) { XmlHelper xh = new XmlHelper(); xh.Start(filename, "SupportConfig"); XmlNode sc = xh.m_toplevel; xh.SetParameter(sc, "XSpace", xspace); xh.SetParameter(sc, "YSpace", yspace); xh.SetParameter(sc, "HeadTopRadiusMM", htrad); xh.SetParameter(sc, "HeadBottomRadiusMM", hbrad); xh.SetParameter(sc, "FootTopRadiusMM", ftrad); xh.SetParameter(sc, "FootBottomRadiusMM", fbrad); xh.SetParameter(sc, "FootBottomIntraRadiusMM", fbrad2); xh.Save(FILE_VERSION); }
public bool Save(XmlHelper xh, XmlNode parent) // use new xml system -SHS { // XmlNode mdc = xh.FindSection(parent, "MonitorDriverConfig"); XmlNode mdc = xh.AddSection(parent, "MonitorDriverConfig"); xh.SetParameter(mdc, "DLP_X_Res", m_XDLPRes); // gotta make this auto.. xh.SetParameter(mdc, "DLP_Y_Res", m_YDLPRes); xh.SetParameter(mdc, "MonitorID", m_monitorid); xh.SetParameter(mdc, "DisplayCommEnabled", m_displayconnectionenabled); m_displayconnection.Save(xh, mdc); xh.SetParameter(mdc, "MonitorTop", m_monitorrect.top); xh.SetParameter(mdc, "MonitorLeft", m_monitorrect.left); xh.SetParameter(mdc, "MonitorRight", m_monitorrect.right); xh.SetParameter(mdc, "MonitorBottom", m_monitorrect.bottom); return true; }
public bool Save(string filename) { bool retval = false; m_filename = filename; m_name = Path.GetFileNameWithoutExtension(filename); XmlHelper xh = new XmlHelper(); // bool fileExist = xh.Start(m_filename, "MachineConfig"); //bool fileExist = false; xh.StartNew(m_filename, "MachineConfig"); XmlNode mc = xh.m_toplevel; xh.SetParameter(mc, "PlatformXSize", m_PlatXSize); xh.SetParameter(mc, "PlatformYSize", m_PlatYSize); xh.SetParameter(mc, "PlatformZSize", m_PlatZSize); xh.SetParameter(mc, "MaxXFeedRate", m_XMaxFeedrate); xh.SetParameter(mc, "MaxYFeedRate", m_YMaxFeedrate); xh.SetParameter(mc, "MaxZFeedRate", m_ZMaxFeedrate); xh.SetParameter(mc, "XRenderSize", XRenderSize); xh.SetParameter(mc, "YRenderSize", YRenderSize); xh.SetParameter(mc, "DisplayedControls", MachineControls); xh.SetParameter(mc, "MachineType", m_machinetype); xh.SetParameter(mc, "MultiMonType", m_multimontype); if (m_driverconfig.Save(xh, mc)) { retval = true; } // save all the monitor configurations foreach (MonitorConfig monc in m_lstMonitorconfigs) { monc.Save(xh, mc); } //m_monitorconfig.Save(xh, mc); xh.Save(FILE_VERSION); return retval; }
public bool Save(String filename) { try { XmlHelper xh = new XmlHelper(); bool fileExist = xh.Start(filename, "ApplicationConfig"); XmlNode ac = xh.m_toplevel; xh.SetParameter(ac, "LastModelName", m_LastModelFilename); xh.SetParameter(ac, "SliceProfileName", Path.GetFileName(m_cursliceprofilename)); xh.SetParameter(ac, "MachineProfileName", Path.GetFileName(m_curmachineeprofilename)); xh.SetParameter(ac, "AutoConnect", m_autoconnect ? "True" : "False"); xh.SetParameter(ac, "LoadLastModel", m_loadlastmodel ? "True" : "False"); xh.SetParameter(ac, "Slic3rLocation", m_slic3rloc); xh.SetParameter(ac, "ForegroundColor", m_foregroundcolor); xh.SetParameter(ac, "BackgroundColor", m_backgroundcolor); xh.SetParameter(ac, "PreviewSlices", m_previewslicesbuilddisplay); xh.Save(FILE_VERSION); return true; }catch(Exception ex) { DebugLogger.Instance().LogRecord(ex.Message); return false; } }
// use new xml system -SHS public bool Save(XmlHelper xh, XmlNode parent) { XmlNode mdc = xh.FindSection(parent, "MonitorDriverConfig"); xh.SetParameter(mdc, "DLP_X_Res", m_XDLPRes); xh.SetParameter(mdc, "DLP_Y_Res", m_YDLPRes); // m_Xpixpermm and m_Ypixpermm are calculated dinamically, no need to save/load //xh.SetParameter(mdc, "PixPermmX", m_Xpixpermm); //xh.SetParameter(mdc, "PixPermmY", m_Ypixpermm); xh.SetParameter(mdc, "MonitorID", m_monitorid); xh.SetParameter(mdc, "DisplayCommEnabled", m_displayconnectionenabled); m_displayconnection.Save(xh, mdc); return true; }
/*This is used to serialize to the GCode post-header info*/ /*public bool Load(String filename) { Stream stream = null; try { m_filename = filename; stream = new FileStream(filename, FileMode.Open); if (Load(stream)) { stream.Close(); return true; } else { stream.Close(); //close it anyway } } catch (Exception ex) { try { stream.Close(); } catch (Exception e) { DebugLogger.Instance().LogError(e.Message); } DebugLogger.Instance().LogRecord(ex.Message); } return false; }*/ public bool Save(String filename) { m_filename = filename; XmlHelper xh = new XmlHelper(); bool fileExist = xh.Start(filename, "SliceBuildConfig"); XmlNode sbc = xh.m_toplevel; xh.SetParameter(sbc, "DotsPermmX", dpmmX); xh.SetParameter(sbc, "DotsPermmY", dpmmY); xh.SetParameter(sbc, "XResolution", xres); xh.SetParameter(sbc, "YResolution", yres); xh.SetParameter(sbc, "SliceHeight", ZThick); xh.SetParameter(sbc, "LayerTime", layertime_ms); xh.SetParameter(sbc, "FirstLayerTime", firstlayertime_ms); xh.SetParameter(sbc, "BlankTime", blanktime_ms); xh.SetParameter(sbc, "PlatformTemp", plat_temp); // xh.SetParameter(sbc, "ExportGCode", exportgcode); xh.SetParameter(sbc, "ExportSVG", exportsvg); xh.SetParameter(sbc, "Export", export); xh.SetParameter(sbc, "XOffset", XOffset); xh.SetParameter(sbc, "YOffset", YOffset); xh.SetParameter(sbc, "NumberofBottomLayers", numfirstlayers); xh.SetParameter(sbc, "Direction", direction); xh.SetParameter(sbc, "LiftDistance", liftdistance); xh.SetParameter(sbc, "SlideTiltValue", slidetiltval); xh.SetParameter(sbc, "AntiAliasing", antialiasing); xh.SetParameter(sbc, "UseMainLiftGCode", usemainliftgcode); xh.SetParameter(sbc, "AntiAliasingValue", aaval); xh.SetParameter(sbc, "LiftFeedRate", liftfeedrate); xh.SetParameter(sbc, "LiftRetractRate", liftretractrate); xh.SetParameter(sbc, "ExportOption", m_exportopt); xh.SetParameter(sbc, "FlipX", m_flipX); xh.SetParameter(sbc, "FlipY", m_flipY); xh.SetParameter(sbc, "Notes", m_notes); xh.SetParameter(sbc, "ResinPriceL", m_resinprice); // xh.SetParameter(sbc, "Raise_Time_Delay",raise_time_ms); try { xh.Save(FILE_VERSION); SaveGCodes(); } catch (Exception ex) { DebugLogger.Instance().LogRecord(ex.Message); return false; } return true; }
/// <summary> /// Save the entire scene into a zip file with a manifest /// This file will later be re-used to store png slicee, gcode & svg /// </summary> /// <param name="scenename"></param> /// <returns></returns> public bool SaveOld(string scenefilename) { try { UVDLPApp.Instance().SceneFileName = scenefilename; // open a zip file with the scenename // iterate through all objects in engine string xmlname = "manifest.xml"; XmlHelper manifest = new XmlHelper(); //start the doc with no filename, becasue we're saving to a memory stream manifest.StartNew("", "manifest"); //start a new stream to store the manifest file MemoryStream manifeststream = new MemoryStream(); //create a new zip file ZipFile zip = new ZipFile(); //get the top-level node in the manifest //XmlNode mc = manifest.m_toplevel; // Add in a section for GCode if present XmlNode gcn = manifest.AddSection(manifest.m_toplevel, "GCode"); if (UVDLPApp.Instance().m_gcode != null) { //create the name of the gcode file String GCodeFileName = Path.GetFileNameWithoutExtension(scenefilename) + ".gcode"; manifest.SetParameter(gcn, "filename", GCodeFileName); Stream gcs = new MemoryStream(); //save to memory stream UVDLPApp.Instance().m_gcode.Save(gcs); //rewind gcs.Seek(0, SeekOrigin.Begin); //create new zip entry zip.AddEntry(GCodeFileName, gcs); } XmlNode mc = manifest.AddSection(manifest.m_toplevel, "Models"); //we need to make sure that only unique names are put in the zipentry // cloned objects yield the same name List<string> m_uniquenames = new List<string>(); // we can adda 4-5 digit code to the end here to make sure names are unique int id = 0; string idstr; foreach (Object3d obj in UVDLPApp.Instance().m_engine3d.m_objects) { //create a unique id to post-fix item names id++; idstr = string.Format("{0:0000}", id); idstr = "_" + idstr; //create a new memory stream MemoryStream ms = new MemoryStream(); //save the object to the memory stream obj.SaveSTL_Binary(ref ms); //rewind the stream to the beginning ms.Seek(0, SeekOrigin.Begin); //get the file name with no extension string objname = Path.GetFileNameWithoutExtension(obj.Name); //spaces cause this to blow up too objname = objname.Replace(' ', '_'); // add a value to the end of the string to make sure it's a unique name objname = objname + idstr; string objnameNE = objname; objname += ".stl"; // stl file zip.AddEntry(objname, ms); //create an entry for this object, using the object name with no extension //save anything special about it //XmlNode objnode = manifest.AddSection(mc, objnameNE); XmlNode objnode = manifest.AddSection(mc, "model"); manifest.SetParameter(objnode, "name", objnameNE); manifest.SetParameter(objnode, "tag", obj.tag); if (obj.tag != Object3d.OBJ_NORMAL && obj.m_parrent != null) { // note it's parent name in the entry manifest.SetParameter(objnode, "parent", Path.GetFileNameWithoutExtension(obj.m_parrent.Name)); } } //save the gcode //save the XML document to memorystream manifest.Save(1, ref manifeststream); manifeststream.Seek(0, SeekOrigin.Begin); //manifeststream. //save the memorystream for the xml metadata manifest into the zip file zip.AddEntry(xmlname, manifeststream); //save the zip file zip.Save(scenefilename); return true; } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } return false; }
public bool Save(string filename) { bool retval = false; m_filename = filename; m_name = Path.GetFileNameWithoutExtension(filename); XmlHelper xh = new XmlHelper(); bool fileExist = xh.Start(m_filename, "MachineConfig"); XmlNode mc = xh.m_toplevel; xh.SetParameter(mc, "PlatformXSize", m_PlatXSize); xh.SetParameter(mc, "PlatformYSize", m_PlatYSize); xh.SetParameter(mc, "PlatformZSize", m_PlatZSize); xh.SetParameter(mc, "MaxXFeedRate", m_XMaxFeedrate); xh.SetParameter(mc, "MaxYFeedRate", m_YMaxFeedrate); xh.SetParameter(mc, "MaxZFeedRate", m_ZMaxFeedrate); xh.SetParameter(mc, "MachineType", m_machinetype); if (m_driverconfig.Save(xh, mc)) { retval = true; } m_monitorconfig.Save(xh, mc); xh.Save(FILE_VERSION); return retval; }
/// <summary> /// This function assumes that the file has already been saved /// after setting the variable, it will re-save the file /// </summary> /// <param name="varname"></param> /// <param name="value"></param> public void SetStringVar(string varname, string value) { //m_filename = filename; XmlHelper xh = new XmlHelper(); xh.StartNew(m_filename, "SliceBuildConfig"); SaveInternal(ref xh); //save the var XmlNode sbc = xh.m_toplevel; xh.SetParameter(sbc, varname, value); try { xh.Save(FILE_VERSION); } catch (Exception ex) { DebugLogger.Instance().LogRecord(ex.Message); } }
public bool Save(String filename) { try { XmlHelper xh = new XmlHelper(); bool fileExist = xh.Start(filename, "ApplicationConfig"); XmlNode ac = xh.m_toplevel; xh.SetParameter(ac, "LastModelName", m_LastModelFilename); xh.SetParameter(ac, "SliceProfileName", Path.GetFileName(m_cursliceprofilename)); xh.SetParameter(ac, "MachineProfileName", Path.GetFileName(m_curmachineeprofilename)); xh.SetParameter(ac, "AutoConnect", m_autoconnect ? "True" : "False"); xh.SetParameter(ac, "LoadLastModel", m_loadlastmodel ? "True" : "False"); xh.SetParameter(ac, "Slic3rLocation", m_slic3rloc); xh.SetParameter(ac, "Slic3rParams", m_slic3rparameters); xh.SetParameter(ac, "ForegroundColor", m_foregroundcolor); xh.SetParameter(ac, "BackgroundColor", m_backgroundcolor); xh.SetParameter(ac, "PreviewSlices", m_previewslicesbuilddisplay); xh.SetParameter(ac, "Preview3dSlice", m_viewslice3d); xh.SetParameter(ac, "Preview3dSliceHeight", m_viewslice3dheight); xh.SetParameter(ac, "DriverLogging", m_driverdebuglog); xh.SetParameter(ac, "IgnoreGCRsp", m_ignoreGCrsp); xh.SetParameter(ac, "ShowBoundingBox", m_showBoundingBox); xh.SetParameter(ac, "LicenseKey", m_licensekey); xh.Save(FILE_VERSION); return true; }catch(Exception ex) { DebugLogger.Instance().LogRecord(ex.Message); return false; } }
private void SaveInternal(ref XmlHelper xh) { XmlNode sbc = xh.m_toplevel; xh.SetParameter(sbc, "DotsPermmX", dpmmX); xh.SetParameter(sbc, "DotsPermmY", dpmmY); xh.SetParameter(sbc, "XResolution", xres); xh.SetParameter(sbc, "YResolution", yres); //xh.SetParameter(sbc, "SliceHeight", ZThick); //xh.SetParameter(sbc, "LayerTime", layertime_ms); //xh.SetParameter(sbc, "FirstLayerTime", firstlayertime_ms); xh.SetParameter(sbc, "BlankTime", blanktime_ms); xh.SetParameter(sbc, "PlatformTemp", plat_temp); // xh.SetParameter(sbc, "ExportGCode", exportgcode); xh.SetParameter(sbc, "ExportSVG", exportsvg); xh.SetParameter(sbc, "Export", export); xh.SetParameter(sbc, "ExportPNG", exportpng); xh.SetParameter(sbc, "XOffset", XOffset); xh.SetParameter(sbc, "YOffset", YOffset); //xh.SetParameter(sbc, "NumberofBottomLayers", numfirstlayers); xh.SetParameter(sbc, "Direction", direction); xh.SetParameter(sbc, "LiftDistance", liftdistance); xh.SetParameter(sbc, "SlideTiltValue", slidetiltval); xh.SetParameter(sbc, "AntiAliasing", antialiasing); xh.SetParameter(sbc, "UseMainLiftGCode", usemainliftgcode); xh.SetParameter(sbc, "AntiAliasingValue", aaval); xh.SetParameter(sbc, "LiftFeedRate", liftfeedrate); xh.SetParameter(sbc, "BottomLiftFeedRate", bottomliftfeedrate); xh.SetParameter(sbc, "LiftRetractRate", liftretractrate); xh.SetParameter(sbc, "ExportOption", m_exportopt); xh.SetParameter(sbc, "RenderOutlines", m_createoutlines); xh.SetParameter(sbc, "OutlineWidth_Inset", m_outlinewidth_inset); xh.SetParameter(sbc, "OutlineWidth_Outset", m_outlinewidth_outset); xh.SetParameter(sbc, "FlipX", m_flipX); xh.SetParameter(sbc, "FlipY", m_flipY); xh.SetParameter(sbc, "Notes", m_notes); //xh.SetParameter(sbc, "ResinPriceL", m_resinprice); xh.SetParameter(sbc, "GCodeHeader", m_headercode); xh.SetParameter(sbc, "GCodeFooter", m_footercode); xh.SetParameter(sbc, "GCodePreslice", m_preslicecode); xh.SetParameter(sbc, "GCodeLift", m_liftcode); xh.SetParameter(sbc, "SelectedInk", selectedInk); foreach (KeyValuePair<string, InkConfig> entry in inks) { inks[entry.Key].Save(xh, sbc); } xh.SetParameter(sbc, "MinTestExposure", minExposure); xh.SetParameter(sbc, "TestExposureStep", exposureStep); xh.SetParameter(sbc, "ExportPreview", exportpreview); xh.SaveUserParamList(userParams); }