class SystemDeviceWidgetController extends DeviceWidgetControllerBase
{
	[ category = "Widget Refs" ]
	protected editable var m_slavesConnectedCount : inkTextRef;
	[ category = "Widget Refs" ]
	protected editable var m_connectedDevicesHolder : inkWidgetRef;

	public override function Initialize( gameController : DeviceInkGameControllerBase, widgetData : SDeviceWidgetPackage )
	{
		var systemWidgetData : TerminalSystemCustomData;
		systemWidgetData = ( ( TerminalSystemCustomData )( widgetData.customData ) );
		if( systemWidgetData )
		{
			inkTextRef.SetText( m_slavesConnectedCount, IntToString( systemWidgetData.connectedDevices ) );
		}
		if( widgetData.widgetState == EWidgetState.ALLOWED )
		{
			inkWidgetRef.SetState( m_connectedDevicesHolder, 'Allowed' );
		}
		else if( widgetData.widgetState == EWidgetState.LOCKED )
		{
			inkWidgetRef.SetState( m_connectedDevicesHolder, 'Locked' );
		}
		else if( widgetData.widgetState == EWidgetState.SEALED )
		{
			inkWidgetRef.SetState( m_connectedDevicesHolder, 'Sealed' );
		}
		super.Initialize( gameController, widgetData );
	}

}

