public bool TieInputPortToAllOutputPorts(InputPort inputPort, TieType tieType) { if (!_rs232Device.Enabled) { return(false); } string result = null; switch (tieType) { case TieType.Video: result = _rs232Device.WriteWithResponse($"{(int)inputPort}*&", $@"^In{(int)inputPort} RGB"); break; case TieType.Audio: result = _rs232Device.WriteWithResponse($"{(int)inputPort}*$", $@"^In{(int)inputPort} Aud$"); break; case TieType.AudioVideo: result = _rs232Device.WriteWithResponse($"{(int)inputPort}*!", $@"^In{(int)inputPort} All$"); break; } return(result != null); }
public bool TieInputPortToAllOutputPorts(InputPort inputPort, TieType tieType) { try { var payload = new { inputPort, tieType }; var response = Utilities.InvokeMethodWithObjectPayload(_serviceClient, _deviceId, "VGAMatrixTieInputPortToAllOutputPorts", payload); return(true); } catch { return(false); } }
public InputPort?GetInputPortForOutputPort(OutputPort outputPort, TieType tieType) { if (!_rs232Device.Enabled) { return(null); } string result = null; if (tieType == TieType.AudioVideo) { throw new ArgumentException("Unable to get Audio and Video ties at the same time."); } switch (tieType) { case TieType.Video: result = _rs232Device.WriteWithResponse($"{(int)outputPort}&", @"^[0-9]+$"); break; case TieType.Audio: result = _rs232Device.WriteWithResponse($"{(int)outputPort}$", @"^[0-9]+$"); break; } if (result == null) { return(null); } InputPort tie = (InputPort)int.Parse(result); if (!tie.Valid()) { return(null); } return(tie); }
public Tournament(GenericReader reader) { int version = reader.ReadEncodedInt(); switch ( version ) { case 4: { this.m_EventController = reader.ReadItem() as EventController; goto case 3; } case 3: { this.m_SuddenDeathRounds = reader.ReadEncodedInt(); goto case 2; } case 2: { this.m_TournyType = (TournyType)reader.ReadEncodedInt(); goto case 1; } case 1: { this.m_GroupType = (GroupingType)reader.ReadEncodedInt(); this.m_TieType = (TieType)reader.ReadEncodedInt(); this.m_SignupPeriod = reader.ReadTimeSpan(); goto case 0; } case 0: { if (version < 3) this.m_SuddenDeathRounds = 3; this.m_ParticipantsPerMatch = reader.ReadEncodedInt(); this.m_PlayersPerParticipant = reader.ReadEncodedInt(); this.m_SignupPeriod = reader.ReadTimeSpan(); this.m_Stage = TournamentStage.Inactive; this.m_Pyramid = new TournyPyramid(); this.m_Ruleset = new Ruleset(RulesetLayout.Root); this.m_Ruleset.ApplyDefault(this.m_Ruleset.Layout.Defaults[0]); this.m_Participants = new ArrayList(); this.m_Undefeated = new ArrayList(); this.m_Arenas = new ArrayList(); break; } } Timer.DelayCall(SliceInterval, SliceInterval, new TimerCallback(Slice)); }
public IActionResult OnPostTieInputPortToOutputPort(InputPort inputPort, OutputPort outputPort, TieType tieType) { _device.TieInputPortToOutputPort(inputPort, outputPort, tieType); DeviceInfoCache.TieState = _device.GetTieState(); return(RedirectToPage()); }
public static bool Valid(this TieType tieType) { return(Enum.IsDefined(typeof(TieType), tieType)); }