示例#1
0
        public void CitpCaExFixtureConsoleStatusTest()
        {
            CaExFixtureConsoleStatus sentPacket = new CaExFixtureConsoleStatus();

            for (int i = 0; i < 3; i++)
            {
                CaExFixtureConsoleStatus.FixtureStatus status = new CaExFixtureConsoleStatus.FixtureStatus();
                status.FixtureId = (uint)(1620 + i);
                status.Clearable = true;
                status.Locked    = false;
                sentPacket.Fixtures.Add(status);
            }

            CaExFixtureConsoleStatus received = CitpPacketTester.SendAndReceiveCaExPacket(sentPacket) as CaExFixtureConsoleStatus;

            Assert.AreEqual(3, received.Fixtures.Count, "Incorrect number of fixtures received.");
            for (int i = 0; i < 3; i++)
            {
                Assert.AreEqual(sentPacket.Fixtures[i].FixtureId, received.Fixtures[i].FixtureId, "Id is not equal.");
                Assert.AreEqual(sentPacket.Fixtures[i].Clearable, received.Fixtures[i].Clearable, "Clearable is not equal.");
                Assert.AreEqual(sentPacket.Fixtures[i].Locked, received.Fixtures[i].Locked, "Locked is not equal.");
            }
        }
示例#2
0
        private static CitpPacket BuildCaEx(CitpRecieveData data)
        {
            CaExHeader header = new CaExHeader(0x0);

            header.ReadData(data.GetReader());

            CitpPacket packet = null;

            switch (header.ContentCode)
            {
            case CaExContentCodes.Nack:
                packet = new CaExNack();
                break;

            case CaExContentCodes.GetLiveViewStatus:
                packet = new CaExGetLiveViewStatus();
                break;

            case CaExContentCodes.LiveViewStatus:
                packet = new CaExLiveViewStatus();
                break;

            case CaExContentCodes.GetLiveViewImage:
                packet = new CaExGetLiveViewImage();
                break;

            case CaExContentCodes.LiveViewImage:
                packet = new CaExLiveViewImage();
                break;

            case CaExContentCodes.SetCueRecordingCapabilities:
                packet = new CaExSetCueRecordingCapabilities();
                break;

            case CaExContentCodes.RecordCue:
                packet = new CaExRecordCue();
                break;

            case CaExContentCodes.SetRecorderClearingCapabilities:
                packet = new CaExSetRecorderClearingCapabilities();
                break;

            case CaExContentCodes.ClearRecorder:
                packet = new CaExClearRecorder();
                break;

            case CaExContentCodes.EnterShow:
                packet = new CaExEnterShow();
                break;

            case CaExContentCodes.LeaveShow:
                packet = new CaExLeaveShow();
                break;

            case CaExContentCodes.FixtureConsoleStatus:
                packet = new CaExFixtureConsoleStatus();
                break;

            case CaExContentCodes.FixtureListRequest:
                packet = new CaExFixtureListRequest();
                break;

            case CaExContentCodes.FixtureList:
                packet = new CaExFixtureList();
                break;

            case CaExContentCodes.FixtureModify:
                packet = new CaExFixtureModify();
                break;

            case CaExContentCodes.FixtureRemove:
                packet = new CaExFixtureRemove();
                break;

            case CaExContentCodes.FixtureSelection:
                packet = new CaExFixtureSelection();
                break;

            case CaExContentCodes.FixtureIdentify:
                packet = new CaExFixtureIdentify();
                break;

            case CaExContentCodes.GetLaserFeedList:
                //Not implemented yet, left here as placeholder.
                return(null);

            default:
                return(null);
            }

            packet.ReadData(data.GetReader());
            return(packet);
        }