public void CitpCaExGetLiveViewImageTest() { CaExGetLiveViewImage sentPacket = new CaExGetLiveViewImage(); sentPacket.Format = LiveViewImageFormat.JPEG; sentPacket.Width = 1920; sentPacket.Height = 1080; sentPacket.CameraFocusX = 10; sentPacket.CameraFocusY = 15; sentPacket.CameraFocusZ = 20; sentPacket.CameraPositionX = 0.75f; sentPacket.CameraPositionY = 3.5f; sentPacket.CameraPositionZ = 15; CaExGetLiveViewImage received = CitpPacketTester.SendAndReceiveCaExPacket(sentPacket) as CaExGetLiveViewImage; Assert.AreEqual(sentPacket.Format, received.Format, "Format is not equal."); Assert.AreEqual(sentPacket.Width, received.Width, "Width is not equal."); Assert.AreEqual(sentPacket.Height, received.Height, "Height is not equal."); Assert.AreEqual(sentPacket.CameraFocusX, received.CameraFocusX, "CameraFocusX is not equal."); Assert.AreEqual(sentPacket.CameraFocusY, received.CameraFocusY, "CameraFocusY is not equal."); Assert.AreEqual(sentPacket.CameraFocusZ, received.CameraFocusZ, "CameraFocusZ is not equal."); Assert.AreEqual(sentPacket.CameraPositionX, received.CameraPositionX, "CameraPositionX is not equal."); Assert.AreEqual(sentPacket.CameraPositionY, received.CameraPositionY, "CameraPositionY is not equal."); Assert.AreEqual(sentPacket.CameraPositionZ, received.CameraPositionZ, "Availability is not equal."); }
private static CitpPacket BuildCaEx(CitpReceiveData 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; default: return(null); } packet.ReadData(data.GetReader()); return(packet); }
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); }