Example #1
0
        public void OnLoaded()
        {
            //绑定实时参数
            var onlineCpmsDict = App.Store.GetState().CpmState.OnlineCpmsDict;

            CpmsTab.BindSource(MachineCode, onlineCpmsDict[MachineCode]);

            //绑定报警
            var alarmsDict = App.Store.GetState().AlarmState.AlarmsDict;

            AlarmTab.BindSource(MachineCode, alarmsDict[MachineCode]);

            //绑定任务
            var mqTaskDict = App.Store.GetState().DMesState.MqSchTasksDict;

            SchTaskTab.BindSource(MachineCode, mqTaskDict[MachineCode]);

            //初始化人员卡
            var mqEmpRfids = App.Store.GetState().DMesState.MqEmpRfidDict;

            SchTaskTab.InitEmployees(mqEmpRfids[MachineCode]);

            //初始化来料
            var scanMaterialDict = App.Store.GetState().DMesState.MqScanMaterialDict;

            if (scanMaterialDict.TryGetValue(MachineCode, out var material))
            {
                ScanMaterialTab.Update(material);
            }
            //绑定485通讯状态
            var com485Dict = App.Store.GetState().CpmState.Com485StatusDict;
            var status     = com485Dict.Where(c => MachineConfig.MachineCodeToIpsDict[MachineCode].Contains(c.Key))
                             .Select(c => c.Value).ToList();

            Com485Tab.BindSource(MachineCode, status);

            //回填参数
            //var dpms = App.Store.GetState().DpmStore.DpmsDict;
            //DpmsTab.BindSource(dpms[MachineCode]);

            //绑定制程质检
            unsubscribe += ProcessCheckTab.BindSource(MachineCode);

            ////绑定曲线参数界面
            CpmDetailTab.BindSource(MachineCode, onlineCpmsDict[MachineCode]);



            //绑定选中的tab
            ViewStore = App.Store.GetState().ViewStoreState.DMewCoreViewDict[MachineCode];

            unsubscribe += App.Store.Subscribe(actionExecDict, false);
            App.Store.Dispatch(new SysActions.CloseLoadingSplash());
        }
Example #2
0
        /// <summary>
        /// 扫描来料
        /// </summary>
        /// <param name="state"></param>
        /// <param name="action"></param>
        void whenScanMaterialAccpet(AppState state, IAction action)
        {
            var mqAction = (MqActions.ScanMaterialAccpet)action;

            if (mqAction.MachineCode != MachineCode)
            {
                return;
            }
            //来料出问题
            if (mqAction.ScanMaterial?.type == false)
            {
                App.Store.Dispatch(new SysActions.ShowNotification(new SysNotificationMsg()
                {
                    Title   = "警告",
                    Content = $"{mqAction.MachineCode} 来料错误,请检查",
                }));
                App.Store.Dispatch(new AlarmActions.OpenAlarmLights(mqAction.MachineCode, 5000));
            }
            ScanMaterialTab.Update(mqAction.ScanMaterial);
        }