//Event handlers void DeviceHandler_Events(object sender, Tcc2DeviceEventArgs e) { switch (e.EventType) { case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Name: SetNameFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Location: SetLocationFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Position: SetPositionFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Version: SetVersionFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Serial: SetSerialFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Product: SetProductFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.MacAddresses: SetMacAddressesFb(e.StringValue); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Identify: SetIdentifyingFb(Convert.ToUInt16(e.BoolValue)); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.CustomLedColor: SetCustomLedColorFb(GetColor(e.LedColor)); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.CustomLedActive: SetCustomLedActiveFb(Convert.ToUInt16(e.BoolValue)); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.MicMuteLedColor: SetMicMuteLedColorFb(GetColor(e.LedColor)); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.MicOnLedColor: SetMicOnLedColorFb(GetColor(e.LedColor)); break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.LedBrightness: SetLedBrightnessFb((ushort)e.IntValue); break; } }
void TccDeviceHandler_Events(object sender, Tcc2DeviceEventArgs e) { CrestronConsole.PrintLine(e.ToString()); }
void DeviceHandler_Events(object sender, Tcc2DeviceEventArgs e) { switch (e.EventType) { case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Name: _xpanel.StringInput[41].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Location: _xpanel.StringInput[42].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Position: _xpanel.StringInput[50].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Version: _xpanel.StringInput[45].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Serial: _xpanel.StringInput[44].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Product: _xpanel.StringInput[43].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.MacAddresses: _xpanel.StringInput[46].StringValue = e.StringValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.Identify: _xpanel.BooleanInput[67].BoolValue = e.BoolValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.CustomLedColor: _xpanel.StringInput[47].StringValue = e.LedColor.ToString(); for (uint i = 0; i < 8; i++) { _xpanel.BooleanInput[43 + i].BoolValue = (int)e.LedColor == i + 1; } break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.CustomLedActive: _xpanel.BooleanInput[42].BoolValue = e.BoolValue; break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.MicMuteLedColor: _xpanel.StringInput[48].StringValue = e.LedColor.ToString(); for (uint i = 0; i < 8; i++) { _xpanel.BooleanInput[51 + i].BoolValue = (int)e.LedColor == i + 1; } break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.MicOnLedColor: _xpanel.StringInput[49].StringValue = e.LedColor.ToString(); for (uint i = 0; i < 8; i++) { _xpanel.BooleanInput[59 + i].BoolValue = (int)e.LedColor == i + 1; } break; case Tcc2DeviceEventArgs.eTcc2DeviceEventType.LedBrightness: _xpanel.UShortInput[41].UShortValue = (ushort)((e.IntValue / 5.0) * 65535); break; } }