-------------------------------------------------------------------------------------------------------------- 
	------------------------------------------ Turret ---------------------------------------------------------
	--------------------------------------------------------------------------------------------------------------
		
		--select 
		--	[ScreenPositionId] = case when l.LadleID = 14 then '#left' when l.LadleID = 2 then '#middle'  when l.LadleID = 6 then '#right' else '#bottom' end
		--	,[ContainerId] = 'container' + cast(LadleID as varchar)		   
		--	,[_LadleOpen] = case when (l.LadlePositionID <>  11 or  LadleID <> 2)then 0 else 1 end -- si ladleposition representa la posicion  y ladleId es si no está open
		--	,[WidgetTypeLadle] =  case when l.LadlePositionID =  7 then 0 else 1 end  --TOP is 1 and BOTTOM is 0
		--	,[LeftValue] = case when
		--					l.LadlePositionID =  7 then cast(cast(h.LastTemperature as int) as varchar) + ' F '
		--					else cast(LadleID as varchar)
		--					end
		--	,[TopValue] = left(l.HeatNumber,7)			
		--	,[MiddleValue] = h.MeltOrderNumber + ' - ' + g.GradeName + ' - ' + m.MaterialSize	
		--	,[MiddleLeftValue] =  cast(cast(h.LastTemperature as int) as varchar) + ' F '
		--	,[MiddleRightValue] = '94.3 ton | 64.0 ton'
		--	,[BottomLeftValue] = cast(l.HeatsOnLining as varchar)
		--	,[BottomMiddleValue] = cast( ( isnull(datediff(SECOND,h.TapTime,GETUTCDATE()),0) + l.ContactTimeSinceReline) / 60.0 as int)
		--	,[BottomRightValue] = cast( l.KWHSinceReline/1000.0 as int)
		--	,[TopLeftValue] = '40.3 ton'
		--	,[TopRightValue] = 'B212173'			
		--	,[BottomLeftValue2] = '40.0 ton'
		--	,[BottomRightValue2] = 'B212172'
		--from lad.ladles l with (NOLOCK)
		--left join lad.Heats h on h.HeatNumber = l.HeatNumber
		--left join lad.MeltOrders m on h.MeltOrderNumber = m.MeltOrderNumber
		--left join lad.catLadlePositions pos on pos.LadlePositionID = l.LadlePositionID	
		--left join LAD.Grades g on m.GradeName = g.GradeName
		--where LadleID in (14,2,6,4)

	
	-----------------------
	-- LEFT POSITION
	-----------------------
		select 			
			[WidgetTypeLadle] =  1			--There are 2 Types of Widgets --> TOP and BOTTOM --> TOP is 1 and BOTTOM is 0
			,[ScreenPositionId] = '#left'
			,[ContainerId] = 'container1'	   
			,[LadleOpen] = 0				-- Ladle Open always is 0 here because only "middle" position has Ladle Open

			--Top and Bottom Widget values
			,[LeftValue] = cast(l.LadleID as varchar)


			--Top Widget Values
			,[TopValue] = left(l.HeatNumber,7)			
			,[MiddleValue] = h.MeltOrderNumber + ' - ' + g.GradeName + ' - ' + m.MaterialSize	
			,[MiddleLeftValue] =  cast(cast(h.LastTemperature as int) as varchar) + ' F '
			,[MiddleRightValue] = '94.3 ton | 64.0 ton'
			,[BottomLeftValue] = cast(l.HeatsOnLining as varchar)
			,[BottomMiddleValue] = cast( ( isnull(datediff(SECOND,h.TapTime,GETUTCDATE()),0) + l.ContactTimeSinceReline) / 60.0 as int)
			,[BottomRightValue] = cast( l.KWHSinceReline/1000.0 as int)

			--Bottom Widget Only
			,[TopLeftValue] = null
			,[TopRightValue] = null			
			,[BottomLeftValue2] = null
			,[BottomRightValue2] = null
		from lad.ladles l with (NOLOCK)
		left join lad.Heats h on h.HeatNumber = l.HeatNumber
		left join lad.MeltOrders m on h.MeltOrderNumber = m.MeltOrderNumber
		left join lad.catLadlePositions pos on pos.LadlePositionID = l.LadlePositionID	
		left join LAD.Grades g on m.GradeName = g.GradeName
		WHERE l.LadleID = 2
	-----------------------
	-- MIDDLE POSITION
	-----------------------
	union all
		select 			
			[WidgetTypeLadle] =  1			--There are 2 Types of Widgets --> TOP and BOTTOM --> TOP is 1 and BOTTOM is 0
			,[ScreenPositionId] = '#middle'
			,[ContainerId] = 'container2'	   
			,[LadleOpen] = 1				------> Configure LadleOpen

			--Top and Bottom Widget values
			,[LeftValue] = cast(l.LadleID as varchar)


			--Top Widget Values
			,[TopValue] = left(l.HeatNumber,7)			
			,[MiddleValue] = h.MeltOrderNumber + ' - ' + g.GradeName + ' - ' + m.MaterialSize	
			,[MiddleLeftValue] =  cast(cast(h.LastTemperature as int) as varchar) + ' F '
			,[MiddleRightValue] = '94.3 ton | 64.0 ton'
			,[BottomLeftValue] = cast(l.HeatsOnLining as varchar)
			,[BottomMiddleValue] = cast( ( isnull(datediff(SECOND,h.TapTime,GETUTCDATE()),0) + l.ContactTimeSinceReline) / 60.0 as int)
			,[BottomRightValue] = cast( l.KWHSinceReline/1000.0 as int)

			--Bottom Widget Only
			,[TopLeftValue] = null
			,[TopRightValue] = null			
			,[BottomLeftValue2] = null
			,[BottomRightValue2] = null
		from lad.ladles l with (NOLOCK)
		left join lad.Heats h on h.HeatNumber = l.HeatNumber
		left join lad.MeltOrders m on h.MeltOrderNumber = m.MeltOrderNumber
		left join lad.catLadlePositions pos on pos.LadlePositionID = l.LadlePositionID	
		left join LAD.Grades g on m.GradeName = g.GradeName
		WHERE l.LadleID = 14


	-----------------------
	-- RIGHT POSITION
	-----------------------
	union all
		select 			
			[WidgetTypeLadle] =  1			--There are 2 Types of Widgets --> TOP and BOTTOM --> TOP is 1 and BOTTOM is 0
			,[ScreenPositionId] = '#right'
			,[ContainerId] = 'container3'	   
			,[LadleOpen] = 0				-- Ladle Open always is 0 here because only "middle" position has Ladle Open

			--Top and Bottom Widget values
			,[LeftValue] = cast(l.LadleID as varchar)


			--Top Widget Values
			,[TopValue] = left(l.HeatNumber,7)			
			,[MiddleValue] = h.MeltOrderNumber + ' - ' + g.GradeName + ' - ' + m.MaterialSize	
			,[MiddleLeftValue] =  cast(cast(h.LastTemperature as int) as varchar) + ' F '
			,[MiddleRightValue] = '94.3 ton | 64.0 ton'
			,[BottomLeftValue] = cast(l.HeatsOnLining as varchar)
			,[BottomMiddleValue] = cast( ( isnull(datediff(SECOND,h.TapTime,GETUTCDATE()),0) + l.ContactTimeSinceReline) / 60.0 as int)
			,[BottomRightValue] = cast( l.KWHSinceReline/1000.0 as int)

			--Bottom Widget Only
			,[TopLeftValue] = null
			,[TopRightValue] = null			
			,[BottomLeftValue2] = null
			,[BottomRightValue2] = null
		from lad.ladles l with (NOLOCK)
		left join lad.Heats h on h.HeatNumber = l.HeatNumber
		left join lad.MeltOrders m on h.MeltOrderNumber = m.MeltOrderNumber
		left join lad.catLadlePositions pos on pos.LadlePositionID = l.LadlePositionID	
		left join LAD.Grades g on m.GradeName = g.GradeName
		WHERE l.LadleID = 6

	-----------------------
	-- RIGHT POSITION
	-----------------------
	union all
		select top 1			
			[WidgetTypeLadle] =  0			--There are 2 Types of Widgets --> TOP and BOTTOM --> TOP is 1 and BOTTOM is 0
			,[ScreenPositionId] = '#bottom'
			,[ContainerId] = 'container4'	   
			,[LadleOpen] = 0				-- Ladle Open always is 0 here because only "middle" position has Ladle Open

			--Top and Bottom Widget values
			,[LeftValue] = '2586' + ' F '


			--Top Widget Values
			,[TopValue] = null		
			,[MiddleValue]  = null
			,[MiddleLeftValue]  = null
			,[MiddleRightValue]  = null
			,[BottomLeftValue]  = null
			,[BottomMiddleValue]  = null
			,[BottomRightValue]  = null

			--Bottom Widget Only
			,[TopLeftValue] = '40.3 ton'
			,[TopRightValue] = 'B212173'			
			,[BottomLeftValue2] = '40.3 ton'
			,[BottomRightValue2] = 'B212172'
	