class DisassembleMasterController extends MasterController
{

	public const override function GetPS() : DisassembleMasterControllerPS
	{
		return ( ( DisassembleMasterControllerPS )( GetBasePS() ) );
	}

}

class DisassembleMasterControllerPS extends MasterControllerPS
{
	default m_deviceName = "Disassemble Master";

	protected event OnInstantiated()
	{
		super.OnInstantiated();
		if( !( IsStringValid( m_deviceName ) ) )
		{
			m_deviceName = "Disassemble Master";
		}
	}

	protected override function Initialize()
	{
		super.Initialize();
	}

	public override function GetActions( out outActions : array< DeviceAction >, context : GetActionsContext ) : Bool
	{
		super.GetActions( outActions, context );
		SetActionIllegality( outActions, m_illegalActions.regularActions );
		return true;
	}

	public function RefreshLockOnSlaves()
	{
		var i : Int32;
		var locked : ToggleLock;
		var open : ForceOpen;
		var devices : array< DeviceComponentPS >;
		devices = GetImmediateSlaves();
		for( i = 0; i < devices.Size(); i += 1 )
		{
			ExtractActionFromSlave( devices[ i ], 'ToggleLock', ( ( DeviceAction )( locked ) ) );
			if( locked )
			{
				GetPersistencySystem().QueuePSDeviceEvent( locked );
			}
			ExtractActionFromSlave( devices[ i ], 'ForceOpen', ( ( DeviceAction )( open ) ) );
			if( open )
			{
				GetPersistencySystem().QueuePSDeviceEvent( open );
			}
		}
	}

	public override function OnDisassembleDevice( evt : DisassembleDevice ) : EntityNotificationType
	{
		TurnAuthorizationModuleOFF();
		return super.OnDisassembleDevice( evt );
	}

}

