Project

General

Profile

Files » xml.c

Frédéric Blanc, 2016-01-29 09:58

 
/*********************************************************************************************************/
//XML
/*********************************************************************************************************/
#include "var.h"
#include <cvixml.h>
/**
* @brief lecture fichier XML
* @param aucun
* @return 0
* @date 22/10/2012
*
*/
int load_xml (void )
{
CVIXMLDocument doc_XML= 0;
CVIXMLElement curElem=0;
ListType elementList = 0;
CVIXMLAttribute attribue;
char chemin_nom[MAX_PATHNAME_LEN];
char valeur[255];
int i;

GetDir (chemin_nom);
sprintf (chemin_nom, "%s\\%s", chemin_nom,"config_BMDCDC.xml");
CVIXMLLoadDocument (chemin_nom,&doc_XML );
if(!doc_XML)
{
save_LOG("Load file config_BMDCDC.xml");
save_LOG(chemin_nom);
return -1;
}
//
CVIXMLGetRootElement(doc_XML,&curElem); //root
CVIXMLGetChildElementByTag (curElem,"ENV" ,&curElem );
CVIXMLGetAttributeByName(curElem,"racine",&attribue);
CVIXMLGetAttributeValue (attribue, Ctrl.racine);
CVIXMLGetAttributeByName(curElem,"m_V3",&attribue); //V3
CVIXMLGetAttributeValue (attribue, valeur);
Ctrl.m_V3=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"m_V4",&attribue); //V4
CVIXMLGetAttributeValue (attribue, valeur);
Ctrl.m_V4=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"m_I3",&attribue); //I3
CVIXMLGetAttributeValue (attribue, valeur);
Ctrl.m_I3=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"m_I4",&attribue); //I4
CVIXMLGetAttributeValue (attribue, valeur);
Ctrl.m_I4=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"m_P3",&attribue); //P3
CVIXMLGetAttributeValue (attribue, valeur);
Ctrl.m_P3=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"m_P4",&attribue); //P4
CVIXMLGetAttributeValue (attribue, valeur);
Ctrl.m_P4=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
//PANEL
CVIXMLGetRootElement(doc_XML,&curElem); //root CONFIG
CVIXMLGetChildElementByTag (curElem,"PANEL" ,&curElem );
for(i=0;i<MAX_PANEL;i++)
{
switch (i)
{
case PANEL_TOP :
sprintf(valeur,"TOP");
break;
case PANEL_ABOUT :
sprintf(valeur,"ABOUT");
break;
case PANEL_LOG :
sprintf(valeur,"LOG");
break;
case PANEL_PORT :
sprintf(valeur,"PORT");
break;
case PANEL_MEASURE :
sprintf(valeur,"MEASURE");
break;
case PANEL_CONTROL :
sprintf(valeur,"CONTROL");
break;
case PANEL_GRAPH :
sprintf(valeur,"GRAPH");
break;
case PANEL_INFO :
sprintf(valeur,"INFO");
break;
}
CVIXMLGetChildElementByTag (curElem,valeur ,&curElem );
//TOP
CVIXMLGetAttributeByName(curElem,"top",&attribue);
CVIXMLGetAttributeValue (attribue, valeur);
T_panel[i].top=atoi(valeur);
//angle gauche
CVIXMLGetAttributeByName(curElem,"left",&attribue);
CVIXMLGetAttributeValue (attribue, valeur);
T_panel[i].left=atoi(valeur);
//hauteur panel
CVIXMLGetAttributeByName(curElem,"height",&attribue);
CVIXMLGetAttributeValue (attribue, valeur);
T_panel[i].height=atoi(valeur);
//largeur panel
CVIXMLGetAttributeByName(curElem,"width",&attribue);
CVIXMLGetAttributeValue (attribue, valeur);
T_panel[i].width=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
}
//INSTRUMENT
CVIXMLGetRootElement(doc_XML,&curElem); //root
CVIXMLGetChildElementByTag (curElem,"INSTRUMENT" ,&curElem );
for(i=0;i<MAX_INSTRUMENT;i++)
{
switch (i)
{
case INST_POWER :
sprintf(valeur,"POWER");
break;
case INST_LOAD :
sprintf(valeur,"LOAD");
break;
case INST_AFG :
sprintf(valeur,"AFG");
break;
case INST_AFG_2 :
sprintf(valeur,"AFG_2");
break;
case INST_PM :
sprintf(valeur,"PM");
break;

}
CVIXMLGetChildElementByTag (curElem,valeur ,&curElem ); //nom instrument
CVIXMLGetAttributeByName(curElem,"nbmodule",&attribue); //nombre de module
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].nbmodule=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"typeCOM",&attribue); //type com
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.typeCOM=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"LANG",&attribue); //type com
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.language=atoi(valeur);
CVIXMLGetChildElementByTag (curElem,"RS232" ,&curElem ); //RS232
CVIXMLGetAttributeByName(curElem,"num",&attribue); //mum port
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.numCOM=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"baudRate",&attribue); //baudRate
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.baudRate=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"dataBits",&attribue); //dataBits
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.dataBits=(char) atoi(valeur);
CVIXMLGetAttributeByName(curElem,"parity",&attribue); //parity
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.parity=(char) atoi(valeur);
CVIXMLGetAttributeByName(curElem,"stopBits",&attribue); //stopBits
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.stopBits=(char) atoi(valeur);
CVIXMLGetAttributeByName(curElem,"flow",&attribue); //flow
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.flow=(char) atoi(valeur);
CVIXMLGetAttributeByName(curElem,"termchar",&attribue); //termchar
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.termchar=(char) atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"USB" ,&curElem ); //USB
CVIXMLGetAttributeByName(curElem,"num",&attribue); //mum port
CVIXMLGetAttributeValue (attribue, instrument[i].port.numUSB);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"GPIB" ,&curElem ); //GPIB
CVIXMLGetAttributeByName(curElem,"num",&attribue); //mum port
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.numGPIB=atoi(valeur);
CVIXMLGetAttributeByName(curElem,"numcarte",&attribue); //mumcarte port
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.numcarteGPIB=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"ETH" ,&curElem ); //ETH
CVIXMLGetAttributeByName(curElem,"num",&attribue); //mum IP
CVIXMLGetAttributeValue (attribue, instrument[i].port.numETH);
CVIXMLGetAttributeByName(curElem,"numcarte",&attribue); //mumcarte port
CVIXMLGetAttributeValue (attribue, valeur);
instrument[i].port.numcarteETH=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetParentElement (curElem, &curElem); //UP

}


return 0;
}
/**
* @brief sauvegarde fichier XML
* @param aucun
* @return 0
* @date 16/10/2012
*
*/
int save_xml (void)
{
CVIXMLDocument doc_XML= 0;
CVIXMLElement curElem=0;
ListType elementList = 0;
CVIXMLAttribute attribue;
char chemin_nom[MAX_PATHNAME_LEN];
char valeur[255];
char i;
GetDir (chemin_nom);
sprintf (chemin_nom, "%s\\%s", chemin_nom,"config_BMDCDC.xml");
CVIXMLNewDocument ("CONFIG", &doc_XML);
if(!doc_XML)
{
save_LOG("Save file config_BMDCDC.xml");
save_LOG(chemin_nom);
return -1;
}
CVIXMLGetRootElement(doc_XML,&curElem); //root
//variable d'environnement
CVIXMLNewElement (curElem,-1,"ENV" ,&curElem );
CVIXMLAddAttribute(curElem,"racine",Ctrl.racine);
sprintf(valeur,"%d",Ctrl.m_V3);
CVIXMLAddAttribute(curElem,"m_V3",valeur);
sprintf(valeur,"%d",Ctrl.m_V4);
CVIXMLAddAttribute(curElem,"m_V4",valeur);
sprintf(valeur,"%d",Ctrl.m_I3);
CVIXMLAddAttribute(curElem,"m_I3",valeur);
sprintf(valeur,"%d",Ctrl.m_I4);
CVIXMLAddAttribute(curElem,"m_I4",valeur);
sprintf(valeur,"%d",Ctrl.m_P3);
CVIXMLAddAttribute(curElem,"m_P3",valeur);
sprintf(valeur,"%d",Ctrl.m_P4);
CVIXMLAddAttribute(curElem,"m_P4",valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetRootElement(doc_XML,&curElem); //root
//panel
CVIXMLNewElement (curElem,-1,"PANEL" ,&curElem );
for(i=0;i<MAX_PANEL;i++)
{
switch (i)
{
case PANEL_TOP :
sprintf(valeur,"TOP");
break;
case PANEL_ABOUT :
sprintf(valeur,"ABOUT");
break;
case PANEL_LOG :
sprintf(valeur,"LOG");
break;
case PANEL_PORT :
sprintf(valeur,"PORT");
break;
case PANEL_MEASURE :
sprintf(valeur,"MEASURE");
break;
case PANEL_CONTROL :
sprintf(valeur,"CONTROL");
break;
case PANEL_GRAPH :
sprintf(valeur,"GRAPH");
break;
case PANEL_INFO :
sprintf(valeur,"INFO");
break;
}
CVIXMLNewElement (curElem,-1,valeur ,&curElem );
// top
GetPanelAttribute (T_panel[i].panel, ATTR_TOP, &T_panel[i].top);
sprintf(valeur,"%d",T_panel[i].top);
CVIXMLAddAttribute(curElem,"top",valeur);
//angle gauche
GetPanelAttribute (T_panel[i].panel, ATTR_LEFT, &T_panel[i].left);
sprintf(valeur,"%d",T_panel[i].left);
CVIXMLAddAttribute(curElem,"left",valeur);
//hauteur panel
GetPanelAttribute (T_panel[i].panel, ATTR_HEIGHT, &T_panel[i].height);
sprintf(valeur,"%d",T_panel[i].height);
CVIXMLAddAttribute(curElem,"height",valeur);
//hauteur largeur
GetPanelAttribute (T_panel[i].panel, ATTR_WIDTH, &T_panel[i].width);
sprintf(valeur,"%d",T_panel[i].width);
CVIXMLAddAttribute(curElem,"width",valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
}
CVIXMLGetRootElement(doc_XML,&curElem); //root
//INSTRUMENT
CVIXMLNewElement (curElem,-1,"INSTRUMENT" ,&curElem );
for(i=0;i<MAX_INSTRUMENT;i++)
{
switch (i)
{
case INST_POWER :
sprintf(valeur,"POWER");
break;
case INST_LOAD :
sprintf(valeur,"LOAD");
break;
case INST_AFG :
sprintf(valeur,"AFG");
break;
case INST_AFG_2 :
sprintf(valeur,"AFG_2");
break;
case INST_PM :
sprintf(valeur,"PM");
break;

}
CVIXMLNewElement (curElem,-1,valeur ,&curElem ); //nom instrument
sprintf(valeur,"%d",instrument[i].nbmodule);
CVIXMLAddAttribute(curElem,"nbmodule",valeur); //type nbmodule
sprintf(valeur,"%d",instrument[i].port.typeCOM);
CVIXMLAddAttribute(curElem,"typeCOM",valeur); //type com
sprintf(valeur,"%d",instrument[i].port.language);
CVIXMLAddAttribute(curElem,"LANG",valeur); //language
//RS232
CVIXMLNewElement (curElem,-1,"RS232" ,&curElem );
sprintf(valeur,"%d",instrument[i].port.numCOM);
CVIXMLAddAttribute (curElem,"num",valeur); //mum port
sprintf(valeur,"%d",instrument[i].port.baudRate);
CVIXMLAddAttribute(curElem,"baudRate",valeur); //baudRate
sprintf(valeur,"%d",instrument[i].port.dataBits);
CVIXMLAddAttribute(curElem,"dataBits",valeur); //dataBits
sprintf(valeur,"%d",instrument[i].port.parity);
CVIXMLAddAttribute(curElem,"parity",valeur); //parity
sprintf(valeur,"%d",instrument[i].port.stopBits);
CVIXMLAddAttribute(curElem,"stopBits",valeur); //stopBits
sprintf(valeur,"%d",instrument[i].port.flow);
CVIXMLAddAttribute(curElem,"flow",valeur); //flow
sprintf(valeur,"%d",instrument[i].port.termchar);
CVIXMLAddAttribute(curElem,"termchar",valeur); //termchar
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"USB" ,&curElem ); //USB
sprintf(valeur,"%s",instrument[i].port.numUSB);
CVIXMLAddAttribute(curElem,"num",valeur); //mum port
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"GPIB" ,&curElem ); //GPIB
sprintf(valeur,"%d",instrument[i].port.numGPIB);
CVIXMLAddAttribute(curElem,"num",valeur); //mum port
sprintf(valeur,"%d",instrument[i].port.numcarteGPIB);
CVIXMLAddAttribute(curElem,"numcarte",valeur); //mum carteport
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"ETH" ,&curElem ); //ETH
CVIXMLAddAttribute(curElem,"num",instrument[i].port.numETH); //mum IP
sprintf(valeur,"%d",instrument[i].port.numcarteETH);
CVIXMLAddAttribute(curElem,"numcarte",valeur); //mum carteport
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetParentElement (curElem, &curElem); //UP

}
CVIXMLGetRootElement(doc_XML,&curElem); //root
CVIXMLSaveDocument (doc_XML, 1, chemin_nom);
return 0;
}
/**
* @brief load fichier consigne
* @param aucun
* @return 0
* @date 25/02/2010
*
*/
int load_consigne_xml (char chemin_nom[])
{
CVIXMLDocument doc_XML= 0;
CVIXMLElement curElem=0;
ListType elementList = 0;
CVIXMLAttribute attribue;
char valeur[255];
char i;
CVIXMLLoadDocument (chemin_nom,&doc_XML );
if(!doc_XML)
{
save_LOG("Load file consigne.xml");
save_LOG(chemin_nom);
return -1;
}
//
CVIXMLGetRootElement(doc_XML,&curElem); //root
CVIXMLGetChildElementByTag (curElem,"FREQ" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].freq=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"PHASE" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].phase=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"INTERLEAVING" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].interleaving=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vin_START" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vin_START=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vin_STOP" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vin_STOP=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vin_STEP" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vin_STEP=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vout_START" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vout_START=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vout_STOP" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vout_STOP=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vout_STEP" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vout_STEP=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Pout_START" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Pout_START=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Pout_STOP" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Pout_STOP=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Pout_STEP" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Pout_STEP=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"DELAY" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].delays=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"DELAY_CAL" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Delay_Cal=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Kp" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Kp=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Ki" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Ki=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Vout_MAX" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Vout_MAX=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Iin_MAX" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].Iin_MAX=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"PWM_MAX" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].pwm_MAX=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"ACCURACY" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].accuracy=atof(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"NB_CYCLE" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
consigne[0].nb_cycle=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLGetChildElementByTag (curElem,"Mode_Iout" ,&curElem );
CVIXMLGetElementValue (curElem,valeur );
Ctrl.Iout=atoi(valeur);
CVIXMLGetParentElement (curElem, &curElem); //UP
return 0;
}

/**
* @brief sauvegarde fichier consigne
* @param aucun
* @return 0
* @date 25/02/2010
*
*/
int save_consigne_xml (char chemin_nom[])
{
CVIXMLDocument doc_XML= 0;
CVIXMLElement curElem=0;
ListType elementList = 0;
CVIXMLAttribute attribue;
char valeur[255];
char i;
CVIXMLNewDocument ("CONFIG", &doc_XML);
if(!doc_XML)
{
save_LOG("save file consigne.xml");
save_LOG(chemin_nom);
return -1;
}
CVIXMLGetRootElement(doc_XML,&curElem); //root
CVIXMLNewElement (curElem,-1,"FREQ" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].freq);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"PHASE" ,&curElem );
sprintf(valeur,"%d",consigne[0].phase);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"INTERLEAVING" ,&curElem );
sprintf(valeur,"%d",consigne[0].interleaving);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vin_START" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vin_START);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vin_STOP" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vin_STOP);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vin_STEP" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vin_STEP);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Pout_START" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Pout_START);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Pout_STOP" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Pout_STOP);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Pout_STEP" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Pout_STEP);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vout_START" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vout_START);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vout_STOP" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vout_STOP);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vout_STEP" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vout_STEP);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"DELAY" ,&curElem );
sprintf(valeur,"%d",consigne[0].delays);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"DELAY_CAL" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Delay_Cal);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Kp" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Kp);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Ki" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Ki);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Vout_MAX" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Vout_MAX);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Iin_MAX" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].Iin_MAX);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"PWM_MAX" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].pwm_MAX);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"ACCURACY" ,&curElem );
sprintf(valeur,"%2.3E",consigne[0].accuracy);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"NB_CYCLE" ,&curElem );
sprintf(valeur,"%d",consigne[0].nb_cycle);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLNewElement (curElem,-1,"Mode_Iout" ,&curElem );
sprintf(valeur,"%d",Ctrl.Iout);
CVIXMLSetElementValue (curElem,valeur );
CVIXMLGetParentElement (curElem, &curElem); //UP
CVIXMLSaveDocument (doc_XML, 1, chemin_nom);
return 0;
}
(24-24/25)