public bool Save(string filename) { try { bool retval = false; XmlWriter xw = XmlWriter.Create(filename); xw.WriteStartDocument(); xw.WriteStartElement("MachineConfig"); xw.WriteElementString("DLP_X_Res", m_XDLPRes.ToString()); xw.WriteElementString("DLP_Y_Res", m_YDLPRes.ToString()); xw.WriteElementString("PlatformXSize", m_PlatXSize.ToString()); xw.WriteElementString("PlatformYSize", m_PlatYSize.ToString()); xw.WriteElementString("PlatformZSize", m_PlatZSize.ToString()); xw.WriteElementString("PixPermmX", m_Xpixpermm.ToString()); xw.WriteElementString("PixPermmY", m_Ypixpermm.ToString()); xw.WriteElementString("MaxZFeedRate", m_ZMaxFeedrate.ToString()); xw.WriteElementString("MonitorID", m_monitorid.ToString()); if (m_driverconfig.Save(xw)) { retval = true; } xw.WriteEndElement(); xw.WriteEndDocument(); xw.Close(); return(retval); } catch (Exception ex) { DebugLogger.Instance().LogRecord(ex.Message); 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); }
public bool Save(string filename, string ip = "") { 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, "OverrideRenderSize", m_OverrideRenderSize); xh.SetParameter(mc, "DisplayedControls", MachineControls); xh.SetParameter(mc, "ip", m_ip != null? m_ip:ip); 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.SaveUserParamList(userParams); xh.Save(FILE_VERSION); return(retval); }