DEFINITION ic_T3cap1_650005348 18
DEFINITION ic_CAX_cap1_650005348 20
DEFINITION ic_TAP_cap1_650005348 21
DEFINITION ic_T3cab_650005348 24
DEFINITION ic_CAX_cab_650005348 26
DEFINITION ic_TAP_cab_650005348 27
REGISTRE ENTIER code_rejet_650005348
REGISTRE ENTIER erreur_650005348
REGISTRE ENTIER CAX_650005348
REGISTRE ENTIER SCT_650005348
REGISTRE ENTIER STY_650005348
REGISTRE ENTIER TAP_650005348
REGISTRE ENTIER T3cap1_650005348
REGISTRE ENTIER T3cab_650005348
REGISTRE ENTIER EFFICACE_650005348
# $Id: Ttnna7dc.src.cpp,v 1.1.4.1 1999/12/06 13:30:13 hery Exp $
####################################################################
#
#                   CE NODES : SERVICE TNN
#                     article Ttnna7dc
#
# En entree: 
#       Article Ttnna7dc 
#
# En sortie:
#       Article OK:
#               Article Ttnna7dc 
#
#       Article ERRONE:
#               Article Ttnna7dc 
#
#	RBE - 07/06/2004 - G2R0Cl : MAJ des codes erreurs
#
############################################################################

############################################################################
#
#			          DEFINITIONS
#
############################################################################

#
# Constante liees au fichier artobj
#


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

#---------------------------------------------------------------------------
# CHAMPS DE L'ARTICLE
#---------------------------------------------------------------------------

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

# trace( "Article Ttnna7dc - Service TNN CE Nodes")

# Initialisation de EFFICACE a inconnu
EFFICACE_650005348=2

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

#----------------------------------------------------------------------------
# TEST 300 et 301:presence des champs optionnels exclusifs T3cap1 et T3cab
# On en profite pour recuperer la valeur des champs existants
#----------------------------------------------------------------------------

T3cap1_650005348 = i_valid_field_n( g_iartin, ic_T3cap1_650005348)
T3cab_650005348 = i_valid_field_n( g_iartin, ic_T3cab_650005348)

SI T3cap1_650005348 > 0
ALORS
# trace("T3cap1 present")
   SI T3cab_650005348 > 0
   ALORS
# ce cas n'est pas normal car ces 2 champs ne peuvent etre present en meme temps.
# trace("T3cab present")
      code_rejet_650005348 = 0x5070+EFFICACE_650005348
      erreur_650005348 = i_PlvMessEmettre(7551,2,g_iartin,"",1,code_rejet_650005348,0,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (T3cap1 et T3cab presents)"
      SAUT STOCKE_ERRONE
   FINSI

#  *** recuperation des champs de cap1 ***
#   trace("T3cab absent")
   CAX_650005348 = i_get_art_field( g_iartin, ic_CAX_cap1_650005348)
   TAP_650005348 = i_get_art_field( g_iartin, ic_TAP_cap1_650005348)
SINON
#   trace("T3cap1 absent")
   SI T3cab_650005348 <= 0
   ALORS
# Ni CAP1 ni CAB ne sont present, ce n'est normalement pas possible
# trace("T3cab absent")
      code_rejet_650005348 = 0x5070+EFFICACE_650005348
      erreur_650005348 = i_PlvMessEmettre(7552,2,g_iartin,"",1,code_rejet_650005348,0,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (T3cap1 et T3cab absents)"
      SAUT STOCKE_ERRONE
   FINSI
# *** recuperation des champs de CAB***
# trace("T3cab present")
   CAX_650005348 = i_get_art_field( g_iartin, ic_CAX_cab_650005348)
   TAP_650005348 = i_get_art_field( g_iartin, ic_TAP_cab_650005348)
FINSI

#---------------------------------------------------------------------------
# DETERMINATION DES ARTICLES INEFFICACES
#----------------------------------------------------------------------------
SI ((TAP_650005348 & 0x40) == 0x40)
ALORS
#  trace( "Article inefficace -> Stockage en inefficace")
	EFFICACE_650005348 = 0
SINON
	EFFICACE_650005348 = 1
FINSI


#----------------------------------------------------------------------------
# Test 302 : On verifie la valeur du champ CAX qui doit etre 0x1
#----------------------------------------------------------------------------
SI CAX_650005348 != 0x01
ALORS
   code_rejet_650005348 = 0x5040+EFFICACE_650005348
   erreur_650005348 = i_PlvMessEmettre(7553,2,g_iartin,"",2,code_rejet_650005348,CAX_650005348,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (CAX = %d inconnue) "
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------------
# TEST 303 : Controle de la presence du champ SCT
#----------------------------------------------------------------------------
SCT_650005348 = g_iartin.SCT
SI SCT_650005348 < 0
ALORS
   code_rejet_650005348 = 0x5040+EFFICACE_650005348
   erreur_650005348 = i_PlvMessEmettre( 7554, 2, g_iartin, "", 1, code_rejet_650005348, 0, 0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (pas de champ SCT)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------------
# TEST 304 : On controle la valeur des bits BC du champ SCT qui doivent etre egal a 0x01
#----------------------------------------------------------------------------
SI (SCT_650005348 & 0x60) != 0x20
ALORS
   code_rejet_650005348 = 0x5040+EFFICACE_650005348
   erreur_650005348 = i_PlvMessEmettre(7555,2,g_iartin,"",2,code_rejet_650005348,SCT_650005348,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (SCT = 0x%02x incorrect)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------------
# TEST 305 : On controle l'existance du champ STY
#----------------------------------------------------------------------------
STY_650005348 = g_iartin.STY
SI STY_650005348 < 0
ALORS
   code_rejet_650005348 = 0x5040+EFFICACE_650005348
   erreur_650005348 = i_PlvMessEmettre(7556,2,g_iartin,"",1,code_rejet_650005348,0,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (pas de champ STY)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------------
# TEST 306 : on verifie que le champ STY est egal a 0x0
#----------------------------------------------------------------------------
SI (STY_650005348 != 0x0)
ALORS
   code_rejet_650005348 = 0x5040+EFFICACE_650005348
   erreur_650005348 = i_PlvMessEmettre(7557,2,g_iartin,"",2,code_rejet_650005348,STY_650005348,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (STY = 0x%02x incorrect)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------------
# TEST 307 : On teste a valeur du champ bits champ TAP qui doit etre 0x00 ou 0x40
#----------------------------------------------------------------------------
SI ((TAP_650005348 != 0x00) && (TAP_650005348 != 0x40))
ALORS
   code_rejet_650005348 = 0x5040+EFFICACE_650005348
   erreur_650005348 = i_PlvMessEmettre(7558,2,g_iartin,"",1,code_rejet_650005348,0,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (champ TAP incoherent)"
   SAUT STOCKE_ERRONE
FINSI

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

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

erreur_650005348 = i_stocke_art(g_iartin,0,PT_OK,0)

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


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

erreur_650005348 = i_make_art_rej(g_iartin, g_iartout, code_rejet_650005348)

erreur_650005348 = i_stocke_art(g_iartout,0,PT_ERRONE,0)

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

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


