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); }
public void CitpCaExRecordCueTest() { CaExRecordCue sentPacket = new CaExRecordCue(); for (int i = 0; i < 4; i++) { RecordCueOption newOption = new RecordCueOption(); newOption.Name = "Paddington"; newOption.Value = "Marmalade " + i; sentPacket.Options.Add(newOption); } CaExRecordCue received = CitpPacketTester.SendAndReceiveCaExPacket(sentPacket) as CaExRecordCue; int optionCount = sentPacket.Options.Count(); Assert.AreEqual(optionCount, received.Options.Count(), "Option count mismatch"); for (int i = 0; i < optionCount; i++) { Assert.AreEqual(sentPacket.Options[i].Name, sentPacket.Options[i].Name, "Name is not equal."); Assert.AreEqual(sentPacket.Options[i].Value, sentPacket.Options[i].Value, "Value is not equal."); } }
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); }