예제 #1
0
        /// <summary>
        /// Check power state of Projector. Returns unknown in case of an error
        /// </summary>
        public PowerCommand.PowerStatus powerQuery()
        {
            PowerCommand pc3 = new PowerCommand(PowerCommand.Power.QUERY);

            if (sendCommand(pc3) == Command.Response.SUCCESS)
            {
                return(pc3.Status);
            }
            return(PowerCommand.PowerStatus.UNKNOWN);
        }
예제 #2
0
        /// <summary>
        /// Turn off projector. Returns true if projector answered with SUCCESS
        /// </summary>
        public bool turnOff()
        {
            PowerCommand pc = new PowerCommand(PowerCommand.Power.OFF);

            return(sendCommand(pc) == Command.Response.SUCCESS);
        }
예제 #3
0
        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._projectorName = pnc.Name;
            }
            else
            {
                return(pi);
            }

            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);
        }