/// <summary> /// Drives power points to a position, unlocks them for hand cranking, or relocks them for power operation. /// </summary> /// <param name="route">Which sub-area the points are in.</param> /// <param name="points">Which points to modify.</param> /// <param name="state">What action the points should take.</param> public async Task ThrowSwitchAsync(int route, int points, ESwitchState state) { try { await Run8.ThrowSwitchAsync(route, points, state); } catch (CommunicationException) { LinkError = true; } }
/// <summary> /// Drives power points to a position, unlocks them for hand cranking, or relocks them for power operation. /// </summary> /// <param name="route">Which sub-area the points are in.</param> /// <param name="points">Which points to modify.</param> /// <param name="state">What action the points should take.</param> public Task ThrowSwitchAsync(int route, int points, ESwitchState state) { DispatcherSwitchMessage msg; msg.Route = route; msg.SwitchID = points; msg.SwitchState = state; return(Task.Factory.FromAsync(Run8.BeginThrowSwitch, Run8.EndThrowSwitch, msg, null)); }