#=======================================================================================
#
#    CTaskShelxeMR.py : CTaskShelxeMR(CCP4TaskWidget.CTaskWidget)
#    
#    Author  : Kyle Stevenson,STFC
#    Created : 14th April 2016, KJS
#
#    Gui Class for refinement of MR solutions using Shelxe
#
#=======================================================================================


from PyQt4 import QtGui,QtCore
import CCP4TaskWidget
import CCP4Widgets

class CTaskShelxeMR(CCP4TaskWidget.CTaskWidget):

    TASKNAME = 'shelxeMR'
    TASKVERSION = 0.0
    TASKMODULE='model_building'
    
    TASKTITLE = 'Model building from Molecular Replacement solution using Shelxe'
    SHORTTASKTITLE = "SHELXE-MR"
    
    DESCRIPTION='Use Shelxe to attempt to improve (or verify) a solution from Molecular Replacement'
    WHATNEXT = ['coot_rebuild','prosmart_refmac','buccaneer_build_refine_mr'] 
    MGDISPLAYFILES = ['FPHIOUT']
  
    def __init__(self,parent):
        CCP4TaskWidget.CTaskWidget.__init__(self,parent)
    
    def drawContents(self):
        
        self.setProgramHelpFile('shelxeMR')
    
                        
        folder = self.openFolder(folderFunction='inputData',title='Input Data and Run Parameters')
    
        self.createLine( [ 'subtitle', 'Select input data', 'Observed structure factors and protein model details are required' ] )
        self.openSubFrame( frame=[True] )
        self.createLine( [ 'widget', 'F_SIGF' ] )
        self.createLine( [ 'widget', 'FREERFLAG'] )
        self.closeSubFrame()
        
        self.openSubFrame( frame=[True] )
        self.createLine(['subtitle', 'Model used for Molecular Replacement','Model used to evaluate phases during Molecular Replacement calculations.'])
        self.createLine( ['widget', 'XYZIN'] )
        self.closeSubFrame()
       
        self.openSubFrame( frame=[True] )
        self.createLine( [ 'subtitle', 'Solvent Content', 'The amount of solvent - estimated or measured - in the asymmetric unit is required for the calculation.' ] )
        self.createLine( [ 'label', 'Fraction of solvent in the asymmetric unit:', 'stretch', 'widget', 'FSOLVENT' ])
        self.closeSubFrame()

        self.closeFolder()
        
        folder2 = self.openFolder(folderFunction='controlParameters',title='Run Options')
        
        self.openSubFrame(frame=[True])
        self.createLine( [ 'subtitle', 'Shelxe Run Options', 'Recommended to run with defaults.' ] )
        self.createLine( [ 'label', 'Number of shelxe tracing cycles:', 'stretch', 'widget', 'NTCYCLES' ] )
        self.createLine( [ 'label', 'Number of density modification cycles (per trace cycle):', 'stretch', 'widget', 'NMCYCLES' ] )
        self.closeSubFrame()        
        
        self.closeFolder()
        
"""
     CTaskShelxeMR.py: CCP4 GUI Project
     Copyright (C) 2015 STFC

     This library is free software: you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public License
     version 3, modified in accordance with the provisions of the 
     license to address the requirements of UK law.
 
     You should have received a copy of the modified GNU Lesser General 
     Public License along with this library.  If not, copies may be 
     downloaded from http://www.ccp4.ac.uk/ccp4license.php
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU Lesser General Public License for more details.
"""
