Add rayman2 source files
This commit is contained in:
303
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_Dat.cpp
Normal file
303
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_Dat.cpp
Normal file
@@ -0,0 +1,303 @@
|
||||
// Implementation file for the definition of a characteristic base type
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_Dat.hpp"
|
||||
|
||||
#include "Others\CTL_Pub.hpp"
|
||||
#include "Others\CTL_Pri.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//Constructor / Destructor
|
||||
//************************************************************************
|
||||
CTL_Editor_Data::CTL_Editor_Data(CTL_tdeEditorDataType _tdeType,
|
||||
CString _csDataName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *_pclCurrentBaseData /*= NULL*/,
|
||||
long _lUSerDefinedDataType /*= 0*/)
|
||||
{
|
||||
m_pro_tdeDataType = _tdeType;
|
||||
|
||||
m_pro_pvMotorData = NULL;
|
||||
m_pri_pclParentList = _pclParentList;
|
||||
|
||||
m_pro_bDataHasChanged = TRUE;
|
||||
|
||||
m_pro_csDataName = _csDataName;
|
||||
|
||||
//Sets Initial and Current Data links
|
||||
m_pclAssociatedCurrentData = NULL;
|
||||
m_pclAssociatedInitialData = NULL;
|
||||
|
||||
m_pro_pclParentControl = NULL;
|
||||
|
||||
//If a current data corresponds to 'this' data, sets 'this' as the
|
||||
// initial data of the other
|
||||
if ( _pclCurrentBaseData != NULL )
|
||||
{
|
||||
m_fn_vSetAssociatedCurrentData(_pclCurrentBaseData);
|
||||
m_pclAssociatedCurrentData->m_fn_vSetAssociatedInitialData(this);
|
||||
}
|
||||
|
||||
m_pro_lUSerDefinedDataType = _lUSerDefinedDataType;
|
||||
|
||||
//CallBack functions
|
||||
m_pro_td_p_fn_vDataHasChangedCallBack = CTL_g_p_fnDefaultCallBack_DataHasChanged;
|
||||
m_pro_td_p_fn_vDataHasChangedSpecialCallBack = NULL;
|
||||
|
||||
m_pro_td_p_fn_vDataModifWhenRead = NULL;
|
||||
m_pro_td_p_fn_vDataModifWhenWrite = NULL;
|
||||
|
||||
m_pro_td_p_fn_bDataMustBeRead = NULL;
|
||||
m_pro_td_p_fn_bDataMustBeWritten = NULL;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_Data::~CTL_Editor_Data()
|
||||
{
|
||||
// Removes from Watch Window if necessary
|
||||
// if ( (g_pclInterface->m_pclWatchWindow != NULL)
|
||||
// && (m_bIsInWatch)
|
||||
// )
|
||||
// g_pclInterface->m_pclWatchWindow->m_fn_vRemoveValue(this);
|
||||
}
|
||||
|
||||
//Member functions
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_Data::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// BEGIN ROMTEAM Cristi Petrescu 98-11-
|
||||
#include "scr.h"
|
||||
#include "ai/aibase/gsparam.h"
|
||||
// END ROMTEAM Cristi Petrescu 98-11-
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_fn_vSetMotorDataPtr(void *p_vMotorData)
|
||||
{
|
||||
// BEGIN ROMTEAM Cristi Petrescu 98-11-
|
||||
tduGetSetParam *p_TMotorData = (tduGetSetParam *)p_vMotorData;
|
||||
// END ROMTEAM Cristi Petrescu 98-11-
|
||||
m_pro_pvMotorData = p_vMotorData;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void *CTL_Editor_Data::m_fn_pvGetMotorDataPtr()
|
||||
{
|
||||
return m_pro_pvMotorData;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_Editor_Data::m_pub_fn_pclAddOwnerData(void *_pvDataPtr,
|
||||
CString _csName)
|
||||
{
|
||||
return m_pri_clListOfOwnerData.m_pub_fn_pclAddOwnerData(_pvDataPtr, _csName);
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_Editor_Data::m_pub_fn_pclAddOwnerData(long _lData,
|
||||
CString _csName)
|
||||
{
|
||||
return m_pri_clListOfOwnerData.m_pub_fn_pclAddOwnerData(_lData, _csName);
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_Editor_Data::m_pub_fn_pclGetOwnerDataWithName(CString _csSearchedName)
|
||||
{
|
||||
return m_pri_clListOfOwnerData.m_pub_fn_pclFindOwnerDataWithName(_csSearchedName);
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
//Parent List of Data
|
||||
CTL_Editor_DataList *CTL_Editor_Data::m_pub_fn_pclGetParentList()
|
||||
{
|
||||
return m_pri_pclParentList;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
//User Defined Data type
|
||||
long CTL_Editor_Data::m_pub_fn_lGetUSerDefinedDataType()
|
||||
{
|
||||
return m_pro_lUSerDefinedDataType;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CStringList *CTL_Editor_Data::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
m_csStringList.AddTail("NO APPROPRIATE SAVING FOR THIS DATA !");
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Returns the name of the Data
|
||||
CString CTL_Editor_Data::m_pub_fn_csGetDataName()
|
||||
{
|
||||
return m_pro_csDataName;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Get/Set for the Parent Control
|
||||
CTL_Editor_Control *CTL_Editor_Data::m_pub_fn_pclGetParentControl()
|
||||
{
|
||||
return m_pro_pclParentControl;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_pub_fn_vSetParentControl(CTL_Editor_Control *_pclParentControl)
|
||||
{
|
||||
m_pro_pclParentControl = _pclParentControl;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Get/Set for the pointer on motor's data
|
||||
void *CTL_Editor_Data::m_pub_fn_pvGetMotorData()
|
||||
{
|
||||
return m_pro_pvMotorData;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_pub_fn_vSetMotorData(void *_p_vMotorData)
|
||||
{
|
||||
m_pro_pvMotorData = _p_vMotorData;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Indicates wether current value is different from the old one or not
|
||||
// (used during motor run)
|
||||
BOOL CTL_Editor_Data::m_pub_fn_bGetDataHasChanged()
|
||||
{
|
||||
return m_pro_bDataHasChanged;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_pub_fn_vSetDataHasChanged(BOOL _bNewSate)
|
||||
{
|
||||
m_pro_bDataHasChanged = _bNewSate;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_tdeEditorDataType CTL_Editor_Data::m_pub_fn_tdeGetDataType()
|
||||
{
|
||||
return m_pro_tdeDataType;
|
||||
}
|
||||
|
||||
//Link between initial and current Data
|
||||
//The associated current Data
|
||||
//************************************************************************
|
||||
BOOL CTL_Editor_Data::m_fn_bHasACurrentData()
|
||||
{
|
||||
return ( m_pclAssociatedCurrentData != NULL );
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_Data *CTL_Editor_Data::m_fn_pclGetAssociatedCurrentData()
|
||||
{
|
||||
return m_pclAssociatedCurrentData;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_fn_vSetAssociatedCurrentData(CTL_Editor_Data *pclData)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_tdeDataType == pclData->m_pro_tdeDataType );
|
||||
m_pclAssociatedCurrentData = pclData;
|
||||
}
|
||||
|
||||
//The associated Initial Data
|
||||
//************************************************************************
|
||||
BOOL CTL_Editor_Data::m_fn_bHasAnInitialData()
|
||||
{
|
||||
return ( m_pclAssociatedInitialData != NULL );
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_Data *CTL_Editor_Data::m_fn_pclGetAssociatedInitialData()
|
||||
{
|
||||
return m_pclAssociatedInitialData;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_fn_vSetAssociatedInitialData(CTL_Editor_Data *pclData)
|
||||
{
|
||||
//This must be already done
|
||||
ERROR_ASSERT( pclData->m_pclAssociatedCurrentData == this );
|
||||
ERROR_ASSERT( m_pro_tdeDataType == pclData->m_pro_tdeDataType );
|
||||
m_pclAssociatedInitialData = pclData;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Set : CallBack function : called when Data has changed
|
||||
void CTL_Editor_Data::m_pub_fn_vSetDataChangedCallBackFunction(CTL_td_p_fn_vCallBackWhenDataHasChanged _td_p_fn_vDataHasChangedCallBack)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_td_p_fn_vDataHasChangedCallBack == NULL );
|
||||
|
||||
m_pro_td_p_fn_vDataHasChangedCallBack = _td_p_fn_vDataHasChangedCallBack;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Set : CallBack function : called when Data has changed (specific for one type of Data)
|
||||
void CTL_Editor_Data::m_pub_fn_vSetDataChangedSpecialCallBackFunction(CTL_td_p_fn_vCallBackWhenDataHasChanged _td_p_fn_vDataHasChangedSpecialCallBack)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_td_p_fn_vDataHasChangedSpecialCallBack == NULL );
|
||||
|
||||
m_pro_td_p_fn_vDataHasChangedSpecialCallBack = _td_p_fn_vDataHasChangedSpecialCallBack;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
void CTL_Editor_Data::m_fn_vDataHasBeenChanged(CTL_tdeUpdateReason _eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
if ( m_pro_td_p_fn_vDataHasChangedCallBack != NULL )
|
||||
m_pro_td_p_fn_vDataHasChangedCallBack(this, _eReason, _lUserDefinedReason);
|
||||
if ( m_pro_td_p_fn_vDataHasChangedSpecialCallBack != NULL )
|
||||
m_pro_td_p_fn_vDataHasChangedSpecialCallBack(this, _eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//Modification Functions
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_pub_fn_vSetModificationFunctionWhenRead(CTL_tdp_fn_vDataModificationFunction p_fn_vDataModifWhenRead)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_td_p_fn_vDataModifWhenRead == NULL );
|
||||
|
||||
m_pro_td_p_fn_vDataModifWhenRead = p_fn_vDataModifWhenRead;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_pub_fn_vSetModificationFunctionWhenWrite(CTL_tdp_fn_vDataModificationFunction p_fn_vDataModifWhenWrite)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_td_p_fn_vDataModifWhenWrite == NULL );
|
||||
|
||||
m_pro_td_p_fn_vDataModifWhenWrite = p_fn_vDataModifWhenWrite;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//When Data must be Read or Write
|
||||
void CTL_Editor_Data::m_pub_fn_vSetDataMustBeRead_CallBack(CTL_td_p_fn_bCallBackWhenDataMustBeReadOrWritten _p_fn_CallBack)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_td_p_fn_bDataMustBeRead == NULL );
|
||||
|
||||
m_pro_td_p_fn_bDataMustBeRead = _p_fn_CallBack;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_Data::m_pub_fn_vSetDataMustBeWritten_CallBack(CTL_td_p_fn_bCallBackWhenDataMustBeReadOrWritten _p_fn_CallBack)
|
||||
{
|
||||
ERROR_ASSERT( m_pro_td_p_fn_bDataMustBeWritten == NULL );
|
||||
|
||||
m_pro_td_p_fn_bDataMustBeWritten = _p_fn_CallBack;
|
||||
}
|
||||
|
||||
|
212
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatA.cpp
Normal file
212
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatA.cpp
Normal file
@@ -0,0 +1,212 @@
|
||||
// Implementation file for the definition of a characteristic type
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "scr.h"
|
||||
#include "ai/aibase/gsparam.h"
|
||||
#define ACTIVE_EDITOR /* we don't want optimized arrays in editors, but defining ACTIVE_EDITOR in the project's settings doesn't work... */
|
||||
#include "ai/aibase/array.h"
|
||||
#undef ACTIVE_EDITOR
|
||||
|
||||
#include "Data\CTL_DatA.hpp"
|
||||
|
||||
#include "WControls\CTL_WCkB.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_ArrayData::CTL_Editor_ArrayData ( CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__ARRAY,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_ArrayData::~CTL_Editor_ArrayData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_ArrayData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_ArrayData::m_fn_vGetMotorData()
|
||||
{
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData &= m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
tdstArray * pstValue = ((tdstArray *) m_pub_fn_pvGetMotorData());
|
||||
|
||||
M_ARRAY_COPY (& m_stCurrentValue, pstValue);
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_ArrayData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData &= m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
tdstArray * p_stValue = (tdstArray *) m_pub_fn_pvGetMotorData();
|
||||
|
||||
M_ARRAY_COPY (p_stValue, & m_stCurrentValue);
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_ArrayData::m_fn_vUpdateData( CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
M_ARRAY_COPY (& m_stCurrentValue, ((CTL_Editor_ArrayData *)pclSourceData) -> mfn_pstGetCurrentValue ());
|
||||
//m_fn_bSetLink(pclSourceData->m_fn_eGetLink());
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_ArrayData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringToReturn;
|
||||
//TODO
|
||||
//csStringToReturn.Format("%u",(unsigned long)m_ulCurrentValue);
|
||||
m_csStringList.AddTail(csStringToReturn);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_ArrayData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
//TODO
|
||||
//m_ulCurrentValue = atol((char *)LPCTSTR(csValueString));
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_ArrayData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged (! M_ARRAY_COMPARE (& m_stCurrentValue, & m_stOldValue));
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
M_ARRAY_COPY (& m_stOldValue, & m_stCurrentValue);
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_ArrayData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
M_ARRAY_COPY (& m_stKeepedValueForUndo, & m_stCurrentValue);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_ArrayData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_bKeepedValueForUndo != m_bCurrentState )
|
||||
{
|
||||
EdActors_ActorBooleanDataModif *pclModif = new EdActors_ActorBooleanDataModif(this,
|
||||
m_bKeepedValueForUndo,
|
||||
m_bCurrentState);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
//************************************************************************
|
||||
/*
|
||||
CTL_Editor_MaskDescriptor *CTL_Editor_MaskedData::m_pub_fn_pclGetMaskdescriptor()
|
||||
{
|
||||
return m_pri_pclMaskdescriptor;
|
||||
}
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_ArrayData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
tdstArray *pstCompareValue = & ((CTL_Editor_ArrayData *)pModifiedData)->m_stOldValue;
|
||||
|
||||
return M_ARRAY_COMPARE (& m_stCurrentValue, pstCompareValue);
|
||||
}
|
||||
|
||||
/*
|
||||
Macros...
|
||||
void fn_vCopyArray (tdstArray *pstSource, tdstArray *pstDest)
|
||||
{
|
||||
M_ARRAY_SIZE (pstDest) = M_ARRAY_SIZE (pstSource);
|
||||
M_ARRAY_TYPE (pstDest) = M_ARRAY_TYPE (pstSource);
|
||||
memcpy (M_ARRAY_ELEMENT (pstDest, 0), M_ARRAY_ELEMENT (pstSource, 0), M_ARRAY_SIZE (pstSource) * C_SizeOfArrayElement);
|
||||
}
|
||||
|
||||
BOOL fn_bCompareArray (tdstArray *pstArray1, tdstArray *pstArray2)
|
||||
{
|
||||
if (M_ARRAY_SIZE (pstArray1) != M_ARRAY_SIZE (pstArray2)
|
||||
return FALSE;
|
||||
|
||||
if (M_ARRAY_TYPE (pstArray1) != M_ARRAY_TYPE (pstArray2)
|
||||
return FALSE;
|
||||
|
||||
// not quite sure about this, but ...
|
||||
// should work most of times
|
||||
return memcmp (M_ARRAY_ELEMENT (pstArray1, 0), M_ARRAY_ELEMENT (pstArray2, 0), M_ARRAY_SIZE (pstArray1) * C_SizeOfArrayElement) == 0;
|
||||
}
|
||||
*/
|
224
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatB.cpp
Normal file
224
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatB.cpp
Normal file
@@ -0,0 +1,224 @@
|
||||
// Implementation file for the definition of a characteristic type
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatB.hpp"
|
||||
|
||||
#include "WControls\CTL_WCkB.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
#define C_szTrueString "True"
|
||||
#define C_szFalseString "False"
|
||||
|
||||
//Constructors / Destructor
|
||||
//**************************************************************************************
|
||||
CTL_Editor_BooleanData::CTL_Editor_BooleanData(CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__BOOLEAN,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_bISBitFieldCoded = FALSE;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_BooleanData::CTL_Editor_BooleanData(tdBitFieldCoder tdMask,
|
||||
CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__BOOLEAN,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_tdMask = tdMask;
|
||||
m_bISBitFieldCoded = TRUE;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_BooleanData::~CTL_Editor_BooleanData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_BooleanData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_BooleanData::m_fn_vGetMotorData()
|
||||
{
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData &= m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
if(m_pub_fn_pvGetMotorData())
|
||||
{
|
||||
unsigned char ucValue = *((unsigned char *)m_pub_fn_pvGetMotorData());
|
||||
|
||||
if ( m_bISBitFieldCoded )
|
||||
m_bCurrentState = ( (ucValue & m_tdMask) != 0 );
|
||||
else
|
||||
m_bCurrentState = ( ucValue != 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_BooleanData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData &= m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
unsigned char *p_ucValue = (unsigned char *)m_pub_fn_pvGetMotorData();
|
||||
|
||||
if ( m_bISBitFieldCoded )
|
||||
{
|
||||
//Only available with a one bit long bitfield coded on a char !!
|
||||
unsigned char ucValue = *p_ucValue;
|
||||
if ( m_bCurrentState )
|
||||
{
|
||||
if ( (ucValue & m_tdMask) == 0 ) //If bit must be changed
|
||||
{
|
||||
ucValue = ucValue ^ m_tdMask;
|
||||
*p_ucValue = ucValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (ucValue & m_tdMask) != 0 ) //If bit must be changed
|
||||
{
|
||||
tdBitFieldCoder tdInverseMask = 0xFF - m_tdMask;
|
||||
unsigned char ucModifiedValue = ucValue & tdInverseMask;
|
||||
*p_ucValue = ucModifiedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*p_ucValue = (m_bCurrentState ? 1 : 0);
|
||||
}
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_BooleanData::m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_bCurrentState = ((CTL_Editor_BooleanData *)pclSourceData)->m_bCurrentState;
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_BooleanData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringToReturn;
|
||||
csStringToReturn.Format("%s",(m_bCurrentState) ? C_szTrueString : C_szFalseString);
|
||||
m_csStringList.AddTail(csStringToReturn);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_BooleanData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
if ( csValueString.CompareNoCase(CString(C_szTrueString)) == 0)
|
||||
m_bCurrentState = TRUE;
|
||||
else
|
||||
m_bCurrentState = FALSE;
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_BooleanData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged( m_bCurrentState != m_bOldState );
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
m_bOldState = m_bCurrentState;
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_BooleanData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
m_bKeepedValueForUndo = m_bCurrentState;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_BooleanData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_bKeepedValueForUndo != m_bCurrentState )
|
||||
{
|
||||
EdActors_ActorBooleanDataModif *pclModif = new EdActors_ActorBooleanDataModif(this,
|
||||
m_bKeepedValueForUndo,
|
||||
m_bCurrentState);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_BooleanData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
return m_bCurrentState == ((CTL_Editor_BooleanData *)pModifiedData)->m_bOldState;
|
||||
}
|
||||
|
||||
|
||||
|
272
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatE.cpp
Normal file
272
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatE.cpp
Normal file
@@ -0,0 +1,272 @@
|
||||
// Implementation file for the definition of an enum characteristic
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatE.hpp"
|
||||
|
||||
#include "Others\CTL_EnLi.hpp"
|
||||
#include "Others\CTL_Pub.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//**************************************************************************
|
||||
//Constructor / Destructor
|
||||
CTL_Editor_EnumData::CTL_Editor_EnumData(CTL_Editor_EnumDescriptor *pclEnumDescriptor,
|
||||
CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__ENUM,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_pclCurrentValue = NULL;
|
||||
m_pclKeepedValueForUndo = NULL;
|
||||
m_pclEnumDescriptor = pclEnumDescriptor;
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
CTL_Editor_EnumData::~CTL_Editor_EnumData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Member functions
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_EnumData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_EnumData::m_fn_vGetMotorData()
|
||||
{
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData = m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
long lEnumValue;
|
||||
switch (m_pclEnumDescriptor->m_fn_ucGetEnumSize())
|
||||
{
|
||||
case 0:
|
||||
char bTempValue;
|
||||
CTL_fn_vGetMemory(m_pub_fn_pvGetMotorData(), &bTempValue, 0);
|
||||
lEnumValue = bTempValue;
|
||||
break;
|
||||
case 1:
|
||||
char cTempValue;
|
||||
CTL_fn_vGetMemory(m_pub_fn_pvGetMotorData(), &cTempValue, 1);
|
||||
lEnumValue = cTempValue;
|
||||
break;
|
||||
case 2:
|
||||
short wTempValue;
|
||||
CTL_fn_vGetMemory(m_pub_fn_pvGetMotorData(), &wTempValue, 2);
|
||||
lEnumValue = wTempValue;
|
||||
break;
|
||||
case 4:
|
||||
CTL_fn_vGetMemory(m_pub_fn_pvGetMotorData(), &lEnumValue, 4);
|
||||
break;
|
||||
}
|
||||
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenRead != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenRead(this);
|
||||
|
||||
//Updates current value (pointer)
|
||||
BOOL bFound = FALSE;
|
||||
CTL_Editor_EnumElement *m_pclCurrentElement;
|
||||
|
||||
if ( m_pclEnumDescriptor != NULL )
|
||||
{
|
||||
POSITION pos = m_pclEnumDescriptor->GetHeadPosition();
|
||||
while ( (pos != NULL) && (!bFound) )
|
||||
{
|
||||
m_pclCurrentElement = m_pclEnumDescriptor->GetNext(pos);
|
||||
bFound = ( m_pclCurrentElement->m_pub_fn_lGetValue() == lEnumValue );
|
||||
}
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
m_pclCurrentValue = m_pclCurrentElement;
|
||||
else
|
||||
{
|
||||
if ( m_pclEnumDescriptor->GetCount() > 0 )
|
||||
m_pclCurrentValue = m_pclEnumDescriptor->GetHead();
|
||||
else
|
||||
m_pclCurrentValue = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_EnumData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData = m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenWrite != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenWrite(this);
|
||||
|
||||
ERROR_ASSERT( m_pub_fn_pvGetMotorData() != NULL );
|
||||
|
||||
if ( m_pclCurrentValue != NULL )
|
||||
{
|
||||
switch ( m_pclEnumDescriptor->m_fn_ucGetEnumSize() )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
char cTempValue = (char)m_pclCurrentValue->m_pub_fn_lGetValue();
|
||||
CTL_fn_vSetMemory(m_pub_fn_pvGetMotorData(), &cTempValue, 0);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
char cTempValue = (char)m_pclCurrentValue->m_pub_fn_lGetValue();
|
||||
CTL_fn_vSetMemory(m_pub_fn_pvGetMotorData(), &cTempValue, 1);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
short sTempValue = (short)m_pclCurrentValue->m_pub_fn_lGetValue();
|
||||
CTL_fn_vSetMemory(m_pub_fn_pvGetMotorData(), &sTempValue, 2);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
long lValue = m_pclCurrentValue->m_pub_fn_lGetValue();
|
||||
CTL_fn_vSetMemory(m_pub_fn_pvGetMotorData(), &lValue, 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenRead != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenRead(this);
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_EnumData::m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_pclCurrentValue = ((CTL_Editor_EnumData *)pclSourceData)->m_pclCurrentValue;
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_EnumData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringToReturn = "!! Unknown !!";
|
||||
if ( m_pclCurrentValue != NULL )
|
||||
csStringToReturn.Format("%s", LPCTSTR(m_pclCurrentValue->m_pub_fn_csGetElementName()));
|
||||
|
||||
m_csStringList.AddTail(csStringToReturn);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data according to a string representing it
|
||||
void CTL_Editor_EnumData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
m_pclCurrentValue = m_pclEnumDescriptor->m_fn_pclGetElementFromString(csValueString);
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_EnumData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged(m_pclCurrentValue != m_pclOldValue);
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
m_pclOldValue = m_pclCurrentValue;
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_EnumData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
m_pclKeepedValueForUndo = m_pclCurrentValue;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_EnumData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_pclKeepedValueForUndo->m_pub_fn_lGetValue() != m_pclCurrentValue->m_pub_fn_lGetValue() )
|
||||
{
|
||||
EdActors_ActorEnumDataModif *pclModif = new EdActors_ActorEnumDataModif(this,
|
||||
m_pclKeepedValueForUndo,
|
||||
m_pclCurrentValue);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumDescriptor *CTL_Editor_EnumData::m_fn_pclGetEnumDescriptor()
|
||||
{
|
||||
return m_pclEnumDescriptor;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_EnumData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
return m_pclCurrentValue == ((CTL_Editor_EnumData *)pModifiedData)->m_pclOldValue;
|
||||
}
|
||||
|
||||
|
||||
|
185
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatF.cpp
Normal file
185
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatF.cpp
Normal file
@@ -0,0 +1,185 @@
|
||||
// Implementation file for the definition of an integer characteristic
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatF.hpp"
|
||||
|
||||
#include "Others\CTL_Pri.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//Constructor / Destructor
|
||||
//************************************************************************************
|
||||
CTL_Editor_DecimalData::CTL_Editor_DecimalData(char cDataSize,
|
||||
CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__DECIMAL,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_cDataSize = cDataSize;
|
||||
|
||||
m_ldCurrentValue = 0;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
CTL_Editor_DecimalData::~CTL_Editor_DecimalData()
|
||||
{
|
||||
}
|
||||
|
||||
//Member functions
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_DecimalData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_DecimalData::m_fn_vGetMotorData()
|
||||
{
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData &= m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
m_ldCurrentValue = 0;
|
||||
CTL_fn_vGetMemoryForFloat(m_pub_fn_pvGetMotorData(), m_ldCurrentValue, m_cDataSize);
|
||||
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenRead != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenRead(this);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_DecimalData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData &= m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenWrite != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenWrite(this);
|
||||
|
||||
CTL_fn_vSetMemoryForFloat(m_pub_fn_pvGetMotorData(), m_ldCurrentValue, m_cDataSize);
|
||||
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenRead != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenRead(this);
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_DecimalData::m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_cDataSize = ((CTL_Editor_DecimalData *)pclSourceData)->m_cDataSize;
|
||||
m_ldCurrentValue = ((CTL_Editor_DecimalData *)pclSourceData)->m_ldCurrentValue;
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_DecimalData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringToReturn;
|
||||
csStringToReturn.Format("%.3f", m_ldCurrentValue);
|
||||
m_csStringList.AddTail(csStringToReturn);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_DecimalData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
m_ldCurrentValue = atof(LPCTSTR(csValueString));
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_DecimalData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged(m_ldCurrentValue != m_ldOldValue);
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
m_ldOldValue = m_ldCurrentValue;
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_DecimalData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
m_ldKeepedValueForUndo = m_ldCurrentValue;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_DecimalData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_ldKeepedValueForUndo != m_ldCurrentValue )
|
||||
{
|
||||
EdActors_ActorFloatDataModif *pclModif = new EdActors_ActorFloatDataModif(this,
|
||||
m_ldKeepedValueForUndo,
|
||||
m_ldCurrentValue);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_DecimalData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
return m_ldCurrentValue == ((CTL_Editor_DecimalData *)pModifiedData)->m_ldOldValue;
|
||||
}
|
||||
|
188
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatI.cpp
Normal file
188
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatI.cpp
Normal file
@@ -0,0 +1,188 @@
|
||||
// Implementation file for the definition of an integer characteristic
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatI.hpp"
|
||||
|
||||
#include "Controls\CTL_Ctl.hpp"
|
||||
#include "Others\CTL_Pub.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//Constructor / Destructor
|
||||
//************************************************************************************
|
||||
CTL_Editor_IntegerData::CTL_Editor_IntegerData(char cDataSize,
|
||||
BOOL bSigned,
|
||||
CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__INTEGER,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_cDataSize = cDataSize;
|
||||
m_bSigned = bSigned;
|
||||
|
||||
m_lCurrentValue = 0;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
CTL_Editor_IntegerData::~CTL_Editor_IntegerData()
|
||||
{
|
||||
}
|
||||
|
||||
//Member functions
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_IntegerData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_IntegerData::m_fn_vGetMotorData()
|
||||
{
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData &= m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
m_lCurrentValue = 0;
|
||||
CTL_fn_vGetMemory(m_pub_fn_pvGetMotorData(), &m_lCurrentValue, m_cDataSize);
|
||||
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenRead != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenRead(this);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_IntegerData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData &= m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenWrite != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenWrite(this);
|
||||
|
||||
CTL_fn_vSetMemory(m_pub_fn_pvGetMotorData(), &m_lCurrentValue, m_cDataSize);
|
||||
|
||||
//Calls Modification function if needed
|
||||
if ( m_pro_td_p_fn_vDataModifWhenRead != NULL )
|
||||
m_pro_td_p_fn_vDataModifWhenRead(this);
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_IntegerData::m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_cDataSize = ((CTL_Editor_IntegerData *)pclSourceData)->m_cDataSize;
|
||||
m_bSigned = ((CTL_Editor_IntegerData *)pclSourceData)->m_bSigned;
|
||||
m_lCurrentValue = ((CTL_Editor_IntegerData *)pclSourceData)->m_lCurrentValue;
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_IntegerData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringToReturn;
|
||||
csStringToReturn.Format("%ld", m_lCurrentValue);
|
||||
m_csStringList.AddTail(csStringToReturn);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_IntegerData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
m_lCurrentValue = atoi(LPCTSTR(csValueString));
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_IntegerData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged(m_lCurrentValue != m_lOldValue);
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
m_lOldValue = m_lCurrentValue;
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_IntegerData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
m_lKeepedValueForUndo = m_lCurrentValue;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_IntegerData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_lKeepedValueForUndo != m_lCurrentValue )
|
||||
{
|
||||
EdActors_ActorIntegerDataModif *pclModif = new EdActors_ActorIntegerDataModif(this,
|
||||
m_lKeepedValueForUndo,
|
||||
m_lCurrentValue);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_IntegerData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
return m_lCurrentValue == ((CTL_Editor_IntegerData *)pModifiedData)->m_lOldValue;
|
||||
}
|
234
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatM.cpp
Normal file
234
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatM.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
// Implementation file for the definition of a characteristic type
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatM.hpp"
|
||||
|
||||
#include "WControls\CTL_WCkB.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//Constructors / Destructor
|
||||
//**************************************************************************************
|
||||
CTL_Editor_MaskedData::CTL_Editor_MaskedData(CTL_Editor_MaskDescriptor *_pclMaskdescriptor,
|
||||
CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__MASKED,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_pri_pclMaskdescriptor = _pclMaskdescriptor;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_MaskedData::~CTL_Editor_MaskedData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_MaskedData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_MaskedData::m_fn_vGetMotorData()
|
||||
{
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData &= m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
unsigned long ulValue = *((unsigned long *)m_pub_fn_pvGetMotorData());
|
||||
|
||||
m_ulCurrentValue = ulValue;
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_MaskedData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData &= m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
long *p_lValue = (long *)m_pub_fn_pvGetMotorData();
|
||||
|
||||
*p_lValue = m_ulCurrentValue;
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_MaskedData::m_fn_vUpdateData( CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_ulCurrentValue = ((CTL_Editor_MaskedData *)pclSourceData)->m_ulCurrentValue;
|
||||
// m_fn_bSetLink(pclSourceData->m_fn_eGetLink());
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_MaskedData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringToReturn;
|
||||
csStringToReturn.Format("%u",(unsigned long)m_ulCurrentValue);
|
||||
m_csStringList.AddTail(csStringToReturn);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_MaskedData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
m_ulCurrentValue = atol((char *)LPCTSTR(csValueString));
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_MaskedData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged( m_ulCurrentValue != m_ulOldValue );
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
m_ulOldValue = m_ulCurrentValue;
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_MaskedData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
m_ulKeepedValueForUndo = m_ulCurrentValue;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_MaskedData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_bKeepedValueForUndo != m_bCurrentState )
|
||||
{
|
||||
EdActors_ActorBooleanDataModif *pclModif = new EdActors_ActorBooleanDataModif(this,
|
||||
m_bKeepedValueForUndo,
|
||||
m_bCurrentState);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_MaskDescriptor *CTL_Editor_MaskedData::m_pub_fn_pclGetMaskdescriptor()
|
||||
{
|
||||
return m_pri_pclMaskdescriptor;
|
||||
}
|
||||
|
||||
//##################################################################"
|
||||
//************************************************************************
|
||||
//Constructor
|
||||
/*EdActors_ActorBooleanDataModif::EdActors_ActorBooleanDataModif( CTL_Editor_Data *pclData,
|
||||
BOOL bOldValue,
|
||||
BOOL bNewValue)
|
||||
: EdActors_ActorDataModif(pclData)
|
||||
{
|
||||
m_bNewValue = bNewValue;
|
||||
m_bKeepedValue = bOldValue;
|
||||
|
||||
CString csName;
|
||||
csName.Format("%s : %s --> %s", pclData->m_csScriptName,
|
||||
bOldValue ? "Vrai" : "Faux",
|
||||
bNewValue ? "Vrai" : "Faux");
|
||||
SetName(csName);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Destructor
|
||||
EdActors_ActorBooleanDataModif::~EdActors_ActorBooleanDataModif()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
BOOL EdActors_ActorBooleanDataModif::Do()
|
||||
{
|
||||
((CTL_Editor_MaskedData *)m_pclData)->m_bCurrentState = m_bNewValue;
|
||||
|
||||
m_pclData->m_fn_vUpdateMotorData();
|
||||
m_pclData->m_bDataHasChanged = TRUE;
|
||||
m_pclData->m_pclParentControl->m_fn_vUpdate();
|
||||
|
||||
// m_pclData->m_pclParentActor->m_pclActor->fn_vNotifySave();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
BOOL EdActors_ActorBooleanDataModif::Undo()
|
||||
{
|
||||
((CTL_Editor_MaskedData *)m_pclData)->m_bCurrentState = m_bKeepedValue;
|
||||
|
||||
m_pclData->m_fn_vUpdateMotorData();
|
||||
m_pclData->m_bDataHasChanged = TRUE;
|
||||
m_pclData->m_pclParentControl->m_fn_vUpdate();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_MaskedData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
return m_ulCurrentValue == ((CTL_Editor_MaskedData *)pModifiedData)->m_ulOldValue;
|
||||
}
|
||||
|
||||
|
127
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatT.cpp
Normal file
127
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatT.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
// Implementation file for the definition of a text characteristic
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatT.hpp"
|
||||
|
||||
#include "CTL_ErO.hpp"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//Constructor / Destructor
|
||||
//************************************************************************************
|
||||
CTL_Editor_TextData::CTL_Editor_TextData(CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__TEXT,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
CTL_Editor_TextData::~CTL_Editor_TextData()
|
||||
{
|
||||
}
|
||||
|
||||
//Member functions
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_TextData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_TextData::m_fn_vGetMotorData()
|
||||
{
|
||||
m_csCurrentString = (CString)((char *)m_pub_fn_pvGetMotorData());
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_TextData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_TextData::m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_csCurrentString = ((CTL_Editor_TextData *)pclSourceData)->m_csCurrentString;
|
||||
// m_fn_bSetLink(pclSourceData->m_fn_eGetLink());
|
||||
|
||||
m_fn_vUpdateMotorData(eReason, _lUserDefinedReason);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_TextData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
m_csStringList.AddTail(m_csCurrentString);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_TextData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
ERROR_ASSERT(pcslValueStringList->GetCount() == 1);
|
||||
CString csValueString = pcslValueStringList->GetHead();
|
||||
|
||||
m_csCurrentString = csValueString;
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_TextData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged(m_csCurrentString != m_csOldString);
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
m_csOldString = m_csCurrentString;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_TextData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
return m_csCurrentString == ((CTL_Editor_TextData *)pModifiedData)->m_csOldString;
|
||||
}
|
||||
|
||||
|
||||
|
293
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatV.cpp
Normal file
293
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_DatV.cpp
Normal file
@@ -0,0 +1,293 @@
|
||||
// Implementation file for the definition of an integer characteristic
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_DatV.hpp"
|
||||
|
||||
#include "Others\CTL_Pri.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
#include "MTH.h"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//Constructor / Destructor
|
||||
//************************************************************************************
|
||||
CTL_Editor_VectorData::CTL_Editor_VectorData(char cDataSize,
|
||||
CString csScriptName,
|
||||
CTL_Editor_DataList *_pclParentList,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
: CTL_Editor_Data(CTL_DATA_TYPE__VECTOR,
|
||||
csScriptName,
|
||||
_pclParentList,
|
||||
pclCurrentBaseData)
|
||||
{
|
||||
m_cDataSize = cDataSize;
|
||||
|
||||
m_ldCurrentValueX = 0;
|
||||
m_ldCurrentValueY = 0;
|
||||
m_ldCurrentValueZ = 0;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
CTL_Editor_VectorData::~CTL_Editor_VectorData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Member functions
|
||||
|
||||
//**************************************************************************************
|
||||
//Function called to Init the data
|
||||
void CTL_Editor_VectorData::m_fn_vInitData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to read associated motor's data
|
||||
void CTL_Editor_VectorData::m_fn_vGetMotorData()
|
||||
{
|
||||
m_ldCurrentValueX = 0.0;
|
||||
m_ldCurrentValueY = 0.0;
|
||||
m_ldCurrentValueZ = 0.0;
|
||||
|
||||
BOOL bMustReadData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeRead != NULL )
|
||||
bMustReadData &= m_pro_td_p_fn_bDataMustBeRead(this);
|
||||
|
||||
if ( bMustReadData )
|
||||
{
|
||||
MTH3D_tdstVector *p_tdstVector = (MTH3D_tdstVector *)m_pub_fn_pvGetMotorData();
|
||||
|
||||
if(p_tdstVector)
|
||||
{
|
||||
CTL_fn_vGetMemoryForFloat(&(p_tdstVector->xX), m_ldCurrentValueX, m_cDataSize);
|
||||
CTL_fn_vGetMemoryForFloat(&(p_tdstVector->xY), m_ldCurrentValueY, m_cDataSize);
|
||||
CTL_fn_vGetMemoryForFloat(&(p_tdstVector->xZ), m_ldCurrentValueZ, m_cDataSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
//Function called to update associated motor's data
|
||||
void CTL_Editor_VectorData::m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
BOOL bMustWriteData = TRUE;
|
||||
if ( m_pro_td_p_fn_bDataMustBeWritten != NULL )
|
||||
bMustWriteData &= m_pro_td_p_fn_bDataMustBeWritten(this);
|
||||
|
||||
if ( bMustWriteData )
|
||||
{
|
||||
MTH3D_tdstVector *p_tdstVector = (MTH3D_tdstVector *)m_pub_fn_pvGetMotorData();
|
||||
|
||||
CTL_fn_vSetMemoryForFloat(&(p_tdstVector->xX), m_ldCurrentValueX, m_cDataSize);
|
||||
CTL_fn_vSetMemoryForFloat(&(p_tdstVector->xY), m_ldCurrentValueY, m_cDataSize);
|
||||
CTL_fn_vSetMemoryForFloat(&(p_tdstVector->xZ), m_ldCurrentValueZ, m_cDataSize);
|
||||
|
||||
//Special changes
|
||||
m_fn_vDataHasBeenChanged(eReason, _lUserDefinedReason);
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to update data with another one
|
||||
void CTL_Editor_VectorData::m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
|
||||
CTL_tdeUpdateReason eReason,
|
||||
long _lUserDefinedReason /*= 0*/)
|
||||
{
|
||||
ERROR_ASSERT(pclSourceData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
m_cDataSize = ((CTL_Editor_VectorData *)pclSourceData)->m_cDataSize;
|
||||
m_ldCurrentValueX = ((CTL_Editor_VectorData *)pclSourceData)->m_ldCurrentValueX;
|
||||
m_ldCurrentValueY = ((CTL_Editor_VectorData *)pclSourceData)->m_ldCurrentValueY;
|
||||
m_ldCurrentValueZ = ((CTL_Editor_VectorData *)pclSourceData)->m_ldCurrentValueZ;
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
|
||||
m_fn_vLookIfDataHasBeenModified();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to get a string representing the value of the data
|
||||
CStringList *CTL_Editor_VectorData::m_fn_pcslFormatDataValueString()
|
||||
{
|
||||
m_csStringList.RemoveAll();
|
||||
|
||||
CString csStringValueX;
|
||||
csStringValueX.Format("%.3f", m_ldCurrentValueX);
|
||||
m_csStringList.AddTail(csStringValueX);
|
||||
CString csStringValueY;
|
||||
csStringValueY.Format("%.3f", m_ldCurrentValueY);
|
||||
m_csStringList.AddTail(csStringValueY);
|
||||
CString csStringValueZ;
|
||||
csStringValueZ.Format("%.3f", m_ldCurrentValueZ);
|
||||
m_csStringList.AddTail(csStringValueZ);
|
||||
|
||||
return &m_csStringList;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to set the value of the data acoording to a string representing it
|
||||
void CTL_Editor_VectorData::m_fn_vSetValueWithString(CStringList *pcslValueStringList)
|
||||
{
|
||||
CString csMessage = "? ? ?";
|
||||
CString csMessage2 = "! ! !";
|
||||
ERROR_PREPARE(/*_M(g_c_csActorModuleNameForErrors,*/
|
||||
csMessage,
|
||||
"CTL_Editor_VectorData::m_fn_vSetValueWithString(...)",
|
||||
E_ERROR_GRAVITY_WARNING,
|
||||
csMessage2);
|
||||
ERROR_ASSERT( pcslValueStringList->GetCount() == 3 );
|
||||
|
||||
if ( (pcslValueStringList->GetCount() == 3) )
|
||||
{
|
||||
//Extracts the three components of the Vector
|
||||
CString csIsolatedData;
|
||||
|
||||
//X coordinate
|
||||
CString csValueString = pcslValueStringList->GetAt(pcslValueStringList->FindIndex(0));
|
||||
m_ldCurrentValueX = atof(LPCTSTR(csValueString));
|
||||
|
||||
//Y coordinate
|
||||
csValueString = pcslValueStringList->GetAt(pcslValueStringList->FindIndex(1));
|
||||
m_ldCurrentValueY = atof(LPCTSTR(csValueString));
|
||||
|
||||
//Z coordinate
|
||||
csValueString = pcslValueStringList->GetAt(pcslValueStringList->FindIndex(2));
|
||||
m_ldCurrentValueZ = atof(LPCTSTR(csValueString));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ldCurrentValueX = 0.0;
|
||||
m_ldCurrentValueY = 0.0;
|
||||
m_ldCurrentValueZ = 0.0;
|
||||
}
|
||||
|
||||
m_fn_vUpdateMotorData();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to look if data has been modified (by motor for example)
|
||||
void CTL_Editor_VectorData::m_fn_vLookIfDataHasBeenModified()
|
||||
{
|
||||
m_fn_vGetMotorData();
|
||||
|
||||
m_pub_fn_vSetDataHasChanged ( ( m_ldCurrentValueX != m_ldOldValueX )
|
||||
|| ( m_ldCurrentValueY != m_ldOldValueY )
|
||||
|| ( m_ldCurrentValueZ != m_ldOldValueZ )
|
||||
);
|
||||
|
||||
if ( m_pub_fn_bGetDataHasChanged() )
|
||||
{
|
||||
m_ldOldValueX = m_ldCurrentValueX;
|
||||
m_ldOldValueY = m_ldCurrentValueY;
|
||||
m_ldOldValueZ = m_ldCurrentValueZ;
|
||||
}
|
||||
}
|
||||
|
||||
//Undo
|
||||
//************************************************************************
|
||||
//Function called to save the current Value (for Undo)
|
||||
void CTL_Editor_VectorData::m_fn_vKeepCurrentValue()
|
||||
{
|
||||
m_ldKeepedValueForUndoX = m_ldCurrentValueX;
|
||||
m_ldKeepedValueForUndoY = m_ldCurrentValueY;
|
||||
m_ldKeepedValueForUndoZ = m_ldCurrentValueZ;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Function called to validate Undo for the current change
|
||||
void CTL_Editor_VectorData::m_fn_vRegisterUndoAction()
|
||||
{
|
||||
/* if ( m_ldKeepedValueForUndo != m_ldCurrentValue )
|
||||
{
|
||||
EdActors_ActorFloatDataModif *pclModif = new EdActors_ActorFloatDataModif(this,
|
||||
m_ldKeepedValueForUndo,
|
||||
m_ldCurrentValue);
|
||||
m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//##################################################################"
|
||||
//************************************************************************
|
||||
//Constructor
|
||||
/*EdActors_ActorFloatDataModif::EdActors_ActorFloatDataModif( CTL_Editor_Data *pclData,
|
||||
long double ldOldValue,
|
||||
long double ldNewValue)
|
||||
: EdActors_ActorDataModif(pclData)
|
||||
{
|
||||
m_ldNewValue = ldNewValue;
|
||||
m_ldKeepedValue = ldOldValue;
|
||||
|
||||
CString csName;
|
||||
csName.Format("%s : %.3f --> %.3f", pclData->m_csScriptName,
|
||||
ldOldValue,
|
||||
ldNewValue);
|
||||
SetName(csName);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//Destructor
|
||||
EdActors_ActorFloatDataModif::~EdActors_ActorFloatDataModif()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
BOOL EdActors_ActorFloatDataModif::Do()
|
||||
{
|
||||
((CTL_Editor_VectorData *)m_pclData)->m_ldCurrentValue = m_ldNewValue;
|
||||
|
||||
m_pclData->m_fn_vUpdateMotorData();
|
||||
m_pclData->m_bDataHasChanged = TRUE;
|
||||
m_pclData->m_pclParentControl->m_fn_vUpdate();
|
||||
|
||||
m_pclData->m_pclParentActor->m_pclActor->fn_vNotifySave();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
BOOL EdActors_ActorFloatDataModif::Undo()
|
||||
{
|
||||
((CTL_Editor_VectorData *)m_pclData)->m_ldCurrentValue = m_ldKeepedValue;
|
||||
|
||||
m_pclData->m_fn_vUpdateMotorData();
|
||||
m_pclData->m_bDataHasChanged = TRUE;
|
||||
m_pclData->m_pclParentControl->m_fn_vUpdate();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : mfn_bEqualsModifiedDataOldValue
|
||||
// Date : 98/06/24
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CTL_Editor_VectorData::mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData)
|
||||
{
|
||||
ASSERT (pModifiedData);
|
||||
|
||||
ERROR_ASSERT(pModifiedData->m_pub_fn_tdeGetDataType() == m_pub_fn_tdeGetDataType());
|
||||
|
||||
return m_ldCurrentValueX == ((CTL_Editor_VectorData *)pModifiedData)->m_ldOldValueX
|
||||
&& m_ldCurrentValueY == ((CTL_Editor_VectorData *)pModifiedData)->m_ldOldValueY
|
||||
&& m_ldCurrentValueZ == ((CTL_Editor_VectorData *)pModifiedData)->m_ldOldValueZ;
|
||||
}
|
||||
|
211
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_LDat.cpp
Normal file
211
Rayman_X/cpa/tempgrp/Ctl/Src/Data/CTL_LDat.cpp
Normal file
@@ -0,0 +1,211 @@
|
||||
// Implementation file for the definition of a characteristic base type
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Data\CTL_LDat.hpp"
|
||||
|
||||
#include "Data\CTL_DatB.hpp"
|
||||
#include "Data\CTL_DatI.hpp"
|
||||
#include "Data\CTL_DatF.hpp"
|
||||
#include "Data\CTL_DatE.hpp"
|
||||
#include "Data\CTL_DatT.hpp"
|
||||
#include "Data\CTL_DatV.hpp"
|
||||
#include "Data\CTL_DatM.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_DataList::CTL_Editor_DataList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_DataList::~CTL_Editor_DataList()
|
||||
{
|
||||
m_fn_vEmptyList();
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
void CTL_Editor_DataList::m_fn_vEmptyList()
|
||||
{
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
delete GetNext(pos);
|
||||
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_Editor_DataList::m_pub_fn_pclAddOwnerData(void *_pvDataPtr,
|
||||
CString _csName)
|
||||
{
|
||||
return m_pri_clListOfOwnerData.m_pub_fn_pclAddOwnerData(_pvDataPtr, _csName);
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_Editor_DataList::m_pub_fn_pclAddOwnerData(long _lData,
|
||||
CString _csName)
|
||||
{
|
||||
return m_pri_clListOfOwnerData.m_pub_fn_pclAddOwnerData(_lData, _csName);
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_Editor_DataList::m_pub_fn_pclGetOwnerDataWithName(CString _csSearchedName)
|
||||
{
|
||||
return m_pri_clListOfOwnerData.m_pub_fn_pclFindOwnerDataWithName(_csSearchedName);
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//**************************************************************************************
|
||||
//**************************************************************************************
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddBooleanData(CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_BooleanData *pclNewData = new CTL_Editor_BooleanData(csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddBitFieldBooleanData(tdBitFieldCoder tdBFCoder,
|
||||
CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_BooleanData *pclNewData = new CTL_Editor_BooleanData(tdBFCoder,
|
||||
csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddMaskedData(CTL_Editor_MaskDescriptor *_pclMaskDescriptor,
|
||||
CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_MaskedData *pclNewData = new CTL_Editor_MaskedData(_pclMaskDescriptor,
|
||||
csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddIntegerData(char cDataLength,
|
||||
BOOL bSigned,
|
||||
CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_IntegerData *pclNewData = new CTL_Editor_IntegerData(cDataLength,
|
||||
bSigned,
|
||||
csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddDecimalData(char cDataLength,
|
||||
CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_DecimalData *pclNewData = new CTL_Editor_DecimalData(cDataLength,
|
||||
csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddEnumData(CTL_Editor_EnumDescriptor *pclEnumDescriptor,
|
||||
CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_EnumData *pclNewData = new CTL_Editor_EnumData(pclEnumDescriptor,
|
||||
csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddTextData(CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_TextData *pclNewData = new CTL_Editor_TextData(csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclAddVectorData(char cDataLength,
|
||||
CString csScriptName,
|
||||
CTL_Editor_Data *pclCurrentBaseData /*= NULL*/)
|
||||
{
|
||||
CTL_Editor_VectorData *pclNewData = new CTL_Editor_VectorData(cDataLength,
|
||||
csScriptName,
|
||||
this,
|
||||
pclCurrentBaseData);
|
||||
|
||||
AddTail(pclNewData);
|
||||
|
||||
return pclNewData;
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
//To add a user defined data
|
||||
void CTL_Editor_DataList::m_pub_fn_vAddData(CTL_Editor_Data *_pclDataToAdd)
|
||||
{
|
||||
AddTail(_pclDataToAdd);
|
||||
}
|
||||
|
||||
//**************************************************************************************
|
||||
CTL_Editor_Data * CTL_Editor_DataList::m_fn_pclGetDataFromName(CString csName)
|
||||
{
|
||||
POSITION pos=GetHeadPosition();
|
||||
CTL_Editor_Data *pclData=NULL;
|
||||
while((pos!=NULL) && (pclData==NULL))
|
||||
{
|
||||
CTL_Editor_Data *pclCurrentData=GetNext(pos);
|
||||
|
||||
if(csName.CompareNoCase(pclCurrentData->m_pub_fn_csGetDataName())==0)
|
||||
pclData=pclCurrentData;
|
||||
}
|
||||
|
||||
return pclData;
|
||||
}
|
||||
|
Reference in New Issue
Block a user