Пример #1
0
        /// <summary>
        /// 路由视图OLP部分
        /// </summary>
        /// <param name="ip"></param>
        /// <param name="port"></param>
        /// <param name="slot"></param>
        /// <returns></returns>
        public ActionResult RouteView(string ip, int port, int slot)
        {
            OLPInfo      olpInfo = new OLPInfo();
            OLPViewModel model   = new OLPViewModel()
            {
                IP   = ip,
                Port = port,
                Slot = slot
            };

            return(View(model));
        }
Пример #2
0
        /// <summary>
        /// 设备视图
        /// </summary>
        /// <param name="ip"></param>
        /// <param name="port"></param>
        /// <param name="slot"></param>
        /// <returns></returns>
        public ActionResult Details(string ip, int port, int slot, int mfId)
        {
            OLPInfo      olpInfo = new OLPInfo();
            OLPViewModel model   = new OLPViewModel()
            {
                IP   = ip,
                Port = port,
                Slot = slot
            };

            var tcp = TcpClientServicePool.GetService(ip, port);

            if (tcp != null)
            {
                try
                {
                    OLPCommService service = new OLPCommService(tcp, slot);
                    olpInfo.RefreshData(service);
                    model.Type            = olpInfo.Card_Type;
                    model.Status          = "正常";
                    model.ProductModel    = "OTS-" + model.Type;
                    model.SerialNumber    = olpInfo.Serial_Number;
                    model.HardwareVersion = olpInfo.Hardware_Version;
                    model.SoftwareVersion = olpInfo.Software_Version;
                    model.WorkMode        = olpInfo.Work_Mode;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    TcpClientServicePool.FreeService(tcp);
                }
            }
            ViewBag.MFID = mfId;
            return(View(model));
        }