示例#1
0
        public bool Load(XmlHelper xh, XmlNode parent) // use new xml system -SHS
        {
            bool    retval = false;
            XmlNode mdc    = xh.FindSection(parent, "MotorsDriverConfig");

            m_drivertype = (eDriverType)xh.GetEnum(mdc, "DriverType", typeof(eDriverType), eDriverType.eGENERIC);
            if (m_connection.Load(xh, mdc))
            {
                retval = true;
            }
            return(retval);
        }
示例#2
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);
        }
        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(XmlReader xr)
 {
     try
     {
         bool retval = false;
         xr.ReadStartElement("DriverConfig");
         m_drivertype = (eDriverType)Enum.Parse(typeof(eDriverType), xr.ReadElementString("DriverType"));
         if (m_connection.Load(xr))
         {
             retval = true;
         }
         xr.ReadEndElement();
         return(retval);
     }
     catch (Exception ex)
     {
         DebugLogger.Instance().LogRecord(ex.Message);
         return(false);
     }
 }
        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);
        }