87 lines
2.8 KiB
C
87 lines
2.8 KiB
C
/*=========================================================================
|
|
*
|
|
* ChlSave.c - save chl file
|
|
*
|
|
* Version 1.0
|
|
* Revision date
|
|
*
|
|
*=======================================================================*/
|
|
|
|
#include "ChlSave.h"
|
|
|
|
#include "conventi.h"
|
|
#include "print.h"
|
|
#include "system.h"
|
|
|
|
#include "ModLib.h"
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
|
|
/****************************************************************************
|
|
* Description: save CHL file header
|
|
*
|
|
* Parameters: p_stFile : script file pointer
|
|
* sFileName : file name
|
|
* p_vPtr : data pointer
|
|
* xAction : script action
|
|
*---------------------------------------------------------------------------
|
|
* Revision date: Author:
|
|
*****************************************************************************/
|
|
void MLT_vSaveChlHeader (SCR_tdst_File_Description *p_stFile, char *sFileName, void *p_vPtr, SCR_tde_Ntfy_Action xAction)
|
|
{
|
|
xString mes;
|
|
|
|
SCR_fn_v_SvL1_DeleteSection(p_stFile);
|
|
SCR_M_SvL0_SaveScriptFileHeader(p_stFile);
|
|
|
|
//save the header section of the chl file
|
|
sprintf(mes, "%s%s", M_A3D_HEADER, SCR_CC_sz_Cfg_SectionIdMark);
|
|
SCR_M_SvL0_SaveBeginSection(p_stFile, mes, SCR_CC_C_Cfg_EOL);
|
|
|
|
SCR_M_SvL0_SaveEntry(p_stFile, M_OBJActionFileType, SCR_CC_C_Cfg_NoChar);
|
|
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 2, "%s", "ChannelNames");
|
|
|
|
SCR_M_SvL0_SaveEntry(p_stFile, M_OBJActionVersionNumber, SCR_CC_C_Cfg_NoChar);
|
|
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 2, "%d", 4);
|
|
|
|
SCR_M_SvL0_SaveEndSection(p_stFile, SCR_CC_C_Cfg_EOL);
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
* Description: Save CHL file
|
|
*
|
|
* Parameters: p_stFile : script file pointer
|
|
* sFileName : file name
|
|
* p_vPtr : data pointer
|
|
* xAction : script action
|
|
*---------------------------------------------------------------------------
|
|
* Revision date: Author:
|
|
*****************************************************************************/
|
|
void MLT_vSaveChlFile (SCR_tdst_File_Description *p_stFile, char *sFileName, void *p_vPtr, SCR_tde_Ntfy_Action xAction)
|
|
{
|
|
xString mes, sFile, sSection;
|
|
int i;
|
|
|
|
SCR_fn_v_SvL1_ToEndSection(p_stFile);
|
|
|
|
sprintf(mes, "(%d)", g_lGeometricIndex);
|
|
sprintf(sFile, "%s.chl", g_sFileIn);
|
|
SCR_fn_v_RdL0_ComputeSectionName(sSection, sFile, M_A3dChannelNames, mes);
|
|
SCR_M_SvL0_SaveBeginSection(p_stFile, MLT_p_cGetSectionName(sSection), SCR_CC_C_Cfg_EOL);
|
|
|
|
for (i=0; i<g_lGeometricIndex; i++)
|
|
{
|
|
sprintf(mes, "Channel%d", i+1);
|
|
SCR_M_SvL0_SaveEntry(p_stFile, M_CHLActionAddChannelName, SCR_CC_C_Cfg_NoChar);
|
|
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 2, "%s", mes);
|
|
}
|
|
|
|
SCR_M_SvL0_SaveEndSection(p_stFile, SCR_CC_C_Cfg_EOL);
|
|
}
|
|
|
|
|