private static void LoadConfiguration() { FileManager.Instance.RegisterFileType(); var jsonValue = SerializeUtil.JsonReadByFile <GlobalParameters>(GlobalModel.ConfigFileName); if (jsonValue != null) { GlobalModel.Params = jsonValue; #region Check if valid var layers = GlobalModel.Params.LayerConfig.LayerCrafts; if (layers.Count != 15) { for (int i = 0; i < 15; i++) { layers[i + 1] = DefaultParaHelper.GetDefaultLayerCraftModel(); } } #endregion } else { GlobalModel.Params.LayerConfig = DefaultParaHelper.GetDefaultLayerConfigModel(); } SystemContext.SystemPara = SystemConfig.Load(@".\Configs\SysConfig.json"); LoadUnitInfo(); }
public FrmLayerConfig(LayerConfigModel layerConfig) : this() { this.Model = mvvmContext1.GetViewModel <LayerConfigModel>(); CopyUtil.CopyModel(this.Model, layerConfig ?? DefaultParaHelper.GetDefaultLayerConfigModel()); this.InitializeBindings(); this.InitializePointMoveCutParaPage(); var monitor = new UnitMonitor(this.tPageLayerGlobal, () => this.Model.RaisePropertiesChanged()); monitor.Listen(); }
public FrmLayerConfig(LayerConfigModel layerConfig, List <int> layers) : this() { this.Model = mvvmContext1.GetViewModel <LayerConfigModel>(); this.layers = layers; CopyUtil.CopyModel(this.Model, layerConfig ?? DefaultParaHelper.GetDefaultLayerConfigModel()); this.InitializeBindings(); this.InitializeTabPages(layers); this.UcLayer_OnPathRecoolingChanged(false, "冷却参数"); this.UcLayer_OnEvaporationFilmChanged(false, "蒸发参数"); var monitor = new UnitMonitor(this.tPageLayerGlobal, () => this.Model.RaisePropertiesChanged()); monitor.Listen(); }