private void C1StateRdy(SerialComm sender) { ControllerState state = sender as ControllerState; kitchenLL.Content = !state.IsLinkValid(0) ? "N/C" : ((state.GetLinkLevel(0) > 0) ? state.GetLinkLevel(0).ToString("P0", CultureInfo.InvariantCulture) : "Off"); roomaLL.Content = !state.IsLinkValid(1) ? "N/C" : ((state.GetLinkLevel(1) > 0) ? state.GetLinkLevel(1).ToString("P0", CultureInfo.InvariantCulture) : "Off"); toiletLL.Content = !state.IsLinkValid(2) ? "N/C" : ((state.GetLinkLevel(2) > 0) ? state.GetLinkLevel(2).ToString("P0", CultureInfo.InvariantCulture) : "Off"); tableLL.Content = !state.IsLinkValid(3) ? "N/C" : ((state.GetLinkLevel(3) > 0) ? "On" : "Off"); }
private void C2StateRdy(SerialComm sender) { ControllerState state = sender as ControllerState; roombLL.Content = !state.IsLinkValid(0) ? "N/C" : ((state.GetLinkLevel(0) > 0) ? state.GetLinkLevel(0).ToString("P0", CultureInfo.InvariantCulture) : "Off"); roomcLL.Content = !state.IsLinkValid(1) ? "N/C" : ((state.GetLinkLevel(1) > 0) ? state.GetLinkLevel(1).ToString("P0", CultureInfo.InvariantCulture) : "Off"); corridorLL.Content = !state.IsLinkValid(2) ? "N/C" : ((state.GetLinkLevel(2) > 0) ? state.GetLinkLevel(2).ToString("P0", CultureInfo.InvariantCulture) : "Off"); showerLL.Content = !state.IsLinkValid(3) ? "N/C" : ((state.GetLinkLevel(3) > 0) ? "On" : "Off"); msenState.Text = state.MSenState; }