Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public UCLayerCoolingPara(LayerCoolingModel layerCooling) : this()
        {
            this.Model = this.mvvmContext1.GetViewModel <LayerCoolingModel>();
            CopyUtil.CopyModel(this.Model, layerCooling ?? DefaultParaHelper.GetDefaultLayerCoolingModel());
            this.InitializeBindings();
            var monitor = new UnitMonitor(this, () => this.Model.RaisePropertiesChanged());

            monitor.Listen();
        }
Exemplo n.º 3
0
        public UCPointMoveCutPara(PointMoveCutModel model) : this()
        {
            this.Model = this.mvvmContext1.GetViewModel <PointMoveCutModel>();
            CopyUtil.CopyModel(this.Model, model ?? DefaultParaHelper.GetDefaultPointMoveModel());
            this.InitializeBindings();
            var monitor = new UnitMonitor(this, () => this.Model.RaisePropertiesChanged());

            monitor.Listen();
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        public UCLayerEvaporatePara(LayerEvaporateModel layerEvaporate) : this()
        {
            this.Model = this.mvvmContext1.GetViewModel <LayerEvaporateModel>();
            CopyUtil.CopyModel(this.Model, layerEvaporate ?? DefaultParaHelper.GetDefaultLayerEvaporateModel());
            this.InitializeBindings();
            this.InitializeCurve();
            var monitor = new UnitMonitor(this, () => this.Model.RaisePropertiesChanged());

            monitor.Listen();
            UnitObserverFacade.Instance.SpeedUnitObserver.UnitChanged += x => this.InitializeCurve();
        }
Exemplo n.º 6
0
        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();
        }