DEFINITION ic_REF_800009808 10
DEFINITION ic_CAX_cap2_800009808 25
DEFINITION ic_TAP_cap2_800009808 26
DEFINITION ic_SUP_cap2_800009808 29
REGISTRE ENTIER code_rejet_800009808
REGISTRE ENTIER erreur_800009808
REGISTRE ENTIER SUP_800009808
REGISTRE ENTIER CAX_800009808
REGISTRE ENTIER SCT_800009808
REGISTRE ENTIER TAP_800009808
REGISTRE ENTIER STY_800009808
REGISTRE ENTIER REF_800009808
REGISTRE ENTIER INEF_800009808
#######################################################################
#
#	article DC SGN4 en entree de Platine
#	RBE	07/06/2004	G2R0Cl : MAJ des codes erreurs
#	05/10/2011 RHE VerifPcode
#
#
#######################################################################

#----------------------------------------------------------------------
# Constante liees au fichier artobj
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# Constante necessaire au changement en NODESTfe6dc
# avec ajout T3 IDUS 
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# GLOBAL
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# CHAMPS ARTICLE
#----------------------------------------------------------------------


#######################################################################
#
#				CONTROLES
#
#######################################################################

#	trace("Article DC faisceau entrant SGN VN6")

#----------------------------------------------------------------------
# TEST DE L'ARTICLE
#----------------------------------------------------------------------
erreur_800009808 = i_test_art( g_iartin)
SI erreur_800009808
ALORS
   code_rejet_800009808 = 0x5071
   erreur_800009808 = i_PlvMessEmettre( 7550, 2, g_iartin, "", 1, code_rejet_800009808, 0, 0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x Erreur syntaxique"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 401 Verification que CAX = 0x04
#----------------------------------------------------------------------
CAX_800009808 = i_get_art_field( g_iartin, ic_CAX_cap2_800009808)
SI CAX_800009808 != 0x04
ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7571,2,g_iartin,"",2,code_rejet_800009808,CAX_800009808,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (CAX = %d inconnue) "
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 402 Verification SCT = 0x26
#----------------------------------------------------------------------
SCT_800009808 = g_iartin.SCT
SI SCT_800009808  != 0x26
ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7572,2,g_iartin,"",2,code_rejet_800009808,SCT_800009808,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (SCT = 0x%02x incorrect)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 306 Verification STY = 0x00
#----------------------------------------------------------------------
STY_800009808 = g_iartin.STY
SI (STY_800009808 != 0x0)
ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7573,2,g_iartin,"",2,code_rejet_800009808,STY_800009808,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (STY = 0x%02x incorrect)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 307 Verification TAP = 0x00 ou 0x40
#----------------------------------------------------------------------
TAP_800009808 = i_get_art_field( g_iartin, ic_TAP_cap2_800009808)
SI ((TAP_800009808 != 0x00) && (TAP_800009808 != 0x40))
ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7574,2,g_iartin,"",2,code_rejet_800009808,TAP_800009808,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (champ TAP incoherent)"
   SAUT STOCKE_ERRONE
FINSI


#----------------------------------------------------------------------
# TEST 403 Verification REF < 95 (95=0x5F)
#----------------------------------------------------------------------
REF_800009808 = i_get_art_field( g_iartin, ic_REF_800009808)
trace1("Valeur du champ REF : %d",REF_800009808)
SI (REF_800009808 > 0x5F)
ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7575,2,g_iartin,"",1,code_rejet_800009808,0,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN6: %04x- Err. syntaxique (champ REF hors bornes)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 404 Verification SUP = 0x00
#----------------------------------------------------------------------
SUP_800009808 = i_get_art_field( g_iartin, ic_SUP_cap2_800009808)
SI (SUP_800009808 != 0x0)
ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7576,2,g_iartin,"",2,code_rejet_800009808,SUP_800009808,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN6: %04x- Err. syntaxique (SUP = %d inconnue)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 405 Verification INEF <= 99
#----------------------------------------------------------------------
# mise en commentaire du paragraphe par Nicole.S le 20.04.01 pour la V8.18.10 
# decommentarisation - LRA 29/01/2002 - EV151.
 INEF_800009808 = g_iartin.INEF
 trace1("Valeur du champ INEF : %d",INEF_800009808)
 SI (INEF_800009808 > 99)
 ALORS
   code_rejet_800009808 = 0x5041
   erreur_800009808 = i_PlvMessEmettre(7577,2,g_iartin,"",1,code_rejet_800009808,0,0)

   SAUT STOCKE_ERRONE
 FINSI

#######################################################################
#
#				TRAITEMENTS
#
#######################################################################

#----------------------------------------------------------------------
# creation article de stockage NODESTfe6dc
# avec valorisation du T3 IDUS 
#----------------------------------------------------------------------
#erreur = i_clever_dup_art(g_iartin, "NODESTfe6dc", g_iartout4)
erreur_800009808 = i_dup_art(g_iartin, "Tsgn4dc", g_iartout4)


g_iartout4.NDR[0] = 0x9
g_iartout4.NDR[1] = g_iartout4.INEF[0]
g_iartout4.NDR[2] = g_iartout4.INEF[1]
g_iartout4.NDR[3] = g_iartout4.REF[0]
g_iartout4.NDR[4] = g_iartout4.REF[1]
g_iartout4.NDR[5] = 0x0
g_iartout4.NDR[6] = 0x0
g_iartout4.NDR[7] = 0x0
g_iartout4.NDR[8] = 0x0
g_iartout4.NDR[9] = 0xf

#######################################################################
#
#				    STOCKAGE
#
#######################################################################

#----------------------------------------------------------------------
# STOCKAGE EN EFFICACE
#----------------------------------------------------------------------

# trace( "Stockage article en Dsgns")

erreur_800009808 = i_stocke_art(g_iartout4, 0, PT_OK, 0)

# trace("Fin traitement Article SGN Nodes")
RETOUR TRAIT_OK

#----------------------------------------------------------------------
# STOCKAGE EN ERRONE
#----------------------------------------------------------------------
POINT STOCKE_ERRONE

# trace("Stockage de l'article en ERRONE")

erreur_800009808 = i_make_art_rej(g_iartin, g_iartout4, code_rejet_800009808)

erreur_800009808 = i_stocke_art(g_iartout4, 0, PT_ERRONE, 0)

# trace("Fin traitement Article SGN Nodes")
RETOUR TRAIT_OK

#######################################################################
#
#				    FIN
#
#######################################################################


