/// <summary>
        /// Return String in the form
        /// Manufacturer Product (ProjectorName)
        /// or
        /// Manufacturer Product
        /// if no projector name is set.
        /// </summary>
        public string getProjectorInfo()
        {
            string toRet = "";
            ManufacturerNameCommand mnc = new ManufacturerNameCommand();

            if (sendCommand(mnc) == Command.Response.SUCCESS)
            {
                toRet = mnc.Manufacturer;
            }

            ProductNameCommand prnc = new ProductNameCommand();

            if (sendCommand(prnc) == Command.Response.SUCCESS)
            {
                toRet += " " + prnc.ProductName;
            }

            ProjectorNameCommand pnc = new ProjectorNameCommand();

            if (sendCommand(pnc) == Command.Response.SUCCESS)
            {
                if (pnc.Name.Length > 0)
                {
                    toRet += " (" + pnc.Name + ")";
                }
            }
            return(toRet);
        }
Exemple #2
0
        /// <summary>
        /// Return String in the form
        /// Manufacturer Product (ProjectorName)
        /// or
        /// Manufacturer Product
        /// if no projector name is set.
        /// </summary>
        public async Task <string> getProjectorInfo()
        {
            string toRet = "";
            ManufacturerNameCommand mnc = new ManufacturerNameCommand();

            if (await sendCommand(mnc) == Command.Response.SUCCESS)
            {
                toRet = "Manuf.:\t" + mnc.Manufacturer;
            }

            ProductNameCommand prnc = new ProductNameCommand();

            if (await sendCommand(prnc) == Command.Response.SUCCESS)
            {
                toRet += "\nModel:\t" + prnc.ProductName;
            }

            ProjectorNameCommand pnc = new ProjectorNameCommand();

            if (await sendCommand(pnc) == Command.Response.SUCCESS)
            {
                if (pnc.Name.Length > 0)
                {
                    toRet += "\nName:\t" + pnc.Name + "";
                }
            }
            return(toRet);
        }
        public static async Task <ProjectorInfo> create(PJLinkConnection c)
        {
            ProjectorInfo pi = new ProjectorInfo();

            pi._projectorHostName = c.HostName;
            ProjectorNameCommand pnc = new ProjectorNameCommand();

            if (await c.sendCommand(pnc) == Command.Response.SUCCESS)
            {
                pi._projectorHostName = pnc.Name;
            }

            ManufacturerNameCommand mnc = new ManufacturerNameCommand();

            if (await c.sendCommand(mnc) == Command.Response.SUCCESS)
            {
                pi._projectorManufacturerName = mnc.Manufacturer;
            }

            ProductNameCommand prnc = new ProductNameCommand();

            if (await c.sendCommand(prnc) == Command.Response.SUCCESS)
            {
                pi._projectorProductName = prnc.ProductName;
            }

            ErrorStatusCommand esc = new ErrorStatusCommand();

            if (await c.sendCommand(esc) == Command.Response.SUCCESS)
            {
                pi._fanStatus    = esc.FanStatus;
                pi._lampStatus   = esc.LampStatus;
                pi._coverStatus  = esc.CoverStatus;
                pi._filterStatus = esc.FilterStatus;
                pi._otherStatus  = esc.OtherStatus;
            }

            PowerCommand pc = new PowerCommand(PowerCommand.Power.QUERY);

            if (await c.sendCommand(pc) == Command.Response.SUCCESS)
            {
                pi._powerStatus = pc.Status;
            }

            LampStatusCommand lsc = new LampStatusCommand();

            if (await c.sendCommand(lsc) == Command.Response.SUCCESS)
            {
                pi._multiLampStatus = lsc.StatusList;
                pi._multiLampHours  = lsc.HoursList;
                pi._numOfLamps      = lsc.NumOfLamps;
            }

            InputCommand ic = new InputCommand();

            if (await c.sendCommand(ic) == Command.Response.SUCCESS)
            {
                pi._input     = ic.Input;
                pi._inputPort = ic.Port;
            }

            return(pi);
        }
        public static ProjectorInfo create(PJLinkConnection c)
        {
            ProjectorInfo pi = new ProjectorInfo();
            pi._projectorHostName = c.HostName;
            ProjectorNameCommand pnc = new ProjectorNameCommand();
            if (c.sendCommand(pnc) == Command.Response.SUCCESS)
                pi._projectorHostName = pnc.Name;

            ManufacturerNameCommand mnc = new ManufacturerNameCommand();
            if (c.sendCommand(mnc) == Command.Response.SUCCESS)
                pi._projectorManufacturerName = mnc.Manufacturer;

            ProductNameCommand prnc = new ProductNameCommand();
            if (c.sendCommand(prnc) == Command.Response.SUCCESS)
                pi._projectorProductName = prnc.ProductName;

            ErrorStatusCommand esc = new ErrorStatusCommand();
            if (c.sendCommand(esc) == Command.Response.SUCCESS)
            {
                pi._fanStatus = esc.FanStatus;
                pi._lampStatus = esc.LampStatus;
                pi._coverStatus = esc.CoverStatus;
                pi._filterStatus = esc.FilterStatus;
                pi._otherStatus = esc.OtherStatus;
            }

            PowerCommand pc = new PowerCommand(PowerCommand.Power.QUERY);
            if (c.sendCommand(pc) == Command.Response.SUCCESS)
                pi._powerStatus = pc.Status;

            LampStatusCommand lsc = new LampStatusCommand();
            if (c.sendCommand(lsc) == Command.Response.SUCCESS)
            {
                pi._multiLampStatus = lsc.StatusList;
                pi._multiLampHours = lsc.HoursList;
                pi._numOfLamps = lsc.NumOfLamps;
            }

            InputCommand ic = new InputCommand();
            if (c.sendCommand(ic) == Command.Response.SUCCESS)
            {
                pi._input = ic.Input;
                pi._inputPort = ic.Port;
            }

            return pi;
        }
        /// <summary>
        /// Return String in the form
        /// Manufacturer Product (ProjectorName)
        /// or 
        /// Manufacturer Product 
        /// if no projector name is set. 
        /// </summary>
        public string getProjectorInfo()
        {
            string toRet = "";
            ManufacturerNameCommand mnc = new ManufacturerNameCommand();
            if (sendCommand(mnc) == Command.Response.SUCCESS)
                toRet = mnc.Manufacturer;

            ProductNameCommand prnc = new ProductNameCommand();
            if (sendCommand(prnc) == Command.Response.SUCCESS)
                toRet+= " " + prnc.ProductName;

            ProjectorNameCommand pnc = new ProjectorNameCommand();
            if (sendCommand(pnc) == Command.Response.SUCCESS) {
                if (pnc.Name.Length > 0)
                    toRet += " (" + pnc.Name + ")";
            }
            return toRet;
        }