示例#1
0
        /// <summary>
        /// 加载需要的xml文档信息
        /// </summary>
        /// <param name="Path">xml文档路径</param>
        private static void LoadXML(string Path)
        {
            Context context = Context.GetInstance();

            try
            {
                ModelGeneralInformation GeneralInfomation = XMLSerializeHelper.DeserializeXML <ModelGeneralInformation>(Path);
                context.GeneralInformation = GeneralInfomation;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#2
0
        private void LoadConfiguration(ModelGeneralInformation ModelConfiguration)
        {
            try
            {
                string CtrlCardPath = XMLFolderPath + ModelConfiguration.ControlCardFileName;
                ControlCardInfomation = XMLSerializeHelper.DeserializeXML <ControlCards>(CtrlCardPath);
                context.ControlCard   = ControlCardInfomation;

                string CameraCfgPath = XMLFolderPath + ModelConfiguration.CameraConfigFileName;
                CameraInfomation          = XMLSerializeHelper.DeserializeXML <SlaveServers>(CameraCfgPath);
                context.SlaveServerConfig = CameraInfomation;

                string  RecipePath       = XMLFolderPath + ModelConfiguration.ModelRecipeFileName;
                Recipes RecipeInfomation = XMLSerializeHelper.DeserializeXML <Recipes>(RecipePath);
                context.ModuleRecipe = RecipeInfomation.RecipeArray;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }