/*------------------------------------------------------------------------------*
 * File Name:	NLFSession.h													*
 * Creation: 	Hong															*
 * Purpose: OriginC Source H file												*
 * Copyright (c) ABCD Corp.	2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010		*
 * All Rights Reserved															*
 * 																				*
 * Modification Log:  															*
 *------------------------------------------------------------------------------*/
 
#ifndef	_NLFIT_FUNCTION_H_
#define	_NLFIT_FUNCTION_H_


class NLFitFunction
{
public:
	/// Hong 04/08/08 QA80-11388 FIX_PARAMETER_SETTING_IN_FDF_FAIL_CORRECT_LOADING
	//NLFitFunction()
	//{
	//	OnInit();
	//}	
	void Reset()
	{
		OnInit();
		m_nNumParaInFunc = 0;
		m_nNumParamsIgnoreShared = 0;
		m_strFuncName.Empty();
		m_strCateName.Empty();
		m_trFF.Reset();
	}
	/// end FIX_PARAMETER_SETTING_IN_FDF_FAIL_CORRECT_LOADING
	NLFitFunction(int nNumParaInFunc = 0, TreeNode& trFF = NULL, LPCSTR lpcszFuncName=NULL, LPCSTR lpcszCateName = NULL, int nMultiplicity = 1, int& nNumParamsIgnoreShared = NULL)
	{
		OnInit();		
		m_nNumParaInFunc = nNumParaInFunc;
		m_nMultiplicity = nMultiplicity;
		if(NULL != trFF)
			m_trFF = trFF;
		if(NULL != lpcszFuncName)		
			m_strFuncName = lpcszFuncName;
		if(NULL != lpcszCateName)		
			m_strCateName = lpcszCateName;
		if(NULL != nNumParamsIgnoreShared)
			m_nNumParamsIgnoreShared = nNumParamsIgnoreShared;	
	}	
	~NLFitFunction()
	{
	}	
	
	void OnInit()
	{
		m_nMultiplicity = 1;
	}
	
	int GetNumMultiplicity()
	{
		return m_nMultiplicity;
	}
	
	void SetNumMultiplicity(int nMultiplicity)
	{
		m_nMultiplicity = nMultiplicity;
	}
	
	string GetFuncName(string& strCateName = NULL)
	{
		if(NULL != strCateName)
		{
			strCateName = m_strCateName;
		}
		return m_strFuncName;
	}
	
	void SetFuncName(string strFuncName, string& strCateName = NULL)
	{
		if(NULL != strCateName)
		{
			m_strCateName = strCateName;
		}
		m_strFuncName = strFuncName;
	}	
	
	TreeNode& GetFuncTree()
	{
		return m_trFF;
	}
	
	void SetFuncTree(TreeNode &trFF)
	{
		m_trFF = trFF;
	}
	
	int GetNumParaInFunc(int& nNumParamsIgnoreShared=NULL)
	{
		if( NULL != nNumParamsIgnoreShared)
		{
			nNumParamsIgnoreShared = m_nNumParamsIgnoreShared;
		}
		return m_nNumParaInFunc;
	}
	
	void SetNumParaInFunc(int nNumParaInFunc, int& nNumParamsIgnoreShared=NULL)
	{
		if( NULL != nNumParamsIgnoreShared)
		{
			m_nNumParamsIgnoreShared = nNumParamsIgnoreShared;
		}
		m_nNumParaInFunc = nNumParaInFunc;
	}
	
	///Cheney 2006-10-23 MOVE_m_bPlotEachPeak_FROM_NLFITFUNCTION_TO_NLFITSESSIONBASE
	/////Cheney 2006-9-15 QA70-8811-8 SUPPORT_PLOT_CUMULATE_CURVE
	//bool GetIsPlotEachPeak()
	//{
		//return m_bPlotEachPeak;
	//}
	//
	//void SetIsPlotEachPeak(bool bPlotEachPeak)
	//{
		//m_bPlotEachPeak = bPlotEachPeak;
	//}
	/////end SUPPORT_PLOT_CUMULATE_CURVE
	///end MOVE_m_bPlotEachPeak_FROM_NLFITFUNCTION_TO_NLFITSESSIONBASE
private:
	int						m_nMultiplicity;
	string					m_strCateName;
	string					m_strFuncName;
	Tree					m_trFF;
	int						m_nNumParaInFunc;	
	int						m_nNumParamsIgnoreShared;
	///Cheney 2006-10-23 MOVE_m_bPlotEachPeak_FROM_NLFITFUNCTION_TO_NLFITSESSIONBASE
	/////Cheney 2006-9-15 QA70-8811-8 SUPPORT_PLOT_CUMULATE_CURVE
	//bool					m_bPlotEachPeak;
	/////end SUPPORT_PLOT_CUMULATE_CURVE
	///end MOVE_m_bPlotEachPeak_FROM_NLFITFUNCTION_TO_NLFITSESSIONBASE
};

#endif	//_NLFIT_FUNCTION_H_