Exemplo n.º 1
0
        private bool InitWESMonitor()
        {
            try
            {
                string svcAddr = ConfigurationManager.AppSettings["MonitorSvcAddr"];
                CtlMonitorInterface.IWESMonitorSvc wesMonitorSvc = ChannelFactory <CtlMonitorInterface.IWESMonitorSvc> .CreateChannel(new BasicHttpBinding(), new EndpointAddress(svcAddr));

                if (wesMonitorSvc == null)
                {
                    Console.WriteLine("WCS服务未启动");
                    return(false);
                }
                Console.WriteLine(wesMonitorSvc.hello());
                this.nodeMonitorView.NodeMonitor = wesMonitorSvc;
                this.nodeMonitorView.AsrsMonitor = wesMonitorSvc;
                nodeMonitorView.Init();
                this.nodeMonitorView.InitDevDic(wesMonitorSvc.GetPLCConnStatDic());
                this.nodeMonitorView.DevMonitorView.devCommMonitor = wesMonitorSvc;
                asrsMonitorView.SetAsrsMonitor(wesMonitorSvc);
                asrsMonitorView.Init();
                nodeMonitorView.SetAsrsMonitors(asrsMonitorView.AsrsMonitors);

                List <string> logSrcs = new List <string>();
                logSrcs.AddRange(wesMonitorSvc.GetLogSrcList());
                List <string> storLogSrcs = storageView.GetLogsrcList();
                if (storLogSrcs != null)
                {
                    logSrcs.AddRange(logSrcs);
                }
                logView.SetLogsrcList(logSrcs);
                logView.AddLogsrcList(ExtLogSrc);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return(false);
            }
        }
Exemplo n.º 2
0
        private bool LoadModules()
        {
            string reStr = "";

            //扩展view
            asrsCheckoutModifyView = new ExtentViews.AsrsCheckoutModifyView("非正常出库调整");

            logView = new LogView("日志");
            childViews.Add(logView);
            logView.SetParent(this);
            logView.RegisterMenus(this.menuStrip1, "日志查询");
            logView.SetLogDispInterface(this);
            presenter.logRecorder = logView.GetLogrecorder();


            configView = new ConfiManageView();
            childViews.Add(configView);
            configView.SetParent(this);
            configView.RegisterMenus(this.menuStrip1, "配置管理");
            configView.SetLoginterface(logView.GetLogrecorder());

            palletTraceView = new ProduceTraceView("托盘追溯");
            childViews.Add(palletTraceView);
            palletTraceView.SetParent(this);
            palletTraceView.RegisterMenus(this.menuStrip1, "托盘追溯");
            palletTraceView.SetLoginterface(logView.GetLogrecorder());

            asrsCtlView = new AsrsCtlView("立库控制");
            childViews.Add(asrsCtlView);

            if (!asrsCtlView.RegistExtView(asrsCheckoutModifyView, ref reStr))
            {
                Console.WriteLine(reStr);
                return(false);
            }
            asrsCtlView.SetParent(this);
            asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制");
            asrsCtlView.SetLoginterface(logView.GetLogrecorder());
            asrsCtlView.SetAsrsPresenter(presenter.AsrsPresenter);
            asrsCtlView.Init();

            nodeMonitorView = new CtlNodeMonitorView("流程监控");
            childViews.Add(nodeMonitorView);
            nodeMonitorView.SetParent(this);
            nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控");
            nodeMonitorView.SetLoginterface(logView.GetLogrecorder());

            storageView = new StorageMainView();
            childViews.Add(storageView);
            storageView.SetParent(this);
            storageView.RegisterMenus(this.menuStrip1, "库存管理");
            storageView.SetLoginterface(logView.GetLogrecorder());
            nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl);
            nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors);



            AsrsInterface.IAsrsManageToCtl asrsResManage = null;
            AsrsInterface.IAsrsCtlToManage asrsCtl       = presenter.GetAsrsCtlInterfaceObj();

            if (!storageView.Init(asrsCtl, ref asrsResManage, ref reStr))
            {
                // logView.GetLogrecorder().AddLog(new LogModel("主模块", "立库管理层模块初始化错误," + reStr, EnumLoglevel.错误));
                Console.WriteLine("立库管理层模块初始化错误," + reStr);
                return(false);
            }
            asrsCtlView.SetAsrsResManage(asrsResManage);
            asrsCheckoutModifyView.SetAsrsResManage(asrsResManage);
            asrsCheckoutModifyView.AsrsPresenter = presenter.AsrsPresenter;
            AttachModuleView(nodeMonitorView);
            foreach (BaseChildView childView in childViews)
            {
                childView.ChangeRoleID(this.roleID);
            }
            presenter.SetAsrsResManage(asrsResManage);

            string[] nodeEnableCfgIDS = new string[] { "1001", "1002", "1003", "1004", "1005", "1006" };
            List <FlowCtlBaseModel.CtlNodeBaseModel> nodeEnableCfgs = new List <FlowCtlBaseModel.CtlNodeBaseModel>();

            foreach (string nodeID in nodeEnableCfgIDS)
            {
                nodeEnableCfgs.Add(presenter.CtlNodeManager.GetNodeByID(nodeID));
            }
            configView.SetCfgNodes(nodeEnableCfgs);

            return(true);
        }
Exemplo n.º 3
0
        private bool LoadModules()
        {
            logView = new LogView("日志");
            childViews.Add(logView);
            logView.SetParent(this);
            logView.RegisterMenus(this.menuStrip1, "日志查询");
            logView.SetLogDispInterface(this);
            presenter.logRecorder = logView.GetLogrecorder();


            configView = new ConfiManageView();
            childViews.Add(configView);
            configView.SetParent(this);
            configView.RegisterMenus(this.menuStrip1, "配置管理");
            configView.SetLoginterface(logView.GetLogrecorder());

            palletTraceView = new ProduceTraceView("托盘追溯");
            childViews.Add(palletTraceView);
            palletTraceView.SetParent(this);
            palletTraceView.RegisterMenus(this.menuStrip1, "托盘追溯");
            palletTraceView.SetLoginterface(logView.GetLogrecorder());

            asrsCtlView = new AsrsCtlView("立库控制");
            childViews.Add(asrsCtlView);
            asrsCtlView.SetParent(this);
            asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制");
            asrsCtlView.SetLoginterface(logView.GetLogrecorder());
            asrsCtlView.SetAsrsPresenter(presenter.AsrsPresenter);
            asrsCtlView.Init();

            nodeMonitorView = new CtlNodeMonitorView("流程监控");
            childViews.Add(nodeMonitorView);
            nodeMonitorView.SetParent(this);
            nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控");
            nodeMonitorView.SetLoginterface(logView.GetLogrecorder());
            nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors);
            this.nodeMonitorView.WmsSimViewDisp = true;


            AsrsInterface.IAsrsManageToCtl asrsResManage = presenter.WmsSvc;
            AsrsInterface.IAsrsCtlToManage asrsCtl       = presenter.GetAsrsCtlInterfaceObj();
            asrsCtlView.SetAsrsResManage(asrsResManage);

            AttachModuleView(nodeMonitorView);
            foreach (BaseChildView childView in childViews)
            {
                childView.ChangeRoleID(this.roleID);
            }
            presenter.SetAsrsResManage(asrsResManage);

            string[] nodeEnableCfgIDS = new string[] { "1001", "1002", "1003", "1004", "1005", "1006" };
            List <FlowCtlBaseModel.CtlNodeBaseModel> nodeEnableCfgs = new List <FlowCtlBaseModel.CtlNodeBaseModel>();

            foreach (string nodeID in nodeEnableCfgIDS)
            {
                nodeEnableCfgs.Add(presenter.CtlNodeManager.GetNodeByID(nodeID));
            }
            configView.SetCfgNodes(nodeEnableCfgs);

            return(true);
        }
Exemplo n.º 4
0
        private bool LoadModules()
        {
            logView = new LogView("日志");
            childViews.Add(logView);
            logView.SetParent(this);
            logView.RegisterMenus(this.menuStrip1, "日志查询");
            logView.SetLogDispInterface(this);

            configView = new ConfiManageView();
            childViews.Add(configView);
            configView.SetParent(this);
            configView.RegisterMenus(this.menuStrip1, "配置管理");
            configView.SetLoginterface(logView.GetLogrecorder());

            asrsCtlView = new AsrsCtlView("立库控制");
            childViews.Add(asrsCtlView);
            asrsCtlView.SetParent(this);
            asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制");
            asrsCtlView.SetLoginterface(logView.GetLogrecorder());
            asrsCtlView.SetAsrsPresenter(presenter.AsrsPresenter);
            asrsCtlView.Init();

            nodeMonitorView = new CtlNodeMonitorView("流程监控");
            childViews.Add(nodeMonitorView);
            nodeMonitorView.SetParent(this);
            nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控");
            nodeMonitorView.SetLoginterface(logView.GetLogrecorder());

            storageView = new StorageMainView();
            childViews.Add(storageView);
            storageView.SetParent(this);
            storageView.RegisterMenus(this.menuStrip1, "库存管理");
            storageView.SetLoginterface(logView.GetLogrecorder());
            nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl);
            nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors);

            List <string> logSrcs     = presenter.GetLogsrcList();
            List <string> storLogSrcs = storageView.GetLogsrcList();

            if (storLogSrcs != null)
            {
                logSrcs.AddRange(storLogSrcs);
            }

            logView.SetLogsrcList(logSrcs);

            AsrsInterface.IAsrsManageToCtl asrsResManage = null;
            AsrsInterface.IAsrsCtlToManage asrsCtl       = presenter.GetAsrsCtlInterfaceObj();
            string reStr = "";

            if (!storageView.Init(asrsCtl, ref asrsResManage, ref reStr))
            {
                // logView.GetLogrecorder().AddLog(new LogModel("主模块", "立库管理层模块初始化错误," + reStr, EnumLoglevel.错误));
                Console.WriteLine("立库管理层模块初始化错误," + reStr);
                return(false);
            }
            asrsCtlView.SetAsrsResManage(asrsResManage);
            AttachModuleView(nodeMonitorView);
            foreach (BaseChildView childView in childViews)
            {
                childView.ChangeRoleID(this.roleID);
            }
            presenter.SetAsrsResManage(asrsResManage);
            return(true);
        }