protected DmTxControllerJoinMap GetDmTxJoinMap(uint joinStart, string joinMapKey) { var joinMap = new DmTxControllerJoinMap(joinStart); var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey); if (!string.IsNullOrEmpty(joinMapSerialized)) { joinMap = JsonConvert.DeserializeObject <DmTxControllerJoinMap>(joinMapSerialized); } return(joinMap); }
protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) { var joinMap = new DmTxControllerJoinMap(); var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey); if (!string.IsNullOrEmpty(joinMapSerialized)) { joinMap = JsonConvert.DeserializeObject <DmTxControllerJoinMap>(joinMapSerialized); } joinMap.OffsetJoinNumbers(joinStart); if (tx.Hardware is DmHDBasedTEndPoint) { Debug.Console(1, tx, "No properties to link. Skipping device {0}", tx.Name); return; } Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus]); tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution]); trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability; bool hdcpTypeSimple; if (tx.Hardware is DmTx4kX02CBase) { hdcpTypeSimple = false; } else { hdcpTypeSimple = true; } if (tx is ITxRouting) { var txR = tx as ITxRouting; trilist.SetUShortSigAction(joinMap.VideoInput, i => txR.ExecuteNumericSwitch(i, 0, eRoutingSignalType.Video)); trilist.SetUShortSigAction(joinMap.AudioInput, i => txR.ExecuteNumericSwitch(i, 0, eRoutingSignalType.Audio)); txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput]); txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput]); trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability; if (txR.InputPorts[DmPortName.HdmiIn] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn]; if (tx.Feedbacks["HdmiInHdcpCapability"] != null) { var intFeedback = tx.Feedbacks["HdmiInHdcpCapability"] as IntFeedback; if (intFeedback != null) { intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState]); } } if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) { var port = inputPort.Port as EndpointHdmiInput; SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist); } } if (txR.InputPorts[DmPortName.HdmiIn1] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn1]; if (tx.Feedbacks["HdmiIn1HdcpCapability"] != null) { var intFeedback = tx.Feedbacks["HdmiIn1HdcpCapability"] as IntFeedback; if (intFeedback != null) { intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState]); } } if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) { var port = inputPort.Port as EndpointHdmiInput; SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist); } } if (txR.InputPorts[DmPortName.HdmiIn2] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn2]; if (tx.Feedbacks["HdmiIn2HdcpCapability"] != null) { var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback; if (intFeedback != null) { intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState]); } } if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) { var port = inputPort.Port as EndpointHdmiInput; SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port2HdcpState, trilist); } } } var txFreeRun = tx as IHasFreeRun; if (txFreeRun != null) { txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled]); trilist.SetBoolSigAction(joinMap.FreeRunEnabled, new Action <bool>(txFreeRun.SetFreeRunEnabled)); } var txVga = tx as IVgaBrightnessContrastControls; { if (txVga == null) { return; } txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness]); txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast]); trilist.SetUShortSigAction(joinMap.VgaBrightness, txVga.SetVgaBrightness); trilist.SetUShortSigAction(joinMap.VgaContrast, txVga.SetVgaContrast); } }
protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge) { Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]); tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber]); tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution.JoinNumber]); trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability; bool hdcpTypeSimple; if (tx.Hardware is DmTx4kX02CBase) { hdcpTypeSimple = false; } else { hdcpTypeSimple = true; } if (tx is ITxRouting) { var txR = tx as ITxRouting; trilist.SetUShortSigAction(joinMap.VideoInput.JoinNumber, i => txR.ExecuteNumericSwitch(i, 0, eRoutingSignalType.Video)); trilist.SetUShortSigAction(joinMap.AudioInput.JoinNumber, i => txR.ExecuteNumericSwitch(i, 0, eRoutingSignalType.Audio)); txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]); txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]); trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability; if (txR.InputPorts[DmPortName.HdmiIn] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn]; if (tx.Feedbacks["HdmiInHdcpCapability"] != null) { var intFeedback = tx.Feedbacks["HdmiInHdcpCapability"] as IntFeedback; if (intFeedback != null) { intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]); } } if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) { var port = inputPort.Port as EndpointHdmiInput; SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState.JoinNumber, trilist); } } if (txR.InputPorts[DmPortName.HdmiIn1] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn1]; if (tx.Feedbacks["HdmiIn1HdcpCapability"] != null) { var intFeedback = tx.Feedbacks["HdmiIn1HdcpCapability"] as IntFeedback; if (intFeedback != null) { intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]); } } if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) { var port = inputPort.Port as EndpointHdmiInput; SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState.JoinNumber, trilist); } } if (txR.InputPorts[DmPortName.HdmiIn2] != null) { var inputPort = txR.InputPorts[DmPortName.HdmiIn2]; if (tx.Feedbacks["HdmiIn2HdcpCapability"] != null) { var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback; if (intFeedback != null) { intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]); } } if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) { var port = inputPort.Port as EndpointHdmiInput; SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port2HdcpState.JoinNumber, trilist); } } } var txFreeRun = tx as IHasFreeRun; if (txFreeRun != null) { txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled.JoinNumber]); trilist.SetBoolSigAction(joinMap.FreeRunEnabled.JoinNumber, txFreeRun.SetFreeRunEnabled); } var txVga = tx as IVgaBrightnessContrastControls; { if (txVga == null) { return; } txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness.JoinNumber]); txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast.JoinNumber]); trilist.SetUShortSigAction(joinMap.VgaBrightness.JoinNumber, txVga.SetVgaBrightness); trilist.SetUShortSigAction(joinMap.VgaContrast.JoinNumber, txVga.SetVgaContrast); } }